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