1 2003-04-27 Havoc Pennington <hp@pobox.com>
5 * dbus/dbus-transport.c (_dbus_transport_get_dispatch_status):
6 report correct status if we finish processing authentication
9 * bus/activation.c (try_send_activation_failure): use
10 bus_transaction_send_error_reply
12 * bus/connection.c (bus_connection_get_groups): return an error
13 explaining the problem
15 * bus/bus.c (bus_context_check_security_policy): implement
16 restriction here that inactive connections can only send the
17 hello message. Also, allow bus driver to send anything to
20 * bus/connection.c (bus_connection_complete): create the
21 BusClientPolicy here instead of on-demand.
22 (bus_connection_get_policy): don't return an error
24 * dbus/dbus-message.c (dbus_message_new_error_reply): allow NULL
25 sender field in message being replied to
27 * bus/bus.c (bus_context_check_security_policy): fix silly typo
28 causing it to return FALSE always
30 * bus/policy.c (bus_client_policy_check_can_send): fix bug where
31 we checked sender rather than destination
33 2003-04-25 Havoc Pennington <hp@redhat.com>
35 test suite is slightly hosed at the moment, will fix soon
37 * bus/connection.c (bus_connections_expire_incomplete): fix to
38 properly disable the timeout when required
39 (bus_connection_set_name): check whether we can remove incomplete
40 connections timeout after we complete each connection.
42 * dbus/dbus-mainloop.c (check_timeout): fix this up a bit,
43 probably still broken.
45 * bus/services.c (bus_registry_acquire_service): implement max
46 number of services owned, and honor allow/deny rules on which
47 services a connection can own.
49 * bus/connection.c (bus_connection_get_policy): report errors here
51 * bus/activation.c: implement limit on number of pending
54 2003-04-25 Havoc Pennington <hp@redhat.com>
56 * dbus/dbus-transport.c (_dbus_transport_get_unix_user): fix bug
57 where we used >= 0 instead of != DBUS_UID_UNSET.
59 2003-04-25 Havoc Pennington <hp@redhat.com>
61 * glib/dbus-gmain.c (remove_watch): fix for a crash when watches
62 were toggled without add/remove, fix from Anders Gustafsson
64 2003-04-24 Havoc Pennington <hp@redhat.com>
66 * test/data/valid-config-files/basic.conf: add <limit> tags to
69 * bus/config-parser.h, bus/config-parser.c, bus/bus.c: Implement
70 <limit> tag in configuration file.
72 2003-04-24 Havoc Pennington <hp@redhat.com>
74 * bus/dispatch.c: somehow missed some name_is
76 * dbus/dbus-timeout.c (_dbus_timeout_set_enabled)
77 (_dbus_timeout_set_interval): new
79 * bus/connection.c (bus_connections_setup_connection): record time
80 when each connection is first set up, and expire them after the
83 2003-04-24 Havoc Pennington <hp@redhat.com>
85 * dbus/dbus-message.c (dbus_message_name_is): rename
86 (dbus_message_service_is): rename
87 (dbus_message_sender_is): rename
88 (dbus_message_get_service): rename
90 2003-04-24 Havoc Pennington <hp@redhat.com>
92 * configure.in: add --enable-checks
94 * dbus/dbus-message.c (dbus_message_new): reverse name/service arguments
96 * dbus/dbus-connection.c (dbus_connection_preallocate_send): fix
98 (_dbus_connection_handler_destroyed_locked): move some private
99 functions into proper docs group
101 * dbus/dbus-internals.h: add _dbus_return_if_fail,
102 _dbus_return_val_if_fail
104 Throughout: use dbus_return_if_fail
106 2003-04-23 James Willcox <jwillcox@gnome.org>
109 * glib/dbus-gmain.c: (add_timeout), (wakeup_main), (create_source),
110 (dbus_connection_setup_with_g_main),
111 (dbus_server_setup_with_g_main):
112 * glib/test-dbus-glib.c: (main):
113 * glib/test-thread-client.c: (main):
114 * glib/test-thread-server.c: (new_connection_callback), (main):
115 * tools/dbus-monitor.c: (main):
117 Added a GMainContext argument to dbus_connection_setup_with_g_main()
118 and dbus_server_setup_with_g_main().
120 2003-04-20 Havoc Pennington <hp@pobox.com>
122 * doc/dbus-specification.sgml: document the restrictions on
123 message and service names
125 2003-04-22 Havoc Pennington <hp@redhat.com>
127 * dbus/dbus-message.c, dbus/dbus-marshal.c: add 64-bit integer
128 support, and do some code cleanups to share more code and
129 speed up array marshal/demarshal.
131 * dbus-1.0.pc.in (Cflags): put libdir include file in cflags
133 * configure.in: generate dbus-arch-deps.h
135 * dbus/dbus-protocol.h (DBUS_TYPE_INT64, DBUS_TYPE_UINT64): add
138 2003-04-22 Havoc Pennington <hp@redhat.com>
140 * test/data/valid-messages/opposite-endian.message: fix test
141 to use proper type for rply field
143 * test/data/invalid-messages: add tests for below validation
145 * dbus/dbus-message.c (decode_header_data): validate field types,
146 and validate that named fields are valid names
147 (decode_name_field): consider messages in the
148 org.freedesktop.Local. namespace to be invalid.
150 * dbus/dbus-string.c (_dbus_string_validate_name): new
152 2003-04-19 Havoc Pennington <hp@pobox.com>
154 * bus/driver.c (bus_driver_handle_hello): check limits and
155 return an error if they are exceeded.
157 * bus/connection.c: maintain separate lists of active and inactive
158 connections, and a count of each. Maintain count of completed
159 connections per user. Implement code to check connection limits.
161 * dbus/dbus-list.c (_dbus_list_unlink): export
163 * bus/bus.c (bus_context_check_security_policy): enforce a maximum
164 number of bytes in the message queue for a connection
166 2003-04-18 Havoc Pennington <hp@pobox.com>
168 * dbus/dbus-auth.c (record_mechanisms): memleak fixes
170 * dbus/dbus-sysdeps.c (_dbus_string_save_to_file): fix some
173 * dbus/dbus-keyring.c (add_new_key): fix a memleak, and
174 on realloc be sure to update the pointer in the keyring
176 * dbus/dbus-string.c (_dbus_string_zero): compensate for align
177 offset to avoid writing to unallocated memory
179 * dbus/dbus-auth.c (process_rejected): return FALSE if we fail to
180 try the next mechanism, so we properly handle OOM
182 * dbus/dbus-keyring.c (_dbus_keyring_new_homedir): fix double-free
184 (_dbus_keyring_new): fix OOM bug
185 (_dbus_keyring_new_homedir): always set error; impose a maximum
186 number of keys we'll load from the file, mostly to speed up the
187 test suite and make its OOM checks more useful, but also for
190 * dbus/dbus-auth.c (process_error_server): reject authentication
191 if we get an error from the client
192 (process_cancel): on cancel, send REJECTED, per the spec
193 (process_error_client): send CANCEL if we get an error from the
196 2003-04-18 Havoc Pennington <hp@pobox.com>
198 * dbus/dbus-mainloop.c (_dbus_loop_iterate): fix UMR in verbose
201 * dbus/dbus-auth.c (handle_client_data_cookie_sha1_mech): fix OOM
204 * dbus/dbus-keyring.c (_dbus_keyring_new_homedir): only whine
205 about DBUS_TEST_HOMEDIR once
207 * bus/Makefile.am (TESTS_ENVIRONMENT): put DBUS_TEST_HOMEDIR in
210 * bus/dispatch.c (bus_dispatch_sha1_test): actually load sha1
211 config file so we test the right thing
213 Throughout: assorted docs improvements
215 2003-04-18 Havoc Pennington <hp@pobox.com>
217 * glib/dbus-gmain.c: adapt to watch changes
219 * bus/bus.c, bus/activation.c, etc.: adjust to watch changes
221 * dbus/dbus-server.h: remove dbus_server_handle_watch
223 * dbus/dbus-connection.h: remove dbus_connection_handle_watch
225 * dbus/dbus-watch.c (dbus_watch_handle): change DBusWatch to work
226 like DBusTimeout, so we don't need dbus_connection_handle_watch
229 2003-04-17 Havoc Pennington <hp@redhat.com>
231 * dbus/dbus-userdb.c, dbus/dbus-sysdeps.c: redo all the passwd
232 database usage so it all goes via the DBusUserDatabase cache.
234 2003-04-17 Havoc Pennington <hp@redhat.com>
236 * dbus/dbus-mainloop.c (_dbus_loop_iterate): fix logic so that if
237 there was an OOM watch we skipped, we always return TRUE so we
238 iterate again to have a look at it again. Fixes test suite hang.
239 Code rearrangement also lets us lose some memset and only iterate
242 * bus/driver.c (bus_driver_handle_message): sense of test for
245 2003-04-16 Havoc Pennington <hp@pobox.com>
247 * doc/dbus-specification.sgml: make spec say serials are unsigned
249 * dbus/dbus-message.h: change message serials to unsigned
251 * dbus/dbus-connection.c: adapt to message serials being unsigned
253 2003-04-15 Havoc Pennington <hp@pobox.com>
255 * bus/bus.c: create and keep around a shared DBusUserDatabase
258 * bus/connection.c (bus_connection_get_groups): don't cache
259 groups for user in the connection object, since user database
260 object now does that.
262 2003-04-16 Havoc Pennington <hp@redhat.com>
264 * dbus/dbus-message.c (_dbus_message_add_size_counter): keep a
265 list of size counters
266 (_dbus_message_loader_putback_message_link): put back a popped link
268 * dbus/dbus-connection.c
269 (dbus_connection_set_max_live_messages_size): rename
271 (dbus_connection_get_outgoing_size): get size of outgoing
273 (_dbus_connection_set_connection_counter): remove this cruft
275 2003-04-14 Havoc Pennington <hp@redhat.com>
277 * dbus/dbus-userdb.c: user database abstraction, mostly to get
278 caching, but at some point we might want to be able to use a
281 * bus/dispatch.c (bus_dispatch_sha1_test): add a test that uses
282 SHA1 conf file to test the sha1 auth mechanism, since the regular
283 test always uses EXTERNAL when available.
286 test/data/valid-config-files/debug-allow-all-sha1.conf.in:
287 add conf file that requires use of sha1 auth
289 2003-04-13 Havoc Pennington <hp@pobox.com>
291 * tools/dbus-send.c, tools/dbus-monitor.c: two utility programs
292 from Philip Blundell to send messages and monitor them.
294 2003-04-13 Havoc Pennington <hp@pobox.com>
296 * dbus/dbus-mainloop.c: fix some reentrancy issues by refcounting
299 * test/data/valid-config-files/debug-allow-all.conf.in: allow all
302 * dbus/dbus-transport.c (_dbus_transport_get_dispatch_status):
303 fix to only recover unused bytes if we're already authenticated
304 (_dbus_transport_get_is_authenticated): fix to still mark us
305 authenticated if there are unused bytes.
307 * bus/dispatch.c: implement security policy checking
309 * bus/connection.c (bus_transaction_send_from_driver): new
311 * bus/bus.c (bus_context_check_security_policy): new
313 * bus/dispatch.c (send_service_nonexistent_error): delete this,
314 now we just set the DBusError and it gets converted to an error
317 * bus/connection.c (allow_user_function): enable code using actual
318 data from the config file
320 * bus/policy.c (list_allows_user): handle wildcard rules for
321 user/group connection perms
323 2003-04-13 Havoc Pennington <hp@pobox.com>
325 * bus/config-parser.c: Load up the BusPolicy and BusPolicyRules
327 * dbus/dbus-sysdeps.c (_dbus_get_user_id): new function
329 * bus/policy.c (bus_policy_append_mandatory_rule)
330 (bus_policy_append_default_rule, bus_policy_append_user_rule)
331 (bus_policy_append_group_rule): new functions
333 2003-04-12 Havoc Pennington <hp@pobox.com>
335 * bus/config-parser.c (bus_config_parser_new): fix a memleak
337 * dbus/dbus-sysdeps.c: change DBusCredentials to use longs for
338 the pid/gid/uid, just for paranoia.
340 * test/break-loader.c (randomly_do_n_things): find a byte
341 containing a type code, and randomly change it to a different
344 2003-04-12 Havoc Pennington <hp@pobox.com>
346 * bus/policy.h: change BusPolicy to be the thing from the config
347 file, and rename old BusPolicy to BusClientPolicy
349 * bus/bus.c, bus/connection.c, bus/config-parser.c: change to
350 match change in how policy works
352 * dbus/dbus-internals.h: mark assert_not_reached as
353 __attribute((noreturn))__
355 2003-04-11 Havoc Pennington <hp@redhat.com>
357 * doc/dbus-specification.sgml: fix a spot with the wrong name for
358 the broadcast service. Use boolean return for ServiceExists.
360 2003-04-11 Havoc Pennington <hp@redhat.com>
362 * configure.in: add another directory to look for qt in.
364 2003-04-11 Havoc Pennington <hp@redhat.com>
366 * AUTHORS: add Colin Walters
368 2003-04-11 Havoc Pennington <hp@redhat.com>
374 2003-04-11 Havoc Pennington <hp@redhat.com>
376 * bus/messagebus.in: remove pid file when stopping the
377 message bus, since the bus won't have privileges to remove it
380 2003-04-11 Havoc Pennington <hp@redhat.com>
382 * bus/bus.c (bus_context_new): move credentials change after
385 2003-04-11 Havoc Pennington <hp@pobox.com>
387 * test/decode-gcov.c: add "below average functions" to the
388 coverage report, and change how some of the code works.
390 * bus/test-main.c: bracket some stuff in DBUS_BUILD_TESTS so it's
391 not in the coverage stats.
393 * test/test-service.c (main): use _dbus_verbose not fprintf in a
394 couple places so running the test suite doesn't result in megaspam.
396 2003-04-11 Havoc Pennington <hp@pobox.com>
398 * bus/dispatch.c (check_existent_service_activation): accept a no
399 memory error in a place we didn't before
401 * bus/test.c (bus_test_run_everything): remove hacky "do it twice
402 in case the first one failed," since the test suite is less
405 2003-04-10 Havoc Pennington <hp@pobox.com>
407 * bus/dispatch.c (check_segfault_service_activation): add test
408 for launching an executable that just crashes.
410 * test/test-segfault.c (main): try setting coredumpsize to 0 so we
411 don't leave a million cores. We'll see how portable this is.
413 2003-04-10 Havoc Pennington <hp@pobox.com>
415 * dbus/dbus-spawn.c (_dbus_spawn_async_with_babysitter): move all
416 the possible parent failures before we fork, so that we don't
417 fail to create a babysitter after creating the child.
419 * bus/activation.c (bus_activation_activate_service): kill child
420 if we don't successfully complete the activation.
422 2003-04-10 Havoc Pennington <hp@redhat.com>
424 * dbus/dbus-connection.c (dbus_connection_flush): don't spin on
425 the connection if it's disconnected
427 * bus/activation.c (bus_activation_service_created): use new
428 transaction features to roll back removal of pending activation if
429 we don't successfully create the service after all. Don't remove
430 pending activation if the function fails.
432 * dbus/dbus-list.c (_dbus_list_insert_before_link)
433 (_dbus_list_insert_after_link): new code to facilitate
436 * dbus/dbus-hash.c (_dbus_hash_table_insert_string_preallocated):
437 new functionality, so we can preallocate the ability to insert
440 * bus/connection.c (bus_transaction_add_cancel_hook): new function
441 allowing us to put custom hooks in a transaction to be used for
442 cancelling said transaction
444 * doc/dbus-specification.sgml: add some discussion of secondary
445 service owners, and disallow zero-length service names
447 * bus/services.c (bus_registry_acquire_service): new function,
448 splits out part of bus_driver_handle_acquire_service() and fixes
449 a bug where we didn't remove the service doing the acquiring
450 from the secondary queue if we failed to remove the current owner
451 from the front of the queue.
453 2003-04-10 Alexander Larsson <alexl@redhat.com>
455 * doc/dbus-specification.sgml:
456 s/org.freedesktop.Broadcast/org.freedesktop.DBus.Broadcast/
458 2003-04-10 Alexander Larsson <alexl@redhat.com>
463 Added files to cvsignore
465 * dbus/dbus-message.h:
466 * dbus/dbus-message.c: (dbus_message_iter_get_named):
467 Make get_named() take two out argument and return a boolean.
468 (dbus_message_iter_get_args_valist):
469 Update usage of get_named().
470 (dbus_message_iter_append_byte):
472 (dbus_message_iter_append_named)
474 (message_iter_test), (check_message_handling_type), (_dbus_message_test):
477 2003-04-10 Alexander Larsson <alexl@redhat.com>
479 * dbus/dbus-marshal.[ch]:
480 Add array_type_pos argument to _dbus_marshal_validate_arg.
481 Let you pass a NULL end_pos to _dbus_marshal_validate_type.
483 * dbus/dbus-message.[ch]:
484 Multi-dimensional arrays have full type specification in the
485 outermost array. Iter code re-arranged to handle this.
486 Added some more iter tests.
488 * doc/dbus-specification.sgml:
491 Update new array encoding description.
492 Correct DBUS_SERVICE_FLAGS_REPLACE_EXISTING description.
494 * test/data/invalid-messages/array-with-mixed-types.message:
495 * test/data/valid-messages/array-of-array-of-uint32.message:
496 Change to the new array format.
498 * test/data/invalid-messages/too-short-dict.message:
501 * test/data/valid-messages/recursive-types.message:
502 Fix up and extend test.
504 2003-04-10 Havoc Pennington <hp@pobox.com>
506 * bus/dispatch.c: lots of fixes
508 * dbus/dbus-mainloop.c (_dbus_loop_dispatch): export
509 (_dbus_loop_iterate): remove old "quit if no callbacks" code,
510 that was crack, broke the test service.
512 * dbus/dbus-transport.c (_dbus_transport_open): fix error
513 handling to avoid piling up errors if we get a failure on the
516 * dbus/dbus-internals.c (_dbus_real_assert_not_reached): include
517 pid in assertion failures.
519 * dbus/dbus-mainloop.c (_dbus_loop_iterate): use static arrays up
520 to some fixed size of file descriptor array. Don't return TRUE
521 anytime a timeout exists, that led to lots of busy loop silliness
524 2003-04-09 Havoc Pennington <hp@redhat.com>
526 * dbus/dbus-mainloop.c (check_timeout): fix timeouts, I thought
527 I'd checked this in earlier but hadn't.
529 2003-04-09 Havoc Pennington <hp@redhat.com>
531 * bus/dispatch.c (bus_dispatch_test): get a bit further through
532 the activation test (man this is getting old!)
534 2003-04-09 Havoc Pennington <hp@redhat.com>
536 * test/test-utils.c: use dispatch status function to fix this up
538 * bus/connection.c (connection_watch_callback): don't dispatch
540 (connection_timeout_callback): don't dispatch from here
541 (bus_connections_setup_connection): set the dispatch status function
542 (bus_connection_disconnected): unset it
544 * dbus/dbus-mainloop.c (_dbus_loop_queue_dispatch): new function
545 used to add a connection to be dispatched
546 (_dbus_loop_iterate): do the dispatching at the end of each
549 * dbus/dbus-connection.c
550 (dbus_connection_set_dispatch_status_function): new function
551 allowing us to fix up main loop usage
552 (_dbus_connection_last_unref): free all the various function
554 (dbus_connection_dispatch): call the DispatchStatusFunction
555 whenever this function returns
556 (dbus_connection_handle_watch): call DispatchStatusFunction
557 (dbus_connection_send_with_reply_and_block): call DispatchStatusFunction
558 (reply_handler_timeout): call DispatchStatusFunction
559 (dbus_connection_flush): call DispatchStatusFunction
561 2003-04-09 Havoc Pennington <hp@redhat.com>
563 * dbus/dbus-bus.c (dbus_bus_register): fix up error handling and
566 * bus/dispatch.c (check_service_activated): fix bug in test
568 * dbus/dbus-mainloop.c (check_timeout): fix this up
570 * dbus/dbus-internals.c (_dbus_verbose_real): include PID in
571 verbose output so we can sort out output from different processes,
572 e.g. in the activation case.
574 2003-04-08 Colin Walters <walters@gnu.org>
576 * bus/bus.c (struct BusContext) [pidfile]: New member, to store
578 (bus_context_new): Set it.
579 (bus_context_unref): Use it to delete the pid file.
581 2003-04-08 Havoc Pennington <hp@redhat.com>
583 * test/data/invalid-messages/array-with-mixed-types.message:
584 regression test that fails for the moment
586 * dbus/dbus-test.c (dbus_internal_do_not_use_run_tests): reorder
587 tests for convenience
589 * dbus/dbus-marshal.c (_dbus_marshal_validate_arg): don't allow
590 array of nil, it broke things.
592 * test/data/invalid-messages/array-of-nil.message: regression test
594 * test/data/valid-messages/array-of-array-of-uint32.message:
595 happened to write this so added it to suite
597 2003-04-08 Havoc Pennington <hp@redhat.com>
599 * bus/driver.c (bus_driver_handle_acquire_service): init
600 retval/reply before checking name
602 * dbus/dbus-marshal.c (_dbus_marshal_validate_arg): add a
603 recursion depth argument
605 * dbus/dbus-message.h (struct DBusMessageIter): put some padding
606 in the public struct for future extension
608 * dbus/dbus-message-builder.c (_dbus_message_data_load): fix
611 * dbus/dbus-marshal.c (_dbus_marshal_validate_arg): fix a verbose
614 * doc/dbus-specification.sgml: fix typo
616 2003-04-08 Alexander Larsson <alexl@redhat.com>
618 Implemented recursive types, named types and new-style iters
621 * glib/test-thread-client.c: (thread_func):
622 * glib/test-thread-server.c: (handle_test_message):
623 * test/test-service.c: (handle_echo):
632 * dbus/dbus-internals.c: (_dbus_type_to_string):
633 Update for new types.
635 * dbus/dbus-marshal.[ch]:
636 Implement recursive types and the new marshalling format.
637 Remove hardcoded dict marshalling.
640 * dbus/dbus-message-builder.c:
642 Remove references to old types
644 * dbus/dbus-message.[ch]:
645 New non-refcounted iter API that supports recursive iters.
646 Use iters for appending, including support for recursive
648 Add byte and named type support.
649 Update everything to new marshalling formats.
650 Add tests for new API.
652 * dbus/dbus-protocol.h:
653 Remove old array types.
654 Add types: BYTE, ARRAY, DICT, NAMED
656 * dbus/dbus-string.c:
657 * dbus/dbus-sysdeps.c:
658 Make parse_double locale safe.
660 * dbus/dbus-test-main.c:
666 * doc/dbus-specification.sgml:
669 * test/data/incomplete-messages/missing-body.message:
670 * test/data/invalid-messages/bad-boolean.message:
671 * test/data/invalid-messages/bad-boolean-array.message:
672 * test/data/invalid-messages/boolean-array-length-too-long.message-raw:
673 * test/data/invalid-messages/boolean-has-no-value.message-raw:
674 * test/data/invalid-messages/too-short-dict.message:
675 * test/data/valid-messages/dict-simple.message:
676 * test/data/valid-messages/dict.message:
677 * test/data/valid-messages/emptiness.message:
678 * test/data/valid-messages/lots-of-arguments.message:
679 * test/data/valid-messages/no-padding.message:
680 * test/data/valid-messages/recursive-types.message:
681 Add missing NAME fields
682 Fix up dicts & arrays
684 * test/data/invalid-messages/dict-with-nil-value.message:
685 Removed, this is not invalid anymore.
687 * test/data/valid-messages/recursive-types.message:
688 Add new test for deeply recursive types.
690 2003-04-07 Havoc Pennington <hp@pobox.com>
692 * bus/driver.c (bus_driver_handle_acquire_service): return an
693 error if you try to acquire a service that starts with ':'
695 2003-04-07 Havoc Pennington <hp@redhat.com>
697 * doc/dbus-specification.sgml: require that base service names
698 start with ':' and that the base service is created/deleted
699 as first and last things a connection does on the bus
701 * bus/dispatch.c (check_existent_service_activation): lots more
702 work on the activation test; it doesn't fully pass yet...
704 * test/test-service.c (main): fix so we don't memleak the
705 connection to the message bus
706 (filter_func): accept a message asking us to exit
708 2003-04-06 Havoc Pennington <hp@pobox.com>
710 * qt/Makefile.am (dbusinclude_HEADERS): install dbus-qt.h,
713 * configure.in: fixes to Qt detection from Colin Walters
715 * doc/Makefile.am: Only remove generated docbook dirs if they
716 exist, from Colin Walters
718 * dbus/dbus-bus.c: change how we set well-known connections to
719 NULL, so that it works if a single connection is stored in
720 two well-known array slots.
722 * test/Makefile.am: remove a lot of stuff that isn't immediately
723 useful, it's in CVS history if we want it.
725 * test/test-service.c: use dbus-mainloop instead of that
728 2003-04-06 Havoc Pennington <hp@pobox.com>
730 * dbus/Makefile.am: split lists of sources into stuff that goes in
731 the library, util functions that go in the lib and are also used
732 elsewhere, and util functions that are used in tests/daemon but
735 * dbus/dbus-mainloop.h, dbus/dbus-mainloop.c: move bus/loop.[hc]
736 here so it can be used in test binaries also
738 2003-04-06 Havoc Pennington <hp@pobox.com>
740 * dbus/dbus-sysdeps.c (_dbus_become_daemon): write the pidfile
741 here in the parent process, so we can return an error if it
742 fails. Also, move some of the code into the child so the parent
743 is less hosed if we fail midway through.
745 * bus/bus.c (bus_context_new): move pidfile detection further up
746 in the function, before we start overwriting sockets and such.
748 * bus/messagebus.in: adjust this a bit, not sure if it will work.
750 * configure.in: add --with-system-pid-file and --with-system-socket
752 2003-04-06 Colin Walters <walters@verbum.org>
754 * configure.in (DBUS_SYSTEM_PID_FILE): New variable.
756 * bus/system.conf.in: Declare a pidfile.
758 * bus/bus.c (bus_context_new): Test for an existing pid file, and
759 create one (if appropriate).
761 * bus/config-parser.c (enum ElementType) [ELEMENT_PIDFILE]: New.
762 (struct BusConfigParser) [pidfile]: New.
763 (element_type_to_name, merge_included, start_busconfig_child)
764 (bus_config_parser_end_element, bus_config_parser_content): Handle it.
765 (bus_config_parser_unref): Free it.
766 (bus_config_parser_get_pidfile): New function.
768 * bus/config-parser.h (_dbus_write_pid_file): Prototype.
770 * dbus/dbus-errors.h (DBUS_ERROR_PIDFILE_EXISTS): New error.
772 * dbus/dbus-sysdeps.c (_dbus_write_pid_file): New function.
774 * dbus/dbus-sysdeps.h: Prototype it.
776 2003-04-06 Havoc Pennington <hp@pobox.com>
778 * bus/bus.c (bus_context_new): print the address in here, rather
779 than in main(), because we need to do it before forking the daemon
781 * bus/dispatch.c (send_service_nonexistent_error): set the sender
782 on the service nonexistent error
784 * bus/driver.c (bus_driver_handle_acquire_service): set the
785 sender on the AcquireService reply
787 * test/data/valid-config-files/debug-allow-all.conf.in: Make test
788 server also listen on a UNIX socket so services can connect to it.
790 2003-04-06 Havoc Pennington <hp@pobox.com>
792 * dbus/dbus-threads.c: Redo how the fake debug mutexes are done
793 so it detects deadlocks and also we actually init threads when
796 2003-04-06 Havoc Pennington <hp@pobox.com>
798 * dbus/dbus-server-unix.c (_dbus_server_new_for_domain_socket):
799 save the domain socket name, and unlink it when we disconnect the
800 server. Means that at least when we exit normally, we won't leave
801 a bunch of junk in /tmp
803 * dbus/dbus-transport-unix.c
804 (_dbus_transport_new_for_domain_socket): code cleanup (nicer
805 memory management). (I was making a real change here but then
808 2003-04-06 Havoc Pennington <hp@pobox.com>
810 * bus/bus.c (bus_context_new): fix wrong handling of
811 server_data_slot_unref() in the error case.
813 * dbus/dbus-internals.h (_dbus_assert): change so it passes
814 "(condition) != 0" to _dbus_real_assert so that
815 "_dbus_assert (pointer)" doesn't cause a warning
817 * bus/main.c (main): accept --print-address option to print out
818 the message bus address
820 * dbus/dbus-sysdeps.c (_dbus_generate_random_ascii): export this
822 * dbus/dbus-transport.c (_dbus_transport_open): special error for
823 "tmpdir" option to unix: address on client side
825 * dbus/dbus-server.c (dbus_server_listen): handle "tmpdir" option
828 * configure.in (TEST_SOCKET_DIR): locate a temporary directory
829 we can use to create sockets in the test suite.
831 * bus/main.c (signal_handler): on SIGTERM, exit the daemon
832 cleanly. To be used for testing.
834 * dbus/dbus-spawn.c (babysit): use _dbus_set_signal_handler()
836 * dbus/dbus-sysdeps.c (_dbus_set_signal_handler): new
838 * dbus/dbus-server-debug-pipe.c (_dbus_transport_debug_pipe_new):
839 handle trying to call this when there's no servers active
841 2003-04-05 Havoc Pennington <hp@pobox.com>
847 2003-04-05 Havoc Pennington <hp@pobox.com>
849 * bus/bus.c (setup_server): fix this so dbus-daemon-1 doesn't
850 crash on startup. Need to get "try starting the daemon"
851 in the test suite I guess. ;-)
853 * dbus/dbus-server.h, dbus/dbus-server.c: remove the stuff that
854 tracked the number of open connections; it's better done in
855 application-specific code as you want it to span all servers etc.
857 2003-04-05 Havoc Pennington <hp@pobox.com>
859 * bus/Makefile.am (install-data-hook): add missing DESTDIR,
860 patch from Colin Walters
862 2003-04-05 Havoc Pennington <hp@pobox.com>
864 * doc/config-file.txt (Elements): fix docs of <auth> to reflect
865 reality; in fact multiple mechanisms are allowed.
867 * dbus/dbus-internals.c (_dbus_real_assert)
868 (_dbus_real_assert_not_reached): move guts of _dbus_assert() and
869 _dbus_assert_not_reached() into functions, so that they don't show
870 up in basic block counts for test coverage, and don't use up as
871 much disk space. Does mean slower execution speed though, so
872 assumes --disable-asserts is the normal production case.
874 2003-04-05 Havoc Pennington <hp@pobox.com>
876 * test/Makefile.am (dist-hook): also dist *.in files
882 2003-04-05 Havoc Pennington <hp@pobox.com>
884 * dbus/dbus-string.c: docs warning
886 * dbus/dbus-spawn.c: missing docs
888 * dbus/dbus-memory.c (struct ShutdownClosure): missing docs
890 2003-04-05 Havoc Pennington <hp@pobox.com>
892 * bus/loop.c (bus_loop_iterate): fix the timeout code, using
895 * dbus/dbus-spawn.c (_dbus_babysitter_unref): set sitter_pid
896 to -1 once we've reaped the babysitter
897 (_dbus_babysitter_handle_watch): do as much work as we can, not
900 * bus/activation.c: add code using DBusBabysitter so that we
901 handle it when a service fails to start up properly.
902 (bus_activation_service_created): don't remove the activation
903 entries as we go, just let them get removed when we free the pending
904 activation. Unref reply messages after sending them.
906 2003-04-05 Havoc Pennington <hp@pobox.com>
908 * test/decode-gcov.c (main): print per-directory stats in the report
910 * Makefile.am (coverage-report.txt): don't include test/* in gcov stats
912 2003-04-05 Havoc Pennington <hp@pobox.com>
914 * Makefile.am (coverage-report.txt): add target "coverage-report.txt"
916 * test/decode-gcov.c: hack up a little program to suck data
917 out of gcov files. Yes this is sort of silly.
919 * configure.in: define something in config.h and do an
920 AM_CONDITIONAL when gcov is enabled
922 2003-04-04 Havoc Pennington <hp@redhat.com>
924 * dbus/dbus-spawn.c, dbus/dbus-spawn.h: Change dbus_spawn to
925 return a "babysitter" object that is used to monitor the status of
926 the spawned process and reap it when required.
928 * test/test-segfault.c, test/test-exit.c,
929 test/test-sleep-forever.c: binaries that do various lame things,
930 used in the test suite.
932 * dbus/dbus-sysdeps.c: kill _dbus_errno_to_string()
934 2003-04-03 Havoc Pennington <hp@pobox.com>
936 * dbus/dbus-spawn.c: Move dbus-spawn into a separate file
937 in preparation for modifying it, dbus-sysdeps is getting
940 2003-04-03 Havoc Pennington <hp@redhat.com>
942 * bus/loop.h, bus/loop.c: make the mainloop an object so we can
945 * bus/*.[hc]: adapt to mainloop change
947 2003-04-03 Havoc Pennington <hp@redhat.com>
949 * bus/activation.c (load_directory): fix up memleaks
950 (bus_activation_entry_free): free the entry
952 * dbus/dbus-bus.c (dbus_bus_acquire_service): return an error if
953 we get one from the message bus; fix memleaks.
955 * dbus/dbus-message.c (dbus_set_error_from_message): new function
957 2003-04-03 Havoc Pennington <hp@pobox.com>
959 * bus/config-parser.c (bus_config_parser_unref): free
960 list of mechanisms, bug discovered by test suite enhancements
961 (putting system.conf and session.conf into suite)
963 * test/Makefile.am, test/test-service.c: add placeholder for a
964 test service that we'll activate as part of test suite. Doesn't
967 * dbus/dbus-sysdeps.c (_dbus_setenv): support unsetenv by
968 setting NULL value, and use system malloc not dbus_malloc()
969 when we have unavoidable memleakage.
971 * dbus/dbus-bus.c (dbus_bus_get): fix bug where bus type of 0
972 didn't work, and support DBUS_BUS_ACTIVATION.
974 * bus/activation.c (child_setup): pass our well-known bus type to
977 * bus/config-parser.c: support <type> to specify well-known type
979 * doc/dbus-specification.sgml: document the env variables to
980 locate well-known buses and find service activator
982 2003-04-02 Havoc Pennington <hp@redhat.com>
984 * test/Makefile.am (all-local): add a rule to copy tests to
985 builddir, so we can have generated tests. Use this to remove the
986 silly hack for testing system.conf and session.conf. Will use this
987 shortly to generate .service files pointing to test binaries.
989 2003-04-02 Havoc Pennington <hp@redhat.com>
991 * dbus/dbus-string.c (set_length): fix a bug - we allocated max of
992 current alloc and needed new length, not max of the doubled
993 allocation and needed new length. Also, when building tests,
994 don't do the double-allocation stuff, just realloc every time.
996 2003-04-02 Havoc Pennington <hp@redhat.com>
998 * dbus/dbus-sysdeps.c (_dbus_file_get_contents): include filenames
1000 (_dbus_string_get_dirname): new
1001 (_dbus_sysdeps_test): new
1002 (_dbus_directory_open): include dirnames in error messages
1004 * bus/config-parser.c: interpret <include> and <includedir> and
1005 <servicedir> relative to config file location if the given
1006 filename is not absolute.
1008 * dbus/dbus-string.c (_dbus_string_find_byte_backward): new
1010 2003-04-02 Havoc Pennington <hp@redhat.com>
1012 * bus/connection.c (bus_transaction_send_error_reply): set sender
1013 service for the error, and unref the reply on success
1015 * bus/activation.c: convert to use BusTransaction so OOM can be
1017 (bus_activation_service_created): set sender of the message
1019 2003-04-01 Havoc Pennington <hp@redhat.com>
1021 * bus/config-parser.c, bus/bus.c: implement <servicedir> and
1022 <includedir> (at least mostly)
1024 * dbus/dbus-sysdeps.c (_dbus_change_identity): set the group ID
1025 first, then the user ID
1027 2003-04-01 Havoc Pennington <hp@pobox.com>
1029 * dbus/dbus-server.c (dbus_server_set_auth_mechanisms): new
1032 * dbus/dbus-auth.c (_dbus_auth_set_mechanisms): new
1034 * dbus/dbus-internals.c (_dbus_dup_string_array): new function
1036 * dbus/dbus-sysdeps.c (_dbus_listen_unix_socket): chmod the
1037 socket 0777, and unlink any existing socket.
1039 * bus/bus.c (bus_context_new): change our UID/GID and fork if
1040 the configuration file so specifies; set up auth mechanism
1043 * bus/config-parser.c (bus_config_parser_content): add support
1044 for <fork> option and fill in code for <auth>
1046 * bus/system.conf.in: add <fork/> to default configuration,
1047 and limit auth mechanisms to EXTERNAL
1049 * doc/config-file.txt (Elements): add <fork>
1051 * dbus/dbus-sysdeps.c (_dbus_become_daemon): new function
1052 (_dbus_change_identity): new function
1054 2003-03-31 Havoc Pennington <hp@redhat.com>
1056 * dbus/dbus-sysdeps.c (_dbus_connect_unix_socket)
1057 (_dbus_listen_unix_socket): fix off-by-one error in null
1058 termination spotted by Nalin
1060 2003-03-31 Havoc Pennington <hp@redhat.com>
1062 * dbus/dbus-keyring.c (_dbus_keyring_new_homedir): allow setting
1063 DBUS_TEST_HOMEDIR when tests are enabled, so we can test without
1064 having a real home directory available.
1066 2003-03-31 Havoc Pennington <hp@redhat.com>
1068 * bus/Makefile.am (install-data-hook): create /var/run/dbus
1070 * bus/messagebus.in: add init script for Red Hat /etc/init.d
1072 * configure.in: add support for specifying a style of init script
1075 2003-03-31 Havoc Pennington <hp@redhat.com>
1077 Fix some annoying DBusString API and fix all affected code.
1079 * dbus/dbus-string.c (_dbus_string_init): get rid of annoying
1081 (_dbus_string_get_data): change to return string instead of using
1083 (_dbus_string_get_const_data): ditto
1084 (_dbus_string_get_data_len): ditto
1085 (_dbus_string_get_const_data_len): ditto
1087 2003-03-31 Havoc Pennington <hp@redhat.com>
1089 * bus/main.c (main): fix up the command line arguments to be nicer
1091 2003-03-31 Havoc Pennington <hp@redhat.com>
1093 * dbus/Makefile.am (INCLUDES): use EXPANDED_LOCALSTATEDIR to
1094 define DBUS_SYSTEM_BUS_PATH as we want to compile in the same
1095 final location that lands in the config file
1097 * bus/config-loader-expat.c (bus_config_load): fix type of
1100 * doc/TODO: remove TODO item for dbus_bus_get()
1102 * dbus/dbus-bus.c (bus_data_free): add missing lock/unlock
1104 2003-03-31 Havoc Pennington <hp@pobox.com>
1106 * dbus/dbus-transport-unix.c (_dbus_transport_new_for_domain_socket)
1107 (_dbus_transport_new_for_tcp_socket): these didn't need the "server"
1108 argument since they are always client side
1110 * dbus/dbus-server.c (dbus_server_get_address): new function
1112 * bus/main.c (main): take the configuration file as an argument.
1114 * test/data/valid-config-files/debug-allow-all.conf: new file to
1115 use with dispatch.c tests for example
1117 * bus/test-main.c (main): require test data dir
1119 * bus/bus.c (bus_context_new): change this to take a
1120 configuration file name as argument
1122 * doc/config-file.txt (Elements): add <servicedir>
1124 * bus/system.conf, bus/session.conf: new files
1126 * dbus/dbus-bus.c (dbus_bus_get): look for system bus on
1127 well-known socket if none set
1129 * configure.in: create system.conf and session.conf
1131 2003-03-30 Havoc Pennington <hp@pobox.com>
1133 * bus/config-parser.c: hacking
1135 * dbus/dbus-memory.c: don't use DBusList for the list of stuff
1136 to shut down, since it could cause weirdness with the DBusList
1139 * dbus/dbus-list.c (_dbus_list_test): add tests for the
1140 link-oriented stack routines
1141 (alloc_link): free the mempool if the first alloc from it fails
1143 * dbus/dbus-mempool.c (struct DBusMemBlock): fix alignment issue
1145 * dbus/dbus-string.c (UNICODE_VALID): sync new version of this
1147 (_dbus_string_skip_white): new
1149 * doc/config-file.txt (Elements): add <includedir>
1151 2003-03-28 Havoc Pennington <hp@pobox.com>
1153 * dbus/dbus-string.c (_dbus_string_copy_data_len)
1154 (_dbus_string_copy_data): new functions
1156 2003-03-28 Anders Carlsson <andersca@codefactory.se>
1158 * dbus/dbus-bus.c: (bus_data_free), (dbus_bus_get):
1162 * dbus/dbus-memory.c:
1165 2003-03-28 Havoc Pennington <hp@pobox.com>
1167 * bus/test.c (bus_test_flush_bus): remove the sleep from here,
1168 I think it may have just been superstition. Not sure.
1170 * dbus/dbus-string.c (_dbus_string_base64_decode): catch some OOM
1171 failures that were not being handled.
1173 * dbus/dbus-auth.c (process_auth): fix a memleak in OOM handling
1175 * dbus/dbus-memory.c: add ability to set number of mallocs in a
1176 row that will fail on out-of-memory.
1178 * dbus/dbus-internals.c (_dbus_test_oom_handling): convenience
1179 function for testing out-of-memory handling.
1181 * bus/config-loader-expat.c (memsuite): don't wrap the dbus
1182 allocation functions, they do map exactly to the expat ones.
1184 2003-03-27 Havoc Pennington <hp@redhat.com>
1186 * bus/config-loader-libxml.c (bus_config_load): add another error
1189 2003-03-26 Anders Carlsson <andersca@codefactory.se>
1192 Add note about automatic service activation.
1194 * doc/dbus-specification.sgml:
1195 Rename the specification and clarify a few things.
1197 2003-03-26 Anders Carlsson <andersca@codefactory.se>
1200 * dbus/dbus-address.c:
1202 * dbus/dbus-marshal.c:
1203 * dbus/dbus-server-debug-pipe.c:
1204 * dbus/dbus-transport-unix.c:
1205 Fix documentation warnings.
1207 2003-03-26 Havoc Pennington <hp@pobox.com>
1209 * bus/test-main.c, dbus/dbus-test.c (main): check memleaks
1210 after every test so it's quick and easy to see which leaked, and
1211 so we test multiple dbus_shutdown() calls
1213 * configure.in: change configure.in XML stuff to also support
1216 * config-loader-libxml.c: some hacking
1218 * config-loader-expat.c: some hacking
1220 * config-parser.c: some hacking, plus tests
1222 2003-03-25 Havoc Pennington <hp@redhat.com>
1224 * throughout - add more _DBUS_ASSERT_ERROR_IS_CLEAR
1226 * configure.in: add --with-xml option to specify XML library,
1227 right now only libxml is supported.
1229 * bus/config-loader-libxml.c, config-parser.c: sync some minor
1230 nonworking code between home and work, still just stubs
1232 2003-03-24 Havoc Pennington <hp@redhat.com>
1234 * dbus/dbus-sysdeps.c (_dbus_set_fd_nonblocking): move to this
1237 * dbus/dbus-errors.c (dbus_set_error, dbus_set_error_const): allow
1238 NULL argument for "message" if the error is a well-known one,
1239 fill in a generic message in this case.
1241 * dbus/dbus-errors.h (DBusResultCode): Kill DBusResultCode in
1244 * bus/test.c (bus_test_flush_bus): add
1246 * bus/policy.c (bus_policy_test): test code stub
1248 2003-03-24 Havoc Pennington <hp@pobox.com>
1250 * bus/connection.c (bus_connections_setup_connection): set up
1251 the "can this user connect" function, but it always returns
1252 TRUE until we have a config file parser so we can have a config
1253 file that allows connections.
1255 2003-03-23 Havoc Pennington <hp@pobox.com>
1257 * dbus/dbus-threads.c (dbus_mutex_new, dbus_condvar_new): with
1258 DBUS_BUILD_TESTS, actually alloc/free a block of memory for
1259 the mutex, so we can check for proper memory management
1262 * dbus/dbus-dataslot.c: remove the mutex from
1263 DBusDataSlotAllocator and lock it manually when using it,
1264 to simplify fitting it into the global slots framework.
1266 * dbus/dbus-threads.c (init_static_locks): rework how we're
1267 handling global locks so they are easily shut down.
1269 * bus/policy.c (bus_policy_append_rule): fix
1271 * bus/test-main.c (main): check for memleaks
1273 * dbus/dbus-test.c (dbus_internal_do_not_use_run_tests): make
1274 test suite check for memleaks
1276 * dbus/dbus-memory.c: add support in test mode for tracking
1277 number of outstanding blocks
1279 2003-03-23 Havoc Pennington <hp@pobox.com>
1281 * bus/policy.c, bus/bus.c, bus/connection.c: implement allow/deny
1284 * dbus/dbus-hash.h: add ULONG hash keys
1286 * dbus/dbus-sysdeps.c (_dbus_get_groups): new
1287 (_dbus_get_group_id): new function
1289 2003-03-20 Havoc Pennington <hp@redhat.com>
1291 * dbus/dbus-connection.c (dbus_connection_set_unix_user_function):
1293 (dbus_connection_get_unix_user): new function
1295 2003-03-20 Havoc Pennington <hp@pobox.com>
1297 * bus/connection.c (bus_connection_send_oom_error): assert that
1298 message has a sender
1299 (connection_execute_transaction): ditto
1300 (bus_connection_preallocate_oom_error): fix to set the sender, and
1301 set recipient to the destination service, not the bus driver
1303 * bus/policy.c: hacking
1305 * dbus/dbus-message.c (dbus_message_service_is): new function
1306 (dbus_message_sender_is): new
1308 2003-03-19 Havoc Pennington <hp@redhat.com>
1310 * bus/policy.c: start sketching code for policy restrictions on
1311 what connections can do.
1313 2003-03-18 Havoc Pennington <hp@redhat.com>
1315 * doc/TODO: some notes on high-level todo items. Little nitpick
1316 stuff is all in @todo, so no need to add it here.
1318 * doc/config-file.txt: some notes on how config file might look
1320 2003-03-18 Anders Carlsson <andersca@codefactory.se>
1326 2003-03-17 Havoc Pennington <hp@redhat.com>
1328 * dbus/dbus-internals.h: add gcc attributes so that
1329 our printf-style functions warn on bad arguments to
1332 * dbus/dbus-sysdeps.c (_dbus_connect_tcp_socket): fix printf
1335 * dbus/dbus-message.c (_dbus_message_loader_queue_messages): fix
1338 2003-03-17 Havoc Pennington <hp@redhat.com>
1340 * bus/test-main.c (main): make it print something as it runs
1341 so make check doesn't look stuck
1343 * doc/negotiation.txt, doc/dbus-sasl-profile.txt: remove
1344 from CVS, now obsolete
1346 2003-03-17 Anders Carlsson <andersca@codefactory.se>
1348 * bus/dispatch.c: (bus_dispatch):
1349 Refetch the service name since it may have been reallocated
1350 when dbus_message_set_sender was called.
1352 * dbus/dbus-sysdeps.c: (_dbus_accept):
1353 Add address and address length variables and use them to stop
1354 valgrind from complaining.
1356 2003-03-17 Havoc Pennington <hp@pobox.com>
1358 All tests pass, no memleaks, no valgrind complaints.
1360 * bus/test.c: refcount handler_slot
1362 * bus/connection.c (bus_connections_new): refcount
1363 connection_data_slot
1365 * dbus/dbus-auth-script.c (_dbus_auth_script_run): delete unused
1366 bytes so that auth scripts pass.
1368 * bus/dispatch.c: init message_handler_slot so it gets allocated
1371 * bus/dispatch.c (message_handler_slot_ref): fix memleak
1373 * dbus/dbus-server-debug-pipe.c (_dbus_server_debug_pipe_new):
1374 dealloc server_pipe_hash when no longer used for benefit of
1377 * dbus/dbus-auth.c (process_command): memleak fix
1379 * bus/dispatch.c (check_hello_message): memleak fix
1381 2003-03-16 Havoc Pennington <hp@pobox.com>
1383 * dbus/dbus-bus.c (ensure_bus_data): fix double-unref of the data slot
1385 2003-03-17 Anders Carlsson <andersca@codefactory.se>
1387 * bus/activation.c (bus_activation_activate_service): Append
1388 the pending activation entry to the list of pending activations.
1390 2003-03-16 Havoc Pennington <hp@pobox.com>
1392 * bus/dispatch.c (bus_dispatch_test): remove double-unrefs of
1395 * dbus/dbus-address.c (create_entry): fix OOM handling when
1396 failing to alloc entry->method
1398 2003-03-16 Havoc Pennington <hp@pobox.com>
1400 * dbus/dbus-watch.c (_dbus_watch_new): handle failure to malloc
1403 * dbus/dbus-server-debug-pipe.c (_dbus_transport_debug_pipe_new):
1404 add some missing dbus_set_result
1406 * bus/dispatch.c (bus_dispatch_add_connection): handle failure to
1407 alloc the DBusMessageHandler
1409 * dbus/dbus-transport.c (_dbus_transport_disconnect): don't ref
1410 the transport here, since we call this from the finalizer; it
1411 resulted in a double-finalize.
1413 * dbus/dbus-transport.c (_dbus_transport_disconnect): fix a bug
1414 where we tried to use transport->connection that was NULL,
1415 happened when transport was disconnected early on due to OOM
1417 * bus/*.c: adapt to handle OOM for watches/timeouts
1419 * dbus/dbus-transport-unix.c: port to handle OOM during
1422 * dbus/dbus-auth.c (_dbus_auth_get_unused_bytes): return a
1423 reference to unused bytes instead of a copy
1425 * dbus/dbus-server.c (dbus_server_handle_watch): return FALSE for
1428 * dbus/dbus-connection.c (dbus_connection_handle_watch): return
1431 * dbus/dbus-timeout.c (dbus_timeout_handle): return FALSE for out
1434 2003-03-16 Anders Carlsson <andersca@codefactory.se>
1436 * doc/dbus-specification.sgml:
1437 Document reply message for ActivateService.
1439 2003-03-16 Anders Carlsson <andersca@codefactory.se>
1441 * bus/activation.c: (bus_pending_activation_entry_free),
1442 (bus_pending_activation_free), (bus_activation_new),
1443 (bus_activation_unref), (bus_activation_service_created),
1444 (bus_activation_activate_service):
1446 * bus/bus.c: (bus_context_new):
1447 * bus/desktop-file.c: (new_section):
1448 * bus/driver.c: (bus_driver_send_service_deleted),
1449 (bus_driver_handle_activate_service):
1450 * bus/services.c: (bus_registry_new), (bus_registry_ensure):
1452 * dbus/dbus-connection.c:
1453 (dbus_connection_send_with_reply_and_block):
1454 * dbus/dbus-message.c: (dbus_message_append_args_valist):
1455 * dbus/dbus-protocol.h:
1456 Make activation work better. Now pending activations will be queued
1457 and the daemon won't try to activate services that are already registered.
1459 2003-03-16 Havoc Pennington <hp@pobox.com>
1461 * dbus/dbus-bus.c (ensure_bus_data): handle failure to set
1464 * dbus/dbus-memory.c (_dbus_initialize_malloc_debug): support
1465 DBUS_MALLOC_BACKTRACES to print trace when failing an alloc
1467 2003-03-16 Havoc Pennington <hp@pobox.com>
1469 * dbus/dbus-string.c (_dbus_string_validate_utf8): oops, unbreak
1470 this. always run the test suite before commit...
1472 * bus/*: adapt to DBusConnection API changes
1474 * glib/dbus-gmain.c: adapt to DBusConnection API changes,
1475 requires renaming stuff to avoid dbus_connection_dispatch name
1478 * dbus/dbus-transport.c (_dbus_transport_queue_messages): new
1481 * dbus/dbus-message.c (_dbus_message_loader_queue_messages):
1482 separate from _dbus_message_loader_return_buffer()
1484 * dbus/dbus-connection.c (dbus_connection_get_n_messages): remove
1485 this, because it's now always broken to use; the number of
1486 messages in queue vs. the number still buffered by the message
1487 loader is undefined/meaningless. Should use
1488 dbus_connection_get_dispatch_state().
1489 (dbus_connection_dispatch): rename from
1490 dbus_connection_dispatch_message
1492 2003-03-16 Havoc Pennington <hp@pobox.com>
1494 * dbus/dbus-string.c (_dbus_string_validate_utf8): copy in a real
1497 2003-03-16 Anders Carlsson <andersca@codefactory.se>
1499 * dbus/dbus-connection.c:
1500 (dbus_connection_send_with_reply_and_block):
1501 Decrease connection->n_incoming when removing an entry
1503 * dbus/dbus-dict.c: (dbus_dict_entry_free),
1504 (dbus_dict_set_boolean_array), (dbus_dict_set_int32_array),
1505 (dbus_dict_set_uint32_array), (dbus_dict_set_double_array),
1506 (dbus_dict_set_byte_array), (dbus_dict_set_string_array),
1507 (dbus_dict_get_boolean_array), (dbus_dict_get_double_array),
1508 (dbus_dict_get_byte_array):
1509 Handle NULL arrays and strings. Also add support for byte arrays.
1511 * dbus/dbus-marshal.c: (_dbus_marshal_byte_array),
1512 (_dbus_marshal_dict), (_dbus_demarshal_byte_array),
1513 (_dbus_demarshal_int32_array), (_dbus_demarshal_uint32_array),
1514 (_dbus_demarshal_double_array), (_dbus_demarshal_string_array),
1515 (_dbus_demarshal_dict), (demarshal_and_validate_len),
1516 (_dbus_marshal_validate_arg), (_dbus_marshal_test):
1517 * dbus/dbus-marshal.h:
1518 Add support for marshalling and demarshalling empty arrays and strings.
1520 * dbus/dbus-message.c: (dbus_message_append_args_valist),
1521 (dbus_message_append_string_array),
1522 (dbus_message_iter_get_boolean),
1523 (dbus_message_iter_get_boolean_array),
1524 (dbus_message_iter_get_int32_array),
1525 (dbus_message_iter_get_uint32_array),
1526 (dbus_message_iter_get_double_array),
1527 (dbus_message_iter_get_byte_array),
1528 (dbus_message_iter_get_string_array), (dbus_message_iter_get_dict),
1529 (check_message_handling):
1530 Add support for getting empty arrays and dicts.
1532 * dbus/dbus-string.c: (_dbus_string_validate_utf8):
1533 Don't do any validation at all for now, that's better than just checking
1536 * test/data/valid-messages/emptiness.message:
1537 New test message with lots of empty arrays.
1539 2003-03-16 Havoc Pennington <hp@pobox.com>
1541 * dbus/dbus-connection.c
1542 (_dbus_connection_queue_received_message_link): new function that
1543 can't fail due to OOM
1545 * dbus/dbus-message.c (_dbus_message_loader_pop_message_link):
1546 new function pops a message together with a list link
1549 * dbus/dbus-transport-unix.c (queue_messages): use new link-based
1550 message queuing functions to avoid needing to alloc memory
1552 2003-03-16 Havoc Pennington <hp@pobox.com>
1554 Oops - test code was only testing failure of around 30 of the
1555 mallocs in the test path, but it turns out there are 500+
1556 mallocs. I believe this was due to misguided linking setup such
1557 that there was one copy of dbus_malloc etc. in the daemon and one
1558 in the shared lib, and only daemon mallocs were tested. In any
1559 case, the test case now tests all 500+ mallocs, and doesn't pass
1560 yet, though there are lots of fixes in this patch.
1562 * dbus/dbus-connection.c (dbus_connection_dispatch_message): fix
1563 this so that it doesn't need to allocate memory, since it
1564 has no way of indicating failure due to OOM (and would be
1565 annoying if it did).
1567 * dbus/dbus-list.c (_dbus_list_pop_first_link): new function
1569 * bus/Makefile.am: rearrange to create two self-contained
1570 libraries, to avoid having libraries with overlapping symbols.
1571 that was resulting in weirdness, e.g. I'm pretty sure there
1572 were two copies of global static variables.
1574 * dbus/dbus-internals.c: move the malloc debug stuff to
1577 * dbus/dbus-list.c (free_link): free list mempool if it becomes
1580 * dbus/dbus-memory.c (_dbus_disable_mem_pools): new function
1582 * dbus/dbus-address.c (dbus_parse_address): free list nodes
1585 * bus/dispatch.c (bus_dispatch_add_connection): free
1586 message_handler_slot when no longer using it, so
1587 memory leak checkers are happy for the test suite.
1589 * dbus/dbus-server-debug-pipe.c (debug_finalize): free server name
1591 * bus/bus.c (new_connection_callback): disconnect in here if
1592 bus_connections_setup_connection fails.
1594 * bus/connection.c (bus_connections_unref): fix to free the
1596 (bus_connections_setup_connection): if this fails, don't
1597 disconnect the connection, just be sure there are no side
1600 * dbus/dbus-string.c (undo_alignment): unbreak this
1602 * dbus/dbus-auth.c (_dbus_auth_unref): free some stuff we were
1604 (_dbus_auth_new): fix the order in which we free strings
1607 * bus/connection.c (bus_connection_disconnected): fix to
1608 not send ServiceDeleted multiple times in case of memory
1611 * dbus/dbus-bus.c (dbus_bus_get_base_service): new function to
1612 get the base service name
1613 (dbus_bus_register_client): don't return base service name,
1614 instead store it on the DBusConnection and have an accessor
1616 (dbus_bus_register_client): rename dbus_bus_register()
1618 * bus/dispatch.c (check_hello_message): verify that other
1619 connections on the bus also got the correct results, not
1620 just the one sending hello
1622 2003-03-15 Havoc Pennington <hp@pobox.com>
1624 Make it pass the Hello handling test including all OOM codepaths.
1625 Now to do other messages...
1627 * bus/services.c (bus_service_remove_owner): fix crash when
1628 removing owner from an empty list of owners
1629 (bus_registry_ensure): don't leave service in the list of
1630 a connection's owned services if we fail to put the service
1633 * bus/connection.c (bus_connection_preallocate_oom_error): set
1634 error flag on the OOM error.
1636 * dbus/dbus-connection.c (_dbus_connection_new_for_transport):
1637 handle _dbus_transport_set_connection failure
1639 * dbus/dbus-transport-unix.c (_dbus_transport_new_for_fd): modify
1640 to create watches up front and simply enable/disable them as
1642 (unix_connection_set): this can now fail on OOM
1644 * dbus/dbus-timeout.c, dbus/dbus-watch.c: add concept
1645 of enabling/disabling a watch or timeout.
1647 * bus/loop.c (bus_loop_iterate): don't touch disabled
1650 * glib/dbus-gmain.c: adapt to enable/disable watches and timeouts
1652 2003-03-15 Havoc Pennington <hp@pobox.com>
1654 * bus/dispatch.c (bus_dispatch_test): OK, now finally actually
1655 write useful test code, after all that futzing around ;-)
1657 Test does not yet pass because we can't handle OOM in
1658 _dbus_transport_messages_pending (basically,
1659 dbus_connection_preallocate_send() does not prealloc the write
1660 watch). To fix this, I think we need to add new stuff to
1661 set_watch_functions, namely a SetEnabled function so we can alloc
1662 the watch earlier, then enable it later.
1664 * dbus/Makefile.am (libdbus_convenience_la_SOURCES): move
1665 dbus-memory.c to the convenience lib
1667 * bus/test.c: rename some static functions to keep them clearly
1668 distinct from stuff in connection.c. Handle client disconnection.
1670 2003-03-14 Havoc Pennington <hp@pobox.com>
1672 * bus/dispatch.c (bus_dispatch_test): do test using debug-pipe
1673 transport, tests more of the real codepath. Set up clients
1674 with bus_setup_debug_client.
1676 * bus/test.c (bus_setup_debug_client): function to set up debug
1677 "clients" on the main loop
1679 * dbus/dbus-transport.c (_dbus_transport_open): add debug-pipe
1682 * dbus/dbus-server.c (dbus_server_listen): add debug-pipe
1685 * dbus/dbus-server-debug.c: support a debug server based on pipes
1687 * dbus/dbus-sysdeps.c (_dbus_full_duplex_pipe): new function
1688 (_dbus_close): new function
1690 * configure.in: check for socketpair
1692 2003-03-14 Havoc Pennington <hp@redhat.com>
1694 * dbus/dbus-memory.c: add a "detect buffer overwrites on free"
1697 * dbus/dbus-transport-debug.c: rework this a good bit to be
1698 less complicated. hopefully still works.
1700 * dbus/dbus-server-debug.c (handle_new_client): remove timeout
1703 * glib/dbus-gmain.c (timeout_handler): don't remove timeout
1706 * dbus/dbus-message.c (dbus_message_copy): rename from
1707 dbus_message_new_from_message, fix it up to copy
1708 all the message fields, add test case
1710 * bus/dispatch.c (bus_dispatch_test): add some more test code,
1711 not quite passing yet
1713 2003-03-14 Havoc Pennington <hp@pobox.com>
1715 * bus/loop.c (bus_loop_iterate): add this so we can "run loop
1716 until no work remains" in test code. (the large diff here
1717 is just code movement, no actual changes)
1719 * dbus/dbus-server-debug.c (DEFAULT_INTERVAL): change interval to
1720 1, no point waiting around for test code.
1721 (_dbus_server_debug_accept_transport): unref the timeout
1722 after adding it (right?)
1724 * dbus/dbus-transport-debug.c (DEFAULT_INTERVAL): ditto
1726 2003-03-13 Havoc Pennington <hp@redhat.com>
1728 * dbus/dbus-timeout.c (_dbus_timeout_list_set_functions): handle
1731 * dbus/dbus-watch.c (_dbus_watch_list_set_functions): handle out
1734 * dbus/dbus-connection.h: Make AddWatchFunction and
1735 AddTimeoutFunction return a bool so they can fail on out-of-memory
1737 * bus/bus.c (bus_context_new): set up timeout handlers
1739 * bus/connection.c (bus_connections_setup_connection): set up
1742 * glib/dbus-gmain.c: adapt to the fact that set_functions stuff
1745 * bus/bus.c (bus_context_new): adapt to changes
1747 * bus/connection.c: adapt to changes
1749 * test/watch.c: adapt to DBusWatch changes
1751 * bus/dispatch.c (bus_dispatch_test): started adding this but
1754 2003-03-14 Anders Carlsson <andersca@codefactory.se>
1756 * bus/dispatch.c (send_service_nonexistent_error): Fix typo.
1758 2003-03-13 Havoc Pennington <hp@pobox.com>
1760 * bus/test.c, bus/test.h, bus/Makefile.am, bus/test-main.c:
1761 set up a test framework as for the library
1763 2003-03-12 Havoc Pennington <hp@pobox.com>
1765 Throughout: purge global variables, introduce BusActivation,
1766 BusConnections, BusRegistry, etc. objects instead.
1768 * bus/bus.h, bus/bus.c: introduce BusContext as a global
1771 * test/Makefile.am (TEST_BINARIES): disable bus-test for now,
1772 going to redo this a bit differently I think
1774 2003-03-12 Havoc Pennington <hp@redhat.com>
1776 Mega-patch that gets the message bus daemon initially handling
1777 out-of-memory. Work still needed. Also lots of random
1778 moving stuff to DBusError instead of ResultCode.
1780 * dbus/dbus-list.c (_dbus_list_length_is_one): new function
1782 * dbus/dbus-connection.c
1783 (dbus_connection_send_with_reply_and_block): use DBusError
1785 * dbus/dbus-bus.c: adapt to API changes, make it use DBusError not
1788 * dbus/dbus-connection.c (dbus_connection_send): drop the result
1789 code here, as the only failure possible is OOM.
1791 * bus/connection.c (bus_connection_disconnect):
1792 rename bus_connection_disconnected as it's a notification only
1794 * bus/driver.c (bus_driver_handle_acquire_service): don't free
1795 "name" on get_args failure, should be done by get_args;
1796 don't disconnect client for bad args, just return an error.
1797 (bus_driver_handle_service_exists): ditto
1799 * bus/services.c (bus_services_list): NULL-terminate returned array
1801 * bus/driver.c (bus_driver_send_service_lost)
1802 (bus_driver_send_service_acquired): send messages from driver to a
1803 specific client to the client's unique name, not to the broadcast
1806 * dbus/dbus-message.c (decode_header_data): reject messages that
1807 contain no name field
1808 (_dbus_message_get_client_serial): rename to
1809 dbus_message_get_serial and make public
1810 (_dbus_message_set_serial): rename from set_client_serial
1811 (_dbus_message_set_reply_serial): make public
1812 (_dbus_message_get_reply_serial): make public
1814 * bus/connection.c (bus_connection_foreach): allow stopping
1815 iteration by returning FALSE from foreach function.
1817 * dbus/dbus-connection.c (dbus_connection_send_preallocated)
1818 (dbus_connection_free_preallocated_send)
1819 (dbus_connection_preallocate_send): new API for sending a message
1820 without possibility of malloc failure.
1821 (dbus_connection_send_message): rename to just
1822 dbus_connection_send (and same for whole function family)
1824 * dbus/dbus-errors.c (dbus_error_free): make this reinit the error
1826 * dbus/dbus-sysdeps.c (_dbus_exit): new function
1828 * bus/activation.c: handle/return errors
1830 * dbus/dbus-errors.h: add more DBUS_ERROR #define
1832 * dbus/dbus-sysdeps.c (_dbus_directory_open) (_dbus_file_get_contents)
1833 (_dbus_directory_get_next_file): use DBusError instead of DBusResultCode
1834 (_dbus_result_from_errno): move to this file
1836 2003-03-10 Anders Carlsson <andersca@codefactory.se>
1838 * dbus/dbus-marshal.c:
1839 (_dbus_marshal_set_string):
1840 Take a length argument so we can marshal the correct string
1843 (_dbus_marshal_dict), (_dbus_demarshal_dict),
1844 (_dbus_marshal_get_arg_end_pos), (_dbus_marshal_validate_arg),
1845 (_dbus_marshal_test):
1846 * dbus/dbus-marshal.h:
1847 Add support for marshalling and demarshalling dicts.
1849 * dbus/dbus-message-builder.c: (_dbus_message_data_load):
1850 Add support for TYPE DICT.
1852 * dbus/dbus-message.c: (set_string_field):
1853 Adjust header padding.
1855 (dbus_message_append_args_valist), (dbus_message_append_dict),
1856 (dbus_message_get_args_valist), (dbus_message_iter_get_arg_type),
1857 (dbus_message_iter_get_dict), (_dbus_message_loader_return_buffer),
1858 (check_message_handling), (check_have_valid_message):
1859 * dbus/dbus-message.h:
1860 Add functions for setting and getting dicts.
1862 * dbus/dbus-protocol.h:
1868 * doc/dbus-specification.sgml:
1869 Add information about how dicts are marshalled.
1871 * test/data/invalid-messages/dict-with-nil-value.message:
1872 * test/data/invalid-messages/too-short-dict.message:
1873 * test/data/valid-messages/dict-simple.message:
1874 * test/data/valid-messages/dict.message:
1875 Add sample messages containing dicts.
1877 2003-03-08 Anders Carlsson <andersca@codefactory.se>
1879 * dbus/dbus-dict.h: Add DBUS_END_DECLS.
1881 2003-03-07 Anders Carlsson <andersca@codefactory.se>
1884 * dbus/dbus-dict.c: (dbus_dict_entry_free), (dbus_dict_new),
1885 (dbus_dict_get_keys), (insert_entry), (dbus_dict_set_boolean),
1886 (dbus_dict_set_int32), (dbus_dict_set_uint32),
1887 (dbus_dict_set_double), (dbus_dict_set_string),
1888 (dbus_dict_set_boolean_array), (dbus_dict_set_int32_array),
1889 (dbus_dict_set_uint32_array), (dbus_dict_set_double_array),
1890 (dbus_dict_set_string_array), (_dbus_dict_test):
1892 Fix according to comments from Havoc.
1894 2003-03-06 Michael Meeks <michael@server.home>
1896 * configure.in: if we don't have kde-config, disable have_qt.
1898 2003-03-07 Anders Carlsson <andersca@codefactory.se>
1903 * dbus/dbus-dict.c: (dbus_dict_entry_free), (dbus_dict_new),
1904 (dbus_dict_ref), (dbus_dict_unref), (dbus_dict_contains),
1905 (dbus_dict_remove), (dbus_dict_get_value_type),
1906 (dbus_dict_get_keys), (dbus_dict_put_boolean),
1907 (dbus_dict_put_int32), (dbus_dict_put_uint32),
1908 (dbus_dict_put_double), (dbus_dict_put_string),
1909 (dbus_dict_put_boolean_array), (dbus_dict_put_int32_array),
1910 (dbus_dict_put_uint32_array), (dbus_dict_put_double_array),
1911 (dbus_dict_put_string_array), (dbus_dict_get_boolean),
1912 (dbus_dict_get_int32), (dbus_dict_get_uint32),
1913 (dbus_dict_get_double), (dbus_dict_get_string),
1914 (dbus_dict_get_boolean_array), (dbus_dict_get_int32_array),
1915 (dbus_dict_get_uint32_array), (dbus_dict_get_double_array),
1916 (dbus_dict_get_string_array), (_dbus_dict_test):
1918 Add DBusDict implementation
1920 * dbus/dbus-test.c: (dbus_internal_do_not_use_run_tests):
1924 2003-03-04 Havoc Pennington <hp@pobox.com>
1926 * test/data/auth/*: adapt to changes
1928 * dbus/dbus-auth-script.c (_dbus_auth_script_run): add
1929 USERID_BASE64 and change USERNAME_BASE64 to put in username not
1932 * dbus/dbus-keyring.c (_dbus_keyring_validate_context): prevent
1933 more stuff from being in a context name, to make the protocol
1934 simpler to deal with
1936 * dbus/dbus-errors.c (dbus_error_has_name): new function
1937 (dbus_error_is_set): new function
1939 * dbus/dbus-auth.c: replace DBUS_STUPID_TEST_MECH auth
1940 with DBUS_COOKIE_SHA1, implement DBUS_COOKIE_SHA1
1942 * dbus/dbus-connection.c (dbus_connection_flush): also read
1943 messages during a flush operation
1945 * dbus/Makefile.am: remove dbus-md5 since it isn't currently used.
1947 2003-03-05 Anders Carlsson <andersca@codefactory.se>
1949 * configure.in: Check for gethostbyname on Solaris.
1951 * dbus/dbus-transport.c: (_dbus_transport_open):
1952 Remove duplicate "tcp" entry.
1954 * doc/dbus-specification.sgml:
1955 Clarify some things.
1957 2003-03-05 Anders Carlsson <andersca@codefactory.se>
1959 * dbus/dbus-auth.c: (send_rejected), (process_test_subdir):
1960 * dbus/dbus-keyring.c: (_dbus_keyring_new_homedir),
1961 (_dbus_keyring_test):
1962 * dbus/dbus-md5.c: (_dbus_md5_compute):
1963 * dbus/dbus-sha.c: (_dbus_sha_compute):
1966 2003-03-05 Anders Carlsson <andersca@codefactory.se>
1968 * README: Add some things.
1970 2003-03-04 Anders Carlsson <andersca@codefactory.se>
1972 * dbus/dbus-message.c (dbus_message_append_args_valist): Add a break;
1973 after case DBUS_TYPE_BOOELAN.
1975 2003-03-02 Havoc Pennington <hp@pobox.com>
1977 * test/break-loader.c (randomly_set_extreme_ints): add test that
1978 sets really huge and small integers
1980 * dbus/dbus-marshal.c (_dbus_marshal_validate_arg): add check
1981 that length of boolean array fits in the string, and that
1982 string has room for boolean value in single-bool case.
1984 * dbus/dbus-message-builder.c (_dbus_message_data_load): add
1985 optional value to "ALIGN" command which is what to fill the
1988 * test/data/valid-messages/no-padding.message: add regression
1989 test for the message padding problem
1991 2003-03-02 Havoc Pennington <hp@pobox.com>
1993 * dbus/dbus-message.c (decode_header_data): fix to always init
1994 message_padding, from Benjamin Dauvergne
1996 2003-03-02 Havoc Pennington <hp@pobox.com>
2002 2003-03-01 Joe Shaw <joe@assbarn.com>
2004 * configure.in: Check for "struct cmsgcred" and try to access its
2005 members for BSD-like unices.
2007 * dbus/dbus-sysdeps.c (read_credentials_byte): Fold this back into
2008 _dbus_read_credentials_unix_socket().
2009 (_dbus_read_credentials_unix_socket): Use recvmsg() instead of
2010 read() for reading the credential byte off the unix socket. Use
2011 struct cmsgcred on systems that support it.
2013 2003-02-27 Alexander Larsson <alexl@redhat.com>
2017 Make gthreads-2.0 dependency optional. Don't build thread test if
2020 2003-02-27 Havoc Pennington <hp@pobox.com>
2022 * dbus/dbus-connection.c
2023 (dbus_connection_send_message_with_reply_and_block): fix doh!
2024 doh! doh! bug that resulted in never removing a reply from the
2025 queue, no wonder we called get_reply_serial so much ;-)
2027 * dbus/dbus-message.c (struct DBusMessage): cache reply serial
2028 and client serial instead of demarshaling them every time
2030 2003-02-27 Havoc Pennington <hp@pobox.com>
2032 * dbus/dbus-marshal.c (_dbus_demarshal_int32): rewrite to be much
2033 more inlined, using dbus-string-private.h, speeds things up
2036 * dbus/dbus-string.c (_dbus_string_free): apply align offset
2037 when freeing the string
2038 (_dbus_string_steal_data): fix for align offset
2039 (undo_alignment): new function
2041 2003-02-26 Havoc Pennington <hp@redhat.com>
2043 All kinds of audit fixes from Owen, plus initial attempt to
2044 handle unaligned memory returned from malloc.
2046 * dbus/dbus-string.c (_dbus_string_init): clamp max length to
2047 leave room for align_offset and nul byte
2048 (fixup_alignment): function to track an align_offset and
2049 ensure real->str is aligned
2050 (DBUS_GENERIC_STRING_PREAMBLE): len must be less than allocated,
2051 to allow a nul byte plus align offset
2052 (_dbus_string_lock): fix overflow issue
2053 (_dbus_string_init_const_len): add assertions on sanity of len,
2054 assign allocated to be ALLOCATION_PADDING larger than len
2055 (set_length): fixup the overflow handling
2056 (_dbus_string_get_data_len): fix overflow in assertion
2057 (open_gap): detect overflow in size of gap to be opened
2058 (_dbus_string_lengthen): add overflow check
2059 (_dbus_string_align_length): fix overflow with _DBUS_ALIGN_VALUE
2060 (_dbus_string_append): add overflow check
2061 (_dbus_string_append_unichar): overflow
2062 (_dbus_string_delete): fix overflow in assertion
2063 (_dbus_string_copy_len): overflow in assertion
2064 (_dbus_string_replace_len): overflows in assertions
2065 (_dbus_string_find): change to implement in terms of
2066 _dbus_string_find_to
2067 (_dbus_string_find_to): assorted fixage
2068 (_dbus_string_equal_c_str): assert c_str != NULL,
2069 fix logic so the function works
2070 (_dbus_string_ends_with_c_str): fix overflow thingy
2071 (_dbus_string_base64_encode): overflow fix
2072 (_dbus_string_validate_ascii): overflow
2073 (_dbus_string_validate_nul): overflow
2075 2003-02-26 Havoc Pennington <hp@redhat.com>
2077 * dbus/dbus-marshal.c (_dbus_marshal_test): fix to work with DISABLE_ASSERTS
2079 2003-02-26 Alexander Larsson <alexl@redhat.com>
2082 Set DBUS_GLIB_THREADS_LIBS for apps using gthread-2.0
2084 * dbus/dbus-connection.c:
2085 * dbus/dbus-connection.h:
2086 Fix _dbus_connection_acquire_io_path and _dbus_connection_acquire_dispatch.
2087 Add dbus_connection_set_wakeup_main_function and use it when queueing
2088 incoming and outgoing messages.
2091 * dbus/dbus-dataslot.c:
2092 Threadsafe usage of DBusDataSlotAllocator
2094 * dbus/dbus-message.c: (dbus_message_get_args_iter):
2097 * dbus/dbus-server-unix.c:
2100 * glib/dbus-gmain.c:
2101 Implement the new wakeup functions for glib.
2104 * glib/test-thread-client.c:
2105 * glib/test-thread-server.c:
2106 * glib/test-thread.h:
2107 Initial cut at some thread test code. Not really done yet.
2109 2003-02-26 Havoc Pennington <hp@pobox.com>
2111 * dbus/dbus-connection.c
2112 (dbus_connection_send_message_with_reply_and_block): fix crash
2113 where we ref'd the outgoing message instead of the returned reply
2115 * dbus/dbus-transport-unix.c (do_authentication): check read watch
2116 at the end of this function, so if we didn't need to read for
2117 authentication, we reinstall it for receiving messages
2119 * dbus/dbus-message.c (dbus_message_new_reply): allow replies to
2120 a NULL sender for peer-to-peer case
2122 * dbus/dbus-transport-unix.c (check_read_watch): handle
2123 !authenticated case correctly
2125 * glib/dbus-gmain.c: add support for DBusServer
2127 * dbus/dbus-server.c: add data slot support
2129 * glib/dbus-gmain.c (dbus_connection_setup_with_g_main): check
2130 return values and handle errors
2132 * dbus/dbus-dataslot.c: factor out the data slot stuff from
2135 * Doxyfile.in (INPUT): add glib subdir
2137 * glib/dbus-gmain.c (dbus_connection_setup_with_g_main): rename
2138 setup_with_g_main instead of hookup_with_g_main; write docs
2140 2003-02-24 Anders Carlsson <andersca@codefactory.se>
2142 * dbus/dbus-marshal.c: (_dbus_marshal_validate_arg):
2143 * dbus/dbus-message-builder.c: (_dbus_message_data_load):
2144 * dbus/dbus-message.c: (dbus_message_append_boolean),
2145 (dbus_message_append_boolean_array),
2146 (dbus_message_get_args_valist), (_dbus_message_test):
2147 * dbus/dbus-message.h:
2148 * doc/dbus-specification.sgml:
2149 Various fixes as pointed out by Havoc.
2151 * test/data/invalid-messages/bad-boolean-array.message:
2152 * test/data/invalid-messages/bad-boolean.message:
2153 Add invalid boolean value test cases.
2155 2003-02-24 Anders Carlsson <andersca@codefactory.se>
2157 * dbus/dbus-internals.c: (_dbus_type_to_string):
2158 * dbus/dbus-marshal.c: (_dbus_marshal_get_arg_end_pos),
2159 (_dbus_marshal_validate_arg):
2160 * dbus/dbus-message-builder.c: (_dbus_message_data_load):
2161 * dbus/dbus-message.c: (dbus_message_append_args_valist),
2162 (dbus_message_append_boolean), (dbus_message_append_boolean_array),
2163 (dbus_message_get_args_valist), (dbus_message_iter_get_boolean),
2164 (dbus_message_iter_get_int32), (dbus_message_iter_get_uint32),
2165 (dbus_message_iter_get_double),
2166 (dbus_message_iter_get_boolean_array), (message_iter_test):
2167 * dbus/dbus-message.h:
2168 * dbus/dbus-protocol.h:
2169 * doc/dbus-specification.sgml:
2170 * test/data/valid-messages/lots-of-arguments.message:
2171 Add support for boolean and boolean array types.
2173 2003-02-23 Havoc Pennington <hp@pobox.com>
2175 * dbus/dbus-keyring.c: finish most of this implementation and
2178 * dbus/dbus-errors.c (dbus_set_error_const, dbus_set_error): make
2179 these barf if the error isn't cleared to NULL
2181 * dbus/dbus-sysdeps.c (_dbus_delete_file): set error on failure
2182 (_dbus_create_directory): new function
2184 * dbus/dbus-errors.c (dbus_set_error): fix warning
2186 * dbus/dbus-string.c (_dbus_string_hex_encode): new function
2187 (_dbus_string_hex_decode): new function
2188 (test_hex_roundtrip): test code
2190 * dbus/dbus-sha.c (_dbus_sha_compute): use dbus_string_hex_encode
2192 * dbus/dbus-md5.c (_dbus_md5_compute): use dbus_string_hex_encode
2194 * dbus/dbus-sysdeps.c (_dbus_string_save_to_file): make this use
2195 the save-to-temp/rename trick to atomically write the new file
2196 (_dbus_string_parse_uint): new function
2198 2003-02-22 Havoc Pennington <hp@pobox.com>
2200 * test/Makefile.am (dist-hook): fix dist for test/data/sha-1
2202 2003-02-22 Havoc Pennington <hp@pobox.com>
2204 * dbus/dbus-message.c (dbus_message_iter_get_string_array):
2205 (dbus_message_iter_get_byte_array): Fix up doxygen warnings
2207 * dbus/dbus-sha.c: add implementation of SHA-1 algorithm
2209 * dbus/test/data/sha-1: add US government test suite for SHA-1
2211 2003-02-21 Anders Carlsson <andersca@codefactory.se>
2213 * dbus/dbus-marshal.c: (_dbus_demarshal_string_array):
2214 Make string arrays NULL-terminated.
2216 * dbus/dbus-memory.c: (dbus_free_string_array):
2217 * dbus/dbus-memory.h:
2218 New function for freeing NULL-terminated string arrays.
2220 * dbus/dbus-message-builder.c: (append_quoted_string),
2221 (_dbus_message_data_load):
2222 Add support for array types.
2224 * dbus/dbus-message.c: (check_message_handling):
2225 Add more types as test cases.
2227 * dbus/dbus-sysdeps.c: (_dbus_string_parse_int),
2228 (_dbus_string_parse_double):
2229 Add the start offset to the end offset.
2231 * test/data/valid-messages/lots-of-arguments.message:
2232 New test message with lots of arguments.
2234 2003-02-21 Anders Carlsson <andersca@codefactory.se>
2236 * dbus/dbus-message.c: (dbus_message_append_nil),
2237 (dbus_message_append_int32), (dbus_message_append_uint32),
2238 (dbus_message_append_double), (dbus_message_append_string),
2239 (dbus_message_append_int32_array),
2240 (dbus_message_append_uint32_array),
2241 (dbus_message_append_double_array),
2242 (dbus_message_append_byte_array),
2243 (dbus_message_append_string_array):
2244 Fix all out-of-memory handling in these functions.
2246 2003-02-21 Anders Carlsson <andersca@codefactory.se>
2248 * dbus/dbus-message.c: (dbus_message_append_nil):
2251 2003-02-21 Anders Carlsson <andersca@codefactory.se>
2253 * dbus/dbus-message.c: (dbus_message_append_args_valist),
2254 (dbus_message_append_nil), (dbus_message_append_int32_array),
2255 (dbus_message_append_uint32_array),
2256 (dbus_message_append_double_array),
2257 (dbus_message_append_byte_array),
2258 (dbus_message_append_string_array), (dbus_message_get_args_valist),
2259 (dbus_message_iter_get_int32_array),
2260 (dbus_message_iter_get_uint32_array),
2261 (dbus_message_iter_get_double_array),
2262 (dbus_message_iter_get_byte_array),
2263 (dbus_message_iter_get_string_array):
2265 * dbus/dbus-message.h:
2266 Add functions for appending and getting arrays.
2268 2003-02-21 Anders Carlsson <andersca@codefactory.se>
2270 * dbus/dbus-mempool.c (_dbus_mem_pool_new): Make the
2271 element size at least 8 bytes, fixes mempool tests on
2274 2003-02-20 Alexander Larsson <alexl@redhat.com>
2276 * dbus/dbus-transport-unix.c (unix_do_iteration):
2277 Unlock the connection mutex during a blocking select call.
2278 Add todo about how we need a way to wake up the select.
2280 * dbus/dbus-connection-internal.h:
2281 * dbus/dbus-connection.c:
2282 Add _dbus_connection_lock and _dbus_connection_unlock.
2284 2003-02-19 Havoc Pennington <hp@pobox.com>
2286 * Doxyfile.in (PREDEFINED): put DOXYGEN_SHOULD_SKIP_THIS in
2287 Doxyfile.in, not Doxyfile
2289 * dbus/dbus-keyring.c: do some hacking on this
2291 * dbus/dbus-sysdeps.c (_dbus_delete_file): new
2293 * dbus/dbus-errors.c (dbus_set_error_const): do not call
2295 (dbus_set_error): remove dbus_error_init, check for message ==
2296 NULL *before* we sprintf into it, and add @todo about including
2297 system headers in this file
2299 * dbus/dbus-sysdeps.c (_dbus_create_file_exclusively): new
2301 * dbus/dbus-errors.h (DBUS_ERROR_FAILED): add
2303 * dbus/dbus-sysdeps.c (get_user_info): break this function out to
2304 get various bits of user information based on either username
2306 (_dbus_homedir_from_username): new function
2308 2003-02-19 Anders Carlsson <andersca@codefactory.se>
2311 Add check for nonposix getpwnam_r
2313 * dbus/dbus-mempool.c: (_dbus_mem_pool_new):
2314 Align the pool element size to a sizeof (void *) boundary.
2316 * dbus/dbus-sysdeps.c: (_dbus_setenv), (_dbus_connect_unix_socket),
2317 (_dbus_listen_unix_socket), (_dbus_credentials_from_username):
2318 General Solaris fixes.
2320 * test/data/valid-messages/simplest-manual.message:
2321 Explicitly state that we want little-endian packing.
2323 2003-02-19 Mikael Hallendal <micke@codefactory.se>
2325 * dbus/dbus-server.c (dbus_server_listen): Support tcp: addresses.
2327 * dbus/dbus-transport-unix.c (_dbus_transport_new_for_tcp_socket):
2328 Added to create a transport connecting using a tcp/ip socket.
2330 * dbus/dbus-sysdeps.c (_dbus_connect_tcp_socket): Added to connect
2331 to a tcp socket at given host and port.
2332 (_dbus_listen_tcp_socket): added to listen on tcp socket for given
2335 * dbus/dbus-server.c (dbus_server_listen): Support tcp: addresses.
2337 * dbus/dbus-server-unix.c (_dbus_server_new_for_tcp_socket):
2338 Added to create a server listening on a TCP/IP socket.
2340 2003-02-19 Havoc Pennington <hp@pobox.com>
2342 Throughout: mop up all the Doxygen warnings and undocumented
2345 * dbus/dbus-sysdeps.c (do_exec): do not use execvp, we don't want
2346 to search any paths.
2348 * dbus/dbus-threads.c: move global mutex initializers to
2349 dbus-internals.h, multiple prototypes was confusing doxygen
2350 besides being kind of ugly
2352 * Doxyfile (PREDEFINED): have Doxygen define
2353 DOXYGEN_SHOULD_SKIP_THIS so we can exclude things from
2354 docs with #ifndef DOXYGEN_SHOULD_SKIP_THIS
2355 (do not abuse the feature! it's for stuff like the autogenerated
2356 macros in dbus-md5.c, not just for things you don't feel like
2359 2003-02-18 Havoc Pennington <hp@pobox.com>
2361 * dbus/dbus-string.c (_dbus_string_zero): new function
2363 * dbus/dbus-md5.c: include MD5 implementation by L. Peter Deutsch,
2364 wrap it in some dbus-friendly API
2366 * dbus/dbus-types.h: add 16-bit types
2368 2003-02-18 Joe Shaw <joe@assbarn.com>
2370 * dbus/dbus-auth.c (handle_server_data_stupid_test_mech): Just get
2371 credentials from our currently running process.
2372 (get_word): Fix a buglet where we were copying the entire length
2373 instead of relative to our position.
2375 * dbus/dbus-hash.c (_dbus_hash_test): Don't try to allocate the
2376 keys on the stack... it's 640k of data.
2378 * dbus/dbus-sysdeps.c (_dbus_read_credentials_unix_socket): Always
2379 read the credentials byte off the socket, even if we don't have
2381 (_dbus_poll): Implement poll() using select() for systems which
2384 * glib/test-dbus-glib.c (main): Print out an error if no
2385 parameters are given.
2387 * test/data/auth/fallback.auth-script: Added. Tests that a client
2388 can fallback to a secondary auth mechanism if the first fails.
2390 2003-02-18 Havoc Pennington <hp@pobox.com>
2394 2003-02-17 Havoc Pennington <hp@pobox.com>
2396 * doc/dbus-specification.sgml: lots of cosmetic
2397 cleanups/rearrangement, add assorted FIXME, change DBUS_ADDRESS
2398 env variable to DBUS_BUS_ADDRESS, s/client/application/,
2399 s/server/bus/ (except in authentication section). Add a section
2400 "Message Bus Message Routing"
2402 2003-02-17 Anders Carlsson <andersca@codefactory.se.>
2408 2003-02-17 Anders Carlsson <andersca@codefactory.se>
2410 * doc/dbus-specification.sgml:
2411 Specification updates.
2413 2003-02-17 Anders Carlsson <andersca@codefactory.se>
2415 * bus/activation.c: (bus_activation_init), (child_setup),
2416 (bus_activation_activate_service):
2418 * bus/main.c: (main):
2419 Set DBUS_ADDRESS environment variable.
2421 * dbus/dbus-errors.c: (dbus_set_error):
2422 Don't use va_copy since that's a C99 feature.
2424 * dbus/dbus-sysdeps.c: (_dbus_setenv), (do_exec),
2425 (_dbus_spawn_async):
2426 * dbus/dbus-sysdeps.h:
2427 Add child_setup_func to _dbus_spawn_async.
2429 * doc/dbus-specification.sgml:
2430 Update specification.
2432 * test/spawn-test.c: (setup_func), (main):
2435 2003-02-17 Alexander Larsson <alexl@redhat.com>
2437 * dbus/dbus-connection.c (_dbus_connection_handler_destroyed_locked):
2440 2003-02-17 Anders Carlsson <andersca@codefactory.se>
2444 * doc/dbus-test-plan.sgml:
2445 Add test plan document.
2450 2003-02-17 Anders Carlsson <andersca@codefactory.se>
2452 * dbus/dbus-message.c: (decode_header_data),
2453 (_dbus_message_loader_return_buffer):
2454 Set the header padding amount when loading a message.
2456 2003-02-16 Anders Carlsson <andersca@codefactory.se>
2458 * bus/dispatch.c: (send_one_message):
2459 Only send broadcast messages to registered connections.
2461 * dbus/dbus-message.c: (dbus_message_name_is):
2462 * dbus/dbus-message.h:
2463 New convenience function.
2465 * dbus/dbus-transport-debug.c: (do_reading):
2466 Only dispatch one message per run.
2469 * test/bus-test.c: (new_connection_callback), (die),
2470 (test_hello_client1_handler), (test_hello_client2_handler),
2471 (test_hello_replies), (main):
2473 * test/bus-test-loop.[ch]:
2476 2003-02-16 Havoc Pennington <hp@pobox.com>
2478 * dbus/dbus-connection.c (dbus_connection_dispatch_message): fix
2479 backward conditional
2481 2003-02-16 Alexander Larsson <alexl@redhat.com>
2483 * dbus/dbus-connection.c:
2484 Implement sent_message_with_reply. (with_reply_and block is still
2486 Made dispatch_message not lose message if OOM.
2488 * dbus/dbus-errors.h:
2489 Add NoReply error (for reply timeouts).
2491 2003-02-16 Alexander Larsson <alexl@redhat.com>
2493 * dbus/dbus-hash.c (_dbus_hash_table_unref):
2494 Actually free keys and values when destroying hashtable.
2496 2003-02-16 Anders Carlsson <andersca@codefactory.se>
2498 * dbus/dbus-auth.c: (client_try_next_mechanism):
2501 * dbus/dbus-threads.c: (dbus_condvar_wait_timeout):
2502 Return TRUE if there's no thread implementation around.
2504 * glib/dbus-gmain.c: (free_source),
2505 (dbus_connection_hookup_with_g_main):
2506 Make sure to remove the GSource when the connection is finalized.
2508 2003-02-16 Anders Carlsson <andersca@codefactory.se>
2510 * bus/dispatch.c: (bus_dispatch_message_handler):
2511 * dbus/dbus-errors.h:
2512 Return an error if someone tries to send a message to a service
2515 2003-02-16 Anders Carlsson <andersca@codefactory.se>
2517 * bus/activation.c: (load_directory), (bus_activation_init),
2518 (bus_activation_activate_service):
2521 (bus_driver_handle_activate_service), (bus_driver_handle_message):
2522 More work on the activation handling.
2524 * dbus/dbus-errors.h:
2525 Add some error messages
2527 * dbus/dbus-message.c: (dbus_message_new_error_reply):
2528 * dbus/dbus-message.h:
2529 New function that creates an error message.
2531 * dbus/dbus-protocol.h:
2532 Add ACTIVATE_SERVER message.
2534 * dbus/dbus-server-unix.c: (unix_handle_watch),
2535 (_dbus_server_new_for_domain_socket):
2536 Call _dbus_fd_set_close_on_exec.
2538 * dbus/dbus-sysdeps.c: (make_pipe), (do_exec),
2539 (_dbus_spawn_async), (_dbus_disable_sigpipe),
2540 (_dbus_fd_set_close_on_exec):
2541 * dbus/dbus-sysdeps.h:
2542 Add _dbus_fd_set_close_on exec function. Also add function that checks
2543 that all open fds are set to close-on-exec and warns otherwise.
2545 * dbus/dbus-transport-unix.c:
2546 (_dbus_transport_new_for_domain_socket):
2547 Call _dbus_fd_set_close_on_exec.
2549 2003-02-16 Havoc Pennington <hp@pobox.com>
2551 * dbus/dbus-connection.c (dbus_connection_set_change_sigpipe):
2552 allow people to avoid setting SIGPIPE to SIG_IGN
2553 (_dbus_connection_new_for_transport): disable SIGPIPE unless
2554 we've been asked not to
2556 2003-02-15 Anders Carlsson <andersca@codefactory.se>
2558 * dbus/dbus-list.c: (_dbus_list_append_link),
2559 (_dbus_list_prepend_link):
2560 * dbus/dbus-memory.c: (dbus_malloc), (dbus_malloc0),
2564 2003-02-15 Anders Carlsson <andersca@codefactory.se>
2567 * bus/activation.c: (bus_activation_entry_free),
2568 (add_desktop_file_entry), (load_directory), (bus_activation_init):
2570 * bus/main.c: (main):
2571 Add simple activation support, doesn't work yet though.
2573 2003-02-15 Zack Rusin <zack@kde.org>
2575 * qt/dbus-qthread.cpp: small casting fix
2577 2003-02-15 Anders Carlsson <andersca@codefactory.se>
2579 * dbus/dbus-errors.c: (dbus_set_error):
2580 * dbus/dbus-errors.h:
2581 Add a few errors and make dbus_set_error void.
2583 * dbus/dbus-sysdeps.c:
2584 (_dbus_errno_to_string), (close_and_invalidate), (make_pipe),
2585 (write_err_and_exit), (read_ints), (do_exec), (_dbus_spawn_async):
2586 * dbus/dbus-sysdeps.h:
2587 Add _dbus_spawn_async.
2589 * test/spawn-test.c: (main):
2590 Test for _dbus_spawn_async.
2592 2003-02-15 Anders Carlsson <andersca@codefactory.se>
2594 * dbus/dbus-internals.h:
2595 Fix build without tests.
2597 * dbus/dbus-list.c: (alloc_link):
2598 Fix a segfault when a malloc fails.
2600 * dbus/dbus-memory.c: (initialize_malloc_debug), (dbus_malloc),
2601 (dbus_malloc0), (dbus_realloc):
2602 Add support for malloc debugging.
2604 2003-02-15 Alexander Larsson <alexl@redhat.com>
2606 * dbus/dbus-threads.c:
2607 * dbus/dbus-threads.h:
2608 Add condvars. Remove static mutext from API.
2609 Implement static mutexes by initializing them from threads_init.
2611 * glib/dbus-gthread.c:
2612 * qt/dbus-qthread.cpp:
2613 Update with the thread api changes.
2618 Turn StaticMutex into normal mutex + init function.
2619 Export new functions _dbus_list_alloc_link, _dbus_list_free_link,
2620 _dbus_list_append_link, _dbus_list_prepend_link
2623 * dbus/dbus-sysdeps.c:
2624 * dbus/dbus-sysdeps.h:
2625 New type dbus_atomic_t, and new functions _dbus_atomic_inc,
2626 _dbus_atomic_dec. Only slow fallback implementation at the moment.
2628 * dbus/dbus-protocol.h:
2629 Add DBUS_MESSAGE_LOCAL_DISCONNECT define
2631 * dbus/dbus-message.c:
2632 Make ref/unref atomic.
2635 * dbus/dbus-connection-internal.h:
2636 * dbus/dbus-connection.c:
2637 * dbus/dbus-connection.h:
2639 Change _peek to _borrow,_return & _steal_borrowed.
2640 Change disconnect callback to event.
2641 Make dbus_connection_dispatch_messages reentrant.
2643 * dbus/dbus-transport.c:
2644 Don't ref the connection on calls to the transport
2647 * dbus/dbus-message-handler.c:
2650 * glib/dbus-gmain.c:
2651 Don't use peek_message anymore
2654 * test/debug-thread.c:
2655 * test/debug-thread.h:
2656 Simple thread implementation that asserts() on deadlocks in
2657 single-threaded code.
2660 (main) Call debug_threads_init.
2663 Use disconnect message instead of disconnect callback.
2667 Don't call dbus_connection_set_disconnect_function. Instead export
2668 bus_connection_disconnect.
2671 Call bus_connection_disconnect when we get a disconnected message.
2673 2003-02-15 Havoc Pennington <hp@pobox.com>
2675 * dbus/dbus-message.c (dbus_message_new): fool around with the
2678 2003-02-14 Havoc Pennington <hp@pobox.com>
2680 * dbus/dbus-mempool.c: fail if the debug functions so indicate
2682 * dbus/dbus-memory.c: fail if the debug functions indicate we
2685 * dbus/dbus-internals.c (_dbus_set_fail_alloc_counter)
2686 (_dbus_decrement_fail_alloc_counter): debug functions to
2687 simulate memory allocation failures
2689 2003-02-14 Havoc Pennington <hp@pobox.com>
2691 * dbus/dbus-errors.h (struct DBusError): add a word of padding
2694 2003-02-13 Anders Carlsson <andersca@codefactory.se>
2696 * bus/driver.c: (bus_driver_handle_hello):
2698 * bus/services.c: (bus_service_lookup):
2699 Reorder message sending so we get a more sane order.
2701 * test/bus-test.c: (message_handler):
2704 2003-02-13 Anders Carlsson <andersca@codefactory.se>
2706 * bus/driver.c: (bus_driver_send_service_deleted),
2707 (bus_driver_send_service_created), (bus_driver_send_service_lost),
2708 (bus_driver_send_service_acquired), (bus_driver_handle_hello),
2709 (bus_driver_send_welcome_message),
2710 (bus_driver_handle_list_services),
2711 (bus_driver_handle_acquire_service),
2712 (bus_driver_handle_service_exists):
2713 * dbus/dbus-bus.c: (dbus_bus_register_client),
2714 (dbus_bus_acquire_service), (dbus_bus_service_exists):
2715 * dbus/dbus-errors.c: (dbus_result_to_string):
2716 * dbus/dbus-errors.h:
2717 * dbus/dbus-message.c: (dbus_message_append_args),
2718 (dbus_message_append_args_valist), (dbus_message_get_args),
2719 (dbus_message_get_args_valist), (dbus_message_get_args_iter),
2720 (dbus_message_iter_get_arg_type), (dbus_message_iter_get_string),
2721 (dbus_message_iter_get_byte_array),
2722 (dbus_message_iter_get_string_array), (message_iter_test),
2723 (check_message_handling), (_dbus_message_test):
2724 * dbus/dbus-message.h:
2725 * test/bus-test.c: (main):
2726 Change fields to arguments in messages, so that they won't be
2727 confused with header fields.
2729 * glib/test-dbus-glib.c: (main):
2730 Remove append_fields from hello message.
2732 2003-02-13 Anders Carlsson <andersca@codefactory.se>
2734 * dbus/dbus-errors.c:
2735 * dbus/dbus-message.c:
2736 * dbus/dbus-string.c:
2737 Documentation fixes.
2739 2003-02-13 Anders Carlsson <andersca@codefactory.se>
2741 * glib/dbus-gmain.c: (timeout_handler), (add_timeout),
2743 Implement support for timeouts in dbus-glib.
2745 2003-02-13 Anders Carlsson <andersca@codefactory.se>
2747 * dbus/dbus-message-builder.c: (_dbus_message_data_load):
2748 * dbus/dbus-message.c: (process_test_subdir):
2749 * test/break-loader.c: (find_breaks_based_on):
2750 Plug some memory leaks.
2752 2003-02-13 Richard Hult <rhult@codefactory.se>
2754 * bus/main.c: Fix build.
2756 * dbus/dbus-errors.h:
2757 * dbus/dbus-errors.c: Fix copyright for Anders.
2759 2003-02-13 Anders Carlsson <andersca@codefactory.se>
2764 * bus/connection.c: (bus_connection_foreach):
2767 * bus/desktop-file.c: (grow_lines_in_section), (grow_sections),
2768 (unescape_string), (new_section), (parse_section_start),
2769 (parse_key_value), (report_error), (bus_desktop_file_load),
2770 (bus_desktop_file_get_string):
2771 * bus/desktop-file.h:
2772 Use DBusError for error reporting.
2774 * bus/dispatch.c: (send_one_message),
2775 (bus_dispatch_message_handler):
2776 * bus/driver.c: (bus_driver_send_service_deleted),
2777 (bus_driver_send_service_created), (bus_driver_send_service_lost),
2778 (bus_driver_send_service_acquired), (bus_driver_handle_hello),
2779 (bus_driver_send_welcome_message),
2780 (bus_driver_handle_list_services),
2781 (bus_driver_handle_acquire_service),
2782 (bus_driver_handle_service_exists):
2783 * bus/loop.c: (bus_loop_run):
2785 Use BUS_HANDLE_OOM instead of _DBUS_HANDLE_OOM.
2787 * bus/utils.c: (bus_wait_for_memory):
2789 New files with general utility functions.
2791 * dbus/dbus-internals.h:
2792 Remove _DBUS_HANDLE_OOM.
2794 2003-02-13 Anders Carlsson <andersca@codefactory.se>
2796 * dbus/dbus-errors.c: (dbus_result_to_string), (dbus_error_init),
2797 (dbus_error_free), (dbus_set_error_const), (dbus_set_error):
2798 * dbus/dbus-errors.h:
2799 Add DBusError structure.
2801 2003-02-13 Anders Carlsson <andersca@codefactory.se>
2803 * test/data/valid-messages/standard-acquire-service.message:
2804 * test/data/valid-messages/standard-hello.message:
2805 * test/data/valid-messages/standard-list-services.message:
2806 * test/data/valid-messages/standard-service-exists.message:
2807 Add some standard messages.
2809 2003-02-13 Anders Carlsson <andersca@codefactory.se>
2811 * bus/driver.c: (bus_driver_send_welcome_message),
2812 (bus_driver_handle_list_services),
2813 (bus_driver_handle_acquire_service),
2814 (bus_driver_handle_service_exists), (bus_driver_handle_message):
2815 Update for API changes in libdbus.
2817 * dbus/dbus-message.c: (dbus_message_new_reply):
2818 * dbus/dbus-message.h:
2819 Remove the name argument. The spec states that replies shouldn't
2822 2003-02-13 Anders Carlsson <andersca@codefactory.se>
2824 * bus/desktop-file.c: (parse_section_start), (parse_key_value),
2825 (report_error), (bus_desktop_file_load), (lookup_section),
2826 (lookup_line), (bus_desktop_file_get_raw),
2827 (bus_desktop_file_get_string):
2828 * bus/desktop-file.h:
2829 Some fixes, and new functions for getting a key value from a section.
2831 2003-02-13 Havoc Pennington <hp@pobox.com>
2833 * test/data/auth/fail-after-n-attempts.auth-script: new test
2835 * dbus/dbus-auth.c (send_rejected): shutdown_mech() when we
2838 2003-02-13 Havoc Pennington <hp@pobox.com>
2840 * dbus/dbus-auth.c (handle_server_data_external_mech): args to
2841 dbus_credentials_match were backward
2843 * dbus/dbus-auth-script.c (_dbus_auth_script_run): support
2844 NO_CREDENTIALS and ROOT_CREDENTIALS
2846 * dbus/dbus-auth.c (_dbus_auth_do_work): move get_state() routine
2847 into here. Never process more commands after we've reached an
2848 end state; store further data as unused bytes.
2850 * test/data/auth/*: add more auth tests
2852 * dbus/dbus-auth-script.c (_dbus_auth_script_run): support EXPECT
2853 command to match exact string and EXPECT_UNUSED to match unused
2856 * test/Makefile.am (dist-hook): fix to dist all the test stuff
2858 2003-02-12 Havoc Pennington <hp@pobox.com>
2860 * dbus/dbus-string.c (_dbus_string_pop_line): fix to also strip
2861 \r off of popped lines
2863 * dbus/dbus-auth.c (_dbus_auth_test): write code to run auth
2866 * dbus/dbus-auth-script.c (_dbus_auth_script_run): when doing a
2869 2003-02-12 Havoc Pennington <hp@pobox.com>
2871 * dbus/Makefile.am: remove break-loader from the build, since it
2874 * configure.in: add --enable-gcov to turn on coverage profiling
2875 flags and disable optimization
2877 2003-02-10 Havoc Pennington <hp@pobox.com>
2879 * dbus/dbus-auth-script.c, dbus/dbus-auth-script.h: sync
2880 initial cut at test framework for DBusAuth from laptop.
2881 Doesn't quite work yet but it compiles and I need to get
2882 it off the 266mhz laptop. ;-)
2884 * dbus/dbus-server-debug.c (_dbus_server_debug_accept_transport):
2885 fix a memleak in error case
2887 2003-02-12 Anders Carlsson <andersca@codefactory.se>
2890 * bus/desktop-file.c:
2891 * bus/desktop-file.h:
2892 Add a desktop file parser.
2894 2003-02-11 Zack Rusin <zack@kde.org>
2896 * qt/message.[h|cpp]: sample implementation
2897 of the KDE wrapper for DBusMessage
2899 2003-02-09 Zack Rusin <zack@kde.org>
2901 * test/bus-test.c: make_it_compile
2902 * doc/dbus-specification.sgml: minimal semantic fix
2904 2003-02-06 Anders Carlsson <andersca@codefactory.se>
2910 2003-02-06 Anders Carlsson <andersca@codefactory.se>
2913 * dbus/dbus-break-loader.c:
2915 * test/break-loader.c:
2916 Move dbus-break-loader to test/ and rename it to break-loader.
2918 2003-02-02 Havoc Pennington <hp@pobox.com>
2920 * dbus/dbus-keyring.c, dbus/dbus-keyring.h: template files
2921 for code to manage cookies in your home directory
2923 * dbus/dbus-sysdeps.c (_dbus_generate_random_bytes): new function
2925 * dbus/dbus-auth.c (get_state): impose a maximum number of tries
2926 to authenticate, then disconnect the client.
2928 2003-02-03 Alexander Larsson <alexl@redhat.com>
2930 * dbus/dbus-message.c (dbus_message_append_fields):
2933 2003-02-02 Anders Carlsson <andersca@codefactory.se>
2935 * doc/dbus-specification.sgml:
2936 Update address format section.
2938 2003-02-02 Anders Carlsson <andersca@codefactory.se>
2941 * test/bus-test.c: (get_time), (add_timeout), (remove_timeout),
2942 (message_handler), (new_connection_callback), (loop_quit),
2946 2003-02-02 Anders Carlsson <andersca@codefactory.se>
2948 * bus/driver.c: (bus_driver_handle_service_exists):
2949 Simplify the code a bit.
2951 * dbus/dbus-bus.c: (dbus_bus_service_exists):
2954 2003-02-02 Anders Carlsson <andersca@codefactory.se>
2957 Add libdbus-daemon.la and link to it.
2959 2003-02-01 James Willcox <jwillcox@gnome.org>
2961 * bus/driver.c: (bus_driver_handle_own_service):
2962 Actually include the service reply code in the message.
2964 2003-02-02 Anders Carlsson <andersca@codefactory.se>
2966 * bus/driver.c: (bus_driver_handle_service_exists):
2967 Don't unref the incoming message.
2969 2003-02-02 Anders Carlsson <andersca@codefactory.se>
2971 * dbus/dbus.h: Add dbus-address.h and dbus-bus.h
2973 2003-02-02 Anders Carlsson <andersca@codefactory.se>
2975 * dbus/dbus-server.c: (dbus_server_listen):
2976 * dbus/dbus-transport.c: (_dbus_transport_open):
2977 ifdef out the calls to the debug transport and server.
2979 2003-02-02 Alexander Larsson <alexl@redhat.com>
2981 * dbus/dbus-watch.c (dbus_watch_get_flags):
2982 Add note in the docs that ERROR or HANGUP won't be returned
2983 and are assumed always on.
2985 * glib/dbus-gmain.c (add_watch):
2986 Always add IO_ERR | IO_HUP
2988 * dbus/dbus-message.h:
2989 Add semicolon after dbus_message_iter_get_string_array().
2990 Makes qt code build again
2992 2003-02-01 Anders Carlsson <andersca@codefactory.se>
2994 * bus/driver.c: (create_unique_client_name),
2995 (bus_driver_handle_hello):
2996 Don't take a name, just use a numeric id to identify
3000 * dbus/dbus-bus.c: (dbus_bus_register_client),
3001 (dbus_bus_acquire_service), (dbus_bus_service_exists):
3003 Add new convenience functions for communicating with the bus.
3005 * dbus/dbus-message.h:
3007 * dbus/dbus-protocol.h:
3010 2003-02-01 Alexander Larsson <alexl@redhat.com>
3012 * dbus/dbus-message.c (dbus_message_append_fields):
3013 Add some more doc comments.
3015 2003-02-01 Havoc Pennington <hp@pobox.com>
3017 * dbus/dbus-break-loader.c (randomly_modify_length): change
3018 a 4-byte value in the message as if it were a length
3020 * dbus/dbus-sysdeps.c (_dbus_string_save_to_file): don't set
3021 execute bit on saved files
3023 2003-02-01 Havoc Pennington <hp@pobox.com>
3025 * dbus/dbus-break-loader.c (main): new program to find messages
3026 that break the loader.
3028 * dbus/dbus-sysdeps.c (_dbus_string_append_uint): new function
3029 * dbus/dbus-sysdeps.c (_dbus_string_save_to_file): new function
3031 * dbus/dbus-string.c (_dbus_string_set_byte): new
3033 2003-01-31 Havoc Pennington <hp@pobox.com>
3035 * dbus/dbus-message.c: refactor the test code to be more general,
3036 in preparation for writing a "randomly permute test cases to
3037 try to break the loader" program.
3039 2003-01-31 Havoc Pennington <hp@pobox.com>
3041 * doc/dbus-specification.sgml: work on the specification
3043 * dbus/dbus-message.c (_dbus_message_loader_return_buffer): check
3044 the protocol version of the message.
3046 * dbus/dbus-protocol.h: drop special _REPLY names, the spec
3047 no longer specifies that.
3048 (DBUS_SERVICE_REPLY_SERVICE_EXISTS): fix flags (1/2/4/8 not
3051 * dbus/dbus-marshal.c (_dbus_marshal_get_arg_end_pos): add missing
3052 "break" for DBUS_TYPE_NIL, remove @todo
3054 2003-01-31 Havoc Pennington <hp@pobox.com>
3056 * dbus/dbus-message.c (dbus_message_set_is_error_reply): rename
3057 just set_is_error/get_is_error as this is a commonly-used
3058 function, and write docs.
3060 2003-01-31 Anders Carlsson <andersca@codefactory.se>
3062 * dbus/dbus-address.c: (dbus_address_entry_free):
3063 Free key and value lists.
3065 * dbus/dbus-internals.c: (_dbus_type_to_string):
3066 Add the types we didn't have.
3068 * dbus/dbus-marshal.c: (_dbus_marshal_get_arg_end_pos),
3069 (_dbus_marshal_validate_arg):
3072 * dbus/dbus-message.c: (dbus_message_set_sender):
3073 Remove todo about being able to set sender to NULL.
3075 (dbus_message_set_is_error_reply),
3076 (dbus_message_get_is_error_reply):
3077 * dbus/dbus-message.h:
3080 * dbus/dbus-protocol.h:
3081 Add error reply flag.
3083 * test/data/valid-messages/opposite-endian.message:
3084 Add NIL type to test.
3086 2003-01-31 Havoc Pennington <hp@pobox.com>
3088 * doc/dbus-specification.sgml: fully specify the header. Add
3089 flags and major protocol version, and change header/body len to
3092 * dbus/dbus-message-builder.c (append_saved_length): append length
3095 * dbus/dbus-message.c (dbus_message_create_header): change header
3096 length and body length to unsigned. Add the new fields from the
3098 (_dbus_message_loader_return_buffer): unsigned header/body len
3100 2003-01-30 Havoc Pennington <hp@pobox.com>
3102 * dbus/dbus-auth.c: rework to use only REJECTED, no
3105 * doc/dbus-sasl-profile.txt: drop MECHANISMS and just
3106 use REJECTED, suggested by Mark McLoughlin
3108 2003-01-30 Havoc Pennington <hp@pobox.com>
3110 * dbus/dbus-server.c (dbus_server_listen): @todo about how we need
3111 a better way to report errors here. e.g. "unix address lacks
3112 path" or something. also "no such file" when the path doesn't
3115 * dbus/dbus-address.c (dbus_address_entries_free): add @todo about
3117 (dbus_parse_address): add @todo about documenting address format,
3118 and allowing , and ; to be escaped
3120 2003-01-30 Anders Carlsson <andersca@codefactory.se>
3123 Add dbus-address.[ch]
3125 * dbus/dbus-address.c: (dbus_address_entry_free),
3126 (dbus_address_entries_free), (create_entry),
3127 (dbus_address_entry_get_method), (dbus_address_entry_get_value),
3128 (dbus_parse_address), (_dbus_address_test):
3129 * dbus/dbus-address.h:
3130 New files for dealing with address parsing.
3132 * dbus/dbus-connection.c:
3133 Document timeout functions.
3135 * dbus/dbus-message.c:
3136 Document dbus_message_new_from_message.
3138 * dbus/dbus-server-debug.c:
3141 * dbus/dbus-server.c: (dbus_server_listen):
3142 Parse address and use correct server implementation.
3144 * dbus/dbus-string.c: (_dbus_string_find_to), (_dbus_string_test):
3145 * dbus/dbus-string.h:
3146 New function with test.
3148 * dbus/dbus-test.c: (dbus_internal_symbol_do_not_use_run_tests):
3152 * dbus/dbus-transport-debug.c:
3155 * dbus/dbus-transport.c: (_dbus_transport_open):
3156 Parse address and use correct transport implementation.
3158 2003-01-30 Havoc Pennington <hp@pobox.com>
3160 * dbus/dbus-message.c: use message->byte_order instead of
3161 DBUS_COMPILER_BYTE_ORDER throughout.
3162 (dbus_message_create_header): pad header to align the
3163 start of the body of the message to 8-byte boundary
3165 * dbus/dbus-marshal.h: make all the demarshalers take const
3166 DBusString arguments.
3168 * dbus/dbus-message.c (_dbus_message_loader_return_buffer):
3169 validate message args here, so we don't have to do slow validation
3170 later, and so we catch bad messages as they are incoming. Also add
3171 better checks on header_len and body_len. Also fill in
3174 * dbus/dbus-string.c (_dbus_string_validate_utf8): new (not
3175 implemented properly)
3176 (_dbus_string_validate_nul): new function to check all-nul
3178 * dbus/dbus-marshal.c (_dbus_marshal_get_field_end_pos): rename
3179 get_arg_end_pos and remove all validation
3180 (_dbus_marshal_validate_arg): actually do validation here.
3182 2003-01-29 Havoc Pennington <hp@pobox.com>
3184 * dbus/dbus-message.c (check_message_handling): fix assertion
3185 failure on set_client_serial
3187 2003-01-28 Havoc Pennington <hp@pobox.com>
3189 * dbus/dbus-server-debug.c: Add doc section comments
3191 * dbus/dbus-transport-debug.c: add doc section comments
3193 2003-01-28 Havoc Pennington <hp@redhat.com>
3195 * dbus/dbus-string.c (_dbus_string_base64_decode): append bytes in
3196 the reverse order from how I had it
3197 (_dbus_string_base64_encode): reverse encoding order. I was
3198 basically byteswapping everything during encoding.
3200 2003-01-28 Anders Carlsson <andersca@codefactory.se>
3202 * dbus/dbus-connection-internal.h:
3203 * dbus/dbus-connection.c: (_dbus_connection_add_timeout),
3204 (_dbus_connection_remove_timeout):
3205 Add functions for adding and removing timeouts.
3207 * dbus/dbus-message.c: (dbus_message_new_from_message):
3208 Add new function that takes a message and creates an exact
3209 copy of it, but with the refcount set to 1.
3210 (check_message_handling):
3213 * dbus/dbus-server-protected.h:
3214 * dbus/dbus-server.c: (_dbus_server_init_base),
3215 (_dbus_server_finalize_base), (_dbus_server_add_timeout),
3216 (dbus_server_set_timeout_functions):
3217 (_dbus_server_remove_timeout):
3218 New functions so that a server can add and remove timeouts.
3220 (dbus_server_listen):
3221 Add commented out call to dbus_server_debug_new.
3223 * dbus/dbus-timeout.c: (_dbus_timeout_new):
3224 Actually set the handler, doh.
3226 * dbus/dbus-transport.c: (_dbus_transport_open):
3227 Add commented out call to dbus_transport_debug_client_new.
3230 Add dbus-transport-debug.[ch] and dbus-server-debug.[ch]
3232 2003-01-28 Havoc Pennington <hp@pobox.com>
3234 * dbus/dbus-message.c (check_message_handling): function to check
3235 on the loaded message, iterates over it etc.
3237 2003-01-28 Havoc Pennington <hp@pobox.com>
3239 * test/Makefile.am (dist-hook): fix make distdir
3241 * dbus/Makefile.am (TESTS_ENVIRONMENT): fix make check
3243 2003-01-27 Havoc Pennington <hp@pobox.com>
3245 * dbus/dbus-mempool.c (time_for_size): replace printf with
3248 * dbus/dbus-message-builder.c (_dbus_message_data_load): allow
3249 empty lines; fix the SAVE_LENGTH stuff to be
3250 START_LENGTH/END_LENGTH so it actually works; couple other
3253 * test/Makefile.am (dist-hook): add dist-hook for .message files
3255 * dbus/dbus-string.c (DBUS_STRING_COPY_PREAMBLE): source of a copy
3256 can be constant or locked.
3257 (_dbus_string_free): allow freeing a const string as
3260 * dbus/dbus-sysdeps.c (_dbus_concat_dir_and_file): utility
3262 * dbus/dbus-test-main.c (main): take an argument which is the
3263 directory containing test data
3265 * dbus/dbus-message.c (_dbus_message_test): pass a test_data_dir
3266 argument to this and load all the messages in test/data/
3267 checking that they can be loaded or not loaded as appropriate.
3269 2003-01-27 Anders Carlsson <andersca@codefactory.se>
3271 * bus/dispatch.c: (bus_dispatch_message_handler):
3272 Dispatch messages sent to services.
3274 * bus/driver.c: (bus_driver_send_service_deleted),
3275 (bus_driver_send_service_created), (bus_driver_send_service_lost),
3276 (bus_driver_send_service_acquired):
3277 Add helper functions for sending service related messages.
3279 (bus_driver_send_welcome_message):
3280 Send HELLO_REPLY instead of WELCOME.
3282 (bus_driver_handle_list_services):
3283 Send LIST_SERVICES_REPLY instead of SERVICES.
3285 (bus_driver_handle_own_service),
3286 (bus_driver_handle_service_exists):
3287 New message handlers.
3289 (bus_driver_handle_message):
3290 Invoke new message handlers.
3292 (bus_driver_remove_connection):
3293 Don't remove any services here since that's done automatically
3294 by bus_service_remove_owner now.
3297 New function signatures.
3299 * bus/services.c: (bus_service_add_owner):
3300 Send ServiceAcquired message if we're the only primary owner.
3302 (bus_service_remove_owner):
3303 Send ServiceAcquired/ServiceLost messages.
3305 (bus_service_set_prohibit_replacement),
3306 (bus_service_get_prohibit_replacement):
3307 Functions for setting prohibit replacement.
3309 (bus_service_has_owner):
3310 New function that checks if a connection is in the owner queue of
3314 Add new function signatures.
3316 * dbus/dbus-list.c: (_dbus_list_test):
3317 Add tests for _dbus_list_remove_last and traversing the list backwards.
3320 Fix a typo in _dbus_list_get_prev_link, if we're at the first element we can't
3321 go any further, so return NULL then.
3323 * dbus/dbus-protocol.h:
3324 Add new messages, service flags and service replies.
3326 2003-01-26 Havoc Pennington <hp@pobox.com>
3328 * dbus/dbus-message-builder.c: implement, completely untested.
3330 * test/data/*: add data to be used in testing.
3331 ".message" files are our simple loadable text format.
3332 ".message-raw" will be binary dumps of messages.
3334 * dbus/dbus-string.c (_dbus_string_starts_with_c_str): new
3336 2003-01-26 Havoc Pennington <hp@pobox.com>
3338 * dbus/dbus-sysdeps.c (_dbus_file_get_contents): new function
3340 * dbus/dbus-errors.c (dbus_result_to_string): add
3343 * dbus/dbus-message-builder.c: new file, will contain code to load
3344 up messages from files. Not implemented yet.
3346 2003-01-26 Havoc Pennington <hp@pobox.com>
3348 * dbus/dbus-message.c (dbus_message_set_sender): support deleting
3349 the sender by setting to NULL
3351 2003-01-26 Havoc Pennington <hp@pobox.com>
3353 The unit tests pass, but otherwise untested. If it breaks, the
3354 tests should have been better. ;-)
3356 * bus/driver.c (bus_driver_handle_hello): return if we disconnect
3359 * dbus/dbus-message.c: redo everything so we maintain
3360 message->header as the only copy of the various fields.
3361 This avoids the possibility of out-of-memory in some cases,
3362 for example dbus_message_lock() can't run out of memory anymore,
3363 and avoids extra copying. Figured I may as well go ahead and do
3364 this since it was busted for dbus_message_lock to not return
3365 failure on OOM, and dbus_message_write_header was totally
3366 unchecked for OOM. Also fixed some random other bugs.
3368 * dbus/dbus-marshal.c (_dbus_marshal_get_field_end_pos): verify
3369 that strings are nul-terminated. Also, end_pos can be equal
3370 to string length just not greater than, I think.
3371 (_dbus_marshal_set_int32): new function
3372 (_dbus_marshal_set_uint32): new function
3373 (_dbus_marshal_set_string): new function
3375 * dbus/dbus-connection.c (_dbus_connection_new_for_transport): fix
3376 a warning, init timeout_list to NULL
3377 (dbus_connection_send_message): don't use uninitialized variable
3380 * dbus/dbus-string.c (_dbus_string_replace_len): new function
3382 2003-01-26 Anders Carlsson <andersca@codefactory.se>
3384 * bus/driver.c: (bus_driver_handle_hello),
3385 (bus_driver_send_welcome_message):
3388 2003-01-26 Anders Carlsson <andersca@codefactory.se>
3390 * dbus/dbus-auth.c: (process_auth), (_dbus_auth_unref):
3391 * dbus/dbus-connection.c: (_dbus_connection_new_for_transport),
3392 (dbus_connection_unref):
3393 * dbus/dbus-marshal.c: (_dbus_marshal_test):
3394 * dbus/dbus-message.c: (dbus_message_unref),
3397 (dbus_message_get_fields):
3398 Remove debugging printout.
3400 (_dbus_message_loader_return_buffer):
3401 Don't store the header string.
3403 (_dbus_message_test):
3406 2003-01-26 Richard Hult <rhult@codefactory.se>
3408 * glib/dbus-gmain.c (dbus_connection_dispatch): Traverse a copy of
3409 the file descriptor list, since it can change under us.
3411 2003-01-25 Anders Carlsson <andersca@codefactory.se>
3413 * glib/dbus-gmain.c: (dbus_connection_prepare),
3414 (dbus_connection_check), (dbus_connection_dispatch), (add_watch),
3415 (remove_watch), (dbus_connection_hookup_with_g_main):
3416 Rewrite the glib handling to use its own GSource instead of a
3417 GIOChannel so we can catch messages put in the queue while waiting
3420 2003-01-25 Anders Carlsson <andersca@codefactory.se>
3423 * bus/connection.c: (connection_disconnect_handler),
3424 (connection_watch_callback), (bus_connection_setup):
3425 * bus/dispatch.c: (send_one_message),
3426 (bus_dispatch_broadcast_message), (bus_dispatch_message_handler),
3427 (bus_dispatch_add_connection), (bus_dispatch_remove_connection):
3429 * bus/driver.c: (bus_driver_send_service_deleted),
3430 (bus_driver_send_service_created), (bus_driver_handle_hello),
3431 (bus_driver_send_welcome_message),
3432 (bus_driver_handle_list_services), (bus_driver_remove_connection),
3433 (bus_driver_handle_message):
3435 Refactor code, put the message dispatching in its own file. Use
3436 _DBUS_HANDLE_OOM. Also send ServiceDeleted messages when a client
3439 2003-01-25 Anders Carlsson <andersca@codefactory.se>
3441 * dbus/dbus-internals.h:
3442 Add _DBUS_HANDLE_OOM macro, it doesn't do anything currently.
3444 * dbus/dbus-message.c: (dbus_message_get_sender):
3445 * dbus/dbus-message.h:
3446 Implement dbus_message_get_sender.
3448 * dbus/dbus-protocol.h:
3449 Add message and service defines.
3451 2003-01-25 Anders Carlsson <andersca@codefactory.se>
3453 * dbus/dbus-connection.c: (dbus_connection_send_message):
3454 * dbus/dbus-message-internal.h:
3455 * dbus/dbus-message.c: (_dbus_message_get_client_serial),
3456 (dbus_message_write_header):
3457 Remove _dbus_messag_unlock and don't set the client serial on a
3458 message if one already exists.
3460 2003-01-24 Havoc Pennington <hp@pobox.com>
3462 * dbus/dbus-list.c (alloc_link): put a thread lock on the global
3465 * bus/driver.c (bus_driver_handle_list_services): fix a leak
3468 2003-01-25 Anders Carlsson <andersca@codefactory.se>
3470 * dbus/dbus-list.c: (alloc_link), (free_link):
3471 Use a memory pool for the links.
3473 2003-01-25 Anders Carlsson <andersca@codefactory.se>
3475 * bus/connection.c: (bus_connection_foreach):
3477 Add new bus_connection_foreach function.
3479 * bus/driver.c: (send_one_message), (bus_driver_broadcast_message):
3480 Add function that broadcasts a message to all clients.
3482 (bus_driver_send_service_created), (bus_driver_handle_hello),
3483 (bus_driver_send_welcome_message),
3484 (bus_driver_handle_list_services), (bus_driver_message_handler):
3485 Implement functions that take care of listing services, and notifying
3486 clients when new services are created.
3488 * bus/services.c: (bus_services_list):
3490 Add new function that returns an array of strings with the currently
3491 registered services.
3494 * glib/dbus-gmain.c:
3495 Update copyright year.
3497 2003-01-25 Anders Carlsson <andersca@codefactory.se>
3499 * dbus/dbus-connection.c: (dbus_connection_send_message):
3500 Unlock the message in case it was sent earlier.
3502 (dbus_connection_send_message_with_reply_and_block):
3503 Remove the reply message from the list.
3505 * dbus/dbus-marshal.c: (_dbus_demarshal_string_array):
3506 Set array_len and new_pos correctly.
3508 (_dbus_marshal_test):
3509 Remove debug output.
3511 * dbus/dbus-message-internal.h:
3512 * dbus/dbus-message.c: (_dbus_message_get_reply_serial):
3513 New function that returns the reply serial.
3515 (_dbus_message_unlock):
3516 New function that unlocks a message and resets its header.
3518 (dbus_message_append_string_array),
3519 (dbus_message_get_fields_valist),
3520 (dbus_message_iter_get_field_type),
3521 (dbus_message_iter_get_string_array),
3522 (dbus_message_get_fields),
3523 (dbus_message_append_fields_valist):
3524 Handle string arrays.
3526 (dbus_message_set_sender):
3527 Make this function public since the bus daemon needs it.
3529 (decode_header_data):
3530 Set the reply serial to -1 initially.
3532 * dbus/dbus-message.h:
3533 Add dbus_message_set_sender.
3535 2003-01-24 Havoc Pennington <hp@pobox.com>
3537 * doc/dbus-specification.sgml: add some stuff
3539 2003-01-22 Havoc Pennington <hp@pobox.com>
3541 * doc/dbus-specification.sgml: Start to document the protocol.
3543 2003-01-22 Havoc Pennington <hp@pobox.com>
3545 * dbus/dbus-connection.c
3546 (dbus_connection_send_message_with_reply_and_block): add some @todo
3548 * bus/driver.c (bus_driver_add_connection): add a FIXME about memleak
3550 2003-01-21 Havoc Pennington <hp@pobox.com>
3552 (patch untested because can't compile)
3554 * bus/driver.c (create_unique_client_name): make this function
3555 never recycle client names. Also, caller should initialize
3558 * dbus/dbus-sysdeps.c (_dbus_get_current_time): new function
3560 2003-01-21 Anders Carlsson <andersca@codefactory.se>
3562 * dbus/dbus-marshal.c: (_dbus_marshal_double),
3563 (_dbus_marshal_int32), (_dbus_marshal_uint32),
3564 (_dbus_marshal_int32_array), (_dbus_marshal_uint32_array),
3565 (_dbus_marshal_double_array), (_dbus_marshal_string_array),
3566 (_dbus_demarshal_int32_array), (_dbus_demarshal_uint32_array),
3567 (_dbus_demarshal_double_array), (_dbus_demarshal_string_array),
3568 (_dbus_marshal_get_field_end_pos), (_dbus_marshal_test):
3569 * dbus/dbus-marshal.h:
3570 * dbus/dbus-protocol.h:
3571 Add support for marshalling and demarshalling integer, double
3574 2003-01-21 Anders Carlsson <andersca@codefactory.se>
3579 * bus/connection.c: (connection_disconnect_handler):
3580 Remove the connection from the bus driver's list.
3582 (connection_watch_callback): Dispatch messages.
3584 (free_connection_data): Free connection name.
3586 (bus_connection_setup): Add connection to the bus driver's list.
3587 (bus_connection_remove_owned_service):
3588 (bus_connection_set_name), (bus_connection_get_name):
3589 Add functions for setting and getting the connection's name.
3592 Add function headers.
3594 * bus/driver.c: (create_unique_client_name),
3595 (bus_driver_handle_hello_message),
3596 (bus_driver_send_welcome_message), (bus_driver_message_handler),
3597 (bus_driver_add_connection), (bus_driver_remove_connection):
3600 * bus/services.c: (bus_service_free):
3602 New file that handles communication and registreation with the bus
3605 2003-01-21 Anders Carlsson <andersca@codefactory.se>
3607 * dbus/dbus-connection.c: (dbus_connection_send_message):
3608 Add a new client_serial parameter.
3610 (dbus_connection_send_message_with_reply):
3611 Remove a @todo since we've implemented the blocking function.
3613 (dbus_connection_send_message_with_reply_and_block):
3614 New function that sends a message and waits for a reply and
3615 then returns the reply.
3617 * dbus/dbus-connection.h:
3620 * dbus/dbus-errors.c: (dbus_result_to_string):
3621 * dbus/dbus-errors.h:
3622 Add new DBUS_RESULT.
3624 * dbus/dbus-message-internal.h:
3625 * dbus/dbus-message.c: (_dbus_message_get_reply_serial),
3626 (_dbus_message_set_sender), (dbus_message_write_header),
3627 (dbus_message_new_reply), (decode_header_data),
3628 (_dbus_message_loader_return_buffer), (_dbus_message_test):
3629 * dbus/dbus-message.h:
3630 Add new functions that set the reply serial and sender.
3631 Also marshal and demarshal them correctly and add test.
3633 * dbus/dbus-protocol.h:
3634 Add new DBUS_MESSAGE_TYPE_SENDER.
3637 * glib/dbus-gmain.c: (watch_callback), (free_callback_data),
3638 (add_watch), (remove_watch), (add_timeout), (remove_timeout),
3639 (dbus_connection_hookup_with_g_main):
3640 * glib/test-dbus-glib.c: (main):
3641 Rewrite to use GIOChannel and remove the GSource crack.
3643 * test/echo-client.c: (main):
3644 * test/watch.c: (check_messages):
3645 Update for changed APIs
3647 2003-01-19 Anders Carlsson <andersca@codefactory.se>
3649 * dbus/Makefile.am: Add dbus-timeout.[cħ]
3651 * dbus/dbus-connection.c: (_dbus_connection_new_for_transport):
3652 Create a DBusTimeoutList.
3653 (dbus_connection_set_timeout_functions): Add new function to
3654 set timeout callbacks
3656 * dbus/dbus-connection.h: Add public DBusTimeout API.
3658 * dbus/dbus-message.c: (dbus_message_get_service):
3659 * dbus/dbus-message.h: New function.
3661 * dbus/dbus-server.c: Fix small doc typo.
3663 * dbus/dbus-timeout.[ch]: New files for mainloop timeouts.
3665 2003-01-19 Anders Carlsson <andersca@codefactory.se>
3667 * dbus/dbus-string.c (_dbus_string_move_len): Don't delete all
3668 of the string, just as long as specified.
3670 2003-01-19 Havoc Pennington <hp@pobox.com>
3672 * dbus/dbus-connection.c (dbus_connection_get_is_authenticated):
3675 * dbus/dbus-server.c (dbus_server_set_max_connections)
3676 (dbus_server_get_max_connections, dbus_server_get_n_connections):
3677 keep track of current number of connections, and add API for
3678 setting a max (but haven't implemented enforcing the max yet)
3680 2003-01-18 Havoc Pennington <hp@pobox.com>
3682 * dbus/dbus-transport-unix.c (unix_do_iteration): only do the
3683 reading/writing if read_watch != NULL or write_watch != NULL.
3685 * dbus/dbus-message.c (_dbus_message_loader_return_buffer): fix
3686 the message loader code to actually load message->header and
3687 message->body into the newly-created message.
3689 * dbus/dbus-transport-unix.c (check_write_watch): fix a mem leak
3692 * dbus/dbus-connection.c (dbus_connection_set_max_message_size)
3693 (dbus_connection_get_max_message_size)
3694 (dbus_connection_set_max_live_messages_size)
3695 (dbus_connection_get_max_live_messages_size): implement some
3696 resource limitation functions
3698 * dbus/dbus-resources.c: new file implementing some of the
3699 resource limits stuff
3701 * dbus/dbus-message.c (dbus_message_iter_get_byte_array): add
3702 missing docs, add @todo to handle OOM etc.
3704 * dbus/dbus-marshal.c (_dbus_demarshal_byte_array): add missing
3707 2003-01-18 Havoc Pennington <hp@pobox.com>
3709 * dbus/dbus-connection.c (dbus_connection_unref): disconnect the
3710 connection if it hasn't been already.
3712 * dbus/dbus-connection.h: kill off the idea of an ErrorFunction,
3713 replace with DisconnectFunction.
3715 2003-01-18 Havoc Pennington <hp@pobox.com>
3717 Building --disable-verbose-mode --disable-asserts --disable-tests
3718 cuts the library from 112K to 45K or so
3720 * configure.in: check for varargs macro support,
3721 add --enable-verbose-mode, --enable-asserts.
3723 * dbus/dbus-internals.h (_dbus_assert): support
3725 (_dbus_verbose): support DBUS_ENABLE_VERBOSE_MODE
3727 2003-01-18 Havoc Pennington <hp@pobox.com>
3729 * dbus/dbus-test.c: include config.h so that tests actually run
3731 * dbus/dbus-string.c: add assertions that stuff is 8-byte aligned,
3732 so the failure mode when that assumption fails will be plenty
3735 2003-01-18 Havoc Pennington <hp@pobox.com>
3737 * configure.in: default --enable-tests to $USE_MAINTAINER_MODE
3739 * dbus/Makefile.am: fix it up so dubs-test-main.c is included in
3742 * test/Makefile.am: don't use special variable "TESTS" for echo-*
3743 since we don't want to use those in make check
3745 2003-01-15 Havoc Pennington <hp@redhat.com>
3751 2003-01-15 Havoc Pennington <hp@redhat.com>
3753 * test/Makefile.am: fix so that test source code ends up in the
3754 distribution on make distcheck
3756 2003-01-15 Havoc Pennington <hp@redhat.com>
3762 2003-01-15 Havoc Pennington <hp@redhat.com>
3764 * dbus/dbus-test.c (dbus_internal_symbol_do_not_use_run_tests):
3765 fix build when --disable-tests
3767 * Makefile.am (EXTRA_DIST): put HACKING in here
3769 * HACKING: document procedure for making a tarball release.
3771 2003-01-14 Anders Carlsson <andersca@codefactory.se>
3773 * bus/connection.c: (connection_error_handler),
3774 (bus_connection_setup):
3775 * bus/main.c: (main):
3776 Make sure that the DBusConnectionData struct is NULLed
3777 out to prevent a segfault.
3779 * dbus/dbus-errors.c: (dbus_result_to_string):
3780 * dbus/dbus-errors.h:
3781 * dbus/dbus-message.c: (dbus_message_get_fields),
3782 (dbus_message_get_fields_valist), (_dbus_message_test):
3783 * dbus/dbus-message.h:
3784 Make dbus_message_get_fields return a result code so we can
3785 track invalid fields as well as oom.
3787 2003-01-11 Havoc Pennington <hp@pobox.com>
3789 * configure.in: change --enable-test/--enable-ansi action-if-given
3790 to enable_foo=$enableval instead of enable_foo=yes
3792 2003-01-08 Havoc Pennington <hp@pobox.com>
3794 * dbus/dbus-string.c (_dbus_string_align_length): new function
3796 * dbus/dbus-test-main.c: move main() for test app here
3798 (dbus_internal_symbol_do_not_use_run_tests): we have to export a
3799 symbol to run tests, because dbus-test isn't in the main
3802 Code review nitpicks.
3804 * dbus/dbus-message.c (dbus_message_write_header): add newlines
3805 for people with narrow emacs ;-). Assert client_serial was filled
3806 in. Assert message->name != NULL.
3807 (dbus_message_append_fields): have "first_field_type" arg separate
3808 from va list, needed for C++ binding that also uses varargs IIRC
3809 and helps with type safety
3810 (dbus_message_new): add @todo about using DBusString to store
3811 service/name internally
3812 (dbus_message_new): don't leak ->service and ->name on OOM later
3814 (dbus_message_unref): free the service name
3815 (dbus_message_get_fields): same change to varargs
3816 i.e. first_field_type
3817 (_dbus_message_loader_return_buffer): assert that the message data
3818 is aligned (if not it's a bug in our code). Put in verbose griping
3819 about why we set corrupted = TRUE.
3820 (decode_header_data): add FIXME that char* is evil. Was going to
3821 add FIXME about evil locale-specific string.h strncmp, but just
3822 switched to wacky string-as-uint32 optimization. Move check for
3823 "no room for field name" above get_const_data_len() to avoid
3824 assertion failure in get_const_data_len if we have trailing 2
3825 bytes or the like. Check for service and name fields being
3826 provided twice. Don't leak service/name on error. Require field
3827 names to be aligned to 4 bytes.
3829 * dbus/dbus-marshal.c: move byte swap stuff to header
3830 (_dbus_pack_int32): uscore-prefix
3831 (_dbus_unpack_int32): uscore-prefix
3832 (_dbus_unpack_uint32): export
3833 (_dbus_demarshal_string): add @todo complaining about use of
3835 (_dbus_marshal_get_field_end_pos): add @todo about bad error
3836 handling allowing corrupt data to go unchecked
3838 2003-01-08 Havoc Pennington <hp@redhat.com>
3840 * dbus/dbus-transport-unix.c (unix_do_iteration): add read/write
3841 to the select() as needed for authentication. (should be using
3842 _dbus_poll() not select, but for another day)
3844 * dbus/dbus.h: include dbus/dbus-protocol.h
3846 2003-01-08 Anders Carlsson <andersca@codefactory.se>
3848 * dbus/Makefile.am (dbusinclude_HEADERS): Install
3851 2003-01-08 Anders Carlsson <andersca@codefactory.se>
3853 * dbus/dbus-internals.c: (_dbus_type_to_string):
3854 New function that returns a string describing a type.
3856 * dbus/dbus-marshal.c: (_dbus_demarshal_byte_array):
3857 * dbus/dbus-marshal.h:
3858 * dbus/dbus-message.c: (dbus_message_get_fields_valist),
3859 (dbus_message_iter_get_field_type), (dbus_message_iter_get_double),
3860 (dbus_message_iter_get_byte_array):
3861 * dbus/dbus-message.h:
3862 Add new convenience functions for appending and getting message fields.
3863 Also add demarshalling routines for byte arrays.
3865 2003-01-07 Anders Carlsson <andersca@codefactory.se>
3867 * dbus/dbus-connection-internal.h:
3868 * dbus/dbus-connection.c: (_dbus_connection_new_for_transport),
3869 (_dbus_connection_get_next_client_serial),
3870 (dbus_connection_send_message):
3871 * dbus/dbus-internals.h:
3872 * dbus/dbus-marshal.c: (unpack_uint32), (dbus_unpack_int32),
3873 (dbus_pack_int32), (_dbus_marshal_double), (_dbus_marshal_int32),
3874 (_dbus_marshal_uint32), (_dbus_demarshal_double),
3875 (_dbus_demarshal_int32), (_dbus_demarshal_uint32),
3876 (_dbus_demarshal_string), (_dbus_marshal_get_field_end_pos),
3877 (_dbus_verbose_bytes), (_dbus_marshal_test):
3878 * dbus/dbus-marshal.h:
3879 * dbus/dbus-message-internal.h:
3880 * dbus/dbus-message.c: (_dbus_message_set_client_serial),
3881 (dbus_message_write_header), (_dbus_message_lock),
3882 (dbus_message_new), (dbus_message_ref), (dbus_message_unref),
3883 (dbus_message_get_name), (dbus_message_append_int32),
3884 (dbus_message_append_uint32), (dbus_message_append_double),
3885 (dbus_message_append_string), (dbus_message_append_byte_array),
3886 (dbus_message_get_fields_iter), (dbus_message_iter_ref),
3887 (dbus_message_iter_unref), (dbus_message_iter_has_next),
3888 (dbus_message_iter_next), (dbus_message_iter_get_field_type),
3889 (dbus_message_iter_get_string), (dbus_message_iter_get_int32),
3890 (dbus_message_iter_get_uint32), (dbus_message_iter_get_double),
3891 (decode_header_data), (_dbus_message_loader_return_buffer),
3892 (message_iter_test), (_dbus_message_test):
3893 * dbus/dbus-message.h:
3894 * dbus/dbus-protocol.h:
3895 * dbus/dbus-test.c: (main):
3897 * glib/test-dbus-glib.c: (message_handler), (main):
3898 * test/echo-client.c: (main):
3899 * test/watch.c: (check_messages):
3900 Make messages sendable and receivable for real.
3902 2003-01-07 Anders Carlsson <andersca@codefactory.se>
3904 * dbus/dbus-marshal.c: (_dbus_marshal_double),
3905 (_dbus_marshal_string), (_dbus_marshal_byte_array):
3906 * dbus/dbus-message.c: (dbus_message_append_int32),
3907 (dbus_message_append_uint32), (dbus_message_append_double),
3908 (dbus_message_append_string), (dbus_message_append_byte_array):
3909 Handle OOM restoration.
3911 2003-01-07 Anders Carlsson <andersca@codefactory.se>
3913 * dbus/dbus-marshal.c: (_dbus_marshal_string),
3914 (_dbus_demarshal_string), (_dbus_marshal_test):
3915 * dbus/dbus-marshal.h:
3916 * dbus/dbus-message.c: (dbus_message_get_name),
3917 Document these functions.
3919 (dbus_message_append_int32), (dbus_message_append_uint32),
3920 (dbus_message_append_double), (dbus_message_append_string),
3921 (dbus_message_append_byte_array):
3922 * dbus/dbus-message.h:
3923 Add functions for adding message fields of different types.
3925 * dbus/dbus-protocol.h:
3926 Add the different types.
3928 2003-01-05 Havoc Pennington <hp@pobox.com>
3930 * bus/connection.c: implement routines for handling connections,
3931 first thing is keeping a list of owned services on each connection
3932 and setting up watches etc.
3934 * bus/services.c: implement a mapping from service names to lists
3937 * dbus/dbus-hash.c: add DBUS_HASH_POINTER
3939 * dbus/dbus-threads.c (dbus_static_mutex_lock): add functions
3940 to use static mutexes for global data
3942 * dbus/dbus-connection.c (dbus_connection_set_data): add new
3943 collection of functions to set/get application-specific data
3944 on the DBusConnection.
3946 2003-01-04 Havoc Pennington <hp@pobox.com>
3948 * dbus/dbus-sysdeps.c (_dbus_sleep_milliseconds): new function
3949 (_dbus_poll): new function
3951 * dbus/dbus-internals.h (_DBUS_STRUCT_OFFSET): new macro
3954 * bus/loop.c: initial code for the daemon main loop
3956 2003-01-04 Havoc Pennington <hp@pobox.com>
3958 * test/watch.c (error_handler): make it safe if the error handler
3959 is called multiple times (if we s/error handler/disconnect
3960 handler/ we should just guarantee it's called only once)
3962 * dbus/dbus-transport.c (_dbus_transport_disconnect): call the
3963 error handler on disconnect (it's quite possible we should
3964 just change the error handler to a "disconnect handler," I'm
3965 not sure we have any other meaningful errors)
3967 * configure.in: check for getpwnam_r
3969 * dbus/dbus-transport.c, dbus/dbus-transport-unix.c,
3970 dbus/dbus-auth.c: add credentials support, add EXTERNAL auth
3971 mechanism as in SASL spec, using socket credentials
3973 * dbus/dbus-sysdeps.c (_dbus_read_credentials_unix_socket): new function
3974 (_dbus_send_credentials_unix_socket): new function
3976 * dbus/dbus-sysdeps.c (_dbus_accept_unix_socket): rename just
3978 (_dbus_write): only check errno if <0 returned
3979 (_dbus_write_two): ditto
3981 2003-01-02 Anders Carlsson <andersca@codefactory.se>
3983 * dbus/dbus-marshal.c: (_dbus_marshal_utf8_string),
3984 (_dbus_marshal_byte_array), (_dbus_demarshal_utf8_string),
3985 (_dbus_marshal_test):
3986 * dbus/dbus-marshal.h:
3987 Add _dbus_marshal_byte_array and rename _dbus_marshal_string
3988 to _dbus_marshal_utf8_string. Also fix some tests.
3990 2002-12-28 Harri Porten <porten@kde.org>
3992 * configure.in: added check for C++ compiler and a very cheesy
3993 check for the Qt integration
3995 * Makefile.am (SUBDIRS): compile qt subdir if support is enabled
3997 * qt/Makefile.am: added
3999 * qt/.cvsignore: added
4001 * qt/dbus-qthread.cc, qt/dbus-qthread.cpp: renamed former to
4002 latter, added #ifdef QT_THREAD_SUPPORT guard.
4004 * dbus/Makefile.am: added missing headers for make dist
4006 2002-12-28 Kristian Rietveld <kris@gtk.org>
4008 * dbus/Makefile.am: fixup export-symbols-regex.
4010 2002-12-27 Anders Carlsson <andersca@codefactory.se>
4012 * acinclude.m4: Add this file and put the
4013 PKG_CHECK_MODULE macro in it.
4015 2002-12-27 Anders Carlsson <andersca@codefactory.se>
4017 * dbus/dbus-marshal.c: (_dbus_marshal_string),
4018 (_dbus_demarshal_double), (_dbus_demarshal_int32),
4019 (_dbus_demarshal_uint32), (_dbus_demarshal_string),
4020 (_dbus_marshal_test):
4021 Make the demarshalling routines align the pos argument.
4022 Add string marshalling tests and fix the obvious bugs
4025 2002-12-26 Havoc Pennington <hp@pobox.com>
4027 * dbus/dbus-auth.c: fixes fixes fixes
4029 * dbus/dbus-transport-unix.c: wire up support for
4030 encoding/decoding data on the wire
4032 * dbus/dbus-auth.c (_dbus_auth_encode_data)
4033 (_dbus_auth_decode_data): append to target string
4034 instead of nuking it.
4036 2002-12-26 Havoc Pennington <hp@pobox.com>
4038 * dbus/dbus-marshal.h (DBUS_COMPILER_BYTE_ORDER): #ifdef
4039 WORDS_BIGENDIAN then compiler byte order is DBUS_BIG_ENDIAN,
4042 * dbus/dbus-marshal.c: Add macros to do int swapping in-place and
4043 avoid swap_bytes() overhead (ignoring possible assembly stuff for
4044 now). Main point is because I wanted unpack_uint32 to implement
4046 (_dbus_verbose_bytes): new function
4048 * dbus/dbus-string.c (_dbus_string_validate_ascii): new function
4050 * dbus/dbus-message.c (_dbus_message_loader_get_is_corrupted): add
4051 mechanism to handle a corrupt message stream
4052 (_dbus_message_loader_new): fix preallocation to only prealloc,
4055 * dbus/dbus-string.c (_dbus_string_skip_blank): fix this function
4056 (_dbus_string_test): enhance tests for copy/move and fix the
4059 * dbus/dbus-transport-unix.c: Hold references in more places to
4060 avoid reentrancy problems
4062 * dbus/dbus-transport.c: ditto
4064 * dbus/dbus-connection.c (dbus_connection_dispatch_message): don't
4065 leak reference count in no-message case
4067 * test/watch.c (do_mainloop): handle adding/removing watches
4068 during iteration over the watches. Also, ref the connection/server
4069 stored on a watch, so we don't try to mangle a destroyed one.
4071 * dbus/dbus-transport-unix.c (do_authentication): perform
4074 * dbus/dbus-auth.c (get_state): add a state
4075 AUTHENTICATED_WITH_UNUSED_BYTES and return it if required
4076 (_dbus_auth_get_unused_bytes): append the unused bytes
4077 to the passed in string, rather than prepend
4079 * dbus/dbus-transport.c (_dbus_transport_init_base): create
4080 the auth conversation DBusAuth
4082 * dbus/dbus-transport-unix.c (_dbus_transport_new_for_fd)
4083 (_dbus_transport_new_for_domain_socket): when creating a
4084 transport, pass in whether it's a client-side or server-side
4085 transport so we know which DBusAuth to create
4087 2002-12-03 Havoc Pennington <hp@pobox.com>
4089 * dbus/dbus-transport-unix.c (unix_finalize): finalize base
4090 _after_ finalizing the derived members
4091 (unix_connection_set): unref watch if we fail to add it
4093 * dbus/dbus-connection.c (dbus_connection_unref): delete the
4094 transport first, so that the connection owned by the
4095 transport will be valid as the transport finalizes.
4097 * dbus/dbus-transport-unix.c (unix_finalize): free the write_watch
4098 if necessary, and remove watches from the connection.
4100 * dbus/dbus-watch.c (_dbus_watch_list_free): improve a comment
4102 2002-12-26 Anders Carlsson <andersca@codefactory.se>
4104 * dbus/dbus-marshal.c: (_dbus_marshal_string),
4105 (_dbus_demarshal_double), (_dbus_demarshal_int32),
4106 (_dbus_demarshal_uint32), (_dbus_demarshal_string),
4107 (_dbus_marshal_test):
4108 * dbus/dbus-marshal.h:
4109 Add string marshal functions and have the demarshal functions
4110 return the new position.
4112 2002-12-25 Havoc Pennington <hp@pobox.com>
4114 * doc/dbus-sasl-profile.txt: docs on the authentication protocol,
4115 it is a simple protocol that just maps directly to SASL.
4117 * dbus/dbus-auth.h, dbus/dbus-auth.c: authentication protocol
4118 initial implementation, not actually used yet.
4120 * dbus/dbus-string.c (_dbus_string_find): new function
4121 (_dbus_string_equal): new function
4122 (_dbus_string_base64_encode): new function
4123 (_dbus_string_base64_decode): new function
4125 2002-12-25 Anders Carlsson <andersca@codefactory.se>
4128 * dbus/dbus-marshal.c: (swap_bytes), (_dbus_marshal_double),
4129 (_dbus_marshal_int32), (_dbus_marshal_uint32),
4130 (_dbus_demarshal_double), (_dbus_demarshal_int32),
4131 (_dbus_demarshal_uint32), (_dbus_marshal_test):
4132 * dbus/dbus-marshal.h:
4133 * dbus/dbus-protocol.h:
4134 * dbus/dbus-test.c: (main):
4136 Add un-optimized marshalling/demarshalling routines.
4138 2002-12-25 Harri Porten <porten@kde.org>
4140 * qt/dbus-qt.h: adjusted ctor and getter to KDE/Qt conventions
4142 2002-12-24 Zack Rusin <zack@kde.org>
4144 * qt/dbus-qthread.cc: adding - integrates QMutex into Dbus
4145 * qt/dbus-qt.h: skeleton with two sample implemenatation of the
4148 2002-12-24 Havoc Pennington <hp@pobox.com>
4150 * glib/dbus-gthread.c: fix include
4152 * glib/dbus-glib.h: rename DBusMessageHandler for now.
4153 I think glib API needs to change, though, as you don't
4154 want to use DBusMessageFunction, you want to use the
4155 DBusMessageHandler object. Probably
4156 dbus_connection_open_with_g_main_loop()
4157 and dbus_connection_setup_g_main_loop() or something like that
4158 (but think of better names...) that just create a connection
4159 that has watch/timeout functions etc. already set up.
4161 * dbus/dbus-connection.c
4162 (dbus_connection_send_message_with_reply): new function just to
4163 show how the message handler helps us deal with replies.
4165 * dbus/dbus-list.c (_dbus_list_remove_last): new function
4167 * dbus/dbus-string.c (_dbus_string_test): free a string that
4170 * dbus/dbus-hash.c: use memory pools for the hash entries
4171 (rebuild_table): be more paranoid about overflow, and
4172 shrink table when we can
4173 (_dbus_hash_test): reduce number of sprintfs and write
4174 valid C89. Add tests for case where we grow and then
4175 shrink the hash table.
4177 * dbus/dbus-mempool.h, dbus/dbus-mempool.c: memory pools
4179 * dbus/dbus-connection.c (dbus_connection_register_handler)
4180 (dbus_connection_unregister_handler): new functions
4182 * dbus/dbus-message.c (dbus_message_get_name): new
4184 * dbus/dbus-list.c: fix docs typo
4186 * dbus/dbus-message-handler.h, dbus/dbus-message-handler.c:
4187 an object representing a handler for messages.
4189 2002-12-16 Anders Carlsson <andersca@codefactory.se>
4192 * glib/dbus-gthread.c: (dbus_gthread_init):
4193 Don't use the gdbus prefix for public functions.
4195 2002-12-16 Anders Carlsson <andersca@codefactory.se>
4199 Add GLib checks and fixup .pc files
4203 * glib/dbus-gmain.c: (gdbus_connection_prepare),
4204 (gdbus_connection_check), (gdbus_connection_dispatch),
4205 (gdbus_add_connection_watch), (gdbus_remove_connection_watch),
4206 (dbus_connection_gsource_new):
4207 * glib/dbus-gthread.c: (dbus_gmutex_new), (dbus_gmutex_free),
4208 (dbus_gmutex_lock), (dbus_gmutex_unlock), (dbus_gthread_init):
4209 * glib/test-dbus-glib.c: (message_handler), (main):
4212 2002-12-15 Harri Porten <porten@kde.org>
4214 * autogen.sh: check for libtoolize before attempting to use it
4216 * dbus/dbus-transport-unix.c: include <sys/time.h> for timeval
4219 * .cvsignore: ignore more stamp files
4221 * dbus/dbus-watch.c (_dbus_watch_list_new): fixed doc error
4223 * test/Makefile.am: added -I$(top_srcdir) to be able to compile
4224 without make install.
4226 2002-12-15 Havoc Pennington <hp@pobox.com>
4228 * dbus/dbus-threads.c: add thread stubs that a higher library
4229 layer can fill in. e.g. the GLib wrapper might fill them in with
4230 GThread stuff. We still need to use this thread API to
4231 thread-safe-ize the library.
4233 2002-12-12 Havoc Pennington <hp@pobox.com>
4235 * dbus/dbus-transport-unix.c, dbus/dbus-server-unix.c: use the
4236 below new interfaces and include fewer system headers.
4238 * dbus/dbus-sysdeps.c (_dbus_read): new function
4239 (_dbus_write): new function
4240 (_dbus_write_two): new function
4241 (_dbus_connect_unix_socket): new function
4242 (_dbus_listen_unix_socket): new function
4244 * dbus/dbus-message-internal.h: change interfaces to use
4247 2002-12-11 Havoc Pennington <hp@pobox.com>
4249 * dbus/dbus-types.h: add dbus_unichar
4251 * dbus/dbus-internals.c (_dbus_verbose): use _dbus_getenv
4253 * dbus/dbus-connection.c (dbus_connection_send_message): return
4256 * dbus/dbus-transport.c: include dbus-watch.h
4258 * dbus/dbus-connection.c: include dbus-message-internal.h
4260 * HACKING: add file with coding guidelines stuff.
4262 * dbus/dbus-string.h, dbus/dbus-string.c: Encapsulate all string
4263 handling here, for security purposes (as in vsftpd). Not actually
4264 using this class yet.
4266 * dbus/dbus-sysdeps.h, dbus/dbus-sysdeps.c: Encapsulate all
4267 system/libc usage here, as in vsftpd, for ease of auditing (and
4268 should also simplify portability). Haven't actually moved all the
4269 system/libc usage into here yet.
4271 2002-11-25 Havoc Pennington <hp@pobox.com>
4273 * dbus/dbus-internals.c (_dbus_verbose): fix to not
4274 always print the first verbose message.
4276 2002-11-24 Havoc Pennington <hp@pobox.com>
4278 * test/echo-client.c, test/echo-server.c: cheesy test
4281 * configure.in (AC_CHECK_FUNCS): check for writev
4283 * dbus/dbus-message.c (_dbus_message_get_network_data): new
4286 * dbus/dbus-list.c (_dbus_list_foreach): new function
4288 * dbus/dbus-internals.c (_dbus_verbose): new function
4290 * dbus/dbus-server.c, dbus/dbus-server.h: public object
4291 representing a server that listens for connections.
4293 * dbus/.cvsignore: create
4295 * dbus/dbus-errors.h, dbus/dbus-errors.c:
4296 public API for reporting errors
4298 * dbus/dbus-connection.h, dbus/dbus-connection.c:
4299 public object representing a connection that
4300 sends/receives messages. (Same object used for
4301 both client and server.)
4303 * dbus/dbus-transport.h, dbus/dbus-transport.c:
4304 Basic abstraction for different kinds of stream
4305 that we might read/write messages from.
4307 2002-11-23 Havoc Pennington <hp@pobox.com>
4309 * dbus/dbus-internals.h (_DBUS_INT_MAX): add _DBUS_INT_MIN
4312 * dbus/dbus-test.c (main): add list test, and include
4313 dbus-test.h as intended
4315 * dbus/dbus-hash.c (_dbus_hash_table_remove_string)
4316 (_dbus_hash_table_remove_int): return value indicates
4317 whether the entry existed to remove
4319 * dbus/dbus-list.c: add linked list utility class,
4322 * dbus/dbus-hash.c: add TODO item about shrinking the hash bucket
4325 2002-11-23 Havoc Pennington <hp@pobox.com>
4327 * Doxyfile.in (INCLUDE_FILE_PATTERNS): expand DBUS_BEGIN_DECLS/
4328 DBUS_END_DECLS to nothing, that should fix this once and for all
4330 * Doxyfile.in (JAVADOC_AUTOBRIEF): set to YES
4332 * dbus/dbus-message.c, dbus/dbus-hash.c:
4333 add some missing @brief
4335 2002-11-23 Havoc Pennington <hp@pobox.com>
4337 * dbus/dbus-message.h: put semicolons after DEBUG_BEGIN_DECLS
4338 to avoid confusing Doxygen
4340 * dbus/dbus-hash.c: @} not }@
4342 * dbus/dbus-message.c (struct DBusMessage): split out
4345 2002-11-23 Havoc Pennington <hp@pobox.com>
4347 * configure.in: pile on more warning flags if using gcc
4349 * Doxyfile.in (EXTRACT_STATIC): set to NO, so we don't have
4350 to document static functions
4352 * configure.in: add summary to end of configure so it
4353 looks nice and attractive
4355 * dbus/dbus-hash.c: finish implementation and write unit
4358 * configure.in: add --enable-tests to enable unit tests
4360 * dbus/dbus-test.c: test program to run unit tests
4361 for all files in dbus/*, initially runs a test for
4364 * dbus/dbus-internals.h: file to hold some internal utility stuff
4366 2002-11-22 Havoc Pennington <hp@redhat.com>
4368 * dbus/dbus-hash.c: copy in Tcl hash table, not yet
4369 "ported" away from Tcl
4371 * dbus/dbus-types.h: header for types such as dbus_bool_t
4373 2002-11-22 Havoc Pennington <hp@redhat.com>
4375 * dbus/dbus.h: fixups for doc warnings
4377 * Doxyfile.in (FILE_PATTERNS): we need to scan .h to pick up
4379 (QUIET): make it quiet so we can see warnings
4381 * dbus/dbus-memory.c: teach D-BUS to allocate and free memory
4383 2002-11-22 Havoc Pennington <hp@redhat.com>
4385 * Makefile.am: include "Doxyfile" target in all-local
4387 * configure.in: generate the Doxyfile
4389 * Doxyfile.in: move Doxyfile here, so we can use
4390 configure to generate a Doxyfile with the right
4393 2002-11-22 Havoc Pennington <hp@redhat.com>
4395 * dbus/dbus-message.c: move inline docs into .c file
4397 * Doxyfile (OUTPUT_DIRECTORY): move output to doc/api
4398 so all docs are under doc/
4399 (MAN_EXTENSION): generate man pages. Use extension
4400 ".3dbus" which matches ".3qt" on my system,
4401 I guess this is OK, I don't know really.
4402 (FILE_PATTERNS): look for .c files not .h, makes sense
4405 2002-11-22 Havoc Pennington <hp@pobox.com>
4407 * Makefile.am (SUBDIRS): rename subdir "server" to "bus"
4408 because any app can be a server, and any app can be a client,
4409 the bus is a special kind of server.
4411 Thu Nov 21 23:35:31 2002 Zack Rusin <zack@kde.org>
4413 * Doxyfile : adding. Still needs Makefile rules to be generated
4414 automatically (just run "doxygen" in the toplevel dir for now to
4417 * dbus/dbus-message.h : Adding sample docs (javadoc since
4418 resembles gtk-doc a little more)
4420 * dbus/dbus.h : Adding sample docs
4422 2002-11-21 Havoc Pennington <hp@redhat.com>
4424 * dbus/Makefile.am (INCLUDES): define DBUS_COMPILATION
4425 so we can allow ourselves to include files directly,
4426 instead of having to use dbus.h
4428 * dbus/dbus.h: fill in
4430 * dbus/dbus-message.h: sketch out a sample header file.
4431 Include griping if you include it directly instead of
4434 * dbus/dbus-macros.h: new file with macros for extern "C",
4435 TRUE/FALSE, NULL, etc.
4437 * doc/file-boilerplate.c: put include guards in here
4439 2002-11-21 Havoc Pennington <hp@redhat.com>
4441 * doc/file-boilerplate.c: include both AFL and GPL boilerplate.
4443 * COPYING: include the GPL as well, and license code
4444 under both AFL and GPL.
4446 2002-11-21 Havoc Pennington <hp@redhat.com>
4448 * acconfig.h: get rid of this
4450 * autogen.sh (run_configure): add --no-configure option
4452 * configure.in: remove AC_ARG_PROGRAM to make
4453 autoconf complain less. add AC_PREREQ.
4454 add AC_DEFINE third arg.
4456 2002-11-21 Anders Carlsson <andersca@codefactory.se>
4459 Fix references so we can distcheck.
4461 2002-11-21 Havoc Pennington <hp@redhat.com>
4463 * Initial module creation