1 2003-04-28 Havoc Pennington <hp@redhat.com>
7 * bus/system.conf.in: add <includedir>system.d</includedir>
9 * dbus/dbus-userdb.c (_dbus_user_database_lookup): fix bug when
10 username was provided but not uid
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.
16 2003-04-27 Havoc Pennington <hp@pobox.com>
20 * dbus/dbus-transport.c (_dbus_transport_get_dispatch_status):
21 report correct status if we finish processing authentication
24 * bus/activation.c (try_send_activation_failure): use
25 bus_transaction_send_error_reply
27 * bus/connection.c (bus_connection_get_groups): return an error
28 explaining the problem
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
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
39 * dbus/dbus-message.c (dbus_message_new_error_reply): allow NULL
40 sender field in message being replied to
42 * bus/bus.c (bus_context_check_security_policy): fix silly typo
43 causing it to return FALSE always
45 * bus/policy.c (bus_client_policy_check_can_send): fix bug where
46 we checked sender rather than destination
48 2003-04-25 Havoc Pennington <hp@redhat.com>
50 test suite is slightly hosed at the moment, will fix soon
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.
57 * dbus/dbus-mainloop.c (check_timeout): fix this up a bit,
58 probably still broken.
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.
64 * bus/connection.c (bus_connection_get_policy): report errors here
66 * bus/activation.c: implement limit on number of pending
69 2003-04-25 Havoc Pennington <hp@redhat.com>
71 * dbus/dbus-transport.c (_dbus_transport_get_unix_user): fix bug
72 where we used >= 0 instead of != DBUS_UID_UNSET.
74 2003-04-25 Havoc Pennington <hp@redhat.com>
76 * glib/dbus-gmain.c (remove_watch): fix for a crash when watches
77 were toggled without add/remove, fix from Anders Gustafsson
79 2003-04-24 Havoc Pennington <hp@redhat.com>
81 * test/data/valid-config-files/basic.conf: add <limit> tags to
84 * bus/config-parser.h, bus/config-parser.c, bus/bus.c: Implement
85 <limit> tag in configuration file.
87 2003-04-24 Havoc Pennington <hp@redhat.com>
89 * bus/dispatch.c: somehow missed some name_is
91 * dbus/dbus-timeout.c (_dbus_timeout_set_enabled)
92 (_dbus_timeout_set_interval): new
94 * bus/connection.c (bus_connections_setup_connection): record time
95 when each connection is first set up, and expire them after the
98 2003-04-24 Havoc Pennington <hp@redhat.com>
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
105 2003-04-24 Havoc Pennington <hp@redhat.com>
107 * configure.in: add --enable-checks
109 * dbus/dbus-message.c (dbus_message_new): reverse name/service arguments
111 * dbus/dbus-connection.c (dbus_connection_preallocate_send): fix
113 (_dbus_connection_handler_destroyed_locked): move some private
114 functions into proper docs group
116 * dbus/dbus-internals.h: add _dbus_return_if_fail,
117 _dbus_return_val_if_fail
119 Throughout: use dbus_return_if_fail
121 2003-04-23 James Willcox <jwillcox@gnome.org>
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):
132 Added a GMainContext argument to dbus_connection_setup_with_g_main()
133 and dbus_server_setup_with_g_main().
135 2003-04-20 Havoc Pennington <hp@pobox.com>
137 * doc/dbus-specification.sgml: document the restrictions on
138 message and service names
140 2003-04-22 Havoc Pennington <hp@redhat.com>
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.
146 * dbus-1.0.pc.in (Cflags): put libdir include file in cflags
148 * configure.in: generate dbus-arch-deps.h
150 * dbus/dbus-protocol.h (DBUS_TYPE_INT64, DBUS_TYPE_UINT64): add
153 2003-04-22 Havoc Pennington <hp@redhat.com>
155 * test/data/valid-messages/opposite-endian.message: fix test
156 to use proper type for rply field
158 * test/data/invalid-messages: add tests for below validation
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.
165 * dbus/dbus-string.c (_dbus_string_validate_name): new
167 2003-04-19 Havoc Pennington <hp@pobox.com>
169 * bus/driver.c (bus_driver_handle_hello): check limits and
170 return an error if they are exceeded.
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.
176 * dbus/dbus-list.c (_dbus_list_unlink): export
178 * bus/bus.c (bus_context_check_security_policy): enforce a maximum
179 number of bytes in the message queue for a connection
181 2003-04-18 Havoc Pennington <hp@pobox.com>
183 * dbus/dbus-auth.c (record_mechanisms): memleak fixes
185 * dbus/dbus-sysdeps.c (_dbus_string_save_to_file): fix some
188 * dbus/dbus-keyring.c (add_new_key): fix a memleak, and
189 on realloc be sure to update the pointer in the keyring
191 * dbus/dbus-string.c (_dbus_string_zero): compensate for align
192 offset to avoid writing to unallocated memory
194 * dbus/dbus-auth.c (process_rejected): return FALSE if we fail to
195 try the next mechanism, so we properly handle OOM
197 * dbus/dbus-keyring.c (_dbus_keyring_new_homedir): fix double-free
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
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
211 2003-04-18 Havoc Pennington <hp@pobox.com>
213 * dbus/dbus-mainloop.c (_dbus_loop_iterate): fix UMR in verbose
216 * dbus/dbus-auth.c (handle_client_data_cookie_sha1_mech): fix OOM
219 * dbus/dbus-keyring.c (_dbus_keyring_new_homedir): only whine
220 about DBUS_TEST_HOMEDIR once
222 * bus/Makefile.am (TESTS_ENVIRONMENT): put DBUS_TEST_HOMEDIR in
225 * bus/dispatch.c (bus_dispatch_sha1_test): actually load sha1
226 config file so we test the right thing
228 Throughout: assorted docs improvements
230 2003-04-18 Havoc Pennington <hp@pobox.com>
232 * glib/dbus-gmain.c: adapt to watch changes
234 * bus/bus.c, bus/activation.c, etc.: adjust to watch changes
236 * dbus/dbus-server.h: remove dbus_server_handle_watch
238 * dbus/dbus-connection.h: remove dbus_connection_handle_watch
240 * dbus/dbus-watch.c (dbus_watch_handle): change DBusWatch to work
241 like DBusTimeout, so we don't need dbus_connection_handle_watch
244 2003-04-17 Havoc Pennington <hp@redhat.com>
246 * dbus/dbus-userdb.c, dbus/dbus-sysdeps.c: redo all the passwd
247 database usage so it all goes via the DBusUserDatabase cache.
249 2003-04-17 Havoc Pennington <hp@redhat.com>
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
257 * bus/driver.c (bus_driver_handle_message): sense of test for
260 2003-04-16 Havoc Pennington <hp@pobox.com>
262 * doc/dbus-specification.sgml: make spec say serials are unsigned
264 * dbus/dbus-message.h: change message serials to unsigned
266 * dbus/dbus-connection.c: adapt to message serials being unsigned
268 2003-04-15 Havoc Pennington <hp@pobox.com>
270 * bus/bus.c: create and keep around a shared DBusUserDatabase
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.
277 2003-04-16 Havoc Pennington <hp@redhat.com>
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
283 * dbus/dbus-connection.c
284 (dbus_connection_set_max_live_messages_size): rename
286 (dbus_connection_get_outgoing_size): get size of outgoing
288 (_dbus_connection_set_connection_counter): remove this cruft
290 2003-04-14 Havoc Pennington <hp@redhat.com>
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
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.
301 test/data/valid-config-files/debug-allow-all-sha1.conf.in:
302 add conf file that requires use of sha1 auth
304 2003-04-13 Havoc Pennington <hp@pobox.com>
306 * tools/dbus-send.c, tools/dbus-monitor.c: two utility programs
307 from Philip Blundell to send messages and monitor them.
309 2003-04-13 Havoc Pennington <hp@pobox.com>
311 * dbus/dbus-mainloop.c: fix some reentrancy issues by refcounting
314 * test/data/valid-config-files/debug-allow-all.conf.in: allow all
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.
322 * bus/dispatch.c: implement security policy checking
324 * bus/connection.c (bus_transaction_send_from_driver): new
326 * bus/bus.c (bus_context_check_security_policy): new
328 * bus/dispatch.c (send_service_nonexistent_error): delete this,
329 now we just set the DBusError and it gets converted to an error
332 * bus/connection.c (allow_user_function): enable code using actual
333 data from the config file
335 * bus/policy.c (list_allows_user): handle wildcard rules for
336 user/group connection perms
338 2003-04-13 Havoc Pennington <hp@pobox.com>
340 * bus/config-parser.c: Load up the BusPolicy and BusPolicyRules
342 * dbus/dbus-sysdeps.c (_dbus_get_user_id): new function
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
348 2003-04-12 Havoc Pennington <hp@pobox.com>
350 * bus/config-parser.c (bus_config_parser_new): fix a memleak
352 * dbus/dbus-sysdeps.c: change DBusCredentials to use longs for
353 the pid/gid/uid, just for paranoia.
355 * test/break-loader.c (randomly_do_n_things): find a byte
356 containing a type code, and randomly change it to a different
359 2003-04-12 Havoc Pennington <hp@pobox.com>
361 * bus/policy.h: change BusPolicy to be the thing from the config
362 file, and rename old BusPolicy to BusClientPolicy
364 * bus/bus.c, bus/connection.c, bus/config-parser.c: change to
365 match change in how policy works
367 * dbus/dbus-internals.h: mark assert_not_reached as
368 __attribute((noreturn))__
370 2003-04-11 Havoc Pennington <hp@redhat.com>
372 * doc/dbus-specification.sgml: fix a spot with the wrong name for
373 the broadcast service. Use boolean return for ServiceExists.
375 2003-04-11 Havoc Pennington <hp@redhat.com>
377 * configure.in: add another directory to look for qt in.
379 2003-04-11 Havoc Pennington <hp@redhat.com>
381 * AUTHORS: add Colin Walters
383 2003-04-11 Havoc Pennington <hp@redhat.com>
389 2003-04-11 Havoc Pennington <hp@redhat.com>
391 * bus/messagebus.in: remove pid file when stopping the
392 message bus, since the bus won't have privileges to remove it
395 2003-04-11 Havoc Pennington <hp@redhat.com>
397 * bus/bus.c (bus_context_new): move credentials change after
400 2003-04-11 Havoc Pennington <hp@pobox.com>
402 * test/decode-gcov.c: add "below average functions" to the
403 coverage report, and change how some of the code works.
405 * bus/test-main.c: bracket some stuff in DBUS_BUILD_TESTS so it's
406 not in the coverage stats.
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.
411 2003-04-11 Havoc Pennington <hp@pobox.com>
413 * bus/dispatch.c (check_existent_service_activation): accept a no
414 memory error in a place we didn't before
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
420 2003-04-10 Havoc Pennington <hp@pobox.com>
422 * bus/dispatch.c (check_segfault_service_activation): add test
423 for launching an executable that just crashes.
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.
428 2003-04-10 Havoc Pennington <hp@pobox.com>
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.
434 * bus/activation.c (bus_activation_activate_service): kill child
435 if we don't successfully complete the activation.
437 2003-04-10 Havoc Pennington <hp@redhat.com>
439 * dbus/dbus-connection.c (dbus_connection_flush): don't spin on
440 the connection if it's disconnected
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.
447 * dbus/dbus-list.c (_dbus_list_insert_before_link)
448 (_dbus_list_insert_after_link): new code to facilitate
451 * dbus/dbus-hash.c (_dbus_hash_table_insert_string_preallocated):
452 new functionality, so we can preallocate the ability to insert
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
459 * doc/dbus-specification.sgml: add some discussion of secondary
460 service owners, and disallow zero-length service names
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.
468 2003-04-10 Alexander Larsson <alexl@redhat.com>
470 * doc/dbus-specification.sgml:
471 s/org.freedesktop.Broadcast/org.freedesktop.DBus.Broadcast/
473 2003-04-10 Alexander Larsson <alexl@redhat.com>
478 Added files to cvsignore
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):
487 (dbus_message_iter_append_named)
489 (message_iter_test), (check_message_handling_type), (_dbus_message_test):
492 2003-04-10 Alexander Larsson <alexl@redhat.com>
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.
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.
503 * doc/dbus-specification.sgml:
506 Update new array encoding description.
507 Correct DBUS_SERVICE_FLAGS_REPLACE_EXISTING description.
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.
513 * test/data/invalid-messages/too-short-dict.message:
516 * test/data/valid-messages/recursive-types.message:
517 Fix up and extend test.
519 2003-04-10 Havoc Pennington <hp@pobox.com>
521 * bus/dispatch.c: lots of fixes
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.
527 * dbus/dbus-transport.c (_dbus_transport_open): fix error
528 handling to avoid piling up errors if we get a failure on the
531 * dbus/dbus-internals.c (_dbus_real_assert_not_reached): include
532 pid in assertion failures.
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
539 2003-04-09 Havoc Pennington <hp@redhat.com>
541 * dbus/dbus-mainloop.c (check_timeout): fix timeouts, I thought
542 I'd checked this in earlier but hadn't.
544 2003-04-09 Havoc Pennington <hp@redhat.com>
546 * bus/dispatch.c (bus_dispatch_test): get a bit further through
547 the activation test (man this is getting old!)
549 2003-04-09 Havoc Pennington <hp@redhat.com>
551 * test/test-utils.c: use dispatch status function to fix this up
553 * bus/connection.c (connection_watch_callback): don't dispatch
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
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
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
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
576 2003-04-09 Havoc Pennington <hp@redhat.com>
578 * dbus/dbus-bus.c (dbus_bus_register): fix up error handling and
581 * bus/dispatch.c (check_service_activated): fix bug in test
583 * dbus/dbus-mainloop.c (check_timeout): fix this up
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.
589 2003-04-08 Colin Walters <walters@gnu.org>
591 * bus/bus.c (struct BusContext) [pidfile]: New member, to store
593 (bus_context_new): Set it.
594 (bus_context_unref): Use it to delete the pid file.
596 2003-04-08 Havoc Pennington <hp@redhat.com>
598 * test/data/invalid-messages/array-with-mixed-types.message:
599 regression test that fails for the moment
601 * dbus/dbus-test.c (dbus_internal_do_not_use_run_tests): reorder
602 tests for convenience
604 * dbus/dbus-marshal.c (_dbus_marshal_validate_arg): don't allow
605 array of nil, it broke things.
607 * test/data/invalid-messages/array-of-nil.message: regression test
609 * test/data/valid-messages/array-of-array-of-uint32.message:
610 happened to write this so added it to suite
612 2003-04-08 Havoc Pennington <hp@redhat.com>
614 * bus/driver.c (bus_driver_handle_acquire_service): init
615 retval/reply before checking name
617 * dbus/dbus-marshal.c (_dbus_marshal_validate_arg): add a
618 recursion depth argument
620 * dbus/dbus-message.h (struct DBusMessageIter): put some padding
621 in the public struct for future extension
623 * dbus/dbus-message-builder.c (_dbus_message_data_load): fix
626 * dbus/dbus-marshal.c (_dbus_marshal_validate_arg): fix a verbose
629 * doc/dbus-specification.sgml: fix typo
631 2003-04-08 Alexander Larsson <alexl@redhat.com>
633 Implemented recursive types, named types and new-style iters
636 * glib/test-thread-client.c: (thread_func):
637 * glib/test-thread-server.c: (handle_test_message):
638 * test/test-service.c: (handle_echo):
647 * dbus/dbus-internals.c: (_dbus_type_to_string):
648 Update for new types.
650 * dbus/dbus-marshal.[ch]:
651 Implement recursive types and the new marshalling format.
652 Remove hardcoded dict marshalling.
655 * dbus/dbus-message-builder.c:
657 Remove references to old types
659 * dbus/dbus-message.[ch]:
660 New non-refcounted iter API that supports recursive iters.
661 Use iters for appending, including support for recursive
663 Add byte and named type support.
664 Update everything to new marshalling formats.
665 Add tests for new API.
667 * dbus/dbus-protocol.h:
668 Remove old array types.
669 Add types: BYTE, ARRAY, DICT, NAMED
671 * dbus/dbus-string.c:
672 * dbus/dbus-sysdeps.c:
673 Make parse_double locale safe.
675 * dbus/dbus-test-main.c:
681 * doc/dbus-specification.sgml:
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
699 * test/data/invalid-messages/dict-with-nil-value.message:
700 Removed, this is not invalid anymore.
702 * test/data/valid-messages/recursive-types.message:
703 Add new test for deeply recursive types.
705 2003-04-07 Havoc Pennington <hp@pobox.com>
707 * bus/driver.c (bus_driver_handle_acquire_service): return an
708 error if you try to acquire a service that starts with ':'
710 2003-04-07 Havoc Pennington <hp@redhat.com>
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
716 * bus/dispatch.c (check_existent_service_activation): lots more
717 work on the activation test; it doesn't fully pass yet...
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
723 2003-04-06 Havoc Pennington <hp@pobox.com>
725 * qt/Makefile.am (dbusinclude_HEADERS): install dbus-qt.h,
728 * configure.in: fixes to Qt detection from Colin Walters
730 * doc/Makefile.am: Only remove generated docbook dirs if they
731 exist, from Colin Walters
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.
737 * test/Makefile.am: remove a lot of stuff that isn't immediately
738 useful, it's in CVS history if we want it.
740 * test/test-service.c: use dbus-mainloop instead of that
743 2003-04-06 Havoc Pennington <hp@pobox.com>
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
750 * dbus/dbus-mainloop.h, dbus/dbus-mainloop.c: move bus/loop.[hc]
751 here so it can be used in test binaries also
753 2003-04-06 Havoc Pennington <hp@pobox.com>
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.
760 * bus/bus.c (bus_context_new): move pidfile detection further up
761 in the function, before we start overwriting sockets and such.
763 * bus/messagebus.in: adjust this a bit, not sure if it will work.
765 * configure.in: add --with-system-pid-file and --with-system-socket
767 2003-04-06 Colin Walters <walters@verbum.org>
769 * configure.in (DBUS_SYSTEM_PID_FILE): New variable.
771 * bus/system.conf.in: Declare a pidfile.
773 * bus/bus.c (bus_context_new): Test for an existing pid file, and
774 create one (if appropriate).
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.
783 * bus/config-parser.h (_dbus_write_pid_file): Prototype.
785 * dbus/dbus-errors.h (DBUS_ERROR_PIDFILE_EXISTS): New error.
787 * dbus/dbus-sysdeps.c (_dbus_write_pid_file): New function.
789 * dbus/dbus-sysdeps.h: Prototype it.
791 2003-04-06 Havoc Pennington <hp@pobox.com>
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
796 * bus/dispatch.c (send_service_nonexistent_error): set the sender
797 on the service nonexistent error
799 * bus/driver.c (bus_driver_handle_acquire_service): set the
800 sender on the AcquireService reply
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.
805 2003-04-06 Havoc Pennington <hp@pobox.com>
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
811 2003-04-06 Havoc Pennington <hp@pobox.com>
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
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
823 2003-04-06 Havoc Pennington <hp@pobox.com>
825 * bus/bus.c (bus_context_new): fix wrong handling of
826 server_data_slot_unref() in the error case.
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
832 * bus/main.c (main): accept --print-address option to print out
833 the message bus address
835 * dbus/dbus-sysdeps.c (_dbus_generate_random_ascii): export this
837 * dbus/dbus-transport.c (_dbus_transport_open): special error for
838 "tmpdir" option to unix: address on client side
840 * dbus/dbus-server.c (dbus_server_listen): handle "tmpdir" option
843 * configure.in (TEST_SOCKET_DIR): locate a temporary directory
844 we can use to create sockets in the test suite.
846 * bus/main.c (signal_handler): on SIGTERM, exit the daemon
847 cleanly. To be used for testing.
849 * dbus/dbus-spawn.c (babysit): use _dbus_set_signal_handler()
851 * dbus/dbus-sysdeps.c (_dbus_set_signal_handler): new
853 * dbus/dbus-server-debug-pipe.c (_dbus_transport_debug_pipe_new):
854 handle trying to call this when there's no servers active
856 2003-04-05 Havoc Pennington <hp@pobox.com>
862 2003-04-05 Havoc Pennington <hp@pobox.com>
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. ;-)
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.
872 2003-04-05 Havoc Pennington <hp@pobox.com>
874 * bus/Makefile.am (install-data-hook): add missing DESTDIR,
875 patch from Colin Walters
877 2003-04-05 Havoc Pennington <hp@pobox.com>
879 * doc/config-file.txt (Elements): fix docs of <auth> to reflect
880 reality; in fact multiple mechanisms are allowed.
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.
889 2003-04-05 Havoc Pennington <hp@pobox.com>
891 * test/Makefile.am (dist-hook): also dist *.in files
897 2003-04-05 Havoc Pennington <hp@pobox.com>
899 * dbus/dbus-string.c: docs warning
901 * dbus/dbus-spawn.c: missing docs
903 * dbus/dbus-memory.c (struct ShutdownClosure): missing docs
905 2003-04-05 Havoc Pennington <hp@pobox.com>
907 * bus/loop.c (bus_loop_iterate): fix the timeout code, using
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
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.
921 2003-04-05 Havoc Pennington <hp@pobox.com>
923 * test/decode-gcov.c (main): print per-directory stats in the report
925 * Makefile.am (coverage-report.txt): don't include test/* in gcov stats
927 2003-04-05 Havoc Pennington <hp@pobox.com>
929 * Makefile.am (coverage-report.txt): add target "coverage-report.txt"
931 * test/decode-gcov.c: hack up a little program to suck data
932 out of gcov files. Yes this is sort of silly.
934 * configure.in: define something in config.h and do an
935 AM_CONDITIONAL when gcov is enabled
937 2003-04-04 Havoc Pennington <hp@redhat.com>
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.
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.
947 * dbus/dbus-sysdeps.c: kill _dbus_errno_to_string()
949 2003-04-03 Havoc Pennington <hp@pobox.com>
951 * dbus/dbus-spawn.c: Move dbus-spawn into a separate file
952 in preparation for modifying it, dbus-sysdeps is getting
955 2003-04-03 Havoc Pennington <hp@redhat.com>
957 * bus/loop.h, bus/loop.c: make the mainloop an object so we can
960 * bus/*.[hc]: adapt to mainloop change
962 2003-04-03 Havoc Pennington <hp@redhat.com>
964 * bus/activation.c (load_directory): fix up memleaks
965 (bus_activation_entry_free): free the entry
967 * dbus/dbus-bus.c (dbus_bus_acquire_service): return an error if
968 we get one from the message bus; fix memleaks.
970 * dbus/dbus-message.c (dbus_set_error_from_message): new function
972 2003-04-03 Havoc Pennington <hp@pobox.com>
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)
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
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.
986 * dbus/dbus-bus.c (dbus_bus_get): fix bug where bus type of 0
987 didn't work, and support DBUS_BUS_ACTIVATION.
989 * bus/activation.c (child_setup): pass our well-known bus type to
992 * bus/config-parser.c: support <type> to specify well-known type
994 * doc/dbus-specification.sgml: document the env variables to
995 locate well-known buses and find service activator
997 2003-04-02 Havoc Pennington <hp@redhat.com>
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.
1004 2003-04-02 Havoc Pennington <hp@redhat.com>
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.
1011 2003-04-02 Havoc Pennington <hp@redhat.com>
1013 * dbus/dbus-sysdeps.c (_dbus_file_get_contents): include filenames
1015 (_dbus_string_get_dirname): new
1016 (_dbus_sysdeps_test): new
1017 (_dbus_directory_open): include dirnames in error messages
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.
1023 * dbus/dbus-string.c (_dbus_string_find_byte_backward): new
1025 2003-04-02 Havoc Pennington <hp@redhat.com>
1027 * bus/connection.c (bus_transaction_send_error_reply): set sender
1028 service for the error, and unref the reply on success
1030 * bus/activation.c: convert to use BusTransaction so OOM can be
1032 (bus_activation_service_created): set sender of the message
1034 2003-04-01 Havoc Pennington <hp@redhat.com>
1036 * bus/config-parser.c, bus/bus.c: implement <servicedir> and
1037 <includedir> (at least mostly)
1039 * dbus/dbus-sysdeps.c (_dbus_change_identity): set the group ID
1040 first, then the user ID
1042 2003-04-01 Havoc Pennington <hp@pobox.com>
1044 * dbus/dbus-server.c (dbus_server_set_auth_mechanisms): new
1047 * dbus/dbus-auth.c (_dbus_auth_set_mechanisms): new
1049 * dbus/dbus-internals.c (_dbus_dup_string_array): new function
1051 * dbus/dbus-sysdeps.c (_dbus_listen_unix_socket): chmod the
1052 socket 0777, and unlink any existing socket.
1054 * bus/bus.c (bus_context_new): change our UID/GID and fork if
1055 the configuration file so specifies; set up auth mechanism
1058 * bus/config-parser.c (bus_config_parser_content): add support
1059 for <fork> option and fill in code for <auth>
1061 * bus/system.conf.in: add <fork/> to default configuration,
1062 and limit auth mechanisms to EXTERNAL
1064 * doc/config-file.txt (Elements): add <fork>
1066 * dbus/dbus-sysdeps.c (_dbus_become_daemon): new function
1067 (_dbus_change_identity): new function
1069 2003-03-31 Havoc Pennington <hp@redhat.com>
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
1075 2003-03-31 Havoc Pennington <hp@redhat.com>
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.
1081 2003-03-31 Havoc Pennington <hp@redhat.com>
1083 * bus/Makefile.am (install-data-hook): create /var/run/dbus
1085 * bus/messagebus.in: add init script for Red Hat /etc/init.d
1087 * configure.in: add support for specifying a style of init script
1090 2003-03-31 Havoc Pennington <hp@redhat.com>
1092 Fix some annoying DBusString API and fix all affected code.
1094 * dbus/dbus-string.c (_dbus_string_init): get rid of annoying
1096 (_dbus_string_get_data): change to return string instead of using
1098 (_dbus_string_get_const_data): ditto
1099 (_dbus_string_get_data_len): ditto
1100 (_dbus_string_get_const_data_len): ditto
1102 2003-03-31 Havoc Pennington <hp@redhat.com>
1104 * bus/main.c (main): fix up the command line arguments to be nicer
1106 2003-03-31 Havoc Pennington <hp@redhat.com>
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
1112 * bus/config-loader-expat.c (bus_config_load): fix type of
1115 * doc/TODO: remove TODO item for dbus_bus_get()
1117 * dbus/dbus-bus.c (bus_data_free): add missing lock/unlock
1119 2003-03-31 Havoc Pennington <hp@pobox.com>
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
1125 * dbus/dbus-server.c (dbus_server_get_address): new function
1127 * bus/main.c (main): take the configuration file as an argument.
1129 * test/data/valid-config-files/debug-allow-all.conf: new file to
1130 use with dispatch.c tests for example
1132 * bus/test-main.c (main): require test data dir
1134 * bus/bus.c (bus_context_new): change this to take a
1135 configuration file name as argument
1137 * doc/config-file.txt (Elements): add <servicedir>
1139 * bus/system.conf, bus/session.conf: new files
1141 * dbus/dbus-bus.c (dbus_bus_get): look for system bus on
1142 well-known socket if none set
1144 * configure.in: create system.conf and session.conf
1146 2003-03-30 Havoc Pennington <hp@pobox.com>
1148 * bus/config-parser.c: hacking
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
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
1158 * dbus/dbus-mempool.c (struct DBusMemBlock): fix alignment issue
1160 * dbus/dbus-string.c (UNICODE_VALID): sync new version of this
1162 (_dbus_string_skip_white): new
1164 * doc/config-file.txt (Elements): add <includedir>
1166 2003-03-28 Havoc Pennington <hp@pobox.com>
1168 * dbus/dbus-string.c (_dbus_string_copy_data_len)
1169 (_dbus_string_copy_data): new functions
1171 2003-03-28 Anders Carlsson <andersca@codefactory.se>
1173 * dbus/dbus-bus.c: (bus_data_free), (dbus_bus_get):
1177 * dbus/dbus-memory.c:
1180 2003-03-28 Havoc Pennington <hp@pobox.com>
1182 * bus/test.c (bus_test_flush_bus): remove the sleep from here,
1183 I think it may have just been superstition. Not sure.
1185 * dbus/dbus-string.c (_dbus_string_base64_decode): catch some OOM
1186 failures that were not being handled.
1188 * dbus/dbus-auth.c (process_auth): fix a memleak in OOM handling
1190 * dbus/dbus-memory.c: add ability to set number of mallocs in a
1191 row that will fail on out-of-memory.
1193 * dbus/dbus-internals.c (_dbus_test_oom_handling): convenience
1194 function for testing out-of-memory handling.
1196 * bus/config-loader-expat.c (memsuite): don't wrap the dbus
1197 allocation functions, they do map exactly to the expat ones.
1199 2003-03-27 Havoc Pennington <hp@redhat.com>
1201 * bus/config-loader-libxml.c (bus_config_load): add another error
1204 2003-03-26 Anders Carlsson <andersca@codefactory.se>
1207 Add note about automatic service activation.
1209 * doc/dbus-specification.sgml:
1210 Rename the specification and clarify a few things.
1212 2003-03-26 Anders Carlsson <andersca@codefactory.se>
1215 * dbus/dbus-address.c:
1217 * dbus/dbus-marshal.c:
1218 * dbus/dbus-server-debug-pipe.c:
1219 * dbus/dbus-transport-unix.c:
1220 Fix documentation warnings.
1222 2003-03-26 Havoc Pennington <hp@pobox.com>
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
1228 * configure.in: change configure.in XML stuff to also support
1231 * config-loader-libxml.c: some hacking
1233 * config-loader-expat.c: some hacking
1235 * config-parser.c: some hacking, plus tests
1237 2003-03-25 Havoc Pennington <hp@redhat.com>
1239 * throughout - add more _DBUS_ASSERT_ERROR_IS_CLEAR
1241 * configure.in: add --with-xml option to specify XML library,
1242 right now only libxml is supported.
1244 * bus/config-loader-libxml.c, config-parser.c: sync some minor
1245 nonworking code between home and work, still just stubs
1247 2003-03-24 Havoc Pennington <hp@redhat.com>
1249 * dbus/dbus-sysdeps.c (_dbus_set_fd_nonblocking): move to this
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.
1256 * dbus/dbus-errors.h (DBusResultCode): Kill DBusResultCode in
1259 * bus/test.c (bus_test_flush_bus): add
1261 * bus/policy.c (bus_policy_test): test code stub
1263 2003-03-24 Havoc Pennington <hp@pobox.com>
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.
1270 2003-03-23 Havoc Pennington <hp@pobox.com>
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
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.
1281 * dbus/dbus-threads.c (init_static_locks): rework how we're
1282 handling global locks so they are easily shut down.
1284 * bus/policy.c (bus_policy_append_rule): fix
1286 * bus/test-main.c (main): check for memleaks
1288 * dbus/dbus-test.c (dbus_internal_do_not_use_run_tests): make
1289 test suite check for memleaks
1291 * dbus/dbus-memory.c: add support in test mode for tracking
1292 number of outstanding blocks
1294 2003-03-23 Havoc Pennington <hp@pobox.com>
1296 * bus/policy.c, bus/bus.c, bus/connection.c: implement allow/deny
1299 * dbus/dbus-hash.h: add ULONG hash keys
1301 * dbus/dbus-sysdeps.c (_dbus_get_groups): new
1302 (_dbus_get_group_id): new function
1304 2003-03-20 Havoc Pennington <hp@redhat.com>
1306 * dbus/dbus-connection.c (dbus_connection_set_unix_user_function):
1308 (dbus_connection_get_unix_user): new function
1310 2003-03-20 Havoc Pennington <hp@pobox.com>
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
1318 * bus/policy.c: hacking
1320 * dbus/dbus-message.c (dbus_message_service_is): new function
1321 (dbus_message_sender_is): new
1323 2003-03-19 Havoc Pennington <hp@redhat.com>
1325 * bus/policy.c: start sketching code for policy restrictions on
1326 what connections can do.
1328 2003-03-18 Havoc Pennington <hp@redhat.com>
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.
1333 * doc/config-file.txt: some notes on how config file might look
1335 2003-03-18 Anders Carlsson <andersca@codefactory.se>
1341 2003-03-17 Havoc Pennington <hp@redhat.com>
1343 * dbus/dbus-internals.h: add gcc attributes so that
1344 our printf-style functions warn on bad arguments to
1347 * dbus/dbus-sysdeps.c (_dbus_connect_tcp_socket): fix printf
1350 * dbus/dbus-message.c (_dbus_message_loader_queue_messages): fix
1353 2003-03-17 Havoc Pennington <hp@redhat.com>
1355 * bus/test-main.c (main): make it print something as it runs
1356 so make check doesn't look stuck
1358 * doc/negotiation.txt, doc/dbus-sasl-profile.txt: remove
1359 from CVS, now obsolete
1361 2003-03-17 Anders Carlsson <andersca@codefactory.se>
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.
1367 * dbus/dbus-sysdeps.c: (_dbus_accept):
1368 Add address and address length variables and use them to stop
1369 valgrind from complaining.
1371 2003-03-17 Havoc Pennington <hp@pobox.com>
1373 All tests pass, no memleaks, no valgrind complaints.
1375 * bus/test.c: refcount handler_slot
1377 * bus/connection.c (bus_connections_new): refcount
1378 connection_data_slot
1380 * dbus/dbus-auth-script.c (_dbus_auth_script_run): delete unused
1381 bytes so that auth scripts pass.
1383 * bus/dispatch.c: init message_handler_slot so it gets allocated
1386 * bus/dispatch.c (message_handler_slot_ref): fix memleak
1388 * dbus/dbus-server-debug-pipe.c (_dbus_server_debug_pipe_new):
1389 dealloc server_pipe_hash when no longer used for benefit of
1392 * dbus/dbus-auth.c (process_command): memleak fix
1394 * bus/dispatch.c (check_hello_message): memleak fix
1396 2003-03-16 Havoc Pennington <hp@pobox.com>
1398 * dbus/dbus-bus.c (ensure_bus_data): fix double-unref of the data slot
1400 2003-03-17 Anders Carlsson <andersca@codefactory.se>
1402 * bus/activation.c (bus_activation_activate_service): Append
1403 the pending activation entry to the list of pending activations.
1405 2003-03-16 Havoc Pennington <hp@pobox.com>
1407 * bus/dispatch.c (bus_dispatch_test): remove double-unrefs of
1410 * dbus/dbus-address.c (create_entry): fix OOM handling when
1411 failing to alloc entry->method
1413 2003-03-16 Havoc Pennington <hp@pobox.com>
1415 * dbus/dbus-watch.c (_dbus_watch_new): handle failure to malloc
1418 * dbus/dbus-server-debug-pipe.c (_dbus_transport_debug_pipe_new):
1419 add some missing dbus_set_result
1421 * bus/dispatch.c (bus_dispatch_add_connection): handle failure to
1422 alloc the DBusMessageHandler
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.
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
1432 * bus/*.c: adapt to handle OOM for watches/timeouts
1434 * dbus/dbus-transport-unix.c: port to handle OOM during
1437 * dbus/dbus-auth.c (_dbus_auth_get_unused_bytes): return a
1438 reference to unused bytes instead of a copy
1440 * dbus/dbus-server.c (dbus_server_handle_watch): return FALSE for
1443 * dbus/dbus-connection.c (dbus_connection_handle_watch): return
1446 * dbus/dbus-timeout.c (dbus_timeout_handle): return FALSE for out
1449 2003-03-16 Anders Carlsson <andersca@codefactory.se>
1451 * doc/dbus-specification.sgml:
1452 Document reply message for ActivateService.
1454 2003-03-16 Anders Carlsson <andersca@codefactory.se>
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):
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):
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.
1474 2003-03-16 Havoc Pennington <hp@pobox.com>
1476 * dbus/dbus-bus.c (ensure_bus_data): handle failure to set
1479 * dbus/dbus-memory.c (_dbus_initialize_malloc_debug): support
1480 DBUS_MALLOC_BACKTRACES to print trace when failing an alloc
1482 2003-03-16 Havoc Pennington <hp@pobox.com>
1484 * dbus/dbus-string.c (_dbus_string_validate_utf8): oops, unbreak
1485 this. always run the test suite before commit...
1487 * bus/*: adapt to DBusConnection API changes
1489 * glib/dbus-gmain.c: adapt to DBusConnection API changes,
1490 requires renaming stuff to avoid dbus_connection_dispatch name
1493 * dbus/dbus-transport.c (_dbus_transport_queue_messages): new
1496 * dbus/dbus-message.c (_dbus_message_loader_queue_messages):
1497 separate from _dbus_message_loader_return_buffer()
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
1507 2003-03-16 Havoc Pennington <hp@pobox.com>
1509 * dbus/dbus-string.c (_dbus_string_validate_utf8): copy in a real
1512 2003-03-16 Anders Carlsson <andersca@codefactory.se>
1514 * dbus/dbus-connection.c:
1515 (dbus_connection_send_with_reply_and_block):
1516 Decrease connection->n_incoming when removing an entry
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.
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.
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.
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
1551 * test/data/valid-messages/emptiness.message:
1552 New test message with lots of empty arrays.
1554 2003-03-16 Havoc Pennington <hp@pobox.com>
1556 * dbus/dbus-connection.c
1557 (_dbus_connection_queue_received_message_link): new function that
1558 can't fail due to OOM
1560 * dbus/dbus-message.c (_dbus_message_loader_pop_message_link):
1561 new function pops a message together with a list link
1564 * dbus/dbus-transport-unix.c (queue_messages): use new link-based
1565 message queuing functions to avoid needing to alloc memory
1567 2003-03-16 Havoc Pennington <hp@pobox.com>
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.
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).
1582 * dbus/dbus-list.c (_dbus_list_pop_first_link): new function
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.
1589 * dbus/dbus-internals.c: move the malloc debug stuff to
1592 * dbus/dbus-list.c (free_link): free list mempool if it becomes
1595 * dbus/dbus-memory.c (_dbus_disable_mem_pools): new function
1597 * dbus/dbus-address.c (dbus_parse_address): free list nodes
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.
1604 * dbus/dbus-server-debug-pipe.c (debug_finalize): free server name
1606 * bus/bus.c (new_connection_callback): disconnect in here if
1607 bus_connections_setup_connection fails.
1609 * bus/connection.c (bus_connections_unref): fix to free the
1611 (bus_connections_setup_connection): if this fails, don't
1612 disconnect the connection, just be sure there are no side
1615 * dbus/dbus-string.c (undo_alignment): unbreak this
1617 * dbus/dbus-auth.c (_dbus_auth_unref): free some stuff we were
1619 (_dbus_auth_new): fix the order in which we free strings
1622 * bus/connection.c (bus_connection_disconnected): fix to
1623 not send ServiceDeleted multiple times in case of memory
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
1631 (dbus_bus_register_client): rename dbus_bus_register()
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
1637 2003-03-15 Havoc Pennington <hp@pobox.com>
1639 Make it pass the Hello handling test including all OOM codepaths.
1640 Now to do other messages...
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
1648 * bus/connection.c (bus_connection_preallocate_oom_error): set
1649 error flag on the OOM error.
1651 * dbus/dbus-connection.c (_dbus_connection_new_for_transport):
1652 handle _dbus_transport_set_connection failure
1654 * dbus/dbus-transport-unix.c (_dbus_transport_new_for_fd): modify
1655 to create watches up front and simply enable/disable them as
1657 (unix_connection_set): this can now fail on OOM
1659 * dbus/dbus-timeout.c, dbus/dbus-watch.c: add concept
1660 of enabling/disabling a watch or timeout.
1662 * bus/loop.c (bus_loop_iterate): don't touch disabled
1665 * glib/dbus-gmain.c: adapt to enable/disable watches and timeouts
1667 2003-03-15 Havoc Pennington <hp@pobox.com>
1669 * bus/dispatch.c (bus_dispatch_test): OK, now finally actually
1670 write useful test code, after all that futzing around ;-)
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.
1679 * dbus/Makefile.am (libdbus_convenience_la_SOURCES): move
1680 dbus-memory.c to the convenience lib
1682 * bus/test.c: rename some static functions to keep them clearly
1683 distinct from stuff in connection.c. Handle client disconnection.
1685 2003-03-14 Havoc Pennington <hp@pobox.com>
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.
1691 * bus/test.c (bus_setup_debug_client): function to set up debug
1692 "clients" on the main loop
1694 * dbus/dbus-transport.c (_dbus_transport_open): add debug-pipe
1697 * dbus/dbus-server.c (dbus_server_listen): add debug-pipe
1700 * dbus/dbus-server-debug.c: support a debug server based on pipes
1702 * dbus/dbus-sysdeps.c (_dbus_full_duplex_pipe): new function
1703 (_dbus_close): new function
1705 * configure.in: check for socketpair
1707 2003-03-14 Havoc Pennington <hp@redhat.com>
1709 * dbus/dbus-memory.c: add a "detect buffer overwrites on free"
1712 * dbus/dbus-transport-debug.c: rework this a good bit to be
1713 less complicated. hopefully still works.
1715 * dbus/dbus-server-debug.c (handle_new_client): remove timeout
1718 * glib/dbus-gmain.c (timeout_handler): don't remove timeout
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
1725 * bus/dispatch.c (bus_dispatch_test): add some more test code,
1726 not quite passing yet
1728 2003-03-14 Havoc Pennington <hp@pobox.com>
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)
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?)
1739 * dbus/dbus-transport-debug.c (DEFAULT_INTERVAL): ditto
1741 2003-03-13 Havoc Pennington <hp@redhat.com>
1743 * dbus/dbus-timeout.c (_dbus_timeout_list_set_functions): handle
1746 * dbus/dbus-watch.c (_dbus_watch_list_set_functions): handle out
1749 * dbus/dbus-connection.h: Make AddWatchFunction and
1750 AddTimeoutFunction return a bool so they can fail on out-of-memory
1752 * bus/bus.c (bus_context_new): set up timeout handlers
1754 * bus/connection.c (bus_connections_setup_connection): set up
1757 * glib/dbus-gmain.c: adapt to the fact that set_functions stuff
1760 * bus/bus.c (bus_context_new): adapt to changes
1762 * bus/connection.c: adapt to changes
1764 * test/watch.c: adapt to DBusWatch changes
1766 * bus/dispatch.c (bus_dispatch_test): started adding this but
1769 2003-03-14 Anders Carlsson <andersca@codefactory.se>
1771 * bus/dispatch.c (send_service_nonexistent_error): Fix typo.
1773 2003-03-13 Havoc Pennington <hp@pobox.com>
1775 * bus/test.c, bus/test.h, bus/Makefile.am, bus/test-main.c:
1776 set up a test framework as for the library
1778 2003-03-12 Havoc Pennington <hp@pobox.com>
1780 Throughout: purge global variables, introduce BusActivation,
1781 BusConnections, BusRegistry, etc. objects instead.
1783 * bus/bus.h, bus/bus.c: introduce BusContext as a global
1786 * test/Makefile.am (TEST_BINARIES): disable bus-test for now,
1787 going to redo this a bit differently I think
1789 2003-03-12 Havoc Pennington <hp@redhat.com>
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.
1795 * dbus/dbus-list.c (_dbus_list_length_is_one): new function
1797 * dbus/dbus-connection.c
1798 (dbus_connection_send_with_reply_and_block): use DBusError
1800 * dbus/dbus-bus.c: adapt to API changes, make it use DBusError not
1803 * dbus/dbus-connection.c (dbus_connection_send): drop the result
1804 code here, as the only failure possible is OOM.
1806 * bus/connection.c (bus_connection_disconnect):
1807 rename bus_connection_disconnected as it's a notification only
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
1814 * bus/services.c (bus_services_list): NULL-terminate returned array
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
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
1829 * bus/connection.c (bus_connection_foreach): allow stopping
1830 iteration by returning FALSE from foreach function.
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)
1839 * dbus/dbus-errors.c (dbus_error_free): make this reinit the error
1841 * dbus/dbus-sysdeps.c (_dbus_exit): new function
1843 * bus/activation.c: handle/return errors
1845 * dbus/dbus-errors.h: add more DBUS_ERROR #define
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
1851 2003-03-10 Anders Carlsson <andersca@codefactory.se>
1853 * dbus/dbus-marshal.c:
1854 (_dbus_marshal_set_string):
1855 Take a length argument so we can marshal the correct string
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.
1864 * dbus/dbus-message-builder.c: (_dbus_message_data_load):
1865 Add support for TYPE DICT.
1867 * dbus/dbus-message.c: (set_string_field):
1868 Adjust header padding.
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.
1877 * dbus/dbus-protocol.h:
1883 * doc/dbus-specification.sgml:
1884 Add information about how dicts are marshalled.
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.
1892 2003-03-08 Anders Carlsson <andersca@codefactory.se>
1894 * dbus/dbus-dict.h: Add DBUS_END_DECLS.
1896 2003-03-07 Anders Carlsson <andersca@codefactory.se>
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):
1907 Fix according to comments from Havoc.
1909 2003-03-06 Michael Meeks <michael@server.home>
1911 * configure.in: if we don't have kde-config, disable have_qt.
1913 2003-03-07 Anders Carlsson <andersca@codefactory.se>
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):
1933 Add DBusDict implementation
1935 * dbus/dbus-test.c: (dbus_internal_do_not_use_run_tests):
1939 2003-03-04 Havoc Pennington <hp@pobox.com>
1941 * test/data/auth/*: adapt to changes
1943 * dbus/dbus-auth-script.c (_dbus_auth_script_run): add
1944 USERID_BASE64 and change USERNAME_BASE64 to put in username not
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
1951 * dbus/dbus-errors.c (dbus_error_has_name): new function
1952 (dbus_error_is_set): new function
1954 * dbus/dbus-auth.c: replace DBUS_STUPID_TEST_MECH auth
1955 with DBUS_COOKIE_SHA1, implement DBUS_COOKIE_SHA1
1957 * dbus/dbus-connection.c (dbus_connection_flush): also read
1958 messages during a flush operation
1960 * dbus/Makefile.am: remove dbus-md5 since it isn't currently used.
1962 2003-03-05 Anders Carlsson <andersca@codefactory.se>
1964 * configure.in: Check for gethostbyname on Solaris.
1966 * dbus/dbus-transport.c: (_dbus_transport_open):
1967 Remove duplicate "tcp" entry.
1969 * doc/dbus-specification.sgml:
1970 Clarify some things.
1972 2003-03-05 Anders Carlsson <andersca@codefactory.se>
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):
1981 2003-03-05 Anders Carlsson <andersca@codefactory.se>
1983 * README: Add some things.
1985 2003-03-04 Anders Carlsson <andersca@codefactory.se>
1987 * dbus/dbus-message.c (dbus_message_append_args_valist): Add a break;
1988 after case DBUS_TYPE_BOOELAN.
1990 2003-03-02 Havoc Pennington <hp@pobox.com>
1992 * test/break-loader.c (randomly_set_extreme_ints): add test that
1993 sets really huge and small integers
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.
1999 * dbus/dbus-message-builder.c (_dbus_message_data_load): add
2000 optional value to "ALIGN" command which is what to fill the
2003 * test/data/valid-messages/no-padding.message: add regression
2004 test for the message padding problem
2006 2003-03-02 Havoc Pennington <hp@pobox.com>
2008 * dbus/dbus-message.c (decode_header_data): fix to always init
2009 message_padding, from Benjamin Dauvergne
2011 2003-03-02 Havoc Pennington <hp@pobox.com>
2017 2003-03-01 Joe Shaw <joe@assbarn.com>
2019 * configure.in: Check for "struct cmsgcred" and try to access its
2020 members for BSD-like unices.
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.
2028 2003-02-27 Alexander Larsson <alexl@redhat.com>
2032 Make gthreads-2.0 dependency optional. Don't build thread test if
2035 2003-02-27 Havoc Pennington <hp@pobox.com>
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 ;-)
2042 * dbus/dbus-message.c (struct DBusMessage): cache reply serial
2043 and client serial instead of demarshaling them every time
2045 2003-02-27 Havoc Pennington <hp@pobox.com>
2047 * dbus/dbus-marshal.c (_dbus_demarshal_int32): rewrite to be much
2048 more inlined, using dbus-string-private.h, speeds things up
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
2056 2003-02-26 Havoc Pennington <hp@redhat.com>
2058 All kinds of audit fixes from Owen, plus initial attempt to
2059 handle unaligned memory returned from malloc.
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
2090 2003-02-26 Havoc Pennington <hp@redhat.com>
2092 * dbus/dbus-marshal.c (_dbus_marshal_test): fix to work with DISABLE_ASSERTS
2094 2003-02-26 Alexander Larsson <alexl@redhat.com>
2097 Set DBUS_GLIB_THREADS_LIBS for apps using gthread-2.0
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.
2106 * dbus/dbus-dataslot.c:
2107 Threadsafe usage of DBusDataSlotAllocator
2109 * dbus/dbus-message.c: (dbus_message_get_args_iter):
2112 * dbus/dbus-server-unix.c:
2115 * glib/dbus-gmain.c:
2116 Implement the new wakeup functions for glib.
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.
2124 2003-02-26 Havoc Pennington <hp@pobox.com>
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
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
2134 * dbus/dbus-message.c (dbus_message_new_reply): allow replies to
2135 a NULL sender for peer-to-peer case
2137 * dbus/dbus-transport-unix.c (check_read_watch): handle
2138 !authenticated case correctly
2140 * glib/dbus-gmain.c: add support for DBusServer
2142 * dbus/dbus-server.c: add data slot support
2144 * glib/dbus-gmain.c (dbus_connection_setup_with_g_main): check
2145 return values and handle errors
2147 * dbus/dbus-dataslot.c: factor out the data slot stuff from
2150 * Doxyfile.in (INPUT): add glib subdir
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
2155 2003-02-24 Anders Carlsson <andersca@codefactory.se>
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.
2166 * test/data/invalid-messages/bad-boolean-array.message:
2167 * test/data/invalid-messages/bad-boolean.message:
2168 Add invalid boolean value test cases.
2170 2003-02-24 Anders Carlsson <andersca@codefactory.se>
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.
2188 2003-02-23 Havoc Pennington <hp@pobox.com>
2190 * dbus/dbus-keyring.c: finish most of this implementation and
2193 * dbus/dbus-errors.c (dbus_set_error_const, dbus_set_error): make
2194 these barf if the error isn't cleared to NULL
2196 * dbus/dbus-sysdeps.c (_dbus_delete_file): set error on failure
2197 (_dbus_create_directory): new function
2199 * dbus/dbus-errors.c (dbus_set_error): fix warning
2201 * dbus/dbus-string.c (_dbus_string_hex_encode): new function
2202 (_dbus_string_hex_decode): new function
2203 (test_hex_roundtrip): test code
2205 * dbus/dbus-sha.c (_dbus_sha_compute): use dbus_string_hex_encode
2207 * dbus/dbus-md5.c (_dbus_md5_compute): use dbus_string_hex_encode
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
2213 2003-02-22 Havoc Pennington <hp@pobox.com>
2215 * test/Makefile.am (dist-hook): fix dist for test/data/sha-1
2217 2003-02-22 Havoc Pennington <hp@pobox.com>
2219 * dbus/dbus-message.c (dbus_message_iter_get_string_array):
2220 (dbus_message_iter_get_byte_array): Fix up doxygen warnings
2222 * dbus/dbus-sha.c: add implementation of SHA-1 algorithm
2224 * dbus/test/data/sha-1: add US government test suite for SHA-1
2226 2003-02-21 Anders Carlsson <andersca@codefactory.se>
2228 * dbus/dbus-marshal.c: (_dbus_demarshal_string_array):
2229 Make string arrays NULL-terminated.
2231 * dbus/dbus-memory.c: (dbus_free_string_array):
2232 * dbus/dbus-memory.h:
2233 New function for freeing NULL-terminated string arrays.
2235 * dbus/dbus-message-builder.c: (append_quoted_string),
2236 (_dbus_message_data_load):
2237 Add support for array types.
2239 * dbus/dbus-message.c: (check_message_handling):
2240 Add more types as test cases.
2242 * dbus/dbus-sysdeps.c: (_dbus_string_parse_int),
2243 (_dbus_string_parse_double):
2244 Add the start offset to the end offset.
2246 * test/data/valid-messages/lots-of-arguments.message:
2247 New test message with lots of arguments.
2249 2003-02-21 Anders Carlsson <andersca@codefactory.se>
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.
2261 2003-02-21 Anders Carlsson <andersca@codefactory.se>
2263 * dbus/dbus-message.c: (dbus_message_append_nil):
2266 2003-02-21 Anders Carlsson <andersca@codefactory.se>
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):
2280 * dbus/dbus-message.h:
2281 Add functions for appending and getting arrays.
2283 2003-02-21 Anders Carlsson <andersca@codefactory.se>
2285 * dbus/dbus-mempool.c (_dbus_mem_pool_new): Make the
2286 element size at least 8 bytes, fixes mempool tests on
2289 2003-02-20 Alexander Larsson <alexl@redhat.com>
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.
2295 * dbus/dbus-connection-internal.h:
2296 * dbus/dbus-connection.c:
2297 Add _dbus_connection_lock and _dbus_connection_unlock.
2299 2003-02-19 Havoc Pennington <hp@pobox.com>
2301 * Doxyfile.in (PREDEFINED): put DOXYGEN_SHOULD_SKIP_THIS in
2302 Doxyfile.in, not Doxyfile
2304 * dbus/dbus-keyring.c: do some hacking on this
2306 * dbus/dbus-sysdeps.c (_dbus_delete_file): new
2308 * dbus/dbus-errors.c (dbus_set_error_const): do not call
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
2314 * dbus/dbus-sysdeps.c (_dbus_create_file_exclusively): new
2316 * dbus/dbus-errors.h (DBUS_ERROR_FAILED): add
2318 * dbus/dbus-sysdeps.c (get_user_info): break this function out to
2319 get various bits of user information based on either username
2321 (_dbus_homedir_from_username): new function
2323 2003-02-19 Anders Carlsson <andersca@codefactory.se>
2326 Add check for nonposix getpwnam_r
2328 * dbus/dbus-mempool.c: (_dbus_mem_pool_new):
2329 Align the pool element size to a sizeof (void *) boundary.
2331 * dbus/dbus-sysdeps.c: (_dbus_setenv), (_dbus_connect_unix_socket),
2332 (_dbus_listen_unix_socket), (_dbus_credentials_from_username):
2333 General Solaris fixes.
2335 * test/data/valid-messages/simplest-manual.message:
2336 Explicitly state that we want little-endian packing.
2338 2003-02-19 Mikael Hallendal <micke@codefactory.se>
2340 * dbus/dbus-server.c (dbus_server_listen): Support tcp: addresses.
2342 * dbus/dbus-transport-unix.c (_dbus_transport_new_for_tcp_socket):
2343 Added to create a transport connecting using a tcp/ip socket.
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
2350 * dbus/dbus-server.c (dbus_server_listen): Support tcp: addresses.
2352 * dbus/dbus-server-unix.c (_dbus_server_new_for_tcp_socket):
2353 Added to create a server listening on a TCP/IP socket.
2355 2003-02-19 Havoc Pennington <hp@pobox.com>
2357 Throughout: mop up all the Doxygen warnings and undocumented
2360 * dbus/dbus-sysdeps.c (do_exec): do not use execvp, we don't want
2361 to search any paths.
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
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
2374 2003-02-18 Havoc Pennington <hp@pobox.com>
2376 * dbus/dbus-string.c (_dbus_string_zero): new function
2378 * dbus/dbus-md5.c: include MD5 implementation by L. Peter Deutsch,
2379 wrap it in some dbus-friendly API
2381 * dbus/dbus-types.h: add 16-bit types
2383 2003-02-18 Joe Shaw <joe@assbarn.com>
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.
2390 * dbus/dbus-hash.c (_dbus_hash_test): Don't try to allocate the
2391 keys on the stack... it's 640k of data.
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
2396 (_dbus_poll): Implement poll() using select() for systems which
2399 * glib/test-dbus-glib.c (main): Print out an error if no
2400 parameters are given.
2402 * test/data/auth/fallback.auth-script: Added. Tests that a client
2403 can fallback to a secondary auth mechanism if the first fails.
2405 2003-02-18 Havoc Pennington <hp@pobox.com>
2409 2003-02-17 Havoc Pennington <hp@pobox.com>
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"
2417 2003-02-17 Anders Carlsson <andersca@codefactory.se.>
2423 2003-02-17 Anders Carlsson <andersca@codefactory.se>
2425 * doc/dbus-specification.sgml:
2426 Specification updates.
2428 2003-02-17 Anders Carlsson <andersca@codefactory.se>
2430 * bus/activation.c: (bus_activation_init), (child_setup),
2431 (bus_activation_activate_service):
2433 * bus/main.c: (main):
2434 Set DBUS_ADDRESS environment variable.
2436 * dbus/dbus-errors.c: (dbus_set_error):
2437 Don't use va_copy since that's a C99 feature.
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.
2444 * doc/dbus-specification.sgml:
2445 Update specification.
2447 * test/spawn-test.c: (setup_func), (main):
2450 2003-02-17 Alexander Larsson <alexl@redhat.com>
2452 * dbus/dbus-connection.c (_dbus_connection_handler_destroyed_locked):
2455 2003-02-17 Anders Carlsson <andersca@codefactory.se>
2459 * doc/dbus-test-plan.sgml:
2460 Add test plan document.
2465 2003-02-17 Anders Carlsson <andersca@codefactory.se>
2467 * dbus/dbus-message.c: (decode_header_data),
2468 (_dbus_message_loader_return_buffer):
2469 Set the header padding amount when loading a message.
2471 2003-02-16 Anders Carlsson <andersca@codefactory.se>
2473 * bus/dispatch.c: (send_one_message):
2474 Only send broadcast messages to registered connections.
2476 * dbus/dbus-message.c: (dbus_message_name_is):
2477 * dbus/dbus-message.h:
2478 New convenience function.
2480 * dbus/dbus-transport-debug.c: (do_reading):
2481 Only dispatch one message per run.
2484 * test/bus-test.c: (new_connection_callback), (die),
2485 (test_hello_client1_handler), (test_hello_client2_handler),
2486 (test_hello_replies), (main):
2488 * test/bus-test-loop.[ch]:
2491 2003-02-16 Havoc Pennington <hp@pobox.com>
2493 * dbus/dbus-connection.c (dbus_connection_dispatch_message): fix
2494 backward conditional
2496 2003-02-16 Alexander Larsson <alexl@redhat.com>
2498 * dbus/dbus-connection.c:
2499 Implement sent_message_with_reply. (with_reply_and block is still
2501 Made dispatch_message not lose message if OOM.
2503 * dbus/dbus-errors.h:
2504 Add NoReply error (for reply timeouts).
2506 2003-02-16 Alexander Larsson <alexl@redhat.com>
2508 * dbus/dbus-hash.c (_dbus_hash_table_unref):
2509 Actually free keys and values when destroying hashtable.
2511 2003-02-16 Anders Carlsson <andersca@codefactory.se>
2513 * dbus/dbus-auth.c: (client_try_next_mechanism):
2516 * dbus/dbus-threads.c: (dbus_condvar_wait_timeout):
2517 Return TRUE if there's no thread implementation around.
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.
2523 2003-02-16 Anders Carlsson <andersca@codefactory.se>
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
2530 2003-02-16 Anders Carlsson <andersca@codefactory.se>
2532 * bus/activation.c: (load_directory), (bus_activation_init),
2533 (bus_activation_activate_service):
2536 (bus_driver_handle_activate_service), (bus_driver_handle_message):
2537 More work on the activation handling.
2539 * dbus/dbus-errors.h:
2540 Add some error messages
2542 * dbus/dbus-message.c: (dbus_message_new_error_reply):
2543 * dbus/dbus-message.h:
2544 New function that creates an error message.
2546 * dbus/dbus-protocol.h:
2547 Add ACTIVATE_SERVER message.
2549 * dbus/dbus-server-unix.c: (unix_handle_watch),
2550 (_dbus_server_new_for_domain_socket):
2551 Call _dbus_fd_set_close_on_exec.
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.
2560 * dbus/dbus-transport-unix.c:
2561 (_dbus_transport_new_for_domain_socket):
2562 Call _dbus_fd_set_close_on_exec.
2564 2003-02-16 Havoc Pennington <hp@pobox.com>
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
2571 2003-02-15 Anders Carlsson <andersca@codefactory.se>
2573 * dbus/dbus-list.c: (_dbus_list_append_link),
2574 (_dbus_list_prepend_link):
2575 * dbus/dbus-memory.c: (dbus_malloc), (dbus_malloc0),
2579 2003-02-15 Anders Carlsson <andersca@codefactory.se>
2582 * bus/activation.c: (bus_activation_entry_free),
2583 (add_desktop_file_entry), (load_directory), (bus_activation_init):
2585 * bus/main.c: (main):
2586 Add simple activation support, doesn't work yet though.
2588 2003-02-15 Zack Rusin <zack@kde.org>
2590 * qt/dbus-qthread.cpp: small casting fix
2592 2003-02-15 Anders Carlsson <andersca@codefactory.se>
2594 * dbus/dbus-errors.c: (dbus_set_error):
2595 * dbus/dbus-errors.h:
2596 Add a few errors and make dbus_set_error void.
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.
2604 * test/spawn-test.c: (main):
2605 Test for _dbus_spawn_async.
2607 2003-02-15 Anders Carlsson <andersca@codefactory.se>
2609 * dbus/dbus-internals.h:
2610 Fix build without tests.
2612 * dbus/dbus-list.c: (alloc_link):
2613 Fix a segfault when a malloc fails.
2615 * dbus/dbus-memory.c: (initialize_malloc_debug), (dbus_malloc),
2616 (dbus_malloc0), (dbus_realloc):
2617 Add support for malloc debugging.
2619 2003-02-15 Alexander Larsson <alexl@redhat.com>
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.
2626 * glib/dbus-gthread.c:
2627 * qt/dbus-qthread.cpp:
2628 Update with the thread api changes.
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
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.
2643 * dbus/dbus-protocol.h:
2644 Add DBUS_MESSAGE_LOCAL_DISCONNECT define
2646 * dbus/dbus-message.c:
2647 Make ref/unref atomic.
2650 * dbus/dbus-connection-internal.h:
2651 * dbus/dbus-connection.c:
2652 * dbus/dbus-connection.h:
2654 Change _peek to _borrow,_return & _steal_borrowed.
2655 Change disconnect callback to event.
2656 Make dbus_connection_dispatch_messages reentrant.
2658 * dbus/dbus-transport.c:
2659 Don't ref the connection on calls to the transport
2662 * dbus/dbus-message-handler.c:
2665 * glib/dbus-gmain.c:
2666 Don't use peek_message anymore
2669 * test/debug-thread.c:
2670 * test/debug-thread.h:
2671 Simple thread implementation that asserts() on deadlocks in
2672 single-threaded code.
2675 (main) Call debug_threads_init.
2678 Use disconnect message instead of disconnect callback.
2682 Don't call dbus_connection_set_disconnect_function. Instead export
2683 bus_connection_disconnect.
2686 Call bus_connection_disconnect when we get a disconnected message.
2688 2003-02-15 Havoc Pennington <hp@pobox.com>
2690 * dbus/dbus-message.c (dbus_message_new): fool around with the
2693 2003-02-14 Havoc Pennington <hp@pobox.com>
2695 * dbus/dbus-mempool.c: fail if the debug functions so indicate
2697 * dbus/dbus-memory.c: fail if the debug functions indicate we
2700 * dbus/dbus-internals.c (_dbus_set_fail_alloc_counter)
2701 (_dbus_decrement_fail_alloc_counter): debug functions to
2702 simulate memory allocation failures
2704 2003-02-14 Havoc Pennington <hp@pobox.com>
2706 * dbus/dbus-errors.h (struct DBusError): add a word of padding
2709 2003-02-13 Anders Carlsson <andersca@codefactory.se>
2711 * bus/driver.c: (bus_driver_handle_hello):
2713 * bus/services.c: (bus_service_lookup):
2714 Reorder message sending so we get a more sane order.
2716 * test/bus-test.c: (message_handler):
2719 2003-02-13 Anders Carlsson <andersca@codefactory.se>
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.
2744 * glib/test-dbus-glib.c: (main):
2745 Remove append_fields from hello message.
2747 2003-02-13 Anders Carlsson <andersca@codefactory.se>
2749 * dbus/dbus-errors.c:
2750 * dbus/dbus-message.c:
2751 * dbus/dbus-string.c:
2752 Documentation fixes.
2754 2003-02-13 Anders Carlsson <andersca@codefactory.se>
2756 * glib/dbus-gmain.c: (timeout_handler), (add_timeout),
2758 Implement support for timeouts in dbus-glib.
2760 2003-02-13 Anders Carlsson <andersca@codefactory.se>
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.
2767 2003-02-13 Richard Hult <rhult@codefactory.se>
2769 * bus/main.c: Fix build.
2771 * dbus/dbus-errors.h:
2772 * dbus/dbus-errors.c: Fix copyright for Anders.
2774 2003-02-13 Anders Carlsson <andersca@codefactory.se>
2779 * bus/connection.c: (bus_connection_foreach):
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.
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):
2800 Use BUS_HANDLE_OOM instead of _DBUS_HANDLE_OOM.
2802 * bus/utils.c: (bus_wait_for_memory):
2804 New files with general utility functions.
2806 * dbus/dbus-internals.h:
2807 Remove _DBUS_HANDLE_OOM.
2809 2003-02-13 Anders Carlsson <andersca@codefactory.se>
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.
2816 2003-02-13 Anders Carlsson <andersca@codefactory.se>
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.
2824 2003-02-13 Anders Carlsson <andersca@codefactory.se>
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.
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
2837 2003-02-13 Anders Carlsson <andersca@codefactory.se>
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.
2846 2003-02-13 Havoc Pennington <hp@pobox.com>
2848 * test/data/auth/fail-after-n-attempts.auth-script: new test
2850 * dbus/dbus-auth.c (send_rejected): shutdown_mech() when we
2853 2003-02-13 Havoc Pennington <hp@pobox.com>
2855 * dbus/dbus-auth.c (handle_server_data_external_mech): args to
2856 dbus_credentials_match were backward
2858 * dbus/dbus-auth-script.c (_dbus_auth_script_run): support
2859 NO_CREDENTIALS and ROOT_CREDENTIALS
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.
2865 * test/data/auth/*: add more auth tests
2867 * dbus/dbus-auth-script.c (_dbus_auth_script_run): support EXPECT
2868 command to match exact string and EXPECT_UNUSED to match unused
2871 * test/Makefile.am (dist-hook): fix to dist all the test stuff
2873 2003-02-12 Havoc Pennington <hp@pobox.com>
2875 * dbus/dbus-string.c (_dbus_string_pop_line): fix to also strip
2876 \r off of popped lines
2878 * dbus/dbus-auth.c (_dbus_auth_test): write code to run auth
2881 * dbus/dbus-auth-script.c (_dbus_auth_script_run): when doing a
2884 2003-02-12 Havoc Pennington <hp@pobox.com>
2886 * dbus/Makefile.am: remove break-loader from the build, since it
2889 * configure.in: add --enable-gcov to turn on coverage profiling
2890 flags and disable optimization
2892 2003-02-10 Havoc Pennington <hp@pobox.com>
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. ;-)
2899 * dbus/dbus-server-debug.c (_dbus_server_debug_accept_transport):
2900 fix a memleak in error case
2902 2003-02-12 Anders Carlsson <andersca@codefactory.se>
2905 * bus/desktop-file.c:
2906 * bus/desktop-file.h:
2907 Add a desktop file parser.
2909 2003-02-11 Zack Rusin <zack@kde.org>
2911 * qt/message.[h|cpp]: sample implementation
2912 of the KDE wrapper for DBusMessage
2914 2003-02-09 Zack Rusin <zack@kde.org>
2916 * test/bus-test.c: make_it_compile
2917 * doc/dbus-specification.sgml: minimal semantic fix
2919 2003-02-06 Anders Carlsson <andersca@codefactory.se>
2925 2003-02-06 Anders Carlsson <andersca@codefactory.se>
2928 * dbus/dbus-break-loader.c:
2930 * test/break-loader.c:
2931 Move dbus-break-loader to test/ and rename it to break-loader.
2933 2003-02-02 Havoc Pennington <hp@pobox.com>
2935 * dbus/dbus-keyring.c, dbus/dbus-keyring.h: template files
2936 for code to manage cookies in your home directory
2938 * dbus/dbus-sysdeps.c (_dbus_generate_random_bytes): new function
2940 * dbus/dbus-auth.c (get_state): impose a maximum number of tries
2941 to authenticate, then disconnect the client.
2943 2003-02-03 Alexander Larsson <alexl@redhat.com>
2945 * dbus/dbus-message.c (dbus_message_append_fields):
2948 2003-02-02 Anders Carlsson <andersca@codefactory.se>
2950 * doc/dbus-specification.sgml:
2951 Update address format section.
2953 2003-02-02 Anders Carlsson <andersca@codefactory.se>
2956 * test/bus-test.c: (get_time), (add_timeout), (remove_timeout),
2957 (message_handler), (new_connection_callback), (loop_quit),
2961 2003-02-02 Anders Carlsson <andersca@codefactory.se>
2963 * bus/driver.c: (bus_driver_handle_service_exists):
2964 Simplify the code a bit.
2966 * dbus/dbus-bus.c: (dbus_bus_service_exists):
2969 2003-02-02 Anders Carlsson <andersca@codefactory.se>
2972 Add libdbus-daemon.la and link to it.
2974 2003-02-01 James Willcox <jwillcox@gnome.org>
2976 * bus/driver.c: (bus_driver_handle_own_service):
2977 Actually include the service reply code in the message.
2979 2003-02-02 Anders Carlsson <andersca@codefactory.se>
2981 * bus/driver.c: (bus_driver_handle_service_exists):
2982 Don't unref the incoming message.
2984 2003-02-02 Anders Carlsson <andersca@codefactory.se>
2986 * dbus/dbus.h: Add dbus-address.h and dbus-bus.h
2988 2003-02-02 Anders Carlsson <andersca@codefactory.se>
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.
2994 2003-02-02 Alexander Larsson <alexl@redhat.com>
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.
3000 * glib/dbus-gmain.c (add_watch):
3001 Always add IO_ERR | IO_HUP
3003 * dbus/dbus-message.h:
3004 Add semicolon after dbus_message_iter_get_string_array().
3005 Makes qt code build again
3007 2003-02-01 Anders Carlsson <andersca@codefactory.se>
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
3015 * dbus/dbus-bus.c: (dbus_bus_register_client),
3016 (dbus_bus_acquire_service), (dbus_bus_service_exists):
3018 Add new convenience functions for communicating with the bus.
3020 * dbus/dbus-message.h:
3022 * dbus/dbus-protocol.h:
3025 2003-02-01 Alexander Larsson <alexl@redhat.com>
3027 * dbus/dbus-message.c (dbus_message_append_fields):
3028 Add some more doc comments.
3030 2003-02-01 Havoc Pennington <hp@pobox.com>
3032 * dbus/dbus-break-loader.c (randomly_modify_length): change
3033 a 4-byte value in the message as if it were a length
3035 * dbus/dbus-sysdeps.c (_dbus_string_save_to_file): don't set
3036 execute bit on saved files
3038 2003-02-01 Havoc Pennington <hp@pobox.com>
3040 * dbus/dbus-break-loader.c (main): new program to find messages
3041 that break the loader.
3043 * dbus/dbus-sysdeps.c (_dbus_string_append_uint): new function
3044 * dbus/dbus-sysdeps.c (_dbus_string_save_to_file): new function
3046 * dbus/dbus-string.c (_dbus_string_set_byte): new
3048 2003-01-31 Havoc Pennington <hp@pobox.com>
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.
3054 2003-01-31 Havoc Pennington <hp@pobox.com>
3056 * doc/dbus-specification.sgml: work on the specification
3058 * dbus/dbus-message.c (_dbus_message_loader_return_buffer): check
3059 the protocol version of the message.
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
3066 * dbus/dbus-marshal.c (_dbus_marshal_get_arg_end_pos): add missing
3067 "break" for DBUS_TYPE_NIL, remove @todo
3069 2003-01-31 Havoc Pennington <hp@pobox.com>
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.
3075 2003-01-31 Anders Carlsson <andersca@codefactory.se>
3077 * dbus/dbus-address.c: (dbus_address_entry_free):
3078 Free key and value lists.
3080 * dbus/dbus-internals.c: (_dbus_type_to_string):
3081 Add the types we didn't have.
3083 * dbus/dbus-marshal.c: (_dbus_marshal_get_arg_end_pos),
3084 (_dbus_marshal_validate_arg):
3087 * dbus/dbus-message.c: (dbus_message_set_sender):
3088 Remove todo about being able to set sender to NULL.
3090 (dbus_message_set_is_error_reply),
3091 (dbus_message_get_is_error_reply):
3092 * dbus/dbus-message.h:
3095 * dbus/dbus-protocol.h:
3096 Add error reply flag.
3098 * test/data/valid-messages/opposite-endian.message:
3099 Add NIL type to test.
3101 2003-01-31 Havoc Pennington <hp@pobox.com>
3103 * doc/dbus-specification.sgml: fully specify the header. Add
3104 flags and major protocol version, and change header/body len to
3107 * dbus/dbus-message-builder.c (append_saved_length): append length
3110 * dbus/dbus-message.c (dbus_message_create_header): change header
3111 length and body length to unsigned. Add the new fields from the
3113 (_dbus_message_loader_return_buffer): unsigned header/body len
3115 2003-01-30 Havoc Pennington <hp@pobox.com>
3117 * dbus/dbus-auth.c: rework to use only REJECTED, no
3120 * doc/dbus-sasl-profile.txt: drop MECHANISMS and just
3121 use REJECTED, suggested by Mark McLoughlin
3123 2003-01-30 Havoc Pennington <hp@pobox.com>
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
3130 * dbus/dbus-address.c (dbus_address_entries_free): add @todo about
3132 (dbus_parse_address): add @todo about documenting address format,
3133 and allowing , and ; to be escaped
3135 2003-01-30 Anders Carlsson <andersca@codefactory.se>
3138 Add dbus-address.[ch]
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.
3147 * dbus/dbus-connection.c:
3148 Document timeout functions.
3150 * dbus/dbus-message.c:
3151 Document dbus_message_new_from_message.
3153 * dbus/dbus-server-debug.c:
3156 * dbus/dbus-server.c: (dbus_server_listen):
3157 Parse address and use correct server implementation.
3159 * dbus/dbus-string.c: (_dbus_string_find_to), (_dbus_string_test):
3160 * dbus/dbus-string.h:
3161 New function with test.
3163 * dbus/dbus-test.c: (dbus_internal_symbol_do_not_use_run_tests):
3167 * dbus/dbus-transport-debug.c:
3170 * dbus/dbus-transport.c: (_dbus_transport_open):
3171 Parse address and use correct transport implementation.
3173 2003-01-30 Havoc Pennington <hp@pobox.com>
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
3180 * dbus/dbus-marshal.h: make all the demarshalers take const
3181 DBusString arguments.
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
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
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.
3197 2003-01-29 Havoc Pennington <hp@pobox.com>
3199 * dbus/dbus-message.c (check_message_handling): fix assertion
3200 failure on set_client_serial
3202 2003-01-28 Havoc Pennington <hp@pobox.com>
3204 * dbus/dbus-server-debug.c: Add doc section comments
3206 * dbus/dbus-transport-debug.c: add doc section comments
3208 2003-01-28 Havoc Pennington <hp@redhat.com>
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.
3215 2003-01-28 Anders Carlsson <andersca@codefactory.se>
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.
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):
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.
3235 (dbus_server_listen):
3236 Add commented out call to dbus_server_debug_new.
3238 * dbus/dbus-timeout.c: (_dbus_timeout_new):
3239 Actually set the handler, doh.
3241 * dbus/dbus-transport.c: (_dbus_transport_open):
3242 Add commented out call to dbus_transport_debug_client_new.
3245 Add dbus-transport-debug.[ch] and dbus-server-debug.[ch]
3247 2003-01-28 Havoc Pennington <hp@pobox.com>
3249 * dbus/dbus-message.c (check_message_handling): function to check
3250 on the loaded message, iterates over it etc.
3252 2003-01-28 Havoc Pennington <hp@pobox.com>
3254 * test/Makefile.am (dist-hook): fix make distdir
3256 * dbus/Makefile.am (TESTS_ENVIRONMENT): fix make check
3258 2003-01-27 Havoc Pennington <hp@pobox.com>
3260 * dbus/dbus-mempool.c (time_for_size): replace printf with
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
3268 * test/Makefile.am (dist-hook): add dist-hook for .message files
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
3275 * dbus/dbus-sysdeps.c (_dbus_concat_dir_and_file): utility
3277 * dbus/dbus-test-main.c (main): take an argument which is the
3278 directory containing test data
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.
3284 2003-01-27 Anders Carlsson <andersca@codefactory.se>
3286 * bus/dispatch.c: (bus_dispatch_message_handler):
3287 Dispatch messages sent to services.
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.
3294 (bus_driver_send_welcome_message):
3295 Send HELLO_REPLY instead of WELCOME.
3297 (bus_driver_handle_list_services):
3298 Send LIST_SERVICES_REPLY instead of SERVICES.
3300 (bus_driver_handle_own_service),
3301 (bus_driver_handle_service_exists):
3302 New message handlers.
3304 (bus_driver_handle_message):
3305 Invoke new message handlers.
3307 (bus_driver_remove_connection):
3308 Don't remove any services here since that's done automatically
3309 by bus_service_remove_owner now.
3312 New function signatures.
3314 * bus/services.c: (bus_service_add_owner):
3315 Send ServiceAcquired message if we're the only primary owner.
3317 (bus_service_remove_owner):
3318 Send ServiceAcquired/ServiceLost messages.
3320 (bus_service_set_prohibit_replacement),
3321 (bus_service_get_prohibit_replacement):
3322 Functions for setting prohibit replacement.
3324 (bus_service_has_owner):
3325 New function that checks if a connection is in the owner queue of
3329 Add new function signatures.
3331 * dbus/dbus-list.c: (_dbus_list_test):
3332 Add tests for _dbus_list_remove_last and traversing the list backwards.
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.
3338 * dbus/dbus-protocol.h:
3339 Add new messages, service flags and service replies.
3341 2003-01-26 Havoc Pennington <hp@pobox.com>
3343 * dbus/dbus-message-builder.c: implement, completely untested.
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.
3349 * dbus/dbus-string.c (_dbus_string_starts_with_c_str): new
3351 2003-01-26 Havoc Pennington <hp@pobox.com>
3353 * dbus/dbus-sysdeps.c (_dbus_file_get_contents): new function
3355 * dbus/dbus-errors.c (dbus_result_to_string): add
3358 * dbus/dbus-message-builder.c: new file, will contain code to load
3359 up messages from files. Not implemented yet.
3361 2003-01-26 Havoc Pennington <hp@pobox.com>
3363 * dbus/dbus-message.c (dbus_message_set_sender): support deleting
3364 the sender by setting to NULL
3366 2003-01-26 Havoc Pennington <hp@pobox.com>
3368 The unit tests pass, but otherwise untested. If it breaks, the
3369 tests should have been better. ;-)
3371 * bus/driver.c (bus_driver_handle_hello): return if we disconnect
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.
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
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
3395 * dbus/dbus-string.c (_dbus_string_replace_len): new function
3397 2003-01-26 Anders Carlsson <andersca@codefactory.se>
3399 * bus/driver.c: (bus_driver_handle_hello),
3400 (bus_driver_send_welcome_message):
3403 2003-01-26 Anders Carlsson <andersca@codefactory.se>
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),
3412 (dbus_message_get_fields):
3413 Remove debugging printout.
3415 (_dbus_message_loader_return_buffer):
3416 Don't store the header string.
3418 (_dbus_message_test):
3421 2003-01-26 Richard Hult <rhult@codefactory.se>
3423 * glib/dbus-gmain.c (dbus_connection_dispatch): Traverse a copy of
3424 the file descriptor list, since it can change under us.
3426 2003-01-25 Anders Carlsson <andersca@codefactory.se>
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
3435 2003-01-25 Anders Carlsson <andersca@codefactory.se>
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):
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):
3450 Refactor code, put the message dispatching in its own file. Use
3451 _DBUS_HANDLE_OOM. Also send ServiceDeleted messages when a client
3454 2003-01-25 Anders Carlsson <andersca@codefactory.se>
3456 * dbus/dbus-internals.h:
3457 Add _DBUS_HANDLE_OOM macro, it doesn't do anything currently.
3459 * dbus/dbus-message.c: (dbus_message_get_sender):
3460 * dbus/dbus-message.h:
3461 Implement dbus_message_get_sender.
3463 * dbus/dbus-protocol.h:
3464 Add message and service defines.
3466 2003-01-25 Anders Carlsson <andersca@codefactory.se>
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.
3475 2003-01-24 Havoc Pennington <hp@pobox.com>
3477 * dbus/dbus-list.c (alloc_link): put a thread lock on the global
3480 * bus/driver.c (bus_driver_handle_list_services): fix a leak
3483 2003-01-25 Anders Carlsson <andersca@codefactory.se>
3485 * dbus/dbus-list.c: (alloc_link), (free_link):
3486 Use a memory pool for the links.
3488 2003-01-25 Anders Carlsson <andersca@codefactory.se>
3490 * bus/connection.c: (bus_connection_foreach):
3492 Add new bus_connection_foreach function.
3494 * bus/driver.c: (send_one_message), (bus_driver_broadcast_message):
3495 Add function that broadcasts a message to all clients.
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.
3503 * bus/services.c: (bus_services_list):
3505 Add new function that returns an array of strings with the currently
3506 registered services.
3509 * glib/dbus-gmain.c:
3510 Update copyright year.
3512 2003-01-25 Anders Carlsson <andersca@codefactory.se>
3514 * dbus/dbus-connection.c: (dbus_connection_send_message):
3515 Unlock the message in case it was sent earlier.
3517 (dbus_connection_send_message_with_reply_and_block):
3518 Remove the reply message from the list.
3520 * dbus/dbus-marshal.c: (_dbus_demarshal_string_array):
3521 Set array_len and new_pos correctly.
3523 (_dbus_marshal_test):
3524 Remove debug output.
3526 * dbus/dbus-message-internal.h:
3527 * dbus/dbus-message.c: (_dbus_message_get_reply_serial):
3528 New function that returns the reply serial.
3530 (_dbus_message_unlock):
3531 New function that unlocks a message and resets its header.
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.
3541 (dbus_message_set_sender):
3542 Make this function public since the bus daemon needs it.
3544 (decode_header_data):
3545 Set the reply serial to -1 initially.
3547 * dbus/dbus-message.h:
3548 Add dbus_message_set_sender.
3550 2003-01-24 Havoc Pennington <hp@pobox.com>
3552 * doc/dbus-specification.sgml: add some stuff
3554 2003-01-22 Havoc Pennington <hp@pobox.com>
3556 * doc/dbus-specification.sgml: Start to document the protocol.
3558 2003-01-22 Havoc Pennington <hp@pobox.com>
3560 * dbus/dbus-connection.c
3561 (dbus_connection_send_message_with_reply_and_block): add some @todo
3563 * bus/driver.c (bus_driver_add_connection): add a FIXME about memleak
3565 2003-01-21 Havoc Pennington <hp@pobox.com>
3567 (patch untested because can't compile)
3569 * bus/driver.c (create_unique_client_name): make this function
3570 never recycle client names. Also, caller should initialize
3573 * dbus/dbus-sysdeps.c (_dbus_get_current_time): new function
3575 2003-01-21 Anders Carlsson <andersca@codefactory.se>
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
3589 2003-01-21 Anders Carlsson <andersca@codefactory.se>
3594 * bus/connection.c: (connection_disconnect_handler):
3595 Remove the connection from the bus driver's list.
3597 (connection_watch_callback): Dispatch messages.
3599 (free_connection_data): Free connection name.
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.
3607 Add function headers.
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):
3615 * bus/services.c: (bus_service_free):
3617 New file that handles communication and registreation with the bus
3620 2003-01-21 Anders Carlsson <andersca@codefactory.se>
3622 * dbus/dbus-connection.c: (dbus_connection_send_message):
3623 Add a new client_serial parameter.
3625 (dbus_connection_send_message_with_reply):
3626 Remove a @todo since we've implemented the blocking function.
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.
3632 * dbus/dbus-connection.h:
3635 * dbus/dbus-errors.c: (dbus_result_to_string):
3636 * dbus/dbus-errors.h:
3637 Add new DBUS_RESULT.
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.
3648 * dbus/dbus-protocol.h:
3649 Add new DBUS_MESSAGE_TYPE_SENDER.
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.
3658 * test/echo-client.c: (main):
3659 * test/watch.c: (check_messages):
3660 Update for changed APIs
3662 2003-01-19 Anders Carlsson <andersca@codefactory.se>
3664 * dbus/Makefile.am: Add dbus-timeout.[cħ]
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
3671 * dbus/dbus-connection.h: Add public DBusTimeout API.
3673 * dbus/dbus-message.c: (dbus_message_get_service):
3674 * dbus/dbus-message.h: New function.
3676 * dbus/dbus-server.c: Fix small doc typo.
3678 * dbus/dbus-timeout.[ch]: New files for mainloop timeouts.
3680 2003-01-19 Anders Carlsson <andersca@codefactory.se>
3682 * dbus/dbus-string.c (_dbus_string_move_len): Don't delete all
3683 of the string, just as long as specified.
3685 2003-01-19 Havoc Pennington <hp@pobox.com>
3687 * dbus/dbus-connection.c (dbus_connection_get_is_authenticated):
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)
3695 2003-01-18 Havoc Pennington <hp@pobox.com>
3697 * dbus/dbus-transport-unix.c (unix_do_iteration): only do the
3698 reading/writing if read_watch != NULL or write_watch != NULL.
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.
3704 * dbus/dbus-transport-unix.c (check_write_watch): fix a mem leak
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
3713 * dbus/dbus-resources.c: new file implementing some of the
3714 resource limits stuff
3716 * dbus/dbus-message.c (dbus_message_iter_get_byte_array): add
3717 missing docs, add @todo to handle OOM etc.
3719 * dbus/dbus-marshal.c (_dbus_demarshal_byte_array): add missing
3722 2003-01-18 Havoc Pennington <hp@pobox.com>
3724 * dbus/dbus-connection.c (dbus_connection_unref): disconnect the
3725 connection if it hasn't been already.
3727 * dbus/dbus-connection.h: kill off the idea of an ErrorFunction,
3728 replace with DisconnectFunction.
3730 2003-01-18 Havoc Pennington <hp@pobox.com>
3732 Building --disable-verbose-mode --disable-asserts --disable-tests
3733 cuts the library from 112K to 45K or so
3735 * configure.in: check for varargs macro support,
3736 add --enable-verbose-mode, --enable-asserts.
3738 * dbus/dbus-internals.h (_dbus_assert): support
3740 (_dbus_verbose): support DBUS_ENABLE_VERBOSE_MODE
3742 2003-01-18 Havoc Pennington <hp@pobox.com>
3744 * dbus/dbus-test.c: include config.h so that tests actually run
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
3750 2003-01-18 Havoc Pennington <hp@pobox.com>
3752 * configure.in: default --enable-tests to $USE_MAINTAINER_MODE
3754 * dbus/Makefile.am: fix it up so dubs-test-main.c is included in
3757 * test/Makefile.am: don't use special variable "TESTS" for echo-*
3758 since we don't want to use those in make check
3760 2003-01-15 Havoc Pennington <hp@redhat.com>
3766 2003-01-15 Havoc Pennington <hp@redhat.com>
3768 * test/Makefile.am: fix so that test source code ends up in the
3769 distribution on make distcheck
3771 2003-01-15 Havoc Pennington <hp@redhat.com>
3777 2003-01-15 Havoc Pennington <hp@redhat.com>
3779 * dbus/dbus-test.c (dbus_internal_symbol_do_not_use_run_tests):
3780 fix build when --disable-tests
3782 * Makefile.am (EXTRA_DIST): put HACKING in here
3784 * HACKING: document procedure for making a tarball release.
3786 2003-01-14 Anders Carlsson <andersca@codefactory.se>
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.
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.
3802 2003-01-11 Havoc Pennington <hp@pobox.com>
3804 * configure.in: change --enable-test/--enable-ansi action-if-given
3805 to enable_foo=$enableval instead of enable_foo=yes
3807 2003-01-08 Havoc Pennington <hp@pobox.com>
3809 * dbus/dbus-string.c (_dbus_string_align_length): new function
3811 * dbus/dbus-test-main.c: move main() for test app here
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
3817 Code review nitpicks.
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
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.
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
3850 (_dbus_marshal_get_field_end_pos): add @todo about bad error
3851 handling allowing corrupt data to go unchecked
3853 2003-01-08 Havoc Pennington <hp@redhat.com>
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)
3859 * dbus/dbus.h: include dbus/dbus-protocol.h
3861 2003-01-08 Anders Carlsson <andersca@codefactory.se>
3863 * dbus/Makefile.am (dbusinclude_HEADERS): Install
3866 2003-01-08 Anders Carlsson <andersca@codefactory.se>
3868 * dbus/dbus-internals.c: (_dbus_type_to_string):
3869 New function that returns a string describing a type.
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.
3880 2003-01-07 Anders Carlsson <andersca@codefactory.se>
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):
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.
3917 2003-01-07 Anders Carlsson <andersca@codefactory.se>
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.
3926 2003-01-07 Anders Carlsson <andersca@codefactory.se>
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.
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.
3940 * dbus/dbus-protocol.h:
3941 Add the different types.
3943 2003-01-05 Havoc Pennington <hp@pobox.com>
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.
3949 * bus/services.c: implement a mapping from service names to lists
3952 * dbus/dbus-hash.c: add DBUS_HASH_POINTER
3954 * dbus/dbus-threads.c (dbus_static_mutex_lock): add functions
3955 to use static mutexes for global data
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.
3961 2003-01-04 Havoc Pennington <hp@pobox.com>
3963 * dbus/dbus-sysdeps.c (_dbus_sleep_milliseconds): new function
3964 (_dbus_poll): new function
3966 * dbus/dbus-internals.h (_DBUS_STRUCT_OFFSET): new macro
3969 * bus/loop.c: initial code for the daemon main loop
3971 2003-01-04 Havoc Pennington <hp@pobox.com>
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)
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)
3982 * configure.in: check for getpwnam_r
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
3988 * dbus/dbus-sysdeps.c (_dbus_read_credentials_unix_socket): new function
3989 (_dbus_send_credentials_unix_socket): new function
3991 * dbus/dbus-sysdeps.c (_dbus_accept_unix_socket): rename just
3993 (_dbus_write): only check errno if <0 returned
3994 (_dbus_write_two): ditto
3996 2003-01-02 Anders Carlsson <andersca@codefactory.se>
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.
4005 2002-12-28 Harri Porten <porten@kde.org>
4007 * configure.in: added check for C++ compiler and a very cheesy
4008 check for the Qt integration
4010 * Makefile.am (SUBDIRS): compile qt subdir if support is enabled
4012 * qt/Makefile.am: added
4014 * qt/.cvsignore: added
4016 * qt/dbus-qthread.cc, qt/dbus-qthread.cpp: renamed former to
4017 latter, added #ifdef QT_THREAD_SUPPORT guard.
4019 * dbus/Makefile.am: added missing headers for make dist
4021 2002-12-28 Kristian Rietveld <kris@gtk.org>
4023 * dbus/Makefile.am: fixup export-symbols-regex.
4025 2002-12-27 Anders Carlsson <andersca@codefactory.se>
4027 * acinclude.m4: Add this file and put the
4028 PKG_CHECK_MODULE macro in it.
4030 2002-12-27 Anders Carlsson <andersca@codefactory.se>
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
4040 2002-12-26 Havoc Pennington <hp@pobox.com>
4042 * dbus/dbus-auth.c: fixes fixes fixes
4044 * dbus/dbus-transport-unix.c: wire up support for
4045 encoding/decoding data on the wire
4047 * dbus/dbus-auth.c (_dbus_auth_encode_data)
4048 (_dbus_auth_decode_data): append to target string
4049 instead of nuking it.
4051 2002-12-26 Havoc Pennington <hp@pobox.com>
4053 * dbus/dbus-marshal.h (DBUS_COMPILER_BYTE_ORDER): #ifdef
4054 WORDS_BIGENDIAN then compiler byte order is DBUS_BIG_ENDIAN,
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
4061 (_dbus_verbose_bytes): new function
4063 * dbus/dbus-string.c (_dbus_string_validate_ascii): new function
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,
4070 * dbus/dbus-string.c (_dbus_string_skip_blank): fix this function
4071 (_dbus_string_test): enhance tests for copy/move and fix the
4074 * dbus/dbus-transport-unix.c: Hold references in more places to
4075 avoid reentrancy problems
4077 * dbus/dbus-transport.c: ditto
4079 * dbus/dbus-connection.c (dbus_connection_dispatch_message): don't
4080 leak reference count in no-message case
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.
4086 * dbus/dbus-transport-unix.c (do_authentication): perform
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
4094 * dbus/dbus-transport.c (_dbus_transport_init_base): create
4095 the auth conversation DBusAuth
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
4102 2002-12-03 Havoc Pennington <hp@pobox.com>
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
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.
4112 * dbus/dbus-transport-unix.c (unix_finalize): free the write_watch
4113 if necessary, and remove watches from the connection.
4115 * dbus/dbus-watch.c (_dbus_watch_list_free): improve a comment
4117 2002-12-26 Anders Carlsson <andersca@codefactory.se>
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.
4127 2002-12-25 Havoc Pennington <hp@pobox.com>
4129 * doc/dbus-sasl-profile.txt: docs on the authentication protocol,
4130 it is a simple protocol that just maps directly to SASL.
4132 * dbus/dbus-auth.h, dbus/dbus-auth.c: authentication protocol
4133 initial implementation, not actually used yet.
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
4140 2002-12-25 Anders Carlsson <andersca@codefactory.se>
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):
4151 Add un-optimized marshalling/demarshalling routines.
4153 2002-12-25 Harri Porten <porten@kde.org>
4155 * qt/dbus-qt.h: adjusted ctor and getter to KDE/Qt conventions
4157 2002-12-24 Zack Rusin <zack@kde.org>
4159 * qt/dbus-qthread.cc: adding - integrates QMutex into Dbus
4160 * qt/dbus-qt.h: skeleton with two sample implemenatation of the
4163 2002-12-24 Havoc Pennington <hp@pobox.com>
4165 * glib/dbus-gthread.c: fix include
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.
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.
4180 * dbus/dbus-list.c (_dbus_list_remove_last): new function
4182 * dbus/dbus-string.c (_dbus_string_test): free a string that
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.
4192 * dbus/dbus-mempool.h, dbus/dbus-mempool.c: memory pools
4194 * dbus/dbus-connection.c (dbus_connection_register_handler)
4195 (dbus_connection_unregister_handler): new functions
4197 * dbus/dbus-message.c (dbus_message_get_name): new
4199 * dbus/dbus-list.c: fix docs typo
4201 * dbus/dbus-message-handler.h, dbus/dbus-message-handler.c:
4202 an object representing a handler for messages.
4204 2002-12-16 Anders Carlsson <andersca@codefactory.se>
4207 * glib/dbus-gthread.c: (dbus_gthread_init):
4208 Don't use the gdbus prefix for public functions.
4210 2002-12-16 Anders Carlsson <andersca@codefactory.se>
4214 Add GLib checks and fixup .pc files
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):
4227 2002-12-15 Harri Porten <porten@kde.org>
4229 * autogen.sh: check for libtoolize before attempting to use it
4231 * dbus/dbus-transport-unix.c: include <sys/time.h> for timeval
4234 * .cvsignore: ignore more stamp files
4236 * dbus/dbus-watch.c (_dbus_watch_list_new): fixed doc error
4238 * test/Makefile.am: added -I$(top_srcdir) to be able to compile
4239 without make install.
4241 2002-12-15 Havoc Pennington <hp@pobox.com>
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.
4248 2002-12-12 Havoc Pennington <hp@pobox.com>
4250 * dbus/dbus-transport-unix.c, dbus/dbus-server-unix.c: use the
4251 below new interfaces and include fewer system headers.
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
4259 * dbus/dbus-message-internal.h: change interfaces to use
4262 2002-12-11 Havoc Pennington <hp@pobox.com>
4264 * dbus/dbus-types.h: add dbus_unichar
4266 * dbus/dbus-internals.c (_dbus_verbose): use _dbus_getenv
4268 * dbus/dbus-connection.c (dbus_connection_send_message): return
4271 * dbus/dbus-transport.c: include dbus-watch.h
4273 * dbus/dbus-connection.c: include dbus-message-internal.h
4275 * HACKING: add file with coding guidelines stuff.
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.
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.
4286 2002-11-25 Havoc Pennington <hp@pobox.com>
4288 * dbus/dbus-internals.c (_dbus_verbose): fix to not
4289 always print the first verbose message.
4291 2002-11-24 Havoc Pennington <hp@pobox.com>
4293 * test/echo-client.c, test/echo-server.c: cheesy test
4296 * configure.in (AC_CHECK_FUNCS): check for writev
4298 * dbus/dbus-message.c (_dbus_message_get_network_data): new
4301 * dbus/dbus-list.c (_dbus_list_foreach): new function
4303 * dbus/dbus-internals.c (_dbus_verbose): new function
4305 * dbus/dbus-server.c, dbus/dbus-server.h: public object
4306 representing a server that listens for connections.
4308 * dbus/.cvsignore: create
4310 * dbus/dbus-errors.h, dbus/dbus-errors.c:
4311 public API for reporting errors
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.)
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.
4322 2002-11-23 Havoc Pennington <hp@pobox.com>
4324 * dbus/dbus-internals.h (_DBUS_INT_MAX): add _DBUS_INT_MIN
4327 * dbus/dbus-test.c (main): add list test, and include
4328 dbus-test.h as intended
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
4334 * dbus/dbus-list.c: add linked list utility class,
4337 * dbus/dbus-hash.c: add TODO item about shrinking the hash bucket
4340 2002-11-23 Havoc Pennington <hp@pobox.com>
4342 * Doxyfile.in (INCLUDE_FILE_PATTERNS): expand DBUS_BEGIN_DECLS/
4343 DBUS_END_DECLS to nothing, that should fix this once and for all
4345 * Doxyfile.in (JAVADOC_AUTOBRIEF): set to YES
4347 * dbus/dbus-message.c, dbus/dbus-hash.c:
4348 add some missing @brief
4350 2002-11-23 Havoc Pennington <hp@pobox.com>
4352 * dbus/dbus-message.h: put semicolons after DEBUG_BEGIN_DECLS
4353 to avoid confusing Doxygen
4355 * dbus/dbus-hash.c: @} not }@
4357 * dbus/dbus-message.c (struct DBusMessage): split out
4360 2002-11-23 Havoc Pennington <hp@pobox.com>
4362 * configure.in: pile on more warning flags if using gcc
4364 * Doxyfile.in (EXTRACT_STATIC): set to NO, so we don't have
4365 to document static functions
4367 * configure.in: add summary to end of configure so it
4368 looks nice and attractive
4370 * dbus/dbus-hash.c: finish implementation and write unit
4373 * configure.in: add --enable-tests to enable unit tests
4375 * dbus/dbus-test.c: test program to run unit tests
4376 for all files in dbus/*, initially runs a test for
4379 * dbus/dbus-internals.h: file to hold some internal utility stuff
4381 2002-11-22 Havoc Pennington <hp@redhat.com>
4383 * dbus/dbus-hash.c: copy in Tcl hash table, not yet
4384 "ported" away from Tcl
4386 * dbus/dbus-types.h: header for types such as dbus_bool_t
4388 2002-11-22 Havoc Pennington <hp@redhat.com>
4390 * dbus/dbus.h: fixups for doc warnings
4392 * Doxyfile.in (FILE_PATTERNS): we need to scan .h to pick up
4394 (QUIET): make it quiet so we can see warnings
4396 * dbus/dbus-memory.c: teach D-BUS to allocate and free memory
4398 2002-11-22 Havoc Pennington <hp@redhat.com>
4400 * Makefile.am: include "Doxyfile" target in all-local
4402 * configure.in: generate the Doxyfile
4404 * Doxyfile.in: move Doxyfile here, so we can use
4405 configure to generate a Doxyfile with the right
4408 2002-11-22 Havoc Pennington <hp@redhat.com>
4410 * dbus/dbus-message.c: move inline docs into .c file
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
4420 2002-11-22 Havoc Pennington <hp@pobox.com>
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.
4426 Thu Nov 21 23:35:31 2002 Zack Rusin <zack@kde.org>
4428 * Doxyfile : adding. Still needs Makefile rules to be generated
4429 automatically (just run "doxygen" in the toplevel dir for now to
4432 * dbus/dbus-message.h : Adding sample docs (javadoc since
4433 resembles gtk-doc a little more)
4435 * dbus/dbus.h : Adding sample docs
4437 2002-11-21 Havoc Pennington <hp@redhat.com>
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
4443 * dbus/dbus.h: fill in
4445 * dbus/dbus-message.h: sketch out a sample header file.
4446 Include griping if you include it directly instead of
4449 * dbus/dbus-macros.h: new file with macros for extern "C",
4450 TRUE/FALSE, NULL, etc.
4452 * doc/file-boilerplate.c: put include guards in here
4454 2002-11-21 Havoc Pennington <hp@redhat.com>
4456 * doc/file-boilerplate.c: include both AFL and GPL boilerplate.
4458 * COPYING: include the GPL as well, and license code
4459 under both AFL and GPL.
4461 2002-11-21 Havoc Pennington <hp@redhat.com>
4463 * acconfig.h: get rid of this
4465 * autogen.sh (run_configure): add --no-configure option
4467 * configure.in: remove AC_ARG_PROGRAM to make
4468 autoconf complain less. add AC_PREREQ.
4469 add AC_DEFINE third arg.
4471 2002-11-21 Anders Carlsson <andersca@codefactory.se>
4474 Fix references so we can distcheck.
4476 2002-11-21 Havoc Pennington <hp@redhat.com>
4478 * Initial module creation