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