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