2003-04-02 Havoc Pennington <hp@redhat.com>
[platform/upstream/dbus.git] / ChangeLog
1 2003-04-02  Havoc Pennington  <hp@redhat.com>
2
3         * dbus/dbus-sysdeps.c (_dbus_file_get_contents): include filenames
4         in error messages
5         (_dbus_string_get_dirname): new
6         (_dbus_sysdeps_test): new
7         (_dbus_directory_open): include dirnames in error messages
8
9         * bus/config-parser.c: interpret <include> and <includedir> and
10         <servicedir> relative to config file location if the given
11         filename is not absolute.
12
13         * dbus/dbus-string.c (_dbus_string_find_byte_backward): new
14
15 2003-04-02  Havoc Pennington  <hp@redhat.com>
16
17         * bus/connection.c (bus_transaction_send_error_reply): set sender
18         service for the error, and unref the reply on success
19
20         * bus/activation.c: convert to use BusTransaction so OOM can be
21         handled correctly
22         (bus_activation_service_created): set sender of the message
23
24 2003-04-01  Havoc Pennington  <hp@redhat.com>
25
26         * bus/config-parser.c, bus/bus.c: implement <servicedir> and
27         <includedir> (at least mostly)
28
29         * dbus/dbus-sysdeps.c (_dbus_change_identity): set the group ID
30         first, then the user ID
31
32 2003-04-01  Havoc Pennington  <hp@pobox.com>
33
34         * dbus/dbus-server.c (dbus_server_set_auth_mechanisms): new
35         function
36
37         * dbus/dbus-auth.c (_dbus_auth_set_mechanisms): new
38
39         * dbus/dbus-internals.c (_dbus_dup_string_array): new function
40
41         * dbus/dbus-sysdeps.c (_dbus_listen_unix_socket): chmod the
42         socket 0777, and unlink any existing socket.
43
44         * bus/bus.c (bus_context_new): change our UID/GID and fork if
45         the configuration file so specifies; set up auth mechanism 
46         restrictions
47
48         * bus/config-parser.c (bus_config_parser_content): add support
49         for <fork> option and fill in code for <auth> 
50
51         * bus/system.conf.in: add <fork/> to default configuration, 
52         and limit auth mechanisms to EXTERNAL
53
54         * doc/config-file.txt (Elements): add <fork>
55
56         * dbus/dbus-sysdeps.c (_dbus_become_daemon): new function
57         (_dbus_change_identity): new function
58
59 2003-03-31  Havoc Pennington  <hp@redhat.com>
60
61         * dbus/dbus-sysdeps.c (_dbus_connect_unix_socket) 
62         (_dbus_listen_unix_socket): fix off-by-one error in null
63         termination spotted by Nalin
64
65 2003-03-31  Havoc Pennington  <hp@redhat.com>
66
67         * dbus/dbus-keyring.c (_dbus_keyring_new_homedir): allow setting
68         DBUS_TEST_HOMEDIR when tests are enabled, so we can test without
69         having a real home directory available.
70
71 2003-03-31  Havoc Pennington  <hp@redhat.com>
72
73         * bus/Makefile.am (install-data-hook): create /var/run/dbus
74
75         * bus/messagebus.in: add init script for Red Hat /etc/init.d
76
77         * configure.in: add support for specifying a style of init script
78         to install
79
80 2003-03-31  Havoc Pennington  <hp@redhat.com>
81
82         Fix some annoying DBusString API and fix all affected code.
83         
84         * dbus/dbus-string.c (_dbus_string_init): get rid of annoying
85         max_length argument
86         (_dbus_string_get_data): change to return string instead of using 
87         an out param
88         (_dbus_string_get_const_data): ditto
89         (_dbus_string_get_data_len): ditto
90         (_dbus_string_get_const_data_len): ditto
91
92 2003-03-31  Havoc Pennington  <hp@redhat.com>
93
94         * bus/main.c (main): fix up the command line arguments to be nicer
95
96 2003-03-31  Havoc Pennington  <hp@redhat.com>
97
98         * dbus/Makefile.am (INCLUDES): use EXPANDED_LOCALSTATEDIR to
99         define DBUS_SYSTEM_BUS_PATH as we want to compile in the same 
100         final location that lands in the config file
101
102         * bus/config-loader-expat.c (bus_config_load): fix type of
103         XML_Parser variable
104
105         * doc/TODO: remove TODO item for dbus_bus_get()
106
107         * dbus/dbus-bus.c (bus_data_free): add missing lock/unlock
108
109 2003-03-31  Havoc Pennington  <hp@pobox.com>
110
111         * dbus/dbus-transport-unix.c (_dbus_transport_new_for_domain_socket)
112         (_dbus_transport_new_for_tcp_socket): these didn't need the "server"
113         argument since they are always client side
114
115         * dbus/dbus-server.c (dbus_server_get_address): new function
116
117         * bus/main.c (main): take the configuration file as an argument.
118
119         * test/data/valid-config-files/debug-allow-all.conf: new file to 
120         use with dispatch.c tests for example
121
122         * bus/test-main.c (main): require test data dir
123
124         * bus/bus.c (bus_context_new): change this to take a
125         configuration file name as argument
126
127         * doc/config-file.txt (Elements): add <servicedir>
128
129         * bus/system.conf, bus/session.conf: new files
130         
131         * dbus/dbus-bus.c (dbus_bus_get): look for system bus on
132         well-known socket if none set
133
134         * configure.in: create system.conf and session.conf
135
136 2003-03-30  Havoc Pennington  <hp@pobox.com>
137
138         * bus/config-parser.c: hacking
139         
140         * dbus/dbus-memory.c: don't use DBusList for the list of stuff 
141         to shut down, since it could cause weirdness with the DBusList
142         lock
143
144         * dbus/dbus-list.c (_dbus_list_test): add tests for the
145         link-oriented stack routines
146         (alloc_link): free the mempool if the first alloc from it fails
147
148         * dbus/dbus-mempool.c (struct DBusMemBlock): fix alignment issue
149
150         * dbus/dbus-string.c (UNICODE_VALID): sync new version of this
151         from GLib
152         (_dbus_string_skip_white): new
153
154         * doc/config-file.txt (Elements): add <includedir>
155
156 2003-03-28  Havoc Pennington  <hp@pobox.com>
157
158         * dbus/dbus-string.c (_dbus_string_copy_data_len)
159         (_dbus_string_copy_data): new functions
160
161 2003-03-28  Anders Carlsson  <andersca@codefactory.se>
162
163         * dbus/dbus-bus.c: (bus_data_free), (dbus_bus_get):
164         * dbus/dbus-bus.h:
165         Add dbus_bus_get.
166         
167         * dbus/dbus-memory.c:
168         Fix a doc comment.
169         
170 2003-03-28  Havoc Pennington  <hp@pobox.com>
171
172         * bus/test.c (bus_test_flush_bus): remove the sleep from here, 
173         I think it may have just been superstition. Not sure.
174
175         * dbus/dbus-string.c (_dbus_string_base64_decode): catch some OOM
176         failures that were not being handled.
177
178         * dbus/dbus-auth.c (process_auth): fix a memleak in OOM handling
179
180         * dbus/dbus-memory.c: add ability to set number of mallocs in a
181         row that will fail on out-of-memory.
182
183         * dbus/dbus-internals.c (_dbus_test_oom_handling): convenience
184         function for testing out-of-memory handling.
185
186         * bus/config-loader-expat.c (memsuite): don't wrap the dbus
187         allocation functions, they do map exactly to the expat ones.
188
189 2003-03-27  Havoc Pennington  <hp@redhat.com>
190
191         * bus/config-loader-libxml.c (bus_config_load): add another error
192         check
193
194 2003-03-26  Anders Carlsson  <andersca@codefactory.se>
195
196         * doc/TODO:
197         Add note about automatic service activation.
198         
199         * doc/dbus-specification.sgml:
200         Rename the specification and clarify a few things.
201         
202 2003-03-26  Anders Carlsson  <andersca@codefactory.se>
203
204         * Doxyfile.in:
205         * dbus/dbus-address.c:
206         * dbus/dbus-dict.c:
207         * dbus/dbus-marshal.c:
208         * dbus/dbus-server-debug-pipe.c:
209         * dbus/dbus-transport-unix.c:
210         Fix documentation warnings.
211         
212 2003-03-26  Havoc Pennington  <hp@pobox.com>
213
214         * bus/test-main.c, dbus/dbus-test.c (main): check memleaks
215         after every test so it's quick and easy to see which leaked, and
216         so we test multiple dbus_shutdown() calls
217
218         * configure.in: change configure.in XML stuff to also support
219         expat
220
221         * config-loader-libxml.c: some hacking
222
223         * config-loader-expat.c: some hacking
224
225         * config-parser.c: some hacking, plus tests
226
227 2003-03-25  Havoc Pennington  <hp@redhat.com>
228
229         * throughout - add more _DBUS_ASSERT_ERROR_IS_CLEAR
230         
231         * configure.in: add --with-xml option to specify XML library,
232         right now only libxml is supported.
233
234         * bus/config-loader-libxml.c, config-parser.c: sync some minor 
235         nonworking code between home and work, still just stubs
236
237 2003-03-24  Havoc Pennington  <hp@redhat.com>
238
239         * dbus/dbus-sysdeps.c (_dbus_set_fd_nonblocking): move to this
240         file
241
242         * dbus/dbus-errors.c (dbus_set_error, dbus_set_error_const): allow 
243         NULL argument for "message" if the error is a well-known one, 
244         fill in a generic message in this case.
245
246         * dbus/dbus-errors.h (DBusResultCode): Kill DBusResultCode in
247         favor of DBusError
248
249         * bus/test.c (bus_test_flush_bus): add
250
251         * bus/policy.c (bus_policy_test): test code stub
252
253 2003-03-24  Havoc Pennington  <hp@pobox.com>
254
255         * bus/connection.c (bus_connections_setup_connection): set up 
256         the "can this user connect" function, but it always returns 
257         TRUE until we have a config file parser so we can have a config
258         file that allows connections.
259
260 2003-03-23  Havoc Pennington  <hp@pobox.com>
261
262         * dbus/dbus-threads.c (dbus_mutex_new, dbus_condvar_new): with 
263         DBUS_BUILD_TESTS, actually alloc/free a block of memory for 
264         the mutex, so we can check for proper memory management 
265         and OOM handling.
266
267         * dbus/dbus-dataslot.c: remove the mutex from
268         DBusDataSlotAllocator and lock it manually when using it, 
269         to simplify fitting it into the global slots framework.
270
271         * dbus/dbus-threads.c (init_static_locks): rework how we're
272         handling global locks so they are easily shut down.
273
274         * bus/policy.c (bus_policy_append_rule): fix
275
276         * bus/test-main.c (main): check for memleaks
277
278         * dbus/dbus-test.c (dbus_internal_do_not_use_run_tests): make 
279         test suite check for memleaks
280
281         * dbus/dbus-memory.c: add support in test mode for tracking 
282         number of outstanding blocks
283
284 2003-03-23  Havoc Pennington  <hp@pobox.com>
285
286         * bus/policy.c, bus/bus.c, bus/connection.c: implement allow/deny
287         policies code
288         
289         * dbus/dbus-hash.h: add ULONG hash keys
290
291         * dbus/dbus-sysdeps.c (_dbus_get_groups): new
292         (_dbus_get_group_id): new function
293
294 2003-03-20  Havoc Pennington  <hp@redhat.com>
295
296         * dbus/dbus-connection.c (dbus_connection_set_unix_user_function):
297         new function
298         (dbus_connection_get_unix_user): new function
299
300 2003-03-20  Havoc Pennington  <hp@pobox.com>
301
302         * bus/connection.c (bus_connection_send_oom_error): assert that
303         message has a sender
304         (connection_execute_transaction): ditto
305         (bus_connection_preallocate_oom_error): fix to set the sender, and
306         set recipient to the destination service, not the bus driver
307
308         * bus/policy.c: hacking
309
310         * dbus/dbus-message.c (dbus_message_service_is): new function
311         (dbus_message_sender_is): new
312
313 2003-03-19  Havoc Pennington  <hp@redhat.com>
314
315         * bus/policy.c: start sketching code for policy restrictions on 
316         what connections can do.
317
318 2003-03-18  Havoc Pennington  <hp@redhat.com>
319
320         * doc/TODO: some notes on high-level todo items. Little nitpick
321         stuff is all in @todo, so no need to add it here.
322
323         * doc/config-file.txt: some notes on how config file might look
324
325 2003-03-18  Anders Carlsson  <andersca@codefactory.se>
326
327         * configure.in: 0.6
328
329         * NEWS: Update.
330         
331 2003-03-17  Havoc Pennington  <hp@redhat.com>
332
333         * dbus/dbus-internals.h: add gcc attributes so that 
334         our printf-style functions warn on bad arguments to 
335         format
336         
337         * dbus/dbus-sysdeps.c (_dbus_connect_tcp_socket): fix printf 
338         format bug
339
340         * dbus/dbus-message.c (_dbus_message_loader_queue_messages): fix
341         printf format bug
342
343 2003-03-17  Havoc Pennington  <hp@redhat.com>
344
345         * bus/test-main.c (main): make it print something as it runs 
346         so make check doesn't look stuck
347
348         * doc/negotiation.txt, doc/dbus-sasl-profile.txt: remove 
349         from CVS, now obsolete
350
351 2003-03-17  Anders Carlsson  <andersca@codefactory.se>
352
353         * bus/dispatch.c: (bus_dispatch):
354         Refetch the service name since it may have been reallocated
355         when dbus_message_set_sender was called.
356         
357         * dbus/dbus-sysdeps.c: (_dbus_accept):
358         Add address and address length variables and use them to stop
359         valgrind from complaining.
360         
361 2003-03-17  Havoc Pennington  <hp@pobox.com>
362
363         All tests pass, no memleaks, no valgrind complaints.
364         
365         * bus/test.c: refcount handler_slot
366
367         * bus/connection.c (bus_connections_new): refcount
368         connection_data_slot
369
370         * dbus/dbus-auth-script.c (_dbus_auth_script_run): delete unused
371         bytes so that auth scripts pass.
372
373         * bus/dispatch.c: init message_handler_slot so it gets allocated
374         properly
375
376         * bus/dispatch.c (message_handler_slot_ref): fix memleak
377
378         * dbus/dbus-server-debug-pipe.c (_dbus_server_debug_pipe_new):
379         dealloc server_pipe_hash when no longer used for benefit of
380         leak checking
381
382         * dbus/dbus-auth.c (process_command): memleak fix
383
384         * bus/dispatch.c (check_hello_message): memleak fix
385
386 2003-03-16  Havoc Pennington  <hp@pobox.com>
387
388         * dbus/dbus-bus.c (ensure_bus_data): fix double-unref of the data slot
389
390 2003-03-17  Anders Carlsson  <andersca@codefactory.se>
391
392         * bus/activation.c (bus_activation_activate_service): Append
393         the pending activation entry to the list of pending activations.
394
395 2003-03-16  Havoc Pennington  <hp@pobox.com>
396
397         * bus/dispatch.c (bus_dispatch_test): remove double-unrefs of
398         connections
399
400         * dbus/dbus-address.c (create_entry): fix OOM handling when
401         failing to alloc entry->method
402
403 2003-03-16  Havoc Pennington  <hp@pobox.com>
404
405         * dbus/dbus-watch.c (_dbus_watch_new): handle failure to malloc
406         the watch
407
408         * dbus/dbus-server-debug-pipe.c (_dbus_transport_debug_pipe_new):
409         add some missing dbus_set_result
410
411         * bus/dispatch.c (bus_dispatch_add_connection): handle failure to 
412         alloc the DBusMessageHandler
413
414         * dbus/dbus-transport.c (_dbus_transport_disconnect): don't ref
415         the transport here, since we call this from the finalizer; it 
416         resulted in a double-finalize.
417
418         * dbus/dbus-transport.c (_dbus_transport_disconnect): fix a bug 
419         where we tried to use transport->connection that was NULL, 
420         happened when transport was disconnected early on due to OOM
421
422         * bus/*.c: adapt to handle OOM for watches/timeouts
423
424         * dbus/dbus-transport-unix.c: port to handle OOM during 
425         watch handling
426         
427         * dbus/dbus-auth.c (_dbus_auth_get_unused_bytes): return a
428         reference to unused bytes instead of a copy
429
430         * dbus/dbus-server.c (dbus_server_handle_watch): return FALSE for
431         out of memory
432
433         * dbus/dbus-connection.c (dbus_connection_handle_watch): return
434         FALSE on OOM
435
436         * dbus/dbus-timeout.c (dbus_timeout_handle): return FALSE for out
437         of memory
438
439 2003-03-16  Anders Carlsson  <andersca@codefactory.se>
440
441         * doc/dbus-specification.sgml:
442         Document reply message for ActivateService.
443         
444 2003-03-16  Anders Carlsson  <andersca@codefactory.se>
445
446         * bus/activation.c: (bus_pending_activation_entry_free),
447         (bus_pending_activation_free), (bus_activation_new),
448         (bus_activation_unref), (bus_activation_service_created),
449         (bus_activation_activate_service):
450         * bus/activation.h:
451         * bus/bus.c: (bus_context_new):
452         * bus/desktop-file.c: (new_section):
453         * bus/driver.c: (bus_driver_send_service_deleted),
454         (bus_driver_handle_activate_service):
455         * bus/services.c: (bus_registry_new), (bus_registry_ensure):
456         * bus/services.h:
457         * dbus/dbus-connection.c:
458         (dbus_connection_send_with_reply_and_block):
459         * dbus/dbus-message.c: (dbus_message_append_args_valist):
460         * dbus/dbus-protocol.h:
461         Make activation work better. Now pending activations will be queued
462         and the daemon won't try to activate services that are already registered.
463         
464 2003-03-16  Havoc Pennington  <hp@pobox.com>
465
466         * dbus/dbus-bus.c (ensure_bus_data): handle failure to set
467         connection data
468
469         * dbus/dbus-memory.c (_dbus_initialize_malloc_debug): support
470         DBUS_MALLOC_BACKTRACES to print trace when failing an alloc
471
472 2003-03-16  Havoc Pennington  <hp@pobox.com>
473
474         * dbus/dbus-string.c (_dbus_string_validate_utf8): oops, unbreak
475         this. always run the test suite before commit...
476
477         * bus/*: adapt to DBusConnection API changes
478
479         * glib/dbus-gmain.c: adapt to DBusConnection API changes, 
480         requires renaming stuff to avoid dbus_connection_dispatch name 
481         conflict.
482
483         * dbus/dbus-transport.c (_dbus_transport_queue_messages): new
484         function
485
486         * dbus/dbus-message.c (_dbus_message_loader_queue_messages):
487         separate from _dbus_message_loader_return_buffer()
488
489         * dbus/dbus-connection.c (dbus_connection_get_n_messages): remove
490         this, because it's now always broken to use; the number of
491         messages in queue vs. the number still buffered by the message
492         loader is undefined/meaningless. Should use
493         dbus_connection_get_dispatch_state().
494         (dbus_connection_dispatch): rename from
495         dbus_connection_dispatch_message
496
497 2003-03-16  Havoc Pennington  <hp@pobox.com>
498
499         * dbus/dbus-string.c (_dbus_string_validate_utf8): copy in a real
500         implementation
501
502 2003-03-16  Anders Carlsson  <andersca@codefactory.se>
503
504         * dbus/dbus-connection.c:
505         (dbus_connection_send_with_reply_and_block):
506         Decrease connection->n_incoming when removing an entry 
507         from the list.
508         * dbus/dbus-dict.c: (dbus_dict_entry_free),
509         (dbus_dict_set_boolean_array), (dbus_dict_set_int32_array),
510         (dbus_dict_set_uint32_array), (dbus_dict_set_double_array),
511         (dbus_dict_set_byte_array), (dbus_dict_set_string_array),
512         (dbus_dict_get_boolean_array), (dbus_dict_get_double_array),
513         (dbus_dict_get_byte_array):
514         Handle NULL arrays and strings. Also add support for byte arrays.
515         
516         * dbus/dbus-marshal.c: (_dbus_marshal_byte_array),
517         (_dbus_marshal_dict), (_dbus_demarshal_byte_array),
518         (_dbus_demarshal_int32_array), (_dbus_demarshal_uint32_array),
519         (_dbus_demarshal_double_array), (_dbus_demarshal_string_array),
520         (_dbus_demarshal_dict), (demarshal_and_validate_len),
521         (_dbus_marshal_validate_arg), (_dbus_marshal_test):
522         * dbus/dbus-marshal.h:
523         Add support for marshalling and demarshalling empty arrays and strings.
524         
525         * dbus/dbus-message.c: (dbus_message_append_args_valist),
526         (dbus_message_append_string_array),
527         (dbus_message_iter_get_boolean),
528         (dbus_message_iter_get_boolean_array),
529         (dbus_message_iter_get_int32_array),
530         (dbus_message_iter_get_uint32_array),
531         (dbus_message_iter_get_double_array),
532         (dbus_message_iter_get_byte_array),
533         (dbus_message_iter_get_string_array), (dbus_message_iter_get_dict),
534         (check_message_handling):
535         Add support for getting empty arrays and dicts.
536         
537         * dbus/dbus-string.c: (_dbus_string_validate_utf8):
538         Don't do any validation at all for now, that's better than just checking
539         for ASCII.
540         
541         * test/data/valid-messages/emptiness.message:
542         New test message with lots of empty arrays.
543         
544 2003-03-16  Havoc Pennington  <hp@pobox.com>
545
546         * dbus/dbus-connection.c
547         (_dbus_connection_queue_received_message_link): new function that
548         can't fail due to OOM
549
550         * dbus/dbus-message.c (_dbus_message_loader_pop_message_link):
551         new function pops a message together with a list link 
552         containing it.
553
554         * dbus/dbus-transport-unix.c (queue_messages): use new link-based
555         message queuing functions to avoid needing to alloc memory
556
557 2003-03-16  Havoc Pennington  <hp@pobox.com>
558
559         Oops - test code was only testing failure of around 30 of the
560         mallocs in the test path, but it turns out there are 500+
561         mallocs. I believe this was due to misguided linking setup such
562         that there was one copy of dbus_malloc etc. in the daemon and one
563         in the shared lib, and only daemon mallocs were tested. In any
564         case, the test case now tests all 500+ mallocs, and doesn't pass
565         yet, though there are lots of fixes in this patch.
566         
567         * dbus/dbus-connection.c (dbus_connection_dispatch_message): fix
568         this so that it doesn't need to allocate memory, since it 
569         has no way of indicating failure due to OOM (and would be 
570         annoying if it did).
571
572         * dbus/dbus-list.c (_dbus_list_pop_first_link): new function
573
574         * bus/Makefile.am: rearrange to create two self-contained
575         libraries, to avoid having libraries with overlapping symbols. 
576         that was resulting in weirdness, e.g. I'm pretty sure there 
577         were two copies of global static variables.
578
579         * dbus/dbus-internals.c: move the malloc debug stuff to 
580         dbus-memory.c
581
582         * dbus/dbus-list.c (free_link): free list mempool if it becomes
583         empty.
584
585         * dbus/dbus-memory.c (_dbus_disable_mem_pools): new function
586
587         * dbus/dbus-address.c (dbus_parse_address): free list nodes
588         on failure.
589
590         * bus/dispatch.c (bus_dispatch_add_connection): free
591         message_handler_slot when no longer using it, so 
592         memory leak checkers are happy for the test suite.
593
594         * dbus/dbus-server-debug-pipe.c (debug_finalize): free server name
595
596         * bus/bus.c (new_connection_callback): disconnect in here if 
597         bus_connections_setup_connection fails.
598
599         * bus/connection.c (bus_connections_unref): fix to free the 
600         connections
601         (bus_connections_setup_connection): if this fails, don't
602         disconnect the connection, just be sure there are no side
603         effects.
604
605         * dbus/dbus-string.c (undo_alignment): unbreak this
606
607         * dbus/dbus-auth.c (_dbus_auth_unref): free some stuff we were
608         leaking
609         (_dbus_auth_new): fix the order in which we free strings 
610         on OOM failure
611
612         * bus/connection.c (bus_connection_disconnected): fix to 
613         not send ServiceDeleted multiple times in case of memory 
614         allocation failure
615
616         * dbus/dbus-bus.c (dbus_bus_get_base_service): new function to
617         get the base service name
618         (dbus_bus_register_client): don't return base service name,
619         instead store it on the DBusConnection and have an accessor
620         function for it.
621         (dbus_bus_register_client): rename dbus_bus_register()
622
623         * bus/dispatch.c (check_hello_message): verify that other 
624         connections on the bus also got the correct results, not 
625         just the one sending hello
626
627 2003-03-15  Havoc Pennington  <hp@pobox.com>
628
629         Make it pass the Hello handling test including all OOM codepaths.
630         Now to do other messages...
631         
632         * bus/services.c (bus_service_remove_owner): fix crash when
633         removing owner from an empty list of owners
634         (bus_registry_ensure): don't leave service in the list of 
635         a connection's owned services if we fail to put the service
636         in the hash table.
637
638         * bus/connection.c (bus_connection_preallocate_oom_error): set
639         error flag on the OOM error.
640
641         * dbus/dbus-connection.c (_dbus_connection_new_for_transport):
642         handle _dbus_transport_set_connection failure
643
644         * dbus/dbus-transport-unix.c (_dbus_transport_new_for_fd): modify
645         to create watches up front and simply enable/disable them as
646         needed.
647         (unix_connection_set): this can now fail on OOM
648
649         * dbus/dbus-timeout.c, dbus/dbus-watch.c: add concept 
650         of enabling/disabling a watch or timeout.
651
652         * bus/loop.c (bus_loop_iterate): don't touch disabled
653         watches/timeouts
654
655         * glib/dbus-gmain.c: adapt to enable/disable watches and timeouts
656
657 2003-03-15  Havoc Pennington  <hp@pobox.com>
658
659         * bus/dispatch.c (bus_dispatch_test): OK, now finally actually
660         write useful test code, after all that futzing around ;-)
661
662         Test does not yet pass because we can't handle OOM in
663         _dbus_transport_messages_pending (basically,
664         dbus_connection_preallocate_send() does not prealloc the write
665         watch). To fix this, I think we need to add new stuff to
666         set_watch_functions, namely a SetEnabled function so we can alloc
667         the watch earlier, then enable it later.
668         
669         * dbus/Makefile.am (libdbus_convenience_la_SOURCES): move
670         dbus-memory.c to the convenience lib
671
672         * bus/test.c: rename some static functions to keep them clearly 
673         distinct from stuff in connection.c. Handle client disconnection.
674
675 2003-03-14  Havoc Pennington  <hp@pobox.com>
676
677         * bus/dispatch.c (bus_dispatch_test): do test using debug-pipe 
678         transport, tests more of the real codepath. Set up clients 
679         with bus_setup_debug_client.
680
681         * bus/test.c (bus_setup_debug_client): function to set up debug 
682         "clients" on the main loop
683
684         * dbus/dbus-transport.c (_dbus_transport_open): add debug-pipe 
685         support
686
687         * dbus/dbus-server.c (dbus_server_listen): add debug-pipe 
688         server type
689
690         * dbus/dbus-server-debug.c: support a debug server based on pipes
691
692         * dbus/dbus-sysdeps.c (_dbus_full_duplex_pipe): new function
693         (_dbus_close): new function
694         
695         * configure.in: check for socketpair
696
697 2003-03-14  Havoc Pennington  <hp@redhat.com>
698
699         * dbus/dbus-memory.c: add a "detect buffer overwrites on free" 
700         cheesy hack
701
702         * dbus/dbus-transport-debug.c: rework this a good bit to be 
703         less complicated. hopefully still works.
704
705         * dbus/dbus-server-debug.c (handle_new_client): remove timeout
706         manually
707
708         * glib/dbus-gmain.c (timeout_handler): don't remove timeout 
709         after running it
710
711         * dbus/dbus-message.c (dbus_message_copy): rename from 
712         dbus_message_new_from_message, fix it up to copy 
713         all the message fields, add test case
714
715         * bus/dispatch.c (bus_dispatch_test): add some more test code, 
716         not quite passing yet
717
718 2003-03-14  Havoc Pennington  <hp@pobox.com>
719
720         * bus/loop.c (bus_loop_iterate): add this so we can "run loop
721         until no work remains" in test code. (the large diff here 
722         is just code movement, no actual changes)
723
724         * dbus/dbus-server-debug.c (DEFAULT_INTERVAL): change interval to
725         1, no point waiting around for test code.
726         (_dbus_server_debug_accept_transport): unref the timeout 
727         after adding it (right?)
728
729         * dbus/dbus-transport-debug.c (DEFAULT_INTERVAL): ditto
730         
731 2003-03-13  Havoc Pennington  <hp@redhat.com>
732
733         * dbus/dbus-timeout.c (_dbus_timeout_list_set_functions): handle
734         out of memory
735
736         * dbus/dbus-watch.c (_dbus_watch_list_set_functions): handle out
737         of memory
738
739         * dbus/dbus-connection.h: Make AddWatchFunction and
740         AddTimeoutFunction return a bool so they can fail on out-of-memory
741
742         * bus/bus.c (bus_context_new): set up timeout handlers
743
744         * bus/connection.c (bus_connections_setup_connection): set up
745         timeout handlers
746
747         * glib/dbus-gmain.c: adapt to the fact that set_functions stuff
748         can fail
749
750         * bus/bus.c (bus_context_new): adapt to changes
751
752         * bus/connection.c: adapt to changes
753
754         * test/watch.c: adapt to DBusWatch changes
755
756         * bus/dispatch.c (bus_dispatch_test): started adding this but
757         didn't finish
758         
759 2003-03-14  Anders Carlsson  <andersca@codefactory.se>
760
761         * bus/dispatch.c (send_service_nonexistent_error): Fix typo.
762
763 2003-03-13  Havoc Pennington  <hp@pobox.com>
764
765         * bus/test.c, bus/test.h, bus/Makefile.am, bus/test-main.c: 
766         set up a test framework as for the library
767
768 2003-03-12  Havoc Pennington  <hp@pobox.com>
769
770         Throughout: purge global variables, introduce BusActivation, 
771         BusConnections, BusRegistry, etc. objects instead.
772         
773         * bus/bus.h, bus/bus.c: introduce BusContext as a global 
774         message bus object
775
776         * test/Makefile.am (TEST_BINARIES): disable bus-test for now, 
777         going to redo this a bit differently I think
778         
779 2003-03-12  Havoc Pennington  <hp@redhat.com>
780
781         Mega-patch that gets the message bus daemon initially handling 
782         out-of-memory. Work still needed. Also lots of random 
783         moving stuff to DBusError instead of ResultCode.
784         
785         * dbus/dbus-list.c (_dbus_list_length_is_one): new function
786
787         * dbus/dbus-connection.c
788         (dbus_connection_send_with_reply_and_block): use DBusError
789
790         * dbus/dbus-bus.c: adapt to API changes, make it use DBusError not
791         DBusResultCode
792
793         * dbus/dbus-connection.c (dbus_connection_send): drop the result
794         code here, as the only failure possible is OOM.
795
796         * bus/connection.c (bus_connection_disconnect):
797         rename bus_connection_disconnected as it's a notification only
798
799         * bus/driver.c (bus_driver_handle_acquire_service): don't free
800         "name" on get_args failure, should be done by get_args; 
801         don't disconnect client for bad args, just return an error.
802         (bus_driver_handle_service_exists): ditto
803
804         * bus/services.c (bus_services_list): NULL-terminate returned array
805
806         * bus/driver.c (bus_driver_send_service_lost)
807         (bus_driver_send_service_acquired): send messages from driver to a
808         specific client to the client's unique name, not to the broadcast
809         service.
810
811         * dbus/dbus-message.c (decode_header_data): reject messages that
812         contain no name field
813         (_dbus_message_get_client_serial): rename to
814         dbus_message_get_serial and make public
815         (_dbus_message_set_serial): rename from set_client_serial
816         (_dbus_message_set_reply_serial): make public
817         (_dbus_message_get_reply_serial): make public
818
819         * bus/connection.c (bus_connection_foreach): allow stopping
820         iteration by returning FALSE from foreach function.
821
822         * dbus/dbus-connection.c (dbus_connection_send_preallocated) 
823         (dbus_connection_free_preallocated_send) 
824         (dbus_connection_preallocate_send): new API for sending a message
825         without possibility of malloc failure.
826         (dbus_connection_send_message): rename to just
827         dbus_connection_send (and same for whole function family)
828
829         * dbus/dbus-errors.c (dbus_error_free): make this reinit the error
830
831         * dbus/dbus-sysdeps.c (_dbus_exit): new function
832
833         * bus/activation.c: handle/return errors
834
835         * dbus/dbus-errors.h: add more DBUS_ERROR #define
836
837         * dbus/dbus-sysdeps.c (_dbus_directory_open) (_dbus_file_get_contents)
838         (_dbus_directory_get_next_file): use DBusError instead of DBusResultCode
839         (_dbus_result_from_errno): move to this file
840
841 2003-03-10  Anders Carlsson  <andersca@codefactory.se>
842
843         * dbus/dbus-marshal.c: 
844         (_dbus_marshal_set_string):
845         Take a length argument so we can marshal the correct string
846         length.
847         
848         (_dbus_marshal_dict), (_dbus_demarshal_dict),
849         (_dbus_marshal_get_arg_end_pos), (_dbus_marshal_validate_arg),
850         (_dbus_marshal_test):
851         * dbus/dbus-marshal.h:  
852         Add support for marshalling and demarshalling dicts.
853         
854         * dbus/dbus-message-builder.c: (_dbus_message_data_load):
855         Add support for TYPE DICT.
856         
857         * dbus/dbus-message.c: (set_string_field):
858         Adjust header padding.
859         
860         (dbus_message_append_args_valist), (dbus_message_append_dict),
861         (dbus_message_get_args_valist), (dbus_message_iter_get_arg_type),
862         (dbus_message_iter_get_dict), (_dbus_message_loader_return_buffer),
863         (check_message_handling), (check_have_valid_message):
864         * dbus/dbus-message.h:
865         Add functions for setting and getting dicts.
866
867         * dbus/dbus-protocol.h:
868         Add DBUS_TYPE_DICT.
869         
870         * dbus/dbus.h:
871         Add dbus-dict.h
872         
873         * doc/dbus-specification.sgml:
874         Add information about how dicts are marshalled.
875         
876         * test/data/invalid-messages/dict-with-nil-value.message:
877         * test/data/invalid-messages/too-short-dict.message:
878         * test/data/valid-messages/dict-simple.message:
879         * test/data/valid-messages/dict.message:
880         Add sample messages containing dicts.
881
882 2003-03-08  Anders Carlsson  <andersca@codefactory.se>
883
884         * dbus/dbus-dict.h: Add DBUS_END_DECLS.
885
886 2003-03-07  Anders Carlsson  <andersca@codefactory.se>
887
888         * dbus/Makefile.am:
889         * dbus/dbus-dict.c: (dbus_dict_entry_free), (dbus_dict_new),
890         (dbus_dict_get_keys), (insert_entry), (dbus_dict_set_boolean),
891         (dbus_dict_set_int32), (dbus_dict_set_uint32),
892         (dbus_dict_set_double), (dbus_dict_set_string),
893         (dbus_dict_set_boolean_array), (dbus_dict_set_int32_array),
894         (dbus_dict_set_uint32_array), (dbus_dict_set_double_array),
895         (dbus_dict_set_string_array), (_dbus_dict_test):
896         * dbus/dbus-dict.h:
897         Fix according to comments from Havoc.
898         
899 2003-03-06  Michael Meeks  <michael@server.home>
900
901         * configure.in: if we don't have kde-config, disable have_qt.
902
903 2003-03-07  Anders Carlsson  <andersca@codefactory.se>
904
905         * dbus/Makefile.am:
906         Add dbus-dict.[ch]
907         
908         * dbus/dbus-dict.c: (dbus_dict_entry_free), (dbus_dict_new),
909         (dbus_dict_ref), (dbus_dict_unref), (dbus_dict_contains),
910         (dbus_dict_remove), (dbus_dict_get_value_type),
911         (dbus_dict_get_keys), (dbus_dict_put_boolean),
912         (dbus_dict_put_int32), (dbus_dict_put_uint32),
913         (dbus_dict_put_double), (dbus_dict_put_string),
914         (dbus_dict_put_boolean_array), (dbus_dict_put_int32_array),
915         (dbus_dict_put_uint32_array), (dbus_dict_put_double_array),
916         (dbus_dict_put_string_array), (dbus_dict_get_boolean),
917         (dbus_dict_get_int32), (dbus_dict_get_uint32),
918         (dbus_dict_get_double), (dbus_dict_get_string),
919         (dbus_dict_get_boolean_array), (dbus_dict_get_int32_array),
920         (dbus_dict_get_uint32_array), (dbus_dict_get_double_array),
921         (dbus_dict_get_string_array), (_dbus_dict_test):
922         * dbus/dbus-dict.h:
923         Add DBusDict implementation
924         
925         * dbus/dbus-test.c: (dbus_internal_do_not_use_run_tests):
926         * dbus/dbus-test.h:
927         Add _dbus_dict_test
928         
929 2003-03-04  Havoc Pennington  <hp@pobox.com>
930
931         * test/data/auth/*: adapt to changes
932
933         * dbus/dbus-auth-script.c (_dbus_auth_script_run): add
934         USERID_BASE64 and change USERNAME_BASE64 to put in username not
935         userid
936
937         * dbus/dbus-keyring.c (_dbus_keyring_validate_context): prevent
938         more stuff from being in a context name, to make the protocol 
939         simpler to deal with
940
941         * dbus/dbus-errors.c (dbus_error_has_name): new function
942         (dbus_error_is_set): new function
943
944         * dbus/dbus-auth.c: replace DBUS_STUPID_TEST_MECH auth 
945         with DBUS_COOKIE_SHA1, implement DBUS_COOKIE_SHA1
946         
947         * dbus/dbus-connection.c (dbus_connection_flush): also read
948         messages during a flush operation
949
950         * dbus/Makefile.am: remove dbus-md5 since it isn't currently used.
951
952 2003-03-05  Anders Carlsson  <andersca@codefactory.se>
953
954         * configure.in: Check for gethostbyname on Solaris.
955
956         * dbus/dbus-transport.c: (_dbus_transport_open):
957         Remove duplicate "tcp" entry.
958         
959         * doc/dbus-specification.sgml:
960         Clarify some things.
961         
962 2003-03-05  Anders Carlsson  <andersca@codefactory.se>
963
964         * dbus/dbus-auth.c: (send_rejected), (process_test_subdir):
965         * dbus/dbus-keyring.c: (_dbus_keyring_new_homedir),
966         (_dbus_keyring_test):
967         * dbus/dbus-md5.c: (_dbus_md5_compute):
968         * dbus/dbus-sha.c: (_dbus_sha_compute):
969         Plug memory leaks.
970
971 2003-03-05  Anders Carlsson  <andersca@codefactory.se>
972
973         * README: Add some things.
974
975 2003-03-04  Anders Carlsson  <andersca@codefactory.se>
976
977         * dbus/dbus-message.c (dbus_message_append_args_valist): Add a break;
978         after case DBUS_TYPE_BOOELAN.
979
980 2003-03-02  Havoc Pennington  <hp@pobox.com>
981
982         * test/break-loader.c (randomly_set_extreme_ints): add test that
983         sets really huge and small integers
984
985         * dbus/dbus-marshal.c (_dbus_marshal_validate_arg): add check
986         that length of boolean array fits in the string, and that 
987         string has room for boolean value in single-bool case.
988
989         * dbus/dbus-message-builder.c (_dbus_message_data_load): add
990         optional value to "ALIGN" command which is what to fill the
991         alignment with.
992
993         * test/data/valid-messages/no-padding.message: add regression
994         test for the message padding problem
995
996 2003-03-02  Havoc Pennington  <hp@pobox.com>
997
998         * dbus/dbus-message.c (decode_header_data): fix to always init
999         message_padding, from Benjamin Dauvergne
1000
1001 2003-03-02  Havoc Pennington  <hp@pobox.com>
1002
1003         * configure.in: 0.5
1004
1005         * NEWS: Update.
1006
1007 2003-03-01  Joe Shaw  <joe@assbarn.com>
1008
1009         * configure.in: Check for "struct cmsgcred" and try to access its
1010         members for BSD-like unices.
1011
1012         * dbus/dbus-sysdeps.c (read_credentials_byte): Fold this back into
1013         _dbus_read_credentials_unix_socket().
1014         (_dbus_read_credentials_unix_socket): Use recvmsg() instead of
1015         read() for reading the credential byte off the unix socket.  Use
1016         struct cmsgcred on systems that support it.
1017
1018 2003-02-27  Alexander Larsson  <alexl@redhat.com>
1019
1020         * glib/Makefile.am: 
1021         * configure.in:
1022         Make gthreads-2.0 dependency optional. Don't build thread test if
1023         its not found.
1024
1025 2003-02-27  Havoc Pennington  <hp@pobox.com>
1026
1027         * dbus/dbus-connection.c
1028         (dbus_connection_send_message_with_reply_and_block): fix doh!
1029         doh! doh! bug that resulted in never removing a reply from the
1030         queue, no wonder we called get_reply_serial so much ;-)
1031         
1032         * dbus/dbus-message.c (struct DBusMessage): cache reply serial
1033         and client serial instead of demarshaling them every time
1034
1035 2003-02-27  Havoc Pennington  <hp@pobox.com>
1036
1037         * dbus/dbus-marshal.c (_dbus_demarshal_int32): rewrite to be much
1038         more inlined, using dbus-string-private.h, speeds things up 
1039         substantially
1040
1041         * dbus/dbus-string.c (_dbus_string_free): apply align offset
1042         when freeing the string
1043         (_dbus_string_steal_data): fix for align offset
1044         (undo_alignment): new function
1045
1046 2003-02-26  Havoc Pennington  <hp@redhat.com>
1047
1048         All kinds of audit fixes from Owen, plus initial attempt to 
1049         handle unaligned memory returned from malloc.
1050         
1051         * dbus/dbus-string.c (_dbus_string_init): clamp max length to 
1052         leave room for align_offset and nul byte
1053         (fixup_alignment): function to track an align_offset and 
1054         ensure real->str is aligned
1055         (DBUS_GENERIC_STRING_PREAMBLE): len must be less than allocated, 
1056         to allow a nul byte plus align offset
1057         (_dbus_string_lock): fix overflow issue
1058         (_dbus_string_init_const_len): add assertions on sanity of len, 
1059         assign allocated to be ALLOCATION_PADDING larger than len
1060         (set_length): fixup the overflow handling
1061         (_dbus_string_get_data_len): fix overflow in assertion
1062         (open_gap): detect overflow in size of gap to be opened
1063         (_dbus_string_lengthen): add overflow check
1064         (_dbus_string_align_length): fix overflow with _DBUS_ALIGN_VALUE
1065         (_dbus_string_append): add overflow check
1066         (_dbus_string_append_unichar): overflow
1067         (_dbus_string_delete): fix overflow in assertion
1068         (_dbus_string_copy_len): overflow in assertion
1069         (_dbus_string_replace_len): overflows in assertions
1070         (_dbus_string_find): change to implement in terms of 
1071         _dbus_string_find_to
1072         (_dbus_string_find_to): assorted fixage
1073         (_dbus_string_equal_c_str): assert c_str != NULL, 
1074         fix logic so the function works
1075         (_dbus_string_ends_with_c_str): fix overflow thingy
1076         (_dbus_string_base64_encode): overflow fix
1077         (_dbus_string_validate_ascii): overflow
1078         (_dbus_string_validate_nul): overflow
1079         
1080 2003-02-26  Havoc Pennington  <hp@redhat.com>
1081
1082         * dbus/dbus-marshal.c (_dbus_marshal_test): fix to work with DISABLE_ASSERTS
1083
1084 2003-02-26  Alexander Larsson  <alexl@redhat.com>
1085
1086         * configure.in:
1087         Set DBUS_GLIB_THREADS_LIBS for apps using gthread-2.0
1088         
1089         * dbus/dbus-connection.c:
1090         * dbus/dbus-connection.h:
1091         Fix _dbus_connection_acquire_io_path and _dbus_connection_acquire_dispatch.
1092         Add dbus_connection_set_wakeup_main_function and use it when queueing
1093         incoming and outgoing messages.
1094         
1095         
1096         * dbus/dbus-dataslot.c:
1097         Threadsafe usage of DBusDataSlotAllocator
1098         
1099         * dbus/dbus-message.c: (dbus_message_get_args_iter):
1100         dbus_new can fail.
1101         
1102         * dbus/dbus-server-unix.c:
1103         Add todo comment
1104         
1105         * glib/dbus-gmain.c:
1106         Implement the new wakeup functions for glib.
1107         
1108         * glib/Makefile.am:
1109         * glib/test-thread-client.c: 
1110         * glib/test-thread-server.c: 
1111         * glib/test-thread.h:
1112         Initial cut at some thread test code. Not really done yet.
1113
1114 2003-02-26  Havoc Pennington  <hp@pobox.com>
1115
1116         * dbus/dbus-connection.c
1117         (dbus_connection_send_message_with_reply_and_block): fix crash
1118         where we ref'd the outgoing message instead of the returned reply
1119
1120         * dbus/dbus-transport-unix.c (do_authentication): check read watch
1121         at the end of this function, so if we didn't need to read for
1122         authentication, we reinstall it for receiving messages
1123
1124         * dbus/dbus-message.c (dbus_message_new_reply): allow replies to 
1125         a NULL sender for peer-to-peer case
1126
1127         * dbus/dbus-transport-unix.c (check_read_watch): handle
1128         !authenticated case correctly
1129
1130         * glib/dbus-gmain.c: add support for DBusServer
1131
1132         * dbus/dbus-server.c: add data slot support
1133
1134         * glib/dbus-gmain.c (dbus_connection_setup_with_g_main): check
1135         return values and handle errors
1136
1137         * dbus/dbus-dataslot.c: factor out the data slot stuff from
1138         DBusConnection
1139
1140         * Doxyfile.in (INPUT): add glib subdir
1141
1142         * glib/dbus-gmain.c (dbus_connection_setup_with_g_main): rename 
1143         setup_with_g_main instead of hookup_with_g_main; write docs
1144         
1145 2003-02-24  Anders Carlsson  <andersca@codefactory.se>
1146
1147         * dbus/dbus-marshal.c: (_dbus_marshal_validate_arg):
1148         * dbus/dbus-message-builder.c: (_dbus_message_data_load):
1149         * dbus/dbus-message.c: (dbus_message_append_boolean),
1150         (dbus_message_append_boolean_array),
1151         (dbus_message_get_args_valist), (_dbus_message_test):
1152         * dbus/dbus-message.h:
1153         * doc/dbus-specification.sgml:
1154         Various fixes as pointed out by Havoc.
1155         
1156         * test/data/invalid-messages/bad-boolean-array.message:
1157         * test/data/invalid-messages/bad-boolean.message:
1158         Add invalid boolean value test cases.
1159         
1160 2003-02-24  Anders Carlsson  <andersca@codefactory.se>
1161
1162         * dbus/dbus-internals.c: (_dbus_type_to_string):
1163         * dbus/dbus-marshal.c: (_dbus_marshal_get_arg_end_pos),
1164         (_dbus_marshal_validate_arg):
1165         * dbus/dbus-message-builder.c: (_dbus_message_data_load):
1166         * dbus/dbus-message.c: (dbus_message_append_args_valist),
1167         (dbus_message_append_boolean), (dbus_message_append_boolean_array),
1168         (dbus_message_get_args_valist), (dbus_message_iter_get_boolean),
1169         (dbus_message_iter_get_int32), (dbus_message_iter_get_uint32),
1170         (dbus_message_iter_get_double),
1171         (dbus_message_iter_get_boolean_array), (message_iter_test):
1172         * dbus/dbus-message.h:
1173         * dbus/dbus-protocol.h:
1174         * doc/dbus-specification.sgml:
1175         * test/data/valid-messages/lots-of-arguments.message:
1176         Add support for boolean and boolean array types.
1177         
1178 2003-02-23  Havoc Pennington  <hp@pobox.com>
1179
1180         * dbus/dbus-keyring.c: finish most of this implementation and 
1181         simple unit test
1182
1183         * dbus/dbus-errors.c (dbus_set_error_const, dbus_set_error): make
1184         these barf if the error isn't cleared to NULL
1185
1186         * dbus/dbus-sysdeps.c (_dbus_delete_file): set error on failure
1187         (_dbus_create_directory): new function
1188
1189         * dbus/dbus-errors.c (dbus_set_error): fix warning
1190
1191         * dbus/dbus-string.c (_dbus_string_hex_encode): new function
1192         (_dbus_string_hex_decode): new function
1193         (test_hex_roundtrip): test code
1194
1195         * dbus/dbus-sha.c (_dbus_sha_compute): use dbus_string_hex_encode
1196
1197         * dbus/dbus-md5.c (_dbus_md5_compute): use dbus_string_hex_encode
1198
1199         * dbus/dbus-sysdeps.c (_dbus_string_save_to_file): make this use 
1200         the save-to-temp/rename trick to atomically write the new file
1201         (_dbus_string_parse_uint): new function
1202
1203 2003-02-22  Havoc Pennington  <hp@pobox.com>
1204
1205         * test/Makefile.am (dist-hook): fix dist for test/data/sha-1
1206
1207 2003-02-22  Havoc Pennington  <hp@pobox.com>
1208
1209         * dbus/dbus-message.c (dbus_message_iter_get_string_array):
1210         (dbus_message_iter_get_byte_array): Fix up doxygen warnings
1211
1212         * dbus/dbus-sha.c: add implementation of SHA-1 algorithm
1213
1214         * dbus/test/data/sha-1: add US government test suite for SHA-1
1215
1216 2003-02-21  Anders Carlsson  <andersca@codefactory.se>
1217
1218         * dbus/dbus-marshal.c: (_dbus_demarshal_string_array):
1219         Make string arrays NULL-terminated.
1220         
1221         * dbus/dbus-memory.c: (dbus_free_string_array):
1222         * dbus/dbus-memory.h:
1223         New function for freeing NULL-terminated string arrays.
1224         
1225         * dbus/dbus-message-builder.c: (append_quoted_string),
1226         (_dbus_message_data_load):
1227         Add support for array types.
1228         
1229         * dbus/dbus-message.c: (check_message_handling):
1230         Add more types as test cases.
1231         
1232         * dbus/dbus-sysdeps.c: (_dbus_string_parse_int),
1233         (_dbus_string_parse_double):
1234         Add the start offset to the end offset.
1235         
1236         * test/data/valid-messages/lots-of-arguments.message:
1237         New test message with lots of arguments.
1238         
1239 2003-02-21  Anders Carlsson  <andersca@codefactory.se>
1240
1241         * dbus/dbus-message.c: (dbus_message_append_nil),
1242         (dbus_message_append_int32), (dbus_message_append_uint32),
1243         (dbus_message_append_double), (dbus_message_append_string),
1244         (dbus_message_append_int32_array),
1245         (dbus_message_append_uint32_array),
1246         (dbus_message_append_double_array),
1247         (dbus_message_append_byte_array),
1248         (dbus_message_append_string_array):
1249         Fix all out-of-memory handling in these functions.
1250
1251 2003-02-21  Anders Carlsson  <andersca@codefactory.se>
1252
1253         * dbus/dbus-message.c: (dbus_message_append_nil):
1254         Fix a silly.
1255         
1256 2003-02-21  Anders Carlsson  <andersca@codefactory.se>
1257
1258         * dbus/dbus-message.c: (dbus_message_append_args_valist),
1259         (dbus_message_append_nil), (dbus_message_append_int32_array),
1260         (dbus_message_append_uint32_array),
1261         (dbus_message_append_double_array),
1262         (dbus_message_append_byte_array),
1263         (dbus_message_append_string_array), (dbus_message_get_args_valist),
1264         (dbus_message_iter_get_int32_array),
1265         (dbus_message_iter_get_uint32_array),
1266         (dbus_message_iter_get_double_array),
1267         (dbus_message_iter_get_byte_array),
1268         (dbus_message_iter_get_string_array):
1269
1270         * dbus/dbus-message.h:
1271         Add functions for appending and getting arrays.
1272         
1273 2003-02-21  Anders Carlsson  <andersca@codefactory.se>
1274
1275         * dbus/dbus-mempool.c (_dbus_mem_pool_new): Make the
1276         element size at least 8 bytes, fixes mempool tests on
1277         64-bit machines.
1278
1279 2003-02-20  Alexander Larsson  <alexl@redhat.com>
1280
1281         * dbus/dbus-transport-unix.c (unix_do_iteration):
1282         Unlock the connection mutex during a blocking select call.
1283         Add todo about how we need a way to wake up the select.
1284
1285         * dbus/dbus-connection-internal.h: 
1286         * dbus/dbus-connection.c:
1287         Add _dbus_connection_lock and _dbus_connection_unlock.
1288
1289 2003-02-19  Havoc Pennington  <hp@pobox.com>
1290
1291         * Doxyfile.in (PREDEFINED): put DOXYGEN_SHOULD_SKIP_THIS in
1292         Doxyfile.in, not Doxyfile
1293
1294         * dbus/dbus-keyring.c: do some hacking on this
1295
1296         * dbus/dbus-sysdeps.c (_dbus_delete_file): new
1297
1298         * dbus/dbus-errors.c (dbus_set_error_const): do not call
1299         dbus_error_init
1300         (dbus_set_error): remove dbus_error_init, check for message ==
1301         NULL *before* we sprintf into it, and add @todo about including 
1302         system headers in this file
1303
1304         * dbus/dbus-sysdeps.c (_dbus_create_file_exclusively): new
1305
1306         * dbus/dbus-errors.h (DBUS_ERROR_FAILED): add
1307
1308         * dbus/dbus-sysdeps.c (get_user_info): break this function out to
1309         get various bits of user information based on either username 
1310         or user ID
1311         (_dbus_homedir_from_username): new function
1312
1313 2003-02-19  Anders Carlsson  <andersca@codefactory.se>
1314
1315         * configure.in:
1316         Add check for nonposix getpwnam_r
1317         
1318         * dbus/dbus-mempool.c: (_dbus_mem_pool_new):
1319         Align the pool element size to a sizeof (void *) boundary.
1320         
1321         * dbus/dbus-sysdeps.c: (_dbus_setenv), (_dbus_connect_unix_socket),
1322         (_dbus_listen_unix_socket), (_dbus_credentials_from_username):
1323         General Solaris fixes.
1324         
1325         * test/data/valid-messages/simplest-manual.message:
1326         Explicitly state that we want little-endian packing.
1327         
1328 2003-02-19  Mikael Hallendal  <micke@codefactory.se>
1329
1330         * dbus/dbus-server.c (dbus_server_listen): Support tcp: addresses.
1331
1332         * dbus/dbus-transport-unix.c (_dbus_transport_new_for_tcp_socket): 
1333         Added to create a transport connecting using a tcp/ip socket.
1334
1335         * dbus/dbus-sysdeps.c (_dbus_connect_tcp_socket): Added to connect
1336         to a tcp socket at given host and port.
1337         (_dbus_listen_tcp_socket): added to listen on tcp socket for given
1338         hostname and port.
1339
1340         * dbus/dbus-server.c (dbus_server_listen): Support tcp: addresses.
1341
1342         * dbus/dbus-server-unix.c (_dbus_server_new_for_tcp_socket): 
1343         Added to create a server listening on a TCP/IP socket.
1344
1345 2003-02-19  Havoc Pennington  <hp@pobox.com>
1346
1347         Throughout: mop up all the Doxygen warnings and undocumented
1348         stuff.
1349         
1350         * dbus/dbus-sysdeps.c (do_exec): do not use execvp, we don't want
1351         to search any paths.
1352
1353         * dbus/dbus-threads.c: move global mutex initializers to
1354         dbus-internals.h, multiple prototypes was confusing doxygen
1355         besides being kind of ugly
1356
1357         * Doxyfile (PREDEFINED): have Doxygen define
1358         DOXYGEN_SHOULD_SKIP_THIS so we can exclude things from 
1359         docs with #ifndef DOXYGEN_SHOULD_SKIP_THIS
1360         (do not abuse the feature! it's for stuff like the autogenerated 
1361         macros in dbus-md5.c, not just for things you don't feel like 
1362         documenting...)
1363
1364 2003-02-18  Havoc Pennington  <hp@pobox.com>
1365
1366         * dbus/dbus-string.c (_dbus_string_zero): new function
1367
1368         * dbus/dbus-md5.c: include MD5 implementation by L. Peter Deutsch,
1369         wrap it in some dbus-friendly API
1370
1371         * dbus/dbus-types.h: add 16-bit types
1372
1373 2003-02-18  Joe Shaw  <joe@assbarn.com>
1374
1375         * dbus/dbus-auth.c (handle_server_data_stupid_test_mech): Just get
1376         credentials from our currently running process.
1377         (get_word): Fix a buglet where we were copying the entire length
1378         instead of relative to our position.
1379
1380         * dbus/dbus-hash.c (_dbus_hash_test): Don't try to allocate the
1381         keys on the stack... it's 640k of data.
1382
1383         * dbus/dbus-sysdeps.c (_dbus_read_credentials_unix_socket): Always
1384         read the credentials byte off the socket, even if we don't have
1385         SO_PEERCRED.
1386         (_dbus_poll): Implement poll() using select() for systems which
1387         don't have it.
1388
1389         * glib/test-dbus-glib.c (main): Print out an error if no
1390         parameters are given.
1391
1392         * test/data/auth/fallback.auth-script: Added.  Tests that a client
1393         can fallback to a secondary auth mechanism if the first fails.
1394
1395 2003-02-18  Havoc Pennington  <hp@pobox.com>
1396
1397         * AUTHORS: add Alex
1398
1399 2003-02-17  Havoc Pennington  <hp@pobox.com>
1400
1401         * doc/dbus-specification.sgml: lots of cosmetic
1402         cleanups/rearrangement, add assorted FIXME, change DBUS_ADDRESS
1403         env variable to DBUS_BUS_ADDRESS, s/client/application/,
1404         s/server/bus/ (except in authentication section). Add a section
1405         "Message Bus Message Routing"
1406
1407 2003-02-17  Anders Carlsson  <andersca@codefactory.se.>
1408
1409         Release 0.4
1410         
1411         * NEWS: Update
1412
1413 2003-02-17  Anders Carlsson  <andersca@codefactory.se>
1414
1415         * doc/dbus-specification.sgml:
1416         Specification updates.
1417         
1418 2003-02-17  Anders Carlsson  <andersca@codefactory.se>
1419
1420         * bus/activation.c: (bus_activation_init), (child_setup),
1421         (bus_activation_activate_service):
1422         * bus/activation.h:
1423         * bus/main.c: (main):
1424         Set DBUS_ADDRESS environment variable.
1425         
1426         * dbus/dbus-errors.c: (dbus_set_error):
1427         Don't use va_copy since that's a C99 feature.
1428         
1429         * dbus/dbus-sysdeps.c: (_dbus_setenv), (do_exec),
1430         (_dbus_spawn_async):
1431         * dbus/dbus-sysdeps.h:
1432         Add child_setup_func to _dbus_spawn_async.
1433         
1434         * doc/dbus-specification.sgml:
1435         Update specification.
1436         
1437         * test/spawn-test.c: (setup_func), (main):
1438         Fix test.
1439         
1440 2003-02-17  Alexander Larsson  <alexl@redhat.com>
1441
1442         * dbus/dbus-connection.c (_dbus_connection_handler_destroyed_locked):
1443         Added todo.
1444
1445 2003-02-17  Anders Carlsson  <andersca@codefactory.se>
1446
1447         * doc/.cvsignore:
1448         * doc/Makefile.am:
1449         * doc/dbus-test-plan.sgml:
1450         Add test plan document.
1451         
1452         * test/Makefile.am:
1453         Fix distcheck.
1454         
1455 2003-02-17  Anders Carlsson  <andersca@codefactory.se>
1456
1457         * dbus/dbus-message.c: (decode_header_data),
1458         (_dbus_message_loader_return_buffer):
1459         Set the header padding amount when loading a message.
1460
1461 2003-02-16  Anders Carlsson  <andersca@codefactory.se>
1462
1463         * bus/dispatch.c: (send_one_message):
1464         Only send broadcast messages to registered connections.
1465         
1466         * dbus/dbus-message.c: (dbus_message_name_is):
1467         * dbus/dbus-message.h:
1468         New convenience function.
1469         
1470         * dbus/dbus-transport-debug.c: (do_reading):
1471         Only dispatch one message per run.
1472
1473         * test/Makefile.am:
1474         * test/bus-test.c: (new_connection_callback), (die),
1475         (test_hello_client1_handler), (test_hello_client2_handler),
1476         (test_hello_replies), (main):
1477
1478         * test/bus-test-loop.[ch]:
1479         Add these.
1480         
1481 2003-02-16  Havoc Pennington  <hp@pobox.com>
1482
1483         * dbus/dbus-connection.c (dbus_connection_dispatch_message): fix
1484         backward conditional
1485
1486 2003-02-16  Alexander Larsson  <alexl@redhat.com>
1487
1488         * dbus/dbus-connection.c:
1489         Implement sent_message_with_reply. (with_reply_and block is still
1490         busted).
1491         Made dispatch_message not lose message if OOM.
1492         
1493         * dbus/dbus-errors.h:
1494         Add NoReply error (for reply timeouts).
1495
1496 2003-02-16  Alexander Larsson  <alexl@redhat.com>
1497
1498         * dbus/dbus-hash.c (_dbus_hash_table_unref):
1499         Actually free keys and values when destroying hashtable.
1500
1501 2003-02-16  Anders Carlsson  <andersca@codefactory.se>
1502
1503         * dbus/dbus-auth.c: (client_try_next_mechanism):
1504         Plug a leak.
1505         
1506         * dbus/dbus-threads.c: (dbus_condvar_wait_timeout):
1507         Return TRUE if there's no thread implementation around.
1508         
1509         * glib/dbus-gmain.c: (free_source),
1510         (dbus_connection_hookup_with_g_main):
1511         Make sure to remove the GSource when the connection is finalized.
1512         
1513 2003-02-16  Anders Carlsson  <andersca@codefactory.se>
1514
1515         * bus/dispatch.c: (bus_dispatch_message_handler):
1516         * dbus/dbus-errors.h:
1517         Return an error if someone tries to send a message to a service
1518         that doesn't exist.
1519         
1520 2003-02-16  Anders Carlsson  <andersca@codefactory.se>
1521
1522         * bus/activation.c: (load_directory), (bus_activation_init),
1523         (bus_activation_activate_service):
1524         * bus/activation.h:
1525         * bus/driver.c: 
1526         (bus_driver_handle_activate_service), (bus_driver_handle_message):
1527         More work on the activation handling.
1528         
1529         * dbus/dbus-errors.h:
1530         Add some error messages
1531         
1532         * dbus/dbus-message.c: (dbus_message_new_error_reply):
1533         * dbus/dbus-message.h:
1534         New function that creates an error message.
1535         
1536         * dbus/dbus-protocol.h:
1537         Add ACTIVATE_SERVER message.
1538         
1539         * dbus/dbus-server-unix.c: (unix_handle_watch),
1540         (_dbus_server_new_for_domain_socket):
1541         Call _dbus_fd_set_close_on_exec.
1542         
1543         * dbus/dbus-sysdeps.c: (make_pipe), (do_exec),
1544         (_dbus_spawn_async), (_dbus_disable_sigpipe),
1545         (_dbus_fd_set_close_on_exec):
1546         * dbus/dbus-sysdeps.h:
1547         Add _dbus_fd_set_close_on exec function. Also add function that checks
1548         that all open fds are set to close-on-exec and warns otherwise.
1549         
1550         * dbus/dbus-transport-unix.c:
1551         (_dbus_transport_new_for_domain_socket):
1552         Call _dbus_fd_set_close_on_exec.
1553
1554 2003-02-16  Havoc Pennington  <hp@pobox.com>
1555
1556         * dbus/dbus-connection.c (dbus_connection_set_change_sigpipe):
1557         allow people to avoid setting SIGPIPE to SIG_IGN
1558         (_dbus_connection_new_for_transport): disable SIGPIPE unless 
1559         we've been asked not to
1560
1561 2003-02-15  Anders Carlsson  <andersca@codefactory.se>
1562
1563         * dbus/dbus-list.c: (_dbus_list_append_link),
1564         (_dbus_list_prepend_link):
1565         * dbus/dbus-memory.c: (dbus_malloc), (dbus_malloc0),
1566         (dbus_realloc):
1567         Warning fixes.
1568
1569 2003-02-15  Anders Carlsson  <andersca@codefactory.se>
1570
1571         * bus/Makefile.am:
1572         * bus/activation.c: (bus_activation_entry_free),
1573         (add_desktop_file_entry), (load_directory), (bus_activation_init):
1574         * bus/activation.h:
1575         * bus/main.c: (main):
1576         Add simple activation support, doesn't work yet though.
1577
1578 2003-02-15   Zack Rusin  <zack@kde.org>
1579
1580         * qt/dbus-qthread.cpp:  small casting fix
1581
1582 2003-02-15  Anders Carlsson  <andersca@codefactory.se>
1583
1584         * dbus/dbus-errors.c: (dbus_set_error):
1585         * dbus/dbus-errors.h:
1586         Add a few errors and make dbus_set_error void.
1587         
1588         * dbus/dbus-sysdeps.c: 
1589         (_dbus_errno_to_string), (close_and_invalidate), (make_pipe),
1590         (write_err_and_exit), (read_ints), (do_exec), (_dbus_spawn_async):
1591         * dbus/dbus-sysdeps.h:
1592         Add _dbus_spawn_async.
1593         
1594         * test/spawn-test.c: (main):
1595         Test for _dbus_spawn_async.
1596         
1597 2003-02-15  Anders Carlsson  <andersca@codefactory.se>
1598
1599         * dbus/dbus-internals.h:
1600         Fix build without tests.
1601         
1602         * dbus/dbus-list.c: (alloc_link):
1603         Fix a segfault when a malloc fails.
1604         
1605         * dbus/dbus-memory.c: (initialize_malloc_debug), (dbus_malloc),
1606         (dbus_malloc0), (dbus_realloc):
1607         Add support for malloc debugging.
1608
1609 2003-02-15  Alexander Larsson  <alexl@redhat.com>
1610
1611         * dbus/dbus-threads.c:
1612         * dbus/dbus-threads.h:
1613         Add condvars. Remove static mutext from API.
1614         Implement static mutexes by initializing them from threads_init.
1615         
1616         * glib/dbus-gthread.c:
1617         * qt/dbus-qthread.cpp:
1618         Update with the thread api changes.
1619
1620                 
1621         * dbus/dbus-list.c:
1622         * dbus/dbus-list.h:
1623         Turn StaticMutex into normal mutex + init function.
1624         Export new functions _dbus_list_alloc_link, _dbus_list_free_link,
1625         _dbus_list_append_link, _dbus_list_prepend_link
1626
1627
1628         * dbus/dbus-sysdeps.c: 
1629         * dbus/dbus-sysdeps.h:
1630         New type dbus_atomic_t, and new functions _dbus_atomic_inc,
1631         _dbus_atomic_dec. Only slow fallback implementation at the moment.
1632         
1633         * dbus/dbus-protocol.h:
1634         Add DBUS_MESSAGE_LOCAL_DISCONNECT define
1635         
1636         * dbus/dbus-message.c:
1637         Make ref/unref atomic.
1638         Fix some docs.
1639         
1640         * dbus/dbus-connection-internal.h:
1641         * dbus/dbus-connection.c:
1642         * dbus/dbus-connection.h:
1643         Make threadsafe.
1644         Change _peek to _borrow,_return & _steal_borrowed.
1645         Change disconnect callback to event.
1646         Make dbus_connection_dispatch_messages reentrant.
1647         
1648         * dbus/dbus-transport.c:
1649         Don't ref the connection on calls to the transport
1650         implementation.
1651         
1652         * dbus/dbus-message-handler.c:
1653         Make threadsafe.
1654         
1655         * glib/dbus-gmain.c:
1656         Don't use peek_message anymore
1657         
1658         * test/Makefile.am:
1659         * test/debug-thread.c:
1660         * test/debug-thread.h:
1661         Simple thread implementation that asserts() on deadlocks in
1662         single-threaded code.
1663         
1664         * test/bus-test.c:
1665         (main) Call debug_threads_init.
1666
1667         * test/watch.c:
1668         Use disconnect message instead of disconnect callback.
1669
1670         * bus/connection.c:
1671         * bus/connection.h:
1672         Don't call dbus_connection_set_disconnect_function. Instead export
1673         bus_connection_disconnect.
1674         
1675         * bus/dispatch.c:
1676         Call bus_connection_disconnect when we get a disconnected message.
1677         
1678 2003-02-15  Havoc Pennington  <hp@pobox.com>
1679
1680         * dbus/dbus-message.c (dbus_message_new): fool around with the
1681         docs
1682
1683 2003-02-14  Havoc Pennington  <hp@pobox.com>
1684
1685         * dbus/dbus-mempool.c: fail if the debug functions so indicate
1686
1687         * dbus/dbus-memory.c: fail if the debug functions indicate we
1688         should
1689
1690         * dbus/dbus-internals.c (_dbus_set_fail_alloc_counter)
1691         (_dbus_decrement_fail_alloc_counter): debug functions to 
1692         simulate memory allocation failures
1693
1694 2003-02-14  Havoc Pennington  <hp@pobox.com>
1695
1696         * dbus/dbus-errors.h (struct DBusError): add a word of padding 
1697         to DBusError
1698
1699 2003-02-13  Anders Carlsson  <andersca@codefactory.se>
1700
1701         * bus/driver.c: (bus_driver_handle_hello):
1702         * bus/driver.h:
1703         * bus/services.c: (bus_service_lookup):
1704         Reorder message sending so we get a more sane order.
1705         
1706         * test/bus-test.c: (message_handler):
1707         Fix tyop.
1708         
1709 2003-02-13  Anders Carlsson  <andersca@codefactory.se>
1710
1711         * bus/driver.c: (bus_driver_send_service_deleted),
1712         (bus_driver_send_service_created), (bus_driver_send_service_lost),
1713         (bus_driver_send_service_acquired), (bus_driver_handle_hello),
1714         (bus_driver_send_welcome_message),
1715         (bus_driver_handle_list_services),
1716         (bus_driver_handle_acquire_service),
1717         (bus_driver_handle_service_exists):
1718         * dbus/dbus-bus.c: (dbus_bus_register_client),
1719         (dbus_bus_acquire_service), (dbus_bus_service_exists):
1720         * dbus/dbus-errors.c: (dbus_result_to_string):
1721         * dbus/dbus-errors.h:
1722         * dbus/dbus-message.c: (dbus_message_append_args),
1723         (dbus_message_append_args_valist), (dbus_message_get_args),
1724         (dbus_message_get_args_valist), (dbus_message_get_args_iter),
1725         (dbus_message_iter_get_arg_type), (dbus_message_iter_get_string),
1726         (dbus_message_iter_get_byte_array),
1727         (dbus_message_iter_get_string_array), (message_iter_test),
1728         (check_message_handling), (_dbus_message_test):
1729         * dbus/dbus-message.h:
1730         * test/bus-test.c: (main):
1731         Change fields to arguments in messages, so that they won't be
1732         confused with header fields.
1733         
1734         * glib/test-dbus-glib.c: (main):
1735         Remove append_fields from hello message.
1736         
1737 2003-02-13  Anders Carlsson  <andersca@codefactory.se>
1738
1739         * dbus/dbus-errors.c:
1740         * dbus/dbus-message.c:
1741         * dbus/dbus-string.c:
1742         Documentation fixes.
1743
1744 2003-02-13  Anders Carlsson  <andersca@codefactory.se>
1745
1746         * glib/dbus-gmain.c: (timeout_handler), (add_timeout),
1747         (remove_timeout):
1748         Implement support for timeouts in dbus-glib.
1749         
1750 2003-02-13  Anders Carlsson  <andersca@codefactory.se>
1751
1752         * dbus/dbus-message-builder.c: (_dbus_message_data_load):
1753         * dbus/dbus-message.c: (process_test_subdir):
1754         * test/break-loader.c: (find_breaks_based_on):
1755         Plug some memory leaks.
1756         
1757 2003-02-13  Richard Hult  <rhult@codefactory.se>
1758
1759         * bus/main.c: Fix build.
1760
1761         * dbus/dbus-errors.h: 
1762         * dbus/dbus-errors.c: Fix copyright for Anders.
1763
1764 2003-02-13  Anders Carlsson  <andersca@codefactory.se>
1765
1766         * bus/Makefile.am:
1767         Add utils.[ch]
1768         
1769         * bus/connection.c: (bus_connection_foreach):
1770         Fix a warning.
1771         
1772         * bus/desktop-file.c: (grow_lines_in_section), (grow_sections),
1773         (unescape_string), (new_section), (parse_section_start),
1774         (parse_key_value), (report_error), (bus_desktop_file_load),
1775         (bus_desktop_file_get_string):
1776         * bus/desktop-file.h:
1777         Use DBusError for error reporting.
1778         
1779         * bus/dispatch.c: (send_one_message),
1780         (bus_dispatch_message_handler):
1781         * bus/driver.c: (bus_driver_send_service_deleted),
1782         (bus_driver_send_service_created), (bus_driver_send_service_lost),
1783         (bus_driver_send_service_acquired), (bus_driver_handle_hello),
1784         (bus_driver_send_welcome_message),
1785         (bus_driver_handle_list_services),
1786         (bus_driver_handle_acquire_service),
1787         (bus_driver_handle_service_exists):
1788         * bus/loop.c: (bus_loop_run):
1789         * bus/main.c:
1790         Use BUS_HANDLE_OOM instead of _DBUS_HANDLE_OOM.
1791         
1792         * bus/utils.c: (bus_wait_for_memory):
1793         * bus/utils.h:
1794         New files with general utility functions.
1795         
1796         * dbus/dbus-internals.h:
1797         Remove _DBUS_HANDLE_OOM.
1798         
1799 2003-02-13  Anders Carlsson  <andersca@codefactory.se>
1800
1801         * dbus/dbus-errors.c: (dbus_result_to_string), (dbus_error_init),
1802         (dbus_error_free), (dbus_set_error_const), (dbus_set_error):
1803         * dbus/dbus-errors.h:
1804         Add DBusError structure.
1805         
1806 2003-02-13  Anders Carlsson  <andersca@codefactory.se>
1807
1808         * test/data/valid-messages/standard-acquire-service.message:
1809         * test/data/valid-messages/standard-hello.message:
1810         * test/data/valid-messages/standard-list-services.message:
1811         * test/data/valid-messages/standard-service-exists.message:
1812         Add some standard messages.
1813         
1814 2003-02-13  Anders Carlsson  <andersca@codefactory.se>
1815
1816         * bus/driver.c: (bus_driver_send_welcome_message),
1817         (bus_driver_handle_list_services),
1818         (bus_driver_handle_acquire_service),
1819         (bus_driver_handle_service_exists), (bus_driver_handle_message):
1820         Update for API changes in libdbus.
1821         
1822         * dbus/dbus-message.c: (dbus_message_new_reply):
1823         * dbus/dbus-message.h:
1824         Remove the name argument. The spec states that replies shouldn't
1825         have a name.
1826
1827 2003-02-13  Anders Carlsson  <andersca@codefactory.se>
1828
1829         * bus/desktop-file.c: (parse_section_start), (parse_key_value),
1830         (report_error), (bus_desktop_file_load), (lookup_section),
1831         (lookup_line), (bus_desktop_file_get_raw),
1832         (bus_desktop_file_get_string):
1833         * bus/desktop-file.h:
1834         Some fixes, and new functions for getting a key value from a section.
1835         
1836 2003-02-13  Havoc Pennington  <hp@pobox.com>
1837
1838         * test/data/auth/fail-after-n-attempts.auth-script: new test
1839
1840         * dbus/dbus-auth.c (send_rejected): shutdown_mech() when we
1841         reject the client.
1842
1843 2003-02-13  Havoc Pennington  <hp@pobox.com>
1844
1845         * dbus/dbus-auth.c (handle_server_data_external_mech): args to
1846         dbus_credentials_match were backward
1847
1848         * dbus/dbus-auth-script.c (_dbus_auth_script_run): support
1849         NO_CREDENTIALS and ROOT_CREDENTIALS
1850
1851         * dbus/dbus-auth.c (_dbus_auth_do_work): move get_state() routine 
1852         into here. Never process more commands after we've reached an 
1853         end state; store further data as unused bytes.
1854
1855         * test/data/auth/*: add more auth tests
1856         
1857         * dbus/dbus-auth-script.c (_dbus_auth_script_run): support EXPECT
1858         command to match exact string and EXPECT_UNUSED to match unused
1859         bytes
1860
1861         * test/Makefile.am (dist-hook): fix to dist all the test stuff
1862
1863 2003-02-12  Havoc Pennington  <hp@pobox.com>
1864
1865         * dbus/dbus-string.c (_dbus_string_pop_line): fix to also strip
1866         \r off of popped lines
1867
1868         * dbus/dbus-auth.c (_dbus_auth_test): write code to run auth
1869         scripts
1870
1871         * dbus/dbus-auth-script.c (_dbus_auth_script_run): when doing a
1872         SEND, append \r\n
1873
1874 2003-02-12  Havoc Pennington  <hp@pobox.com>
1875
1876         * dbus/Makefile.am: remove break-loader from the build, since it
1877         moved.
1878
1879         * configure.in: add --enable-gcov to turn on coverage profiling
1880         flags and disable optimization
1881
1882 2003-02-10  Havoc Pennington  <hp@pobox.com>
1883
1884         * dbus/dbus-auth-script.c, dbus/dbus-auth-script.h: sync 
1885         initial cut at test framework for DBusAuth from laptop.
1886         Doesn't quite work yet but it compiles and I need to get 
1887         it off the 266mhz laptop. ;-)
1888         
1889         * dbus/dbus-server-debug.c (_dbus_server_debug_accept_transport):
1890         fix a memleak in error case
1891
1892 2003-02-12  Anders Carlsson  <andersca@codefactory.se>
1893
1894         * bus/Makefile.am:
1895         * bus/desktop-file.c:
1896         * bus/desktop-file.h:
1897         Add a desktop file parser.
1898
1899 2003-02-11  Zack Rusin  <zack@kde.org>
1900
1901         * qt/message.[h|cpp]: sample implementation
1902         of the KDE wrapper for DBusMessage
1903
1904 2003-02-09  Zack Rusin  <zack@kde.org>
1905
1906         * test/bus-test.c: make_it_compile
1907         * doc/dbus-specification.sgml: minimal semantic fix
1908
1909 2003-02-06  Anders Carlsson  <andersca@codefactory.se>
1910
1911         Release 0.3
1912         
1913         * NEWS: Update
1914
1915 2003-02-06  Anders Carlsson  <andersca@codefactory.se>
1916
1917         * dbus/Makefile.am:
1918         * dbus/dbus-break-loader.c:
1919         * test/Makefile.am:
1920         * test/break-loader.c:
1921         Move dbus-break-loader to test/ and rename it to break-loader.
1922
1923 2003-02-02  Havoc Pennington  <hp@pobox.com>
1924
1925         * dbus/dbus-keyring.c, dbus/dbus-keyring.h: template files 
1926         for code to manage cookies in your home directory
1927
1928         * dbus/dbus-sysdeps.c (_dbus_generate_random_bytes): new function
1929
1930         * dbus/dbus-auth.c (get_state): impose a maximum number of tries
1931         to authenticate, then disconnect the client.
1932
1933 2003-02-03  Alexander Larsson  <alexl@redhat.com>
1934
1935         * dbus/dbus-message.c (dbus_message_append_fields):
1936         Correct docs.
1937
1938 2003-02-02  Anders Carlsson  <andersca@codefactory.se>
1939
1940         * doc/dbus-specification.sgml:
1941         Update address format section.
1942         
1943 2003-02-02  Anders Carlsson  <andersca@codefactory.se>
1944
1945         * test/Makefile.am:
1946         * test/bus-test.c: (get_time), (add_timeout), (remove_timeout),
1947         (message_handler), (new_connection_callback), (loop_quit),
1948         (loop_run), (main):
1949         Add bus test.
1950         
1951 2003-02-02  Anders Carlsson  <andersca@codefactory.se>
1952
1953         * bus/driver.c: (bus_driver_handle_service_exists):
1954         Simplify the code a bit.
1955         
1956         * dbus/dbus-bus.c: (dbus_bus_service_exists):
1957         Fix a silly. 
1958         
1959 2003-02-02  Anders Carlsson  <andersca@codefactory.se>
1960
1961         * bus/Makefile.am:
1962         Add libdbus-daemon.la and link to it.
1963
1964 2003-02-01  James Willcox  <jwillcox@gnome.org>
1965
1966         * bus/driver.c: (bus_driver_handle_own_service):
1967         Actually include the service reply code in the message.
1968
1969 2003-02-02  Anders Carlsson  <andersca@codefactory.se>
1970
1971         * bus/driver.c: (bus_driver_handle_service_exists):
1972         Don't unref the incoming message.
1973         
1974 2003-02-02  Anders Carlsson  <andersca@codefactory.se>
1975
1976         * dbus/dbus.h: Add dbus-address.h and dbus-bus.h
1977
1978 2003-02-02  Anders Carlsson  <andersca@codefactory.se>
1979
1980         * dbus/dbus-server.c: (dbus_server_listen):
1981         * dbus/dbus-transport.c: (_dbus_transport_open):
1982         ifdef out the calls to the debug transport and server.
1983         
1984 2003-02-02  Alexander Larsson  <alexl@redhat.com>
1985
1986         * dbus/dbus-watch.c (dbus_watch_get_flags):
1987         Add note in the docs that ERROR or HANGUP won't be returned
1988         and are assumed always on.
1989
1990         * glib/dbus-gmain.c (add_watch):
1991         Always add IO_ERR | IO_HUP
1992
1993         * dbus/dbus-message.h:
1994         Add semicolon after dbus_message_iter_get_string_array().
1995         Makes qt code build again
1996
1997 2003-02-01  Anders Carlsson  <andersca@codefactory.se>
1998
1999         * bus/driver.c: (create_unique_client_name),
2000         (bus_driver_handle_hello):
2001         Don't take a name, just use a numeric id to identify
2002         each client.
2003         
2004         * dbus/Makefile.am:
2005         * dbus/dbus-bus.c: (dbus_bus_register_client),
2006         (dbus_bus_acquire_service), (dbus_bus_service_exists):
2007         * dbus/dbus-bus.h:
2008         Add new convenience functions for communicating with the bus.
2009         
2010         * dbus/dbus-message.h:
2011         
2012         * dbus/dbus-protocol.h:
2013         Fix a typo.
2014         
2015 2003-02-01  Alexander Larsson  <alexl@redhat.com>
2016
2017         * dbus/dbus-message.c (dbus_message_append_fields):
2018         Add some more doc comments.
2019
2020 2003-02-01  Havoc Pennington  <hp@pobox.com>
2021
2022         * dbus/dbus-break-loader.c (randomly_modify_length): change 
2023         a 4-byte value in the message as if it were a length
2024
2025         * dbus/dbus-sysdeps.c (_dbus_string_save_to_file): don't set
2026         execute bit on saved files
2027
2028 2003-02-01  Havoc Pennington  <hp@pobox.com>
2029
2030         * dbus/dbus-break-loader.c (main): new program to find messages
2031         that break the loader.
2032
2033         * dbus/dbus-sysdeps.c (_dbus_string_append_uint): new function
2034         * dbus/dbus-sysdeps.c (_dbus_string_save_to_file): new function
2035
2036         * dbus/dbus-string.c (_dbus_string_set_byte): new
2037         
2038 2003-01-31  Havoc Pennington  <hp@pobox.com>
2039
2040         * dbus/dbus-message.c: refactor the test code to be more general, 
2041         in preparation for writing a "randomly permute test cases to 
2042         try to break the loader" program.
2043
2044 2003-01-31  Havoc Pennington  <hp@pobox.com>
2045         
2046         * doc/dbus-specification.sgml: work on the specification
2047
2048         * dbus/dbus-message.c (_dbus_message_loader_return_buffer): check 
2049         the protocol version of the message.
2050
2051         * dbus/dbus-protocol.h: drop special _REPLY names, the spec 
2052         no longer specifies that.
2053         (DBUS_SERVICE_REPLY_SERVICE_EXISTS): fix flags (1/2/4/8 not 
2054         1/2/3/4)
2055
2056         * dbus/dbus-marshal.c (_dbus_marshal_get_arg_end_pos): add missing
2057         "break" for DBUS_TYPE_NIL, remove @todo
2058
2059 2003-01-31  Havoc Pennington  <hp@pobox.com>
2060
2061         * dbus/dbus-message.c (dbus_message_set_is_error_reply): rename 
2062         just set_is_error/get_is_error as this is a commonly-used
2063         function, and write docs.
2064
2065 2003-01-31  Anders Carlsson  <andersca@codefactory.se>
2066
2067         * dbus/dbus-address.c: (dbus_address_entry_free):
2068         Free key and value lists.
2069         
2070         * dbus/dbus-internals.c: (_dbus_type_to_string):
2071         Add the types we didn't have.
2072         
2073         * dbus/dbus-marshal.c: (_dbus_marshal_get_arg_end_pos),
2074         (_dbus_marshal_validate_arg):
2075         Add NIL types.
2076         
2077         * dbus/dbus-message.c: (dbus_message_set_sender):
2078         Remove todo about being able to set sender to NULL.
2079         
2080         (dbus_message_set_is_error_reply),
2081         (dbus_message_get_is_error_reply):
2082         * dbus/dbus-message.h:
2083         New functions.
2084         
2085         * dbus/dbus-protocol.h:
2086         Add error reply flag.
2087         
2088         * test/data/valid-messages/opposite-endian.message:
2089         Add NIL type to test.
2090         
2091 2003-01-31  Havoc Pennington  <hp@pobox.com>
2092
2093         * doc/dbus-specification.sgml: fully specify the header.  Add
2094         flags and major protocol version, and change header/body len to
2095         unsigned.
2096
2097         * dbus/dbus-message-builder.c (append_saved_length): append length
2098         as uint32
2099
2100         * dbus/dbus-message.c (dbus_message_create_header): change header
2101         length and body length to unsigned. Add the new fields from the
2102         spec
2103         (_dbus_message_loader_return_buffer): unsigned header/body len
2104
2105 2003-01-30  Havoc Pennington  <hp@pobox.com>
2106
2107         * dbus/dbus-auth.c: rework to use only REJECTED, no 
2108         MECHANISMS
2109
2110         * doc/dbus-sasl-profile.txt: drop MECHANISMS and just 
2111         use REJECTED, suggested by Mark McLoughlin
2112
2113 2003-01-30  Havoc Pennington  <hp@pobox.com>
2114
2115         * dbus/dbus-server.c (dbus_server_listen): @todo about how we need
2116         a better way to report errors here. e.g.  "unix address lacks
2117         path" or something. also "no such file" when the path doesn't
2118         exist, etc.
2119
2120         * dbus/dbus-address.c (dbus_address_entries_free): add @todo about
2121         leaking list nodes
2122         (dbus_parse_address): add @todo about documenting address format, 
2123         and allowing , and ; to be escaped
2124
2125 2003-01-30  Anders Carlsson  <andersca@codefactory.se>
2126
2127         * dbus/Makefile.am:
2128         Add dbus-address.[ch]
2129         
2130         * dbus/dbus-address.c: (dbus_address_entry_free),
2131         (dbus_address_entries_free), (create_entry),
2132         (dbus_address_entry_get_method), (dbus_address_entry_get_value),
2133         (dbus_parse_address), (_dbus_address_test):
2134         * dbus/dbus-address.h:
2135         New files for dealing with address parsing.
2136         
2137         * dbus/dbus-connection.c:
2138         Document timeout functions.
2139         
2140         * dbus/dbus-message.c:
2141         Document dbus_message_new_from_message.
2142         
2143         * dbus/dbus-server-debug.c:
2144         Document.
2145         
2146         * dbus/dbus-server.c: (dbus_server_listen):
2147         Parse address and use correct server implementation.
2148         
2149         * dbus/dbus-string.c: (_dbus_string_find_to), (_dbus_string_test):
2150         * dbus/dbus-string.h:
2151         New function with test.
2152         
2153         * dbus/dbus-test.c: (dbus_internal_symbol_do_not_use_run_tests):
2154         * dbus/dbus-test.h:
2155         Add address tests.
2156         
2157         * dbus/dbus-transport-debug.c:
2158         Document.
2159         
2160         * dbus/dbus-transport.c: (_dbus_transport_open):
2161         Parse address and use correct transport implementation. 
2162
2163 2003-01-30  Havoc Pennington  <hp@pobox.com>
2164
2165         * dbus/dbus-message.c: use message->byte_order instead of 
2166         DBUS_COMPILER_BYTE_ORDER throughout.
2167         (dbus_message_create_header): pad header to align the 
2168         start of the body of the message to 8-byte boundary
2169
2170         * dbus/dbus-marshal.h: make all the demarshalers take const 
2171         DBusString arguments.
2172
2173         * dbus/dbus-message.c (_dbus_message_loader_return_buffer):
2174         validate message args here, so we don't have to do slow validation
2175         later, and so we catch bad messages as they are incoming. Also add
2176         better checks on header_len and body_len. Also fill in
2177         message->byte_order
2178
2179         * dbus/dbus-string.c (_dbus_string_validate_utf8): new (not
2180         implemented properly)
2181         (_dbus_string_validate_nul): new function to check all-nul
2182
2183         * dbus/dbus-marshal.c (_dbus_marshal_get_field_end_pos): rename 
2184         get_arg_end_pos and remove all validation
2185         (_dbus_marshal_validate_arg): actually do validation here.
2186
2187 2003-01-29  Havoc Pennington  <hp@pobox.com>
2188
2189         * dbus/dbus-message.c (check_message_handling): fix assertion
2190         failure on set_client_serial
2191
2192 2003-01-28  Havoc Pennington  <hp@pobox.com>
2193
2194         * dbus/dbus-server-debug.c: Add doc section comments
2195         
2196         * dbus/dbus-transport-debug.c: add doc section comments
2197         
2198 2003-01-28  Havoc Pennington  <hp@redhat.com>
2199
2200         * dbus/dbus-string.c (_dbus_string_base64_decode): append bytes in
2201         the reverse order from how I had it
2202         (_dbus_string_base64_encode): reverse encoding order. I was
2203         basically byteswapping everything during encoding.
2204
2205 2003-01-28  Anders Carlsson  <andersca@codefactory.se>
2206
2207         * dbus/dbus-connection-internal.h:
2208         * dbus/dbus-connection.c: (_dbus_connection_add_timeout),
2209         (_dbus_connection_remove_timeout):
2210         Add functions for adding and removing timeouts.
2211         
2212         * dbus/dbus-message.c: (dbus_message_new_from_message):
2213         Add new function that takes a message and creates an exact
2214         copy of it, but with the refcount set to 1.
2215         (check_message_handling):
2216         Fix build error.
2217         
2218         * dbus/dbus-server-protected.h:
2219         * dbus/dbus-server.c: (_dbus_server_init_base),
2220         (_dbus_server_finalize_base), (_dbus_server_add_timeout),
2221         (dbus_server_set_timeout_functions):
2222         (_dbus_server_remove_timeout):
2223         New functions so that a server can add and remove timeouts.
2224
2225         (dbus_server_listen):
2226         Add commented out call to dbus_server_debug_new.
2227
2228         * dbus/dbus-timeout.c: (_dbus_timeout_new):
2229         Actually set the handler, doh.
2230         
2231         * dbus/dbus-transport.c: (_dbus_transport_open):
2232         Add commented out call to dbus_transport_debug_client_new.
2233         
2234         * dbus/Makefile.am:
2235         Add dbus-transport-debug.[ch] and dbus-server-debug.[ch]
2236         
2237 2003-01-28  Havoc Pennington  <hp@pobox.com>
2238
2239         * dbus/dbus-message.c (check_message_handling): function to check 
2240         on the loaded message, iterates over it etc.
2241
2242 2003-01-28  Havoc Pennington  <hp@pobox.com>
2243
2244         * test/Makefile.am (dist-hook): fix make distdir
2245
2246         * dbus/Makefile.am (TESTS_ENVIRONMENT): fix make check
2247
2248 2003-01-27  Havoc Pennington  <hp@pobox.com>
2249
2250         * dbus/dbus-mempool.c (time_for_size): replace printf with 
2251         _dbus_verbose
2252
2253         * dbus/dbus-message-builder.c (_dbus_message_data_load): allow
2254         empty lines; fix the SAVE_LENGTH stuff to be
2255         START_LENGTH/END_LENGTH so it actually works; couple other 
2256         bugfixes
2257         
2258         * test/Makefile.am (dist-hook): add dist-hook for .message files
2259
2260         * dbus/dbus-string.c (DBUS_STRING_COPY_PREAMBLE): source of a copy
2261         can be constant or locked.
2262         (_dbus_string_free): allow freeing a const string as
2263         documented/intended
2264
2265         * dbus/dbus-sysdeps.c (_dbus_concat_dir_and_file): utility
2266
2267         * dbus/dbus-test-main.c (main): take an argument which is the 
2268         directory containing test data
2269
2270         * dbus/dbus-message.c (_dbus_message_test): pass a test_data_dir
2271         argument to this and load all the messages in test/data/
2272         checking that they can be loaded or not loaded as appropriate.
2273
2274 2003-01-27  Anders Carlsson  <andersca@codefactory.se>
2275
2276         * bus/dispatch.c: (bus_dispatch_message_handler):
2277         Dispatch messages sent to services.
2278         
2279         * bus/driver.c: (bus_driver_send_service_deleted),
2280         (bus_driver_send_service_created), (bus_driver_send_service_lost),
2281         (bus_driver_send_service_acquired):
2282         Add helper functions for sending service related messages.
2283
2284         (bus_driver_send_welcome_message):
2285         Send HELLO_REPLY instead of WELCOME.
2286         
2287         (bus_driver_handle_list_services):
2288         Send LIST_SERVICES_REPLY instead of SERVICES.
2289         
2290         (bus_driver_handle_own_service),
2291         (bus_driver_handle_service_exists):
2292         New message handlers.
2293         
2294         (bus_driver_handle_message):
2295         Invoke new message handlers.
2296         
2297         (bus_driver_remove_connection):
2298         Don't remove any services here since that's done automatically
2299         by bus_service_remove_owner now.
2300         
2301         * bus/driver.h:
2302         New function signatures.
2303         
2304         * bus/services.c: (bus_service_add_owner):
2305         Send ServiceAcquired message if we're the only primary owner.
2306         
2307         (bus_service_remove_owner):
2308         Send ServiceAcquired/ServiceLost messages.
2309         
2310         (bus_service_set_prohibit_replacement),
2311         (bus_service_get_prohibit_replacement):
2312         Functions for setting prohibit replacement.
2313         
2314         (bus_service_has_owner):
2315         New function that checks if a connection is in the owner queue of 
2316         a certain service.
2317         
2318         * bus/services.h:
2319         Add new function signatures.
2320         
2321         * dbus/dbus-list.c: (_dbus_list_test):
2322         Add tests for _dbus_list_remove_last and traversing the list backwards.
2323         
2324         * dbus/dbus-list.h:
2325         Fix a typo in _dbus_list_get_prev_link, if we're at the first element we can't
2326         go any further, so return NULL then.
2327         
2328         * dbus/dbus-protocol.h:
2329         Add new messages, service flags and service replies.
2330         
2331 2003-01-26  Havoc Pennington  <hp@pobox.com>
2332
2333         * dbus/dbus-message-builder.c: implement, completely untested.
2334
2335         * test/data/*: add data to be used in testing. 
2336         ".message" files are our simple loadable text format.
2337         ".message-raw" will be binary dumps of messages.
2338
2339         * dbus/dbus-string.c (_dbus_string_starts_with_c_str): new
2340
2341 2003-01-26  Havoc Pennington  <hp@pobox.com>
2342
2343         * dbus/dbus-sysdeps.c (_dbus_file_get_contents): new function
2344
2345         * dbus/dbus-errors.c (dbus_result_to_string): add
2346         file errors
2347
2348         * dbus/dbus-message-builder.c: new file, will contain code to load
2349         up messages from files. Not implemented yet.
2350
2351 2003-01-26  Havoc Pennington  <hp@pobox.com>
2352
2353         * dbus/dbus-message.c (dbus_message_set_sender): support deleting
2354         the sender by setting to NULL
2355
2356 2003-01-26  Havoc Pennington  <hp@pobox.com>
2357
2358         The unit tests pass, but otherwise untested.  If it breaks, the
2359         tests should have been better. ;-)
2360         
2361         * bus/driver.c (bus_driver_handle_hello): return if we disconnect
2362         the connection.
2363
2364         * dbus/dbus-message.c: redo everything so we maintain 
2365         message->header as the only copy of the various fields.
2366         This avoids the possibility of out-of-memory in some cases,
2367         for example dbus_message_lock() can't run out of memory anymore,
2368         and avoids extra copying. Figured I may as well go ahead and do 
2369         this since it was busted for dbus_message_lock to not return 
2370         failure on OOM, and dbus_message_write_header was totally
2371         unchecked for OOM. Also fixed some random other bugs.
2372
2373         * dbus/dbus-marshal.c (_dbus_marshal_get_field_end_pos): verify
2374         that strings are nul-terminated. Also, end_pos can be equal 
2375         to string length just not greater than, I think.
2376         (_dbus_marshal_set_int32): new function
2377         (_dbus_marshal_set_uint32): new function
2378         (_dbus_marshal_set_string): new function
2379
2380         * dbus/dbus-connection.c (_dbus_connection_new_for_transport): fix
2381         a warning, init timeout_list to NULL
2382         (dbus_connection_send_message): don't use uninitialized variable
2383         "serial"
2384
2385         * dbus/dbus-string.c (_dbus_string_replace_len): new function
2386
2387 2003-01-26  Anders Carlsson  <andersca@codefactory.se>
2388
2389         * bus/driver.c: (bus_driver_handle_hello),
2390         (bus_driver_send_welcome_message):
2391         Plug leaks
2392         
2393 2003-01-26  Anders Carlsson  <andersca@codefactory.se>
2394
2395         * dbus/dbus-auth.c: (process_auth), (_dbus_auth_unref):
2396         * dbus/dbus-connection.c: (_dbus_connection_new_for_transport),
2397         (dbus_connection_unref):
2398         * dbus/dbus-marshal.c: (_dbus_marshal_test):
2399         * dbus/dbus-message.c: (dbus_message_unref),
2400         Plug memory leaks.
2401         
2402         (dbus_message_get_fields): 
2403         Remove debugging printout.
2404
2405         (_dbus_message_loader_return_buffer):
2406         Don't store the header string.
2407         
2408         (_dbus_message_test):
2409         Plug leaks.
2410
2411 2003-01-26  Richard Hult  <rhult@codefactory.se>
2412
2413         * glib/dbus-gmain.c (dbus_connection_dispatch): Traverse a copy of
2414         the file descriptor list, since it can change under us.
2415
2416 2003-01-25  Anders Carlsson  <andersca@codefactory.se>
2417
2418         * glib/dbus-gmain.c: (dbus_connection_prepare),
2419         (dbus_connection_check), (dbus_connection_dispatch), (add_watch),
2420         (remove_watch), (dbus_connection_hookup_with_g_main):
2421         Rewrite the glib handling to use its own GSource instead of a 
2422         GIOChannel so we can catch messages put in the queue while waiting
2423         for a reply.
2424         
2425 2003-01-25  Anders Carlsson  <andersca@codefactory.se>
2426
2427         * bus/Makefile.am:
2428         * bus/connection.c: (connection_disconnect_handler),
2429         (connection_watch_callback), (bus_connection_setup):
2430         * bus/dispatch.c: (send_one_message),
2431         (bus_dispatch_broadcast_message), (bus_dispatch_message_handler),
2432         (bus_dispatch_add_connection), (bus_dispatch_remove_connection):
2433         * bus/dispatch.h:
2434         * bus/driver.c: (bus_driver_send_service_deleted),
2435         (bus_driver_send_service_created), (bus_driver_handle_hello),
2436         (bus_driver_send_welcome_message),
2437         (bus_driver_handle_list_services), (bus_driver_remove_connection),
2438         (bus_driver_handle_message):
2439         * bus/driver.h:
2440         Refactor code, put the message dispatching in its own file. Use 
2441         _DBUS_HANDLE_OOM. Also send ServiceDeleted messages when a client
2442         is disconnected.
2443         
2444 2003-01-25  Anders Carlsson  <andersca@codefactory.se>
2445
2446         * dbus/dbus-internals.h:
2447         Add _DBUS_HANDLE_OOM macro, it doesn't do anything currently.
2448         
2449         * dbus/dbus-message.c: (dbus_message_get_sender):
2450         * dbus/dbus-message.h:
2451         Implement dbus_message_get_sender.
2452         
2453         * dbus/dbus-protocol.h:
2454         Add message and service defines.
2455         
2456 2003-01-25  Anders Carlsson  <andersca@codefactory.se>
2457
2458         * dbus/dbus-connection.c: (dbus_connection_send_message):
2459         * dbus/dbus-message-internal.h:
2460         * dbus/dbus-message.c: (_dbus_message_get_client_serial),
2461         (dbus_message_write_header):
2462         Remove _dbus_messag_unlock and don't set the client serial on a 
2463         message if one already exists.
2464         
2465 2003-01-24  Havoc Pennington  <hp@pobox.com>
2466
2467         * dbus/dbus-list.c (alloc_link): put a thread lock on the global
2468         list_pool
2469
2470         * bus/driver.c (bus_driver_handle_list_services): fix a leak 
2471         on OOM
2472
2473 2003-01-25  Anders Carlsson  <andersca@codefactory.se>
2474
2475         * dbus/dbus-list.c: (alloc_link), (free_link):
2476         Use a memory pool for the links.
2477         
2478 2003-01-25  Anders Carlsson  <andersca@codefactory.se>
2479
2480         * bus/connection.c: (bus_connection_foreach):
2481         * bus/connection.h:
2482         Add new bus_connection_foreach function.
2483         
2484         * bus/driver.c: (send_one_message), (bus_driver_broadcast_message):
2485         Add function that broadcasts a message to all clients.
2486         
2487         (bus_driver_send_service_created), (bus_driver_handle_hello),
2488         (bus_driver_send_welcome_message),
2489         (bus_driver_handle_list_services), (bus_driver_message_handler):
2490         Implement functions that take care of listing services, and notifying
2491         clients when new services are created.
2492         
2493         * bus/services.c: (bus_services_list):
2494         * bus/services.h:
2495         Add new function that returns an array of strings with the currently
2496         registered services.
2497         
2498         * glib/dbus-glib.h:
2499         * glib/dbus-gmain.c:
2500         Update copyright year.
2501         
2502 2003-01-25  Anders Carlsson  <andersca@codefactory.se>
2503
2504         * dbus/dbus-connection.c: (dbus_connection_send_message):
2505         Unlock the message in case it was sent earlier.
2506         
2507         (dbus_connection_send_message_with_reply_and_block):
2508         Remove the reply message from the list.
2509         
2510         * dbus/dbus-marshal.c: (_dbus_demarshal_string_array):
2511         Set array_len and new_pos correctly.
2512         
2513         (_dbus_marshal_test):
2514         Remove debug output.
2515         
2516         * dbus/dbus-message-internal.h:
2517         * dbus/dbus-message.c: (_dbus_message_get_reply_serial):
2518         New function that returns the reply serial.
2519         
2520         (_dbus_message_unlock):
2521         New function that unlocks a message and resets its header.
2522
2523         (dbus_message_append_string_array), 
2524         (dbus_message_get_fields_valist),
2525         (dbus_message_iter_get_field_type),
2526         (dbus_message_iter_get_string_array),   
2527         (dbus_message_get_fields),      
2528         (dbus_message_append_fields_valist):
2529         Handle string arrays.
2530         
2531         (dbus_message_set_sender):
2532         Make this function public since the bus daemon needs it.
2533         
2534         (decode_header_data):
2535         Set the reply serial to -1 initially.
2536
2537         * dbus/dbus-message.h:
2538         Add dbus_message_set_sender.    
2539
2540 2003-01-24  Havoc Pennington  <hp@pobox.com>
2541
2542         * doc/dbus-specification.sgml: add some stuff
2543
2544 2003-01-22  Havoc Pennington  <hp@pobox.com>
2545
2546         * doc/dbus-specification.sgml: Start to document the protocol.
2547
2548 2003-01-22  Havoc Pennington  <hp@pobox.com>
2549
2550         * dbus/dbus-connection.c
2551         (dbus_connection_send_message_with_reply_and_block): add some @todo
2552
2553         * bus/driver.c (bus_driver_add_connection): add a FIXME about memleak
2554
2555 2003-01-21  Havoc Pennington  <hp@pobox.com>
2556
2557         (patch untested because can't compile)
2558         
2559         * bus/driver.c (create_unique_client_name): make this function
2560         never recycle client names. Also, caller should initialize 
2561         the DBusString.
2562
2563         * dbus/dbus-sysdeps.c (_dbus_get_current_time): new function
2564
2565 2003-01-21  Anders Carlsson  <andersca@codefactory.se>
2566
2567         * dbus/dbus-marshal.c: (_dbus_marshal_double),
2568         (_dbus_marshal_int32), (_dbus_marshal_uint32),
2569         (_dbus_marshal_int32_array), (_dbus_marshal_uint32_array),
2570         (_dbus_marshal_double_array), (_dbus_marshal_string_array),
2571         (_dbus_demarshal_int32_array), (_dbus_demarshal_uint32_array),
2572         (_dbus_demarshal_double_array), (_dbus_demarshal_string_array),
2573         (_dbus_marshal_get_field_end_pos), (_dbus_marshal_test):
2574         * dbus/dbus-marshal.h:
2575         * dbus/dbus-protocol.h:
2576         Add support for marshalling and demarshalling integer, double
2577         and string arrays.
2578         
2579 2003-01-21  Anders Carlsson  <andersca@codefactory.se>
2580
2581         * bus/Makefile.am:
2582         Add driver.[ch]
2583         
2584         * bus/connection.c: (connection_disconnect_handler):
2585         Remove the connection from the bus driver's list.
2586         
2587         (connection_watch_callback): Dispatch messages.
2588
2589         (free_connection_data): Free connection name.
2590         
2591         (bus_connection_setup): Add connection to the bus driver's list.
2592         (bus_connection_remove_owned_service): 
2593         (bus_connection_set_name), (bus_connection_get_name):
2594         Add functions for setting and getting the connection's name.
2595         
2596         * bus/connection.h:
2597         Add function headers.
2598         
2599         * bus/driver.c: (create_unique_client_name),
2600         (bus_driver_handle_hello_message),
2601         (bus_driver_send_welcome_message), (bus_driver_message_handler),
2602         (bus_driver_add_connection), (bus_driver_remove_connection):
2603         * bus/driver.h:
2604         * bus/main.c:
2605         * bus/services.c: (bus_service_free):
2606         * bus/services.h:
2607         New file that handles communication and registreation with the bus
2608         itself. 
2609         
2610 2003-01-21  Anders Carlsson  <andersca@codefactory.se>
2611
2612         * dbus/dbus-connection.c: (dbus_connection_send_message):
2613         Add a new client_serial parameter.
2614         
2615         (dbus_connection_send_message_with_reply):
2616         Remove a @todo since we've implemented the blocking function.
2617         
2618         (dbus_connection_send_message_with_reply_and_block):
2619         New function that sends a message and waits for a reply and
2620         then returns the reply.
2621         
2622         * dbus/dbus-connection.h:
2623         Add new functions.
2624         
2625         * dbus/dbus-errors.c: (dbus_result_to_string):
2626         * dbus/dbus-errors.h:
2627         Add new DBUS_RESULT.
2628         
2629         * dbus/dbus-message-internal.h:
2630         * dbus/dbus-message.c: (_dbus_message_get_reply_serial),
2631         (_dbus_message_set_sender), (dbus_message_write_header),
2632         (dbus_message_new_reply), (decode_header_data),
2633         (_dbus_message_loader_return_buffer), (_dbus_message_test):
2634         * dbus/dbus-message.h:
2635         Add new functions that set the reply serial and sender.
2636         Also marshal and demarshal them correctly and add test.
2637         
2638         * dbus/dbus-protocol.h:
2639         Add new DBUS_MESSAGE_TYPE_SENDER.
2640         
2641         * glib/dbus-glib.h:
2642         * glib/dbus-gmain.c: (watch_callback), (free_callback_data),
2643         (add_watch), (remove_watch), (add_timeout), (remove_timeout),
2644         (dbus_connection_hookup_with_g_main):
2645         * glib/test-dbus-glib.c: (main):
2646         Rewrite to use GIOChannel and remove the GSource crack.
2647         
2648         * test/echo-client.c: (main):
2649         * test/watch.c: (check_messages):
2650         Update for changed APIs
2651         
2652 2003-01-19  Anders Carlsson  <andersca@codefactory.se>
2653
2654         * dbus/Makefile.am: Add dbus-timeout.[cħ]
2655         
2656         * dbus/dbus-connection.c: (_dbus_connection_new_for_transport):
2657         Create a DBusTimeoutList.       
2658         (dbus_connection_set_timeout_functions): Add new function to
2659         set timeout callbacks
2660         
2661         * dbus/dbus-connection.h: Add public DBusTimeout API.
2662         
2663         * dbus/dbus-message.c: (dbus_message_get_service):
2664         * dbus/dbus-message.h:  New function.
2665
2666         * dbus/dbus-server.c: Fix small doc typo.
2667         
2668         * dbus/dbus-timeout.[ch]: New files for mainloop timeouts.
2669
2670 2003-01-19  Anders Carlsson  <andersca@codefactory.se>
2671
2672         * dbus/dbus-string.c (_dbus_string_move_len): Don't delete all
2673         of the string, just as long as specified.
2674
2675 2003-01-19  Havoc Pennington  <hp@pobox.com>
2676
2677         * dbus/dbus-connection.c (dbus_connection_get_is_authenticated):
2678         new function
2679
2680         * dbus/dbus-server.c (dbus_server_set_max_connections)
2681         (dbus_server_get_max_connections, dbus_server_get_n_connections):
2682         keep track of current number of connections, and add API for
2683         setting a max (but haven't implemented enforcing the max yet)
2684
2685 2003-01-18  Havoc Pennington  <hp@pobox.com>
2686
2687         * dbus/dbus-transport-unix.c (unix_do_iteration): only do the
2688         reading/writing if read_watch != NULL or write_watch != NULL.
2689
2690         * dbus/dbus-message.c (_dbus_message_loader_return_buffer): fix
2691         the message loader code to actually load message->header and
2692         message->body into the newly-created message.
2693
2694         * dbus/dbus-transport-unix.c (check_write_watch): fix a mem leak
2695         in OOM case
2696
2697         * dbus/dbus-connection.c (dbus_connection_set_max_message_size) 
2698         (dbus_connection_get_max_message_size) 
2699         (dbus_connection_set_max_live_messages_size) 
2700         (dbus_connection_get_max_live_messages_size): implement some
2701         resource limitation functions
2702
2703         * dbus/dbus-resources.c: new file implementing some of the
2704         resource limits stuff
2705
2706         * dbus/dbus-message.c (dbus_message_iter_get_byte_array): add
2707         missing docs, add @todo to handle OOM etc.
2708
2709         * dbus/dbus-marshal.c (_dbus_demarshal_byte_array): add missing
2710         docs
2711         
2712 2003-01-18  Havoc Pennington  <hp@pobox.com>
2713
2714         * dbus/dbus-connection.c (dbus_connection_unref): disconnect the 
2715         connection if it hasn't been already.
2716
2717         * dbus/dbus-connection.h: kill off the idea of an ErrorFunction,
2718         replace with DisconnectFunction.
2719
2720 2003-01-18  Havoc Pennington  <hp@pobox.com>
2721
2722         Building --disable-verbose-mode --disable-asserts --disable-tests
2723         cuts the library from 112K to 45K or so
2724         
2725         * configure.in: check for varargs macro support, 
2726         add --enable-verbose-mode, --enable-asserts. 
2727
2728         * dbus/dbus-internals.h (_dbus_assert): support
2729         DBUS_DISABLE_ASSERT
2730         (_dbus_verbose): support DBUS_ENABLE_VERBOSE_MODE
2731
2732 2003-01-18  Havoc Pennington  <hp@pobox.com>
2733
2734         * dbus/dbus-test.c: include config.h so that tests actually run
2735
2736         * dbus/dbus-string.c: add assertions that stuff is 8-byte aligned,
2737         so the failure mode when that assumption fails will be plenty
2738         obvious.
2739
2740 2003-01-18  Havoc Pennington  <hp@pobox.com>
2741
2742         * configure.in: default --enable-tests to $USE_MAINTAINER_MODE
2743
2744         * dbus/Makefile.am: fix it up so dubs-test-main.c is included in
2745         the distribution
2746
2747         * test/Makefile.am: don't use special variable "TESTS" for echo-*
2748         since we don't want to use those in make check
2749
2750 2003-01-15  Havoc Pennington  <hp@redhat.com>
2751
2752         Release 0.2
2753         
2754         * NEWS: update
2755
2756 2003-01-15  Havoc Pennington  <hp@redhat.com>
2757
2758         * test/Makefile.am: fix so that test source code ends up in the
2759         distribution on make distcheck
2760
2761 2003-01-15  Havoc Pennington  <hp@redhat.com>
2762
2763         Release 0.1.
2764         
2765         * NEWS: update  
2766
2767 2003-01-15  Havoc Pennington  <hp@redhat.com>
2768
2769         * dbus/dbus-test.c (dbus_internal_symbol_do_not_use_run_tests):
2770         fix build when --disable-tests
2771
2772         * Makefile.am (EXTRA_DIST): put HACKING in here
2773
2774         * HACKING: document procedure for making a tarball release.
2775
2776 2003-01-14  Anders Carlsson  <andersca@codefactory.se>
2777
2778         * bus/connection.c: (connection_error_handler),
2779         (bus_connection_setup):
2780         * bus/main.c: (main):
2781         Make sure that the DBusConnectionData struct is NULLed
2782         out to prevent a segfault.
2783         
2784         * dbus/dbus-errors.c: (dbus_result_to_string):
2785         * dbus/dbus-errors.h:
2786         * dbus/dbus-message.c: (dbus_message_get_fields),
2787         (dbus_message_get_fields_valist), (_dbus_message_test):
2788         * dbus/dbus-message.h:
2789         Make dbus_message_get_fields return a result code so we can
2790         track invalid fields as well as oom.
2791         
2792 2003-01-11  Havoc Pennington  <hp@pobox.com>
2793
2794         * configure.in: change --enable-test/--enable-ansi action-if-given
2795         to enable_foo=$enableval instead of enable_foo=yes
2796
2797 2003-01-08  Havoc Pennington  <hp@pobox.com>
2798
2799         * dbus/dbus-string.c (_dbus_string_align_length): new function
2800
2801         * dbus/dbus-test-main.c: move main() for test app here
2802         * dbus/dbus-test.c
2803         (dbus_internal_symbol_do_not_use_run_tests): we have to export a
2804         symbol to run tests, because dbus-test isn't in the main 
2805         library
2806
2807         Code review nitpicks.
2808         
2809         * dbus/dbus-message.c (dbus_message_write_header): add newlines
2810         for people with narrow emacs ;-). Assert client_serial was filled
2811         in. Assert message->name != NULL.
2812         (dbus_message_append_fields): have "first_field_type" arg separate
2813         from va list, needed for C++ binding that also uses varargs IIRC
2814         and helps with type safety
2815         (dbus_message_new): add @todo about using DBusString to store
2816         service/name internally
2817         (dbus_message_new): don't leak ->service and ->name on OOM later
2818         in the function
2819         (dbus_message_unref): free the service name
2820         (dbus_message_get_fields): same change to varargs
2821         i.e. first_field_type
2822         (_dbus_message_loader_return_buffer): assert that the message data
2823         is aligned (if not it's a bug in our code). Put in verbose griping
2824         about why we set corrupted = TRUE.
2825         (decode_header_data): add FIXME that char* is evil.  Was going to
2826         add FIXME about evil locale-specific string.h strncmp, but just
2827         switched to wacky string-as-uint32 optimization. Move check for
2828         "no room for field name" above get_const_data_len() to avoid
2829         assertion failure in get_const_data_len if we have trailing 2
2830         bytes or the like. Check for service and name fields being
2831         provided twice. Don't leak service/name on error. Require field
2832         names to be aligned to 4 bytes.
2833
2834         * dbus/dbus-marshal.c: move byte swap stuff to header
2835         (_dbus_pack_int32): uscore-prefix
2836         (_dbus_unpack_int32): uscore-prefix
2837         (_dbus_unpack_uint32): export
2838         (_dbus_demarshal_string): add @todo complaining about use of
2839         memcpy()
2840         (_dbus_marshal_get_field_end_pos): add @todo about bad error
2841         handling allowing corrupt data to go unchecked
2842
2843 2003-01-08  Havoc Pennington  <hp@redhat.com>
2844
2845         * dbus/dbus-transport-unix.c (unix_do_iteration): add read/write 
2846         to the select() as needed for authentication. (should be using
2847         _dbus_poll() not select, but for another day)
2848
2849         * dbus/dbus.h: include dbus/dbus-protocol.h
2850
2851 2003-01-08  Anders Carlsson  <andersca@codefactory.se>
2852
2853         * dbus/Makefile.am (dbusinclude_HEADERS): Install
2854         dbus-connection.h
2855
2856 2003-01-08  Anders Carlsson  <andersca@codefactory.se>
2857
2858         * dbus/dbus-internals.c: (_dbus_type_to_string):
2859         New function that returns a string describing a type.
2860         
2861         * dbus/dbus-marshal.c: (_dbus_demarshal_byte_array):
2862         * dbus/dbus-marshal.h:
2863         * dbus/dbus-message.c: (dbus_message_get_fields_valist),
2864         (dbus_message_iter_get_field_type), (dbus_message_iter_get_double),
2865         (dbus_message_iter_get_byte_array):
2866         * dbus/dbus-message.h:
2867         Add new convenience functions for appending and getting message fields.
2868         Also add demarshalling routines for byte arrays.
2869
2870 2003-01-07  Anders Carlsson  <andersca@codefactory.se>
2871
2872         * dbus/dbus-connection-internal.h:
2873         * dbus/dbus-connection.c: (_dbus_connection_new_for_transport),
2874         (_dbus_connection_get_next_client_serial),
2875         (dbus_connection_send_message):
2876         * dbus/dbus-internals.h:
2877         * dbus/dbus-marshal.c: (unpack_uint32), (dbus_unpack_int32),
2878         (dbus_pack_int32), (_dbus_marshal_double), (_dbus_marshal_int32),
2879         (_dbus_marshal_uint32), (_dbus_demarshal_double),
2880         (_dbus_demarshal_int32), (_dbus_demarshal_uint32),
2881         (_dbus_demarshal_string), (_dbus_marshal_get_field_end_pos),
2882         (_dbus_verbose_bytes), (_dbus_marshal_test):
2883         * dbus/dbus-marshal.h:
2884         * dbus/dbus-message-internal.h:
2885         * dbus/dbus-message.c: (_dbus_message_set_client_serial),
2886         (dbus_message_write_header), (_dbus_message_lock),
2887         (dbus_message_new), (dbus_message_ref), (dbus_message_unref),
2888         (dbus_message_get_name), (dbus_message_append_int32),
2889         (dbus_message_append_uint32), (dbus_message_append_double),
2890         (dbus_message_append_string), (dbus_message_append_byte_array),
2891         (dbus_message_get_fields_iter), (dbus_message_iter_ref),
2892         (dbus_message_iter_unref), (dbus_message_iter_has_next),
2893         (dbus_message_iter_next), (dbus_message_iter_get_field_type),
2894         (dbus_message_iter_get_string), (dbus_message_iter_get_int32),
2895         (dbus_message_iter_get_uint32), (dbus_message_iter_get_double),
2896         (decode_header_data), (_dbus_message_loader_return_buffer),
2897         (message_iter_test), (_dbus_message_test):
2898         * dbus/dbus-message.h:
2899         * dbus/dbus-protocol.h:
2900         * dbus/dbus-test.c: (main):
2901         * dbus/dbus-test.h:
2902         * glib/test-dbus-glib.c: (message_handler), (main):
2903         * test/echo-client.c: (main):
2904         * test/watch.c: (check_messages):
2905         Make messages sendable and receivable for real.
2906         
2907 2003-01-07  Anders Carlsson  <andersca@codefactory.se>
2908
2909         * dbus/dbus-marshal.c: (_dbus_marshal_double),
2910         (_dbus_marshal_string), (_dbus_marshal_byte_array):
2911         * dbus/dbus-message.c: (dbus_message_append_int32),
2912         (dbus_message_append_uint32), (dbus_message_append_double),
2913         (dbus_message_append_string), (dbus_message_append_byte_array):
2914         Handle OOM restoration.
2915         
2916 2003-01-07  Anders Carlsson  <andersca@codefactory.se>
2917
2918         * dbus/dbus-marshal.c: (_dbus_marshal_string),
2919         (_dbus_demarshal_string), (_dbus_marshal_test):
2920         * dbus/dbus-marshal.h:
2921         * dbus/dbus-message.c: (dbus_message_get_name),
2922         Document these functions.
2923         
2924         (dbus_message_append_int32), (dbus_message_append_uint32),
2925         (dbus_message_append_double), (dbus_message_append_string),
2926         (dbus_message_append_byte_array):
2927         * dbus/dbus-message.h:
2928         Add functions for adding message fields of different types.
2929         
2930         * dbus/dbus-protocol.h:
2931         Add the different types.
2932
2933 2003-01-05  Havoc Pennington  <hp@pobox.com>
2934
2935         * bus/connection.c: implement routines for handling connections,
2936         first thing is keeping a list of owned services on each connection
2937         and setting up watches etc.
2938
2939         * bus/services.c: implement a mapping from service names to lists
2940         of connections
2941
2942         * dbus/dbus-hash.c: add DBUS_HASH_POINTER
2943
2944         * dbus/dbus-threads.c (dbus_static_mutex_lock): add functions
2945         to use static mutexes for global data
2946
2947         * dbus/dbus-connection.c (dbus_connection_set_data): add new
2948         collection of functions to set/get application-specific data
2949         on the DBusConnection.
2950
2951 2003-01-04  Havoc Pennington  <hp@pobox.com>
2952
2953         * dbus/dbus-sysdeps.c (_dbus_sleep_milliseconds): new function
2954         (_dbus_poll): new function
2955
2956         * dbus/dbus-internals.h (_DBUS_STRUCT_OFFSET): new macro
2957         copied from GLib
2958
2959         * bus/loop.c: initial code for the daemon main loop
2960
2961 2003-01-04  Havoc Pennington  <hp@pobox.com>
2962
2963         * test/watch.c (error_handler): make it safe if the error handler 
2964         is called multiple times (if we s/error handler/disconnect
2965         handler/ we should just guarantee it's called only once)
2966
2967         * dbus/dbus-transport.c (_dbus_transport_disconnect): call the
2968         error handler on disconnect (it's quite possible we should
2969         just change the error handler to a "disconnect handler," I'm 
2970         not sure we have any other meaningful errors)
2971
2972         * configure.in: check for getpwnam_r
2973
2974         * dbus/dbus-transport.c, dbus/dbus-transport-unix.c,
2975         dbus/dbus-auth.c: add credentials support, add EXTERNAL auth
2976         mechanism as in SASL spec, using socket credentials
2977
2978         * dbus/dbus-sysdeps.c (_dbus_read_credentials_unix_socket): new function
2979         (_dbus_send_credentials_unix_socket): new function
2980
2981         * dbus/dbus-sysdeps.c (_dbus_accept_unix_socket): rename just
2982         dbus_accept()
2983         (_dbus_write): only check errno if <0 returned
2984         (_dbus_write_two): ditto
2985
2986 2003-01-02  Anders Carlsson  <andersca@codefactory.se>
2987
2988         * dbus/dbus-marshal.c: (_dbus_marshal_utf8_string),
2989         (_dbus_marshal_byte_array), (_dbus_demarshal_utf8_string),
2990         (_dbus_marshal_test):
2991         * dbus/dbus-marshal.h:
2992         Add _dbus_marshal_byte_array and rename _dbus_marshal_string
2993         to _dbus_marshal_utf8_string. Also fix some tests.
2994         
2995 2002-12-28  Harri Porten  <porten@kde.org>
2996
2997         * configure.in: added check for C++ compiler and a very cheesy
2998         check for the Qt integration
2999
3000         * Makefile.am (SUBDIRS): compile qt subdir if support is enabled
3001
3002         * qt/Makefile.am: added 
3003
3004         * qt/.cvsignore: added  
3005
3006         * qt/dbus-qthread.cc, qt/dbus-qthread.cpp: renamed former to
3007         latter, added #ifdef QT_THREAD_SUPPORT guard.
3008
3009         * dbus/Makefile.am: added missing headers for make dist
3010
3011 2002-12-28  Kristian Rietveld  <kris@gtk.org>
3012
3013         * dbus/Makefile.am: fixup export-symbols-regex.
3014
3015 2002-12-27  Anders Carlsson  <andersca@codefactory.se>
3016
3017         * acinclude.m4: Add this file and put the 
3018         PKG_CHECK_MODULE macro in it.
3019
3020 2002-12-27  Anders Carlsson  <andersca@codefactory.se>
3021
3022         * dbus/dbus-marshal.c: (_dbus_marshal_string),
3023         (_dbus_demarshal_double), (_dbus_demarshal_int32),
3024         (_dbus_demarshal_uint32), (_dbus_demarshal_string),
3025         (_dbus_marshal_test):
3026         Make the demarshalling routines align the pos argument.
3027         Add string marshalling tests and fix the obvious bugs 
3028         discovered.
3029         
3030 2002-12-26  Havoc Pennington  <hp@pobox.com>
3031
3032         * dbus/dbus-auth.c: fixes fixes fixes
3033
3034         * dbus/dbus-transport-unix.c: wire up support for
3035         encoding/decoding data on the wire
3036
3037         * dbus/dbus-auth.c (_dbus_auth_encode_data) 
3038         (_dbus_auth_decode_data): append to target string 
3039         instead of nuking it.
3040
3041 2002-12-26  Havoc Pennington  <hp@pobox.com>
3042
3043         * dbus/dbus-marshal.h (DBUS_COMPILER_BYTE_ORDER): #ifdef
3044         WORDS_BIGENDIAN then compiler byte order is DBUS_BIG_ENDIAN,
3045         doh
3046
3047         * dbus/dbus-marshal.c: Add macros to do int swapping in-place and
3048         avoid swap_bytes() overhead (ignoring possible assembly stuff for 
3049         now). Main point is because I wanted unpack_uint32 to implement
3050         _dbus_verbose_bytes
3051         (_dbus_verbose_bytes): new function
3052
3053         * dbus/dbus-string.c (_dbus_string_validate_ascii): new function
3054
3055         * dbus/dbus-message.c (_dbus_message_loader_get_is_corrupted): add
3056         mechanism to handle a corrupt message stream
3057         (_dbus_message_loader_new): fix preallocation to only prealloc, 
3058         not prelengthen
3059         
3060         * dbus/dbus-string.c (_dbus_string_skip_blank): fix this function
3061         (_dbus_string_test): enhance tests for copy/move and fix the
3062         functions
3063
3064         * dbus/dbus-transport-unix.c: Hold references in more places to 
3065         avoid reentrancy problems
3066
3067         * dbus/dbus-transport.c: ditto
3068
3069         * dbus/dbus-connection.c (dbus_connection_dispatch_message): don't
3070         leak reference count in no-message case
3071
3072         * test/watch.c (do_mainloop): handle adding/removing watches
3073         during iteration over the watches. Also, ref the connection/server
3074         stored on a watch, so we don't try to mangle a destroyed one.
3075
3076         * dbus/dbus-transport-unix.c (do_authentication): perform
3077         authentication
3078
3079         * dbus/dbus-auth.c (get_state): add a state
3080         AUTHENTICATED_WITH_UNUSED_BYTES and return it if required
3081         (_dbus_auth_get_unused_bytes): append the unused bytes
3082         to the passed in string, rather than prepend
3083
3084         * dbus/dbus-transport.c (_dbus_transport_init_base): create 
3085         the auth conversation DBusAuth
3086
3087         * dbus/dbus-transport-unix.c (_dbus_transport_new_for_fd)
3088         (_dbus_transport_new_for_domain_socket): when creating a
3089         transport, pass in whether it's a client-side or server-side
3090         transport so we know which DBusAuth to create
3091
3092 2002-12-03  Havoc Pennington  <hp@pobox.com>
3093
3094         * dbus/dbus-transport-unix.c (unix_finalize): finalize base
3095         _after_ finalizing the derived members
3096         (unix_connection_set): unref watch if we fail to add it
3097
3098         * dbus/dbus-connection.c (dbus_connection_unref): delete the
3099         transport first, so that the connection owned by the 
3100         transport will be valid as the transport finalizes.
3101
3102         * dbus/dbus-transport-unix.c (unix_finalize): free the write_watch
3103         if necessary, and remove watches from the connection.
3104         
3105         * dbus/dbus-watch.c (_dbus_watch_list_free): improve a comment
3106         
3107 2002-12-26  Anders Carlsson  <andersca@codefactory.se>
3108
3109         * dbus/dbus-marshal.c: (_dbus_marshal_string),
3110         (_dbus_demarshal_double), (_dbus_demarshal_int32),
3111         (_dbus_demarshal_uint32), (_dbus_demarshal_string),
3112         (_dbus_marshal_test):
3113         * dbus/dbus-marshal.h:
3114         Add string marshal functions and have the demarshal functions
3115         return the new position.
3116         
3117 2002-12-25  Havoc Pennington  <hp@pobox.com>
3118
3119         * doc/dbus-sasl-profile.txt: docs on the authentication protocol, 
3120         it is a simple protocol that just maps directly to SASL.
3121
3122         * dbus/dbus-auth.h, dbus/dbus-auth.c: authentication protocol
3123         initial implementation, not actually used yet.
3124         
3125         * dbus/dbus-string.c (_dbus_string_find): new function
3126         (_dbus_string_equal): new function
3127         (_dbus_string_base64_encode): new function
3128         (_dbus_string_base64_decode): new function
3129
3130 2002-12-25  Anders Carlsson  <andersca@codefactory.se>
3131
3132         * dbus/Makefile.am:
3133         * dbus/dbus-marshal.c: (swap_bytes), (_dbus_marshal_double),
3134         (_dbus_marshal_int32), (_dbus_marshal_uint32),
3135         (_dbus_demarshal_double), (_dbus_demarshal_int32),
3136         (_dbus_demarshal_uint32), (_dbus_marshal_test):
3137         * dbus/dbus-marshal.h:
3138         * dbus/dbus-protocol.h:
3139         * dbus/dbus-test.c: (main):
3140         * dbus/dbus-test.h:
3141         Add un-optimized marshalling/demarshalling routines.
3142         
3143 2002-12-25  Harri Porten  <porten@kde.org>
3144
3145         * qt/dbus-qt.h: adjusted ctor and getter to KDE/Qt conventions
3146
3147 2002-12-24  Zack Rusin  <zack@kde.org>
3148
3149         * qt/dbus-qthread.cc: adding - integrates QMutex into Dbus
3150         * qt/dbus-qt.h: skeleton with two sample implemenatation of the
3151         main loop stuff
3152
3153 2002-12-24  Havoc Pennington  <hp@pobox.com>
3154
3155         * glib/dbus-gthread.c: fix include
3156
3157         * glib/dbus-glib.h: rename DBusMessageHandler for now. 
3158         I think glib API needs to change, though, as you don't 
3159         want to use DBusMessageFunction, you want to use the 
3160         DBusMessageHandler object. Probably 
3161         dbus_connection_open_with_g_main_loop()
3162         and dbus_connection_setup_g_main_loop() or something like that
3163         (but think of better names...) that just create a connection 
3164         that has watch/timeout functions etc. already set up.
3165
3166         * dbus/dbus-connection.c
3167         (dbus_connection_send_message_with_reply): new function just to 
3168         show how the message handler helps us deal with replies.
3169
3170         * dbus/dbus-list.c (_dbus_list_remove_last): new function
3171
3172         * dbus/dbus-string.c (_dbus_string_test): free a string that
3173         wasn't
3174
3175         * dbus/dbus-hash.c: use memory pools for the hash entries
3176         (rebuild_table): be more paranoid about overflow, and 
3177         shrink table when we can
3178         (_dbus_hash_test): reduce number of sprintfs and write
3179         valid C89. Add tests for case where we grow and then 
3180         shrink the hash table.
3181
3182         * dbus/dbus-mempool.h, dbus/dbus-mempool.c: memory pools
3183
3184         * dbus/dbus-connection.c (dbus_connection_register_handler) 
3185         (dbus_connection_unregister_handler): new functions
3186
3187         * dbus/dbus-message.c (dbus_message_get_name): new
3188
3189         * dbus/dbus-list.c: fix docs typo
3190
3191         * dbus/dbus-message-handler.h, dbus/dbus-message-handler.c:
3192         an object representing a handler for messages.
3193
3194 2002-12-16  Anders Carlsson  <andersca@codefactory.se>
3195
3196         * glib/dbus-glib.h:
3197         * glib/dbus-gthread.c: (dbus_gthread_init):
3198         Don't use the gdbus prefix for public functions.
3199         
3200 2002-12-16  Anders Carlsson  <andersca@codefactory.se>
3201
3202         * Makefile.am:
3203         * configure.in:
3204         Add GLib checks and fixup .pc files
3205         
3206         * glib/Makefile.am:
3207         * glib/dbus-glib.h:
3208         * glib/dbus-gmain.c: (gdbus_connection_prepare),
3209         (gdbus_connection_check), (gdbus_connection_dispatch),
3210         (gdbus_add_connection_watch), (gdbus_remove_connection_watch),
3211         (dbus_connection_gsource_new):
3212         * glib/dbus-gthread.c: (dbus_gmutex_new), (dbus_gmutex_free),
3213         (dbus_gmutex_lock), (dbus_gmutex_unlock), (dbus_gthread_init):
3214         * glib/test-dbus-glib.c: (message_handler), (main):
3215         Add GLib support.
3216         
3217 2002-12-15  Harri Porten  <porten@kde.org>
3218
3219         * autogen.sh: check for libtoolize before attempting to use it 
3220         
3221         * dbus/dbus-transport-unix.c: include <sys/time.h> for timeval
3222         struct.
3223         
3224         * .cvsignore: ignore more stamp files
3225
3226         * dbus/dbus-watch.c (_dbus_watch_list_new): fixed doc error
3227
3228         * test/Makefile.am: added -I$(top_srcdir) to be able to compile
3229         without make install.
3230
3231 2002-12-15  Havoc Pennington  <hp@pobox.com>
3232
3233         * dbus/dbus-threads.c: add thread stubs that a higher library
3234         layer can fill in. e.g. the GLib wrapper might fill them in with
3235         GThread stuff. We still need to use this thread API to
3236         thread-safe-ize the library.
3237
3238 2002-12-12  Havoc Pennington  <hp@pobox.com>
3239
3240         * dbus/dbus-transport-unix.c, dbus/dbus-server-unix.c: use the
3241         below new interfaces and include fewer system headers.
3242
3243         * dbus/dbus-sysdeps.c (_dbus_read): new function
3244         (_dbus_write): new function
3245         (_dbus_write_two): new function
3246         (_dbus_connect_unix_socket): new function
3247         (_dbus_listen_unix_socket): new function
3248
3249         * dbus/dbus-message-internal.h: change interfaces to use
3250         DBusString
3251
3252 2002-12-11  Havoc Pennington  <hp@pobox.com>
3253
3254         * dbus/dbus-types.h: add dbus_unichar
3255
3256         * dbus/dbus-internals.c (_dbus_verbose): use _dbus_getenv
3257
3258         * dbus/dbus-connection.c (dbus_connection_send_message): return
3259         TRUE on success
3260
3261         * dbus/dbus-transport.c: include dbus-watch.h   
3262
3263         * dbus/dbus-connection.c: include dbus-message-internal.h
3264
3265         * HACKING: add file with coding guidelines stuff.
3266
3267         * dbus/dbus-string.h, dbus/dbus-string.c: Encapsulate all string
3268         handling here, for security purposes (as in vsftpd). Not actually
3269         using this class yet.
3270
3271         * dbus/dbus-sysdeps.h, dbus/dbus-sysdeps.c: Encapsulate all
3272         system/libc usage here, as in vsftpd, for ease of auditing (and
3273         should also simplify portability). Haven't actually moved all the
3274         system/libc usage into here yet.
3275         
3276 2002-11-25  Havoc Pennington  <hp@pobox.com>
3277
3278         * dbus/dbus-internals.c (_dbus_verbose): fix to not 
3279         always print the first verbose message.
3280
3281 2002-11-24  Havoc Pennington  <hp@pobox.com>
3282
3283         * test/echo-client.c, test/echo-server.c: cheesy test 
3284         clients.
3285         
3286         * configure.in (AC_CHECK_FUNCS): check for writev
3287
3288         * dbus/dbus-message.c (_dbus_message_get_network_data): new
3289         function
3290
3291         * dbus/dbus-list.c (_dbus_list_foreach): new function
3292
3293         * dbus/dbus-internals.c (_dbus_verbose): new function
3294
3295         * dbus/dbus-server.c, dbus/dbus-server.h: public object
3296         representing a server that listens for connections.
3297
3298         * dbus/.cvsignore: create
3299
3300         * dbus/dbus-errors.h, dbus/dbus-errors.c:
3301         public API for reporting errors
3302
3303         * dbus/dbus-connection.h, dbus/dbus-connection.c:
3304         public object representing a connection that 
3305         sends/receives messages. (Same object used for 
3306         both client and server.)
3307
3308         * dbus/dbus-transport.h, dbus/dbus-transport.c:
3309         Basic abstraction for different kinds of stream
3310         that we might read/write messages from.
3311
3312 2002-11-23  Havoc Pennington  <hp@pobox.com>
3313
3314         * dbus/dbus-internals.h (_DBUS_INT_MAX): add _DBUS_INT_MIN 
3315         _DBUS_INT_MAX
3316
3317         * dbus/dbus-test.c (main): add list test, and include 
3318         dbus-test.h as intended
3319
3320         * dbus/dbus-hash.c (_dbus_hash_table_remove_string) 
3321         (_dbus_hash_table_remove_int): return value indicates 
3322         whether the entry existed to remove
3323
3324         * dbus/dbus-list.c: add linked list utility class, 
3325         with docs and tests
3326
3327         * dbus/dbus-hash.c: add TODO item about shrinking the hash bucket 
3328         array sometimes.
3329
3330 2002-11-23  Havoc Pennington  <hp@pobox.com>
3331
3332         * Doxyfile.in (INCLUDE_FILE_PATTERNS): expand DBUS_BEGIN_DECLS/
3333         DBUS_END_DECLS to nothing, that should fix this once and for all
3334
3335         * Doxyfile.in (JAVADOC_AUTOBRIEF): set to YES
3336
3337         * dbus/dbus-message.c, dbus/dbus-hash.c: 
3338         add some missing @brief
3339
3340 2002-11-23  Havoc Pennington  <hp@pobox.com>
3341
3342         * dbus/dbus-message.h: put semicolons after DEBUG_BEGIN_DECLS 
3343         to avoid confusing Doxygen
3344
3345         * dbus/dbus-hash.c: @} not }@
3346
3347         * dbus/dbus-message.c (struct DBusMessage): split out 
3348         internals docs
3349
3350 2002-11-23  Havoc Pennington  <hp@pobox.com>
3351
3352         * configure.in: pile on more warning flags if using gcc
3353
3354         * Doxyfile.in (EXTRACT_STATIC): set to NO, so we don't have 
3355         to document static functions
3356
3357         * configure.in: add summary to end of configure so it 
3358         looks nice and attractive
3359
3360         * dbus/dbus-hash.c: finish implementation and write unit 
3361         tests and docs
3362
3363         * configure.in: add --enable-tests to enable unit tests
3364
3365         * dbus/dbus-test.c: test program to run unit tests 
3366         for all files in dbus/*, initially runs a test for 
3367         dbus-hash.c
3368         
3369         * dbus/dbus-internals.h: file to hold some internal utility stuff
3370
3371 2002-11-22  Havoc Pennington  <hp@redhat.com>
3372
3373         * dbus/dbus-hash.c: copy in Tcl hash table, not yet 
3374         "ported" away from Tcl
3375
3376         * dbus/dbus-types.h: header for types such as dbus_bool_t
3377
3378 2002-11-22  Havoc Pennington  <hp@redhat.com>
3379
3380         * dbus/dbus.h: fixups for doc warnings
3381
3382         * Doxyfile.in (FILE_PATTERNS): we need to scan .h to pick up 
3383         macros
3384         (QUIET): make it quiet so we can see warnings
3385
3386         * dbus/dbus-memory.c: teach D-BUS to allocate and free memory
3387
3388 2002-11-22  Havoc Pennington  <hp@redhat.com>
3389
3390         * Makefile.am: include "Doxyfile" target in all-local
3391
3392         * configure.in: generate the Doxyfile
3393
3394         * Doxyfile.in: move Doxyfile here, so we can use 
3395         configure to generate a Doxyfile with the right 
3396         version number etc.
3397
3398 2002-11-22  Havoc Pennington  <hp@redhat.com>
3399
3400         * dbus/dbus-message.c: move inline docs into .c file
3401
3402         * Doxyfile (OUTPUT_DIRECTORY): move output to doc/api
3403         so all docs are under doc/
3404         (MAN_EXTENSION): generate man pages. Use extension 
3405         ".3dbus" which matches ".3qt" on my system, 
3406         I guess this is OK, I don't know really.
3407         (FILE_PATTERNS): look for .c files not .h, makes sense
3408         for plain C I think
3409
3410 2002-11-22  Havoc Pennington  <hp@pobox.com>
3411
3412         * Makefile.am (SUBDIRS): rename subdir "server" to "bus" 
3413         because any app can be a server, and any app can be a client, 
3414         the bus is a special kind of server.
3415
3416 Thu Nov 21 23:35:31 2002  Zack Rusin  <zack@kde.org>
3417
3418         * Doxyfile : adding. Still needs Makefile rules to be generated
3419         automatically (just run "doxygen" in the toplevel dir for now to
3420         generate docs)
3421         
3422         * dbus/dbus-message.h : Adding sample docs (javadoc since
3423         resembles gtk-doc a little more)
3424
3425         * dbus/dbus.h : Adding sample docs
3426
3427 2002-11-21  Havoc Pennington  <hp@redhat.com>
3428
3429         * dbus/Makefile.am (INCLUDES): define DBUS_COMPILATION 
3430         so we can allow ourselves to include files directly, 
3431         instead of having to use dbus.h
3432
3433         * dbus/dbus.h: fill in
3434
3435         * dbus/dbus-message.h: sketch out a sample header file.
3436         Include griping if you include it directly instead of 
3437         via dbus.h
3438
3439         * dbus/dbus-macros.h: new file with macros for extern "C", 
3440         TRUE/FALSE, NULL, etc.
3441
3442         * doc/file-boilerplate.c: put include guards in here
3443
3444 2002-11-21  Havoc Pennington  <hp@redhat.com>
3445
3446         * doc/file-boilerplate.c: include both AFL and GPL boilerplate.
3447
3448         * COPYING: include the GPL as well, and license code 
3449         under both AFL and GPL.
3450
3451 2002-11-21  Havoc Pennington  <hp@redhat.com>
3452
3453         * acconfig.h: get rid of this
3454
3455         * autogen.sh (run_configure): add --no-configure option
3456
3457         * configure.in: remove AC_ARG_PROGRAM to make
3458         autoconf complain less. add AC_PREREQ. 
3459         add AC_DEFINE third arg.
3460         
3461 2002-11-21  Anders Carlsson  <andersca@codefactory.se>
3462
3463         * doc/Makefile.am:
3464         Fix references so we can distcheck.
3465
3466 2002-11-21  Havoc Pennington  <hp@redhat.com>
3467
3468         * Initial module creation
3469