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