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