1 2003-04-25 Havoc Pennington <hp@redhat.com>
3 test suite is slightly hosed at the moment, will fix soon
5 * bus/connection.c (bus_connections_expire_incomplete): fix to
6 properly disable the timeout when required
7 (bus_connection_set_name): check whether we can remove incomplete
8 connections timeout after we complete each connection.
10 * dbus/dbus-mainloop.c (check_timeout): fix this up a bit,
11 probably still broken.
13 * bus/services.c (bus_registry_acquire_service): implement max
14 number of services owned, and honor allow/deny rules on which
15 services a connection can own.
17 * bus/connection.c (bus_connection_get_policy): report errors here
19 * bus/activation.c: implement limit on number of pending
22 2003-04-25 Havoc Pennington <hp@redhat.com>
24 * dbus/dbus-transport.c (_dbus_transport_get_unix_user): fix bug
25 where we used >= 0 instead of != DBUS_UID_UNSET.
27 2003-04-25 Havoc Pennington <hp@redhat.com>
29 * glib/dbus-gmain.c (remove_watch): fix for a crash when watches
30 were toggled without add/remove, fix from Anders Gustafsson
32 2003-04-24 Havoc Pennington <hp@redhat.com>
34 * test/data/valid-config-files/basic.conf: add <limit> tags to
37 * bus/config-parser.h, bus/config-parser.c, bus/bus.c: Implement
38 <limit> tag in configuration file.
40 2003-04-24 Havoc Pennington <hp@redhat.com>
42 * bus/dispatch.c: somehow missed some name_is
44 * dbus/dbus-timeout.c (_dbus_timeout_set_enabled)
45 (_dbus_timeout_set_interval): new
47 * bus/connection.c (bus_connections_setup_connection): record time
48 when each connection is first set up, and expire them after the
51 2003-04-24 Havoc Pennington <hp@redhat.com>
53 * dbus/dbus-message.c (dbus_message_name_is): rename
54 (dbus_message_service_is): rename
55 (dbus_message_sender_is): rename
56 (dbus_message_get_service): rename
58 2003-04-24 Havoc Pennington <hp@redhat.com>
60 * configure.in: add --enable-checks
62 * dbus/dbus-message.c (dbus_message_new): reverse name/service arguments
64 * dbus/dbus-connection.c (dbus_connection_preallocate_send): fix
66 (_dbus_connection_handler_destroyed_locked): move some private
67 functions into proper docs group
69 * dbus/dbus-internals.h: add _dbus_return_if_fail,
70 _dbus_return_val_if_fail
72 Throughout: use dbus_return_if_fail
74 2003-04-23 James Willcox <jwillcox@gnome.org>
77 * glib/dbus-gmain.c: (add_timeout), (wakeup_main), (create_source),
78 (dbus_connection_setup_with_g_main),
79 (dbus_server_setup_with_g_main):
80 * glib/test-dbus-glib.c: (main):
81 * glib/test-thread-client.c: (main):
82 * glib/test-thread-server.c: (new_connection_callback), (main):
83 * tools/dbus-monitor.c: (main):
85 Added a GMainContext argument to dbus_connection_setup_with_g_main()
86 and dbus_server_setup_with_g_main().
88 2003-04-20 Havoc Pennington <hp@pobox.com>
90 * doc/dbus-specification.sgml: document the restrictions on
91 message and service names
93 2003-04-22 Havoc Pennington <hp@redhat.com>
95 * dbus/dbus-message.c, dbus/dbus-marshal.c: add 64-bit integer
96 support, and do some code cleanups to share more code and
97 speed up array marshal/demarshal.
99 * dbus-1.0.pc.in (Cflags): put libdir include file in cflags
101 * configure.in: generate dbus-arch-deps.h
103 * dbus/dbus-protocol.h (DBUS_TYPE_INT64, DBUS_TYPE_UINT64): add
106 2003-04-22 Havoc Pennington <hp@redhat.com>
108 * test/data/valid-messages/opposite-endian.message: fix test
109 to use proper type for rply field
111 * test/data/invalid-messages: add tests for below validation
113 * dbus/dbus-message.c (decode_header_data): validate field types,
114 and validate that named fields are valid names
115 (decode_name_field): consider messages in the
116 org.freedesktop.Local. namespace to be invalid.
118 * dbus/dbus-string.c (_dbus_string_validate_name): new
120 2003-04-19 Havoc Pennington <hp@pobox.com>
122 * bus/driver.c (bus_driver_handle_hello): check limits and
123 return an error if they are exceeded.
125 * bus/connection.c: maintain separate lists of active and inactive
126 connections, and a count of each. Maintain count of completed
127 connections per user. Implement code to check connection limits.
129 * dbus/dbus-list.c (_dbus_list_unlink): export
131 * bus/bus.c (bus_context_check_security_policy): enforce a maximum
132 number of bytes in the message queue for a connection
134 2003-04-18 Havoc Pennington <hp@pobox.com>
136 * dbus/dbus-auth.c (record_mechanisms): memleak fixes
138 * dbus/dbus-sysdeps.c (_dbus_string_save_to_file): fix some
141 * dbus/dbus-keyring.c (add_new_key): fix a memleak, and
142 on realloc be sure to update the pointer in the keyring
144 * dbus/dbus-string.c (_dbus_string_zero): compensate for align
145 offset to avoid writing to unallocated memory
147 * dbus/dbus-auth.c (process_rejected): return FALSE if we fail to
148 try the next mechanism, so we properly handle OOM
150 * dbus/dbus-keyring.c (_dbus_keyring_new_homedir): fix double-free
152 (_dbus_keyring_new): fix OOM bug
153 (_dbus_keyring_new_homedir): always set error; impose a maximum
154 number of keys we'll load from the file, mostly to speed up the
155 test suite and make its OOM checks more useful, but also for
158 * dbus/dbus-auth.c (process_error_server): reject authentication
159 if we get an error from the client
160 (process_cancel): on cancel, send REJECTED, per the spec
161 (process_error_client): send CANCEL if we get an error from the
164 2003-04-18 Havoc Pennington <hp@pobox.com>
166 * dbus/dbus-mainloop.c (_dbus_loop_iterate): fix UMR in verbose
169 * dbus/dbus-auth.c (handle_client_data_cookie_sha1_mech): fix OOM
172 * dbus/dbus-keyring.c (_dbus_keyring_new_homedir): only whine
173 about DBUS_TEST_HOMEDIR once
175 * bus/Makefile.am (TESTS_ENVIRONMENT): put DBUS_TEST_HOMEDIR in
178 * bus/dispatch.c (bus_dispatch_sha1_test): actually load sha1
179 config file so we test the right thing
181 Throughout: assorted docs improvements
183 2003-04-18 Havoc Pennington <hp@pobox.com>
185 * glib/dbus-gmain.c: adapt to watch changes
187 * bus/bus.c, bus/activation.c, etc.: adjust to watch changes
189 * dbus/dbus-server.h: remove dbus_server_handle_watch
191 * dbus/dbus-connection.h: remove dbus_connection_handle_watch
193 * dbus/dbus-watch.c (dbus_watch_handle): change DBusWatch to work
194 like DBusTimeout, so we don't need dbus_connection_handle_watch
197 2003-04-17 Havoc Pennington <hp@redhat.com>
199 * dbus/dbus-userdb.c, dbus/dbus-sysdeps.c: redo all the passwd
200 database usage so it all goes via the DBusUserDatabase cache.
202 2003-04-17 Havoc Pennington <hp@redhat.com>
204 * dbus/dbus-mainloop.c (_dbus_loop_iterate): fix logic so that if
205 there was an OOM watch we skipped, we always return TRUE so we
206 iterate again to have a look at it again. Fixes test suite hang.
207 Code rearrangement also lets us lose some memset and only iterate
210 * bus/driver.c (bus_driver_handle_message): sense of test for
213 2003-04-16 Havoc Pennington <hp@pobox.com>
215 * doc/dbus-specification.sgml: make spec say serials are unsigned
217 * dbus/dbus-message.h: change message serials to unsigned
219 * dbus/dbus-connection.c: adapt to message serials being unsigned
221 2003-04-15 Havoc Pennington <hp@pobox.com>
223 * bus/bus.c: create and keep around a shared DBusUserDatabase
226 * bus/connection.c (bus_connection_get_groups): don't cache
227 groups for user in the connection object, since user database
228 object now does that.
230 2003-04-16 Havoc Pennington <hp@redhat.com>
232 * dbus/dbus-message.c (_dbus_message_add_size_counter): keep a
233 list of size counters
234 (_dbus_message_loader_putback_message_link): put back a popped link
236 * dbus/dbus-connection.c
237 (dbus_connection_set_max_live_messages_size): rename
239 (dbus_connection_get_outgoing_size): get size of outgoing
241 (_dbus_connection_set_connection_counter): remove this cruft
243 2003-04-14 Havoc Pennington <hp@redhat.com>
245 * dbus/dbus-userdb.c: user database abstraction, mostly to get
246 caching, but at some point we might want to be able to use a
249 * bus/dispatch.c (bus_dispatch_sha1_test): add a test that uses
250 SHA1 conf file to test the sha1 auth mechanism, since the regular
251 test always uses EXTERNAL when available.
254 test/data/valid-config-files/debug-allow-all-sha1.conf.in:
255 add conf file that requires use of sha1 auth
257 2003-04-13 Havoc Pennington <hp@pobox.com>
259 * tools/dbus-send.c, tools/dbus-monitor.c: two utility programs
260 from Philip Blundell to send messages and monitor them.
262 2003-04-13 Havoc Pennington <hp@pobox.com>
264 * dbus/dbus-mainloop.c: fix some reentrancy issues by refcounting
267 * test/data/valid-config-files/debug-allow-all.conf.in: allow all
270 * dbus/dbus-transport.c (_dbus_transport_get_dispatch_status):
271 fix to only recover unused bytes if we're already authenticated
272 (_dbus_transport_get_is_authenticated): fix to still mark us
273 authenticated if there are unused bytes.
275 * bus/dispatch.c: implement security policy checking
277 * bus/connection.c (bus_transaction_send_from_driver): new
279 * bus/bus.c (bus_context_check_security_policy): new
281 * bus/dispatch.c (send_service_nonexistent_error): delete this,
282 now we just set the DBusError and it gets converted to an error
285 * bus/connection.c (allow_user_function): enable code using actual
286 data from the config file
288 * bus/policy.c (list_allows_user): handle wildcard rules for
289 user/group connection perms
291 2003-04-13 Havoc Pennington <hp@pobox.com>
293 * bus/config-parser.c: Load up the BusPolicy and BusPolicyRules
295 * dbus/dbus-sysdeps.c (_dbus_get_user_id): new function
297 * bus/policy.c (bus_policy_append_mandatory_rule)
298 (bus_policy_append_default_rule, bus_policy_append_user_rule)
299 (bus_policy_append_group_rule): new functions
301 2003-04-12 Havoc Pennington <hp@pobox.com>
303 * bus/config-parser.c (bus_config_parser_new): fix a memleak
305 * dbus/dbus-sysdeps.c: change DBusCredentials to use longs for
306 the pid/gid/uid, just for paranoia.
308 * test/break-loader.c (randomly_do_n_things): find a byte
309 containing a type code, and randomly change it to a different
312 2003-04-12 Havoc Pennington <hp@pobox.com>
314 * bus/policy.h: change BusPolicy to be the thing from the config
315 file, and rename old BusPolicy to BusClientPolicy
317 * bus/bus.c, bus/connection.c, bus/config-parser.c: change to
318 match change in how policy works
320 * dbus/dbus-internals.h: mark assert_not_reached as
321 __attribute((noreturn))__
323 2003-04-11 Havoc Pennington <hp@redhat.com>
325 * doc/dbus-specification.sgml: fix a spot with the wrong name for
326 the broadcast service. Use boolean return for ServiceExists.
328 2003-04-11 Havoc Pennington <hp@redhat.com>
330 * configure.in: add another directory to look for qt in.
332 2003-04-11 Havoc Pennington <hp@redhat.com>
334 * AUTHORS: add Colin Walters
336 2003-04-11 Havoc Pennington <hp@redhat.com>
342 2003-04-11 Havoc Pennington <hp@redhat.com>
344 * bus/messagebus.in: remove pid file when stopping the
345 message bus, since the bus won't have privileges to remove it
348 2003-04-11 Havoc Pennington <hp@redhat.com>
350 * bus/bus.c (bus_context_new): move credentials change after
353 2003-04-11 Havoc Pennington <hp@pobox.com>
355 * test/decode-gcov.c: add "below average functions" to the
356 coverage report, and change how some of the code works.
358 * bus/test-main.c: bracket some stuff in DBUS_BUILD_TESTS so it's
359 not in the coverage stats.
361 * test/test-service.c (main): use _dbus_verbose not fprintf in a
362 couple places so running the test suite doesn't result in megaspam.
364 2003-04-11 Havoc Pennington <hp@pobox.com>
366 * bus/dispatch.c (check_existent_service_activation): accept a no
367 memory error in a place we didn't before
369 * bus/test.c (bus_test_run_everything): remove hacky "do it twice
370 in case the first one failed," since the test suite is less
373 2003-04-10 Havoc Pennington <hp@pobox.com>
375 * bus/dispatch.c (check_segfault_service_activation): add test
376 for launching an executable that just crashes.
378 * test/test-segfault.c (main): try setting coredumpsize to 0 so we
379 don't leave a million cores. We'll see how portable this is.
381 2003-04-10 Havoc Pennington <hp@pobox.com>
383 * dbus/dbus-spawn.c (_dbus_spawn_async_with_babysitter): move all
384 the possible parent failures before we fork, so that we don't
385 fail to create a babysitter after creating the child.
387 * bus/activation.c (bus_activation_activate_service): kill child
388 if we don't successfully complete the activation.
390 2003-04-10 Havoc Pennington <hp@redhat.com>
392 * dbus/dbus-connection.c (dbus_connection_flush): don't spin on
393 the connection if it's disconnected
395 * bus/activation.c (bus_activation_service_created): use new
396 transaction features to roll back removal of pending activation if
397 we don't successfully create the service after all. Don't remove
398 pending activation if the function fails.
400 * dbus/dbus-list.c (_dbus_list_insert_before_link)
401 (_dbus_list_insert_after_link): new code to facilitate
404 * dbus/dbus-hash.c (_dbus_hash_table_insert_string_preallocated):
405 new functionality, so we can preallocate the ability to insert
408 * bus/connection.c (bus_transaction_add_cancel_hook): new function
409 allowing us to put custom hooks in a transaction to be used for
410 cancelling said transaction
412 * doc/dbus-specification.sgml: add some discussion of secondary
413 service owners, and disallow zero-length service names
415 * bus/services.c (bus_registry_acquire_service): new function,
416 splits out part of bus_driver_handle_acquire_service() and fixes
417 a bug where we didn't remove the service doing the acquiring
418 from the secondary queue if we failed to remove the current owner
419 from the front of the queue.
421 2003-04-10 Alexander Larsson <alexl@redhat.com>
423 * doc/dbus-specification.sgml:
424 s/org.freedesktop.Broadcast/org.freedesktop.DBus.Broadcast/
426 2003-04-10 Alexander Larsson <alexl@redhat.com>
431 Added files to cvsignore
433 * dbus/dbus-message.h:
434 * dbus/dbus-message.c: (dbus_message_iter_get_named):
435 Make get_named() take two out argument and return a boolean.
436 (dbus_message_iter_get_args_valist):
437 Update usage of get_named().
438 (dbus_message_iter_append_byte):
440 (dbus_message_iter_append_named)
442 (message_iter_test), (check_message_handling_type), (_dbus_message_test):
445 2003-04-10 Alexander Larsson <alexl@redhat.com>
447 * dbus/dbus-marshal.[ch]:
448 Add array_type_pos argument to _dbus_marshal_validate_arg.
449 Let you pass a NULL end_pos to _dbus_marshal_validate_type.
451 * dbus/dbus-message.[ch]:
452 Multi-dimensional arrays have full type specification in the
453 outermost array. Iter code re-arranged to handle this.
454 Added some more iter tests.
456 * doc/dbus-specification.sgml:
459 Update new array encoding description.
460 Correct DBUS_SERVICE_FLAGS_REPLACE_EXISTING description.
462 * test/data/invalid-messages/array-with-mixed-types.message:
463 * test/data/valid-messages/array-of-array-of-uint32.message:
464 Change to the new array format.
466 * test/data/invalid-messages/too-short-dict.message:
469 * test/data/valid-messages/recursive-types.message:
470 Fix up and extend test.
472 2003-04-10 Havoc Pennington <hp@pobox.com>
474 * bus/dispatch.c: lots of fixes
476 * dbus/dbus-mainloop.c (_dbus_loop_dispatch): export
477 (_dbus_loop_iterate): remove old "quit if no callbacks" code,
478 that was crack, broke the test service.
480 * dbus/dbus-transport.c (_dbus_transport_open): fix error
481 handling to avoid piling up errors if we get a failure on the
484 * dbus/dbus-internals.c (_dbus_real_assert_not_reached): include
485 pid in assertion failures.
487 * dbus/dbus-mainloop.c (_dbus_loop_iterate): use static arrays up
488 to some fixed size of file descriptor array. Don't return TRUE
489 anytime a timeout exists, that led to lots of busy loop silliness
492 2003-04-09 Havoc Pennington <hp@redhat.com>
494 * dbus/dbus-mainloop.c (check_timeout): fix timeouts, I thought
495 I'd checked this in earlier but hadn't.
497 2003-04-09 Havoc Pennington <hp@redhat.com>
499 * bus/dispatch.c (bus_dispatch_test): get a bit further through
500 the activation test (man this is getting old!)
502 2003-04-09 Havoc Pennington <hp@redhat.com>
504 * test/test-utils.c: use dispatch status function to fix this up
506 * bus/connection.c (connection_watch_callback): don't dispatch
508 (connection_timeout_callback): don't dispatch from here
509 (bus_connections_setup_connection): set the dispatch status function
510 (bus_connection_disconnected): unset it
512 * dbus/dbus-mainloop.c (_dbus_loop_queue_dispatch): new function
513 used to add a connection to be dispatched
514 (_dbus_loop_iterate): do the dispatching at the end of each
517 * dbus/dbus-connection.c
518 (dbus_connection_set_dispatch_status_function): new function
519 allowing us to fix up main loop usage
520 (_dbus_connection_last_unref): free all the various function
522 (dbus_connection_dispatch): call the DispatchStatusFunction
523 whenever this function returns
524 (dbus_connection_handle_watch): call DispatchStatusFunction
525 (dbus_connection_send_with_reply_and_block): call DispatchStatusFunction
526 (reply_handler_timeout): call DispatchStatusFunction
527 (dbus_connection_flush): call DispatchStatusFunction
529 2003-04-09 Havoc Pennington <hp@redhat.com>
531 * dbus/dbus-bus.c (dbus_bus_register): fix up error handling and
534 * bus/dispatch.c (check_service_activated): fix bug in test
536 * dbus/dbus-mainloop.c (check_timeout): fix this up
538 * dbus/dbus-internals.c (_dbus_verbose_real): include PID in
539 verbose output so we can sort out output from different processes,
540 e.g. in the activation case.
542 2003-04-08 Colin Walters <walters@gnu.org>
544 * bus/bus.c (struct BusContext) [pidfile]: New member, to store
546 (bus_context_new): Set it.
547 (bus_context_unref): Use it to delete the pid file.
549 2003-04-08 Havoc Pennington <hp@redhat.com>
551 * test/data/invalid-messages/array-with-mixed-types.message:
552 regression test that fails for the moment
554 * dbus/dbus-test.c (dbus_internal_do_not_use_run_tests): reorder
555 tests for convenience
557 * dbus/dbus-marshal.c (_dbus_marshal_validate_arg): don't allow
558 array of nil, it broke things.
560 * test/data/invalid-messages/array-of-nil.message: regression test
562 * test/data/valid-messages/array-of-array-of-uint32.message:
563 happened to write this so added it to suite
565 2003-04-08 Havoc Pennington <hp@redhat.com>
567 * bus/driver.c (bus_driver_handle_acquire_service): init
568 retval/reply before checking name
570 * dbus/dbus-marshal.c (_dbus_marshal_validate_arg): add a
571 recursion depth argument
573 * dbus/dbus-message.h (struct DBusMessageIter): put some padding
574 in the public struct for future extension
576 * dbus/dbus-message-builder.c (_dbus_message_data_load): fix
579 * dbus/dbus-marshal.c (_dbus_marshal_validate_arg): fix a verbose
582 * doc/dbus-specification.sgml: fix typo
584 2003-04-08 Alexander Larsson <alexl@redhat.com>
586 Implemented recursive types, named types and new-style iters
589 * glib/test-thread-client.c: (thread_func):
590 * glib/test-thread-server.c: (handle_test_message):
591 * test/test-service.c: (handle_echo):
600 * dbus/dbus-internals.c: (_dbus_type_to_string):
601 Update for new types.
603 * dbus/dbus-marshal.[ch]:
604 Implement recursive types and the new marshalling format.
605 Remove hardcoded dict marshalling.
608 * dbus/dbus-message-builder.c:
610 Remove references to old types
612 * dbus/dbus-message.[ch]:
613 New non-refcounted iter API that supports recursive iters.
614 Use iters for appending, including support for recursive
616 Add byte and named type support.
617 Update everything to new marshalling formats.
618 Add tests for new API.
620 * dbus/dbus-protocol.h:
621 Remove old array types.
622 Add types: BYTE, ARRAY, DICT, NAMED
624 * dbus/dbus-string.c:
625 * dbus/dbus-sysdeps.c:
626 Make parse_double locale safe.
628 * dbus/dbus-test-main.c:
634 * doc/dbus-specification.sgml:
637 * test/data/incomplete-messages/missing-body.message:
638 * test/data/invalid-messages/bad-boolean.message:
639 * test/data/invalid-messages/bad-boolean-array.message:
640 * test/data/invalid-messages/boolean-array-length-too-long.message-raw:
641 * test/data/invalid-messages/boolean-has-no-value.message-raw:
642 * test/data/invalid-messages/too-short-dict.message:
643 * test/data/valid-messages/dict-simple.message:
644 * test/data/valid-messages/dict.message:
645 * test/data/valid-messages/emptiness.message:
646 * test/data/valid-messages/lots-of-arguments.message:
647 * test/data/valid-messages/no-padding.message:
648 * test/data/valid-messages/recursive-types.message:
649 Add missing NAME fields
650 Fix up dicts & arrays
652 * test/data/invalid-messages/dict-with-nil-value.message:
653 Removed, this is not invalid anymore.
655 * test/data/valid-messages/recursive-types.message:
656 Add new test for deeply recursive types.
658 2003-04-07 Havoc Pennington <hp@pobox.com>
660 * bus/driver.c (bus_driver_handle_acquire_service): return an
661 error if you try to acquire a service that starts with ':'
663 2003-04-07 Havoc Pennington <hp@redhat.com>
665 * doc/dbus-specification.sgml: require that base service names
666 start with ':' and that the base service is created/deleted
667 as first and last things a connection does on the bus
669 * bus/dispatch.c (check_existent_service_activation): lots more
670 work on the activation test; it doesn't fully pass yet...
672 * test/test-service.c (main): fix so we don't memleak the
673 connection to the message bus
674 (filter_func): accept a message asking us to exit
676 2003-04-06 Havoc Pennington <hp@pobox.com>
678 * qt/Makefile.am (dbusinclude_HEADERS): install dbus-qt.h,
681 * configure.in: fixes to Qt detection from Colin Walters
683 * doc/Makefile.am: Only remove generated docbook dirs if they
684 exist, from Colin Walters
686 * dbus/dbus-bus.c: change how we set well-known connections to
687 NULL, so that it works if a single connection is stored in
688 two well-known array slots.
690 * test/Makefile.am: remove a lot of stuff that isn't immediately
691 useful, it's in CVS history if we want it.
693 * test/test-service.c: use dbus-mainloop instead of that
696 2003-04-06 Havoc Pennington <hp@pobox.com>
698 * dbus/Makefile.am: split lists of sources into stuff that goes in
699 the library, util functions that go in the lib and are also used
700 elsewhere, and util functions that are used in tests/daemon but
703 * dbus/dbus-mainloop.h, dbus/dbus-mainloop.c: move bus/loop.[hc]
704 here so it can be used in test binaries also
706 2003-04-06 Havoc Pennington <hp@pobox.com>
708 * dbus/dbus-sysdeps.c (_dbus_become_daemon): write the pidfile
709 here in the parent process, so we can return an error if it
710 fails. Also, move some of the code into the child so the parent
711 is less hosed if we fail midway through.
713 * bus/bus.c (bus_context_new): move pidfile detection further up
714 in the function, before we start overwriting sockets and such.
716 * bus/messagebus.in: adjust this a bit, not sure if it will work.
718 * configure.in: add --with-system-pid-file and --with-system-socket
720 2003-04-06 Colin Walters <walters@verbum.org>
722 * configure.in (DBUS_SYSTEM_PID_FILE): New variable.
724 * bus/system.conf.in: Declare a pidfile.
726 * bus/bus.c (bus_context_new): Test for an existing pid file, and
727 create one (if appropriate).
729 * bus/config-parser.c (enum ElementType) [ELEMENT_PIDFILE]: New.
730 (struct BusConfigParser) [pidfile]: New.
731 (element_type_to_name, merge_included, start_busconfig_child)
732 (bus_config_parser_end_element, bus_config_parser_content): Handle it.
733 (bus_config_parser_unref): Free it.
734 (bus_config_parser_get_pidfile): New function.
736 * bus/config-parser.h (_dbus_write_pid_file): Prototype.
738 * dbus/dbus-errors.h (DBUS_ERROR_PIDFILE_EXISTS): New error.
740 * dbus/dbus-sysdeps.c (_dbus_write_pid_file): New function.
742 * dbus/dbus-sysdeps.h: Prototype it.
744 2003-04-06 Havoc Pennington <hp@pobox.com>
746 * bus/bus.c (bus_context_new): print the address in here, rather
747 than in main(), because we need to do it before forking the daemon
749 * bus/dispatch.c (send_service_nonexistent_error): set the sender
750 on the service nonexistent error
752 * bus/driver.c (bus_driver_handle_acquire_service): set the
753 sender on the AcquireService reply
755 * test/data/valid-config-files/debug-allow-all.conf.in: Make test
756 server also listen on a UNIX socket so services can connect to it.
758 2003-04-06 Havoc Pennington <hp@pobox.com>
760 * dbus/dbus-threads.c: Redo how the fake debug mutexes are done
761 so it detects deadlocks and also we actually init threads when
764 2003-04-06 Havoc Pennington <hp@pobox.com>
766 * dbus/dbus-server-unix.c (_dbus_server_new_for_domain_socket):
767 save the domain socket name, and unlink it when we disconnect the
768 server. Means that at least when we exit normally, we won't leave
769 a bunch of junk in /tmp
771 * dbus/dbus-transport-unix.c
772 (_dbus_transport_new_for_domain_socket): code cleanup (nicer
773 memory management). (I was making a real change here but then
776 2003-04-06 Havoc Pennington <hp@pobox.com>
778 * bus/bus.c (bus_context_new): fix wrong handling of
779 server_data_slot_unref() in the error case.
781 * dbus/dbus-internals.h (_dbus_assert): change so it passes
782 "(condition) != 0" to _dbus_real_assert so that
783 "_dbus_assert (pointer)" doesn't cause a warning
785 * bus/main.c (main): accept --print-address option to print out
786 the message bus address
788 * dbus/dbus-sysdeps.c (_dbus_generate_random_ascii): export this
790 * dbus/dbus-transport.c (_dbus_transport_open): special error for
791 "tmpdir" option to unix: address on client side
793 * dbus/dbus-server.c (dbus_server_listen): handle "tmpdir" option
796 * configure.in (TEST_SOCKET_DIR): locate a temporary directory
797 we can use to create sockets in the test suite.
799 * bus/main.c (signal_handler): on SIGTERM, exit the daemon
800 cleanly. To be used for testing.
802 * dbus/dbus-spawn.c (babysit): use _dbus_set_signal_handler()
804 * dbus/dbus-sysdeps.c (_dbus_set_signal_handler): new
806 * dbus/dbus-server-debug-pipe.c (_dbus_transport_debug_pipe_new):
807 handle trying to call this when there's no servers active
809 2003-04-05 Havoc Pennington <hp@pobox.com>
815 2003-04-05 Havoc Pennington <hp@pobox.com>
817 * bus/bus.c (setup_server): fix this so dbus-daemon-1 doesn't
818 crash on startup. Need to get "try starting the daemon"
819 in the test suite I guess. ;-)
821 * dbus/dbus-server.h, dbus/dbus-server.c: remove the stuff that
822 tracked the number of open connections; it's better done in
823 application-specific code as you want it to span all servers etc.
825 2003-04-05 Havoc Pennington <hp@pobox.com>
827 * bus/Makefile.am (install-data-hook): add missing DESTDIR,
828 patch from Colin Walters
830 2003-04-05 Havoc Pennington <hp@pobox.com>
832 * doc/config-file.txt (Elements): fix docs of <auth> to reflect
833 reality; in fact multiple mechanisms are allowed.
835 * dbus/dbus-internals.c (_dbus_real_assert)
836 (_dbus_real_assert_not_reached): move guts of _dbus_assert() and
837 _dbus_assert_not_reached() into functions, so that they don't show
838 up in basic block counts for test coverage, and don't use up as
839 much disk space. Does mean slower execution speed though, so
840 assumes --disable-asserts is the normal production case.
842 2003-04-05 Havoc Pennington <hp@pobox.com>
844 * test/Makefile.am (dist-hook): also dist *.in files
850 2003-04-05 Havoc Pennington <hp@pobox.com>
852 * dbus/dbus-string.c: docs warning
854 * dbus/dbus-spawn.c: missing docs
856 * dbus/dbus-memory.c (struct ShutdownClosure): missing docs
858 2003-04-05 Havoc Pennington <hp@pobox.com>
860 * bus/loop.c (bus_loop_iterate): fix the timeout code, using
863 * dbus/dbus-spawn.c (_dbus_babysitter_unref): set sitter_pid
864 to -1 once we've reaped the babysitter
865 (_dbus_babysitter_handle_watch): do as much work as we can, not
868 * bus/activation.c: add code using DBusBabysitter so that we
869 handle it when a service fails to start up properly.
870 (bus_activation_service_created): don't remove the activation
871 entries as we go, just let them get removed when we free the pending
872 activation. Unref reply messages after sending them.
874 2003-04-05 Havoc Pennington <hp@pobox.com>
876 * test/decode-gcov.c (main): print per-directory stats in the report
878 * Makefile.am (coverage-report.txt): don't include test/* in gcov stats
880 2003-04-05 Havoc Pennington <hp@pobox.com>
882 * Makefile.am (coverage-report.txt): add target "coverage-report.txt"
884 * test/decode-gcov.c: hack up a little program to suck data
885 out of gcov files. Yes this is sort of silly.
887 * configure.in: define something in config.h and do an
888 AM_CONDITIONAL when gcov is enabled
890 2003-04-04 Havoc Pennington <hp@redhat.com>
892 * dbus/dbus-spawn.c, dbus/dbus-spawn.h: Change dbus_spawn to
893 return a "babysitter" object that is used to monitor the status of
894 the spawned process and reap it when required.
896 * test/test-segfault.c, test/test-exit.c,
897 test/test-sleep-forever.c: binaries that do various lame things,
898 used in the test suite.
900 * dbus/dbus-sysdeps.c: kill _dbus_errno_to_string()
902 2003-04-03 Havoc Pennington <hp@pobox.com>
904 * dbus/dbus-spawn.c: Move dbus-spawn into a separate file
905 in preparation for modifying it, dbus-sysdeps is getting
908 2003-04-03 Havoc Pennington <hp@redhat.com>
910 * bus/loop.h, bus/loop.c: make the mainloop an object so we can
913 * bus/*.[hc]: adapt to mainloop change
915 2003-04-03 Havoc Pennington <hp@redhat.com>
917 * bus/activation.c (load_directory): fix up memleaks
918 (bus_activation_entry_free): free the entry
920 * dbus/dbus-bus.c (dbus_bus_acquire_service): return an error if
921 we get one from the message bus; fix memleaks.
923 * dbus/dbus-message.c (dbus_set_error_from_message): new function
925 2003-04-03 Havoc Pennington <hp@pobox.com>
927 * bus/config-parser.c (bus_config_parser_unref): free
928 list of mechanisms, bug discovered by test suite enhancements
929 (putting system.conf and session.conf into suite)
931 * test/Makefile.am, test/test-service.c: add placeholder for a
932 test service that we'll activate as part of test suite. Doesn't
935 * dbus/dbus-sysdeps.c (_dbus_setenv): support unsetenv by
936 setting NULL value, and use system malloc not dbus_malloc()
937 when we have unavoidable memleakage.
939 * dbus/dbus-bus.c (dbus_bus_get): fix bug where bus type of 0
940 didn't work, and support DBUS_BUS_ACTIVATION.
942 * bus/activation.c (child_setup): pass our well-known bus type to
945 * bus/config-parser.c: support <type> to specify well-known type
947 * doc/dbus-specification.sgml: document the env variables to
948 locate well-known buses and find service activator
950 2003-04-02 Havoc Pennington <hp@redhat.com>
952 * test/Makefile.am (all-local): add a rule to copy tests to
953 builddir, so we can have generated tests. Use this to remove the
954 silly hack for testing system.conf and session.conf. Will use this
955 shortly to generate .service files pointing to test binaries.
957 2003-04-02 Havoc Pennington <hp@redhat.com>
959 * dbus/dbus-string.c (set_length): fix a bug - we allocated max of
960 current alloc and needed new length, not max of the doubled
961 allocation and needed new length. Also, when building tests,
962 don't do the double-allocation stuff, just realloc every time.
964 2003-04-02 Havoc Pennington <hp@redhat.com>
966 * dbus/dbus-sysdeps.c (_dbus_file_get_contents): include filenames
968 (_dbus_string_get_dirname): new
969 (_dbus_sysdeps_test): new
970 (_dbus_directory_open): include dirnames in error messages
972 * bus/config-parser.c: interpret <include> and <includedir> and
973 <servicedir> relative to config file location if the given
974 filename is not absolute.
976 * dbus/dbus-string.c (_dbus_string_find_byte_backward): new
978 2003-04-02 Havoc Pennington <hp@redhat.com>
980 * bus/connection.c (bus_transaction_send_error_reply): set sender
981 service for the error, and unref the reply on success
983 * bus/activation.c: convert to use BusTransaction so OOM can be
985 (bus_activation_service_created): set sender of the message
987 2003-04-01 Havoc Pennington <hp@redhat.com>
989 * bus/config-parser.c, bus/bus.c: implement <servicedir> and
990 <includedir> (at least mostly)
992 * dbus/dbus-sysdeps.c (_dbus_change_identity): set the group ID
993 first, then the user ID
995 2003-04-01 Havoc Pennington <hp@pobox.com>
997 * dbus/dbus-server.c (dbus_server_set_auth_mechanisms): new
1000 * dbus/dbus-auth.c (_dbus_auth_set_mechanisms): new
1002 * dbus/dbus-internals.c (_dbus_dup_string_array): new function
1004 * dbus/dbus-sysdeps.c (_dbus_listen_unix_socket): chmod the
1005 socket 0777, and unlink any existing socket.
1007 * bus/bus.c (bus_context_new): change our UID/GID and fork if
1008 the configuration file so specifies; set up auth mechanism
1011 * bus/config-parser.c (bus_config_parser_content): add support
1012 for <fork> option and fill in code for <auth>
1014 * bus/system.conf.in: add <fork/> to default configuration,
1015 and limit auth mechanisms to EXTERNAL
1017 * doc/config-file.txt (Elements): add <fork>
1019 * dbus/dbus-sysdeps.c (_dbus_become_daemon): new function
1020 (_dbus_change_identity): new function
1022 2003-03-31 Havoc Pennington <hp@redhat.com>
1024 * dbus/dbus-sysdeps.c (_dbus_connect_unix_socket)
1025 (_dbus_listen_unix_socket): fix off-by-one error in null
1026 termination spotted by Nalin
1028 2003-03-31 Havoc Pennington <hp@redhat.com>
1030 * dbus/dbus-keyring.c (_dbus_keyring_new_homedir): allow setting
1031 DBUS_TEST_HOMEDIR when tests are enabled, so we can test without
1032 having a real home directory available.
1034 2003-03-31 Havoc Pennington <hp@redhat.com>
1036 * bus/Makefile.am (install-data-hook): create /var/run/dbus
1038 * bus/messagebus.in: add init script for Red Hat /etc/init.d
1040 * configure.in: add support for specifying a style of init script
1043 2003-03-31 Havoc Pennington <hp@redhat.com>
1045 Fix some annoying DBusString API and fix all affected code.
1047 * dbus/dbus-string.c (_dbus_string_init): get rid of annoying
1049 (_dbus_string_get_data): change to return string instead of using
1051 (_dbus_string_get_const_data): ditto
1052 (_dbus_string_get_data_len): ditto
1053 (_dbus_string_get_const_data_len): ditto
1055 2003-03-31 Havoc Pennington <hp@redhat.com>
1057 * bus/main.c (main): fix up the command line arguments to be nicer
1059 2003-03-31 Havoc Pennington <hp@redhat.com>
1061 * dbus/Makefile.am (INCLUDES): use EXPANDED_LOCALSTATEDIR to
1062 define DBUS_SYSTEM_BUS_PATH as we want to compile in the same
1063 final location that lands in the config file
1065 * bus/config-loader-expat.c (bus_config_load): fix type of
1068 * doc/TODO: remove TODO item for dbus_bus_get()
1070 * dbus/dbus-bus.c (bus_data_free): add missing lock/unlock
1072 2003-03-31 Havoc Pennington <hp@pobox.com>
1074 * dbus/dbus-transport-unix.c (_dbus_transport_new_for_domain_socket)
1075 (_dbus_transport_new_for_tcp_socket): these didn't need the "server"
1076 argument since they are always client side
1078 * dbus/dbus-server.c (dbus_server_get_address): new function
1080 * bus/main.c (main): take the configuration file as an argument.
1082 * test/data/valid-config-files/debug-allow-all.conf: new file to
1083 use with dispatch.c tests for example
1085 * bus/test-main.c (main): require test data dir
1087 * bus/bus.c (bus_context_new): change this to take a
1088 configuration file name as argument
1090 * doc/config-file.txt (Elements): add <servicedir>
1092 * bus/system.conf, bus/session.conf: new files
1094 * dbus/dbus-bus.c (dbus_bus_get): look for system bus on
1095 well-known socket if none set
1097 * configure.in: create system.conf and session.conf
1099 2003-03-30 Havoc Pennington <hp@pobox.com>
1101 * bus/config-parser.c: hacking
1103 * dbus/dbus-memory.c: don't use DBusList for the list of stuff
1104 to shut down, since it could cause weirdness with the DBusList
1107 * dbus/dbus-list.c (_dbus_list_test): add tests for the
1108 link-oriented stack routines
1109 (alloc_link): free the mempool if the first alloc from it fails
1111 * dbus/dbus-mempool.c (struct DBusMemBlock): fix alignment issue
1113 * dbus/dbus-string.c (UNICODE_VALID): sync new version of this
1115 (_dbus_string_skip_white): new
1117 * doc/config-file.txt (Elements): add <includedir>
1119 2003-03-28 Havoc Pennington <hp@pobox.com>
1121 * dbus/dbus-string.c (_dbus_string_copy_data_len)
1122 (_dbus_string_copy_data): new functions
1124 2003-03-28 Anders Carlsson <andersca@codefactory.se>
1126 * dbus/dbus-bus.c: (bus_data_free), (dbus_bus_get):
1130 * dbus/dbus-memory.c:
1133 2003-03-28 Havoc Pennington <hp@pobox.com>
1135 * bus/test.c (bus_test_flush_bus): remove the sleep from here,
1136 I think it may have just been superstition. Not sure.
1138 * dbus/dbus-string.c (_dbus_string_base64_decode): catch some OOM
1139 failures that were not being handled.
1141 * dbus/dbus-auth.c (process_auth): fix a memleak in OOM handling
1143 * dbus/dbus-memory.c: add ability to set number of mallocs in a
1144 row that will fail on out-of-memory.
1146 * dbus/dbus-internals.c (_dbus_test_oom_handling): convenience
1147 function for testing out-of-memory handling.
1149 * bus/config-loader-expat.c (memsuite): don't wrap the dbus
1150 allocation functions, they do map exactly to the expat ones.
1152 2003-03-27 Havoc Pennington <hp@redhat.com>
1154 * bus/config-loader-libxml.c (bus_config_load): add another error
1157 2003-03-26 Anders Carlsson <andersca@codefactory.se>
1160 Add note about automatic service activation.
1162 * doc/dbus-specification.sgml:
1163 Rename the specification and clarify a few things.
1165 2003-03-26 Anders Carlsson <andersca@codefactory.se>
1168 * dbus/dbus-address.c:
1170 * dbus/dbus-marshal.c:
1171 * dbus/dbus-server-debug-pipe.c:
1172 * dbus/dbus-transport-unix.c:
1173 Fix documentation warnings.
1175 2003-03-26 Havoc Pennington <hp@pobox.com>
1177 * bus/test-main.c, dbus/dbus-test.c (main): check memleaks
1178 after every test so it's quick and easy to see which leaked, and
1179 so we test multiple dbus_shutdown() calls
1181 * configure.in: change configure.in XML stuff to also support
1184 * config-loader-libxml.c: some hacking
1186 * config-loader-expat.c: some hacking
1188 * config-parser.c: some hacking, plus tests
1190 2003-03-25 Havoc Pennington <hp@redhat.com>
1192 * throughout - add more _DBUS_ASSERT_ERROR_IS_CLEAR
1194 * configure.in: add --with-xml option to specify XML library,
1195 right now only libxml is supported.
1197 * bus/config-loader-libxml.c, config-parser.c: sync some minor
1198 nonworking code between home and work, still just stubs
1200 2003-03-24 Havoc Pennington <hp@redhat.com>
1202 * dbus/dbus-sysdeps.c (_dbus_set_fd_nonblocking): move to this
1205 * dbus/dbus-errors.c (dbus_set_error, dbus_set_error_const): allow
1206 NULL argument for "message" if the error is a well-known one,
1207 fill in a generic message in this case.
1209 * dbus/dbus-errors.h (DBusResultCode): Kill DBusResultCode in
1212 * bus/test.c (bus_test_flush_bus): add
1214 * bus/policy.c (bus_policy_test): test code stub
1216 2003-03-24 Havoc Pennington <hp@pobox.com>
1218 * bus/connection.c (bus_connections_setup_connection): set up
1219 the "can this user connect" function, but it always returns
1220 TRUE until we have a config file parser so we can have a config
1221 file that allows connections.
1223 2003-03-23 Havoc Pennington <hp@pobox.com>
1225 * dbus/dbus-threads.c (dbus_mutex_new, dbus_condvar_new): with
1226 DBUS_BUILD_TESTS, actually alloc/free a block of memory for
1227 the mutex, so we can check for proper memory management
1230 * dbus/dbus-dataslot.c: remove the mutex from
1231 DBusDataSlotAllocator and lock it manually when using it,
1232 to simplify fitting it into the global slots framework.
1234 * dbus/dbus-threads.c (init_static_locks): rework how we're
1235 handling global locks so they are easily shut down.
1237 * bus/policy.c (bus_policy_append_rule): fix
1239 * bus/test-main.c (main): check for memleaks
1241 * dbus/dbus-test.c (dbus_internal_do_not_use_run_tests): make
1242 test suite check for memleaks
1244 * dbus/dbus-memory.c: add support in test mode for tracking
1245 number of outstanding blocks
1247 2003-03-23 Havoc Pennington <hp@pobox.com>
1249 * bus/policy.c, bus/bus.c, bus/connection.c: implement allow/deny
1252 * dbus/dbus-hash.h: add ULONG hash keys
1254 * dbus/dbus-sysdeps.c (_dbus_get_groups): new
1255 (_dbus_get_group_id): new function
1257 2003-03-20 Havoc Pennington <hp@redhat.com>
1259 * dbus/dbus-connection.c (dbus_connection_set_unix_user_function):
1261 (dbus_connection_get_unix_user): new function
1263 2003-03-20 Havoc Pennington <hp@pobox.com>
1265 * bus/connection.c (bus_connection_send_oom_error): assert that
1266 message has a sender
1267 (connection_execute_transaction): ditto
1268 (bus_connection_preallocate_oom_error): fix to set the sender, and
1269 set recipient to the destination service, not the bus driver
1271 * bus/policy.c: hacking
1273 * dbus/dbus-message.c (dbus_message_service_is): new function
1274 (dbus_message_sender_is): new
1276 2003-03-19 Havoc Pennington <hp@redhat.com>
1278 * bus/policy.c: start sketching code for policy restrictions on
1279 what connections can do.
1281 2003-03-18 Havoc Pennington <hp@redhat.com>
1283 * doc/TODO: some notes on high-level todo items. Little nitpick
1284 stuff is all in @todo, so no need to add it here.
1286 * doc/config-file.txt: some notes on how config file might look
1288 2003-03-18 Anders Carlsson <andersca@codefactory.se>
1294 2003-03-17 Havoc Pennington <hp@redhat.com>
1296 * dbus/dbus-internals.h: add gcc attributes so that
1297 our printf-style functions warn on bad arguments to
1300 * dbus/dbus-sysdeps.c (_dbus_connect_tcp_socket): fix printf
1303 * dbus/dbus-message.c (_dbus_message_loader_queue_messages): fix
1306 2003-03-17 Havoc Pennington <hp@redhat.com>
1308 * bus/test-main.c (main): make it print something as it runs
1309 so make check doesn't look stuck
1311 * doc/negotiation.txt, doc/dbus-sasl-profile.txt: remove
1312 from CVS, now obsolete
1314 2003-03-17 Anders Carlsson <andersca@codefactory.se>
1316 * bus/dispatch.c: (bus_dispatch):
1317 Refetch the service name since it may have been reallocated
1318 when dbus_message_set_sender was called.
1320 * dbus/dbus-sysdeps.c: (_dbus_accept):
1321 Add address and address length variables and use them to stop
1322 valgrind from complaining.
1324 2003-03-17 Havoc Pennington <hp@pobox.com>
1326 All tests pass, no memleaks, no valgrind complaints.
1328 * bus/test.c: refcount handler_slot
1330 * bus/connection.c (bus_connections_new): refcount
1331 connection_data_slot
1333 * dbus/dbus-auth-script.c (_dbus_auth_script_run): delete unused
1334 bytes so that auth scripts pass.
1336 * bus/dispatch.c: init message_handler_slot so it gets allocated
1339 * bus/dispatch.c (message_handler_slot_ref): fix memleak
1341 * dbus/dbus-server-debug-pipe.c (_dbus_server_debug_pipe_new):
1342 dealloc server_pipe_hash when no longer used for benefit of
1345 * dbus/dbus-auth.c (process_command): memleak fix
1347 * bus/dispatch.c (check_hello_message): memleak fix
1349 2003-03-16 Havoc Pennington <hp@pobox.com>
1351 * dbus/dbus-bus.c (ensure_bus_data): fix double-unref of the data slot
1353 2003-03-17 Anders Carlsson <andersca@codefactory.se>
1355 * bus/activation.c (bus_activation_activate_service): Append
1356 the pending activation entry to the list of pending activations.
1358 2003-03-16 Havoc Pennington <hp@pobox.com>
1360 * bus/dispatch.c (bus_dispatch_test): remove double-unrefs of
1363 * dbus/dbus-address.c (create_entry): fix OOM handling when
1364 failing to alloc entry->method
1366 2003-03-16 Havoc Pennington <hp@pobox.com>
1368 * dbus/dbus-watch.c (_dbus_watch_new): handle failure to malloc
1371 * dbus/dbus-server-debug-pipe.c (_dbus_transport_debug_pipe_new):
1372 add some missing dbus_set_result
1374 * bus/dispatch.c (bus_dispatch_add_connection): handle failure to
1375 alloc the DBusMessageHandler
1377 * dbus/dbus-transport.c (_dbus_transport_disconnect): don't ref
1378 the transport here, since we call this from the finalizer; it
1379 resulted in a double-finalize.
1381 * dbus/dbus-transport.c (_dbus_transport_disconnect): fix a bug
1382 where we tried to use transport->connection that was NULL,
1383 happened when transport was disconnected early on due to OOM
1385 * bus/*.c: adapt to handle OOM for watches/timeouts
1387 * dbus/dbus-transport-unix.c: port to handle OOM during
1390 * dbus/dbus-auth.c (_dbus_auth_get_unused_bytes): return a
1391 reference to unused bytes instead of a copy
1393 * dbus/dbus-server.c (dbus_server_handle_watch): return FALSE for
1396 * dbus/dbus-connection.c (dbus_connection_handle_watch): return
1399 * dbus/dbus-timeout.c (dbus_timeout_handle): return FALSE for out
1402 2003-03-16 Anders Carlsson <andersca@codefactory.se>
1404 * doc/dbus-specification.sgml:
1405 Document reply message for ActivateService.
1407 2003-03-16 Anders Carlsson <andersca@codefactory.se>
1409 * bus/activation.c: (bus_pending_activation_entry_free),
1410 (bus_pending_activation_free), (bus_activation_new),
1411 (bus_activation_unref), (bus_activation_service_created),
1412 (bus_activation_activate_service):
1414 * bus/bus.c: (bus_context_new):
1415 * bus/desktop-file.c: (new_section):
1416 * bus/driver.c: (bus_driver_send_service_deleted),
1417 (bus_driver_handle_activate_service):
1418 * bus/services.c: (bus_registry_new), (bus_registry_ensure):
1420 * dbus/dbus-connection.c:
1421 (dbus_connection_send_with_reply_and_block):
1422 * dbus/dbus-message.c: (dbus_message_append_args_valist):
1423 * dbus/dbus-protocol.h:
1424 Make activation work better. Now pending activations will be queued
1425 and the daemon won't try to activate services that are already registered.
1427 2003-03-16 Havoc Pennington <hp@pobox.com>
1429 * dbus/dbus-bus.c (ensure_bus_data): handle failure to set
1432 * dbus/dbus-memory.c (_dbus_initialize_malloc_debug): support
1433 DBUS_MALLOC_BACKTRACES to print trace when failing an alloc
1435 2003-03-16 Havoc Pennington <hp@pobox.com>
1437 * dbus/dbus-string.c (_dbus_string_validate_utf8): oops, unbreak
1438 this. always run the test suite before commit...
1440 * bus/*: adapt to DBusConnection API changes
1442 * glib/dbus-gmain.c: adapt to DBusConnection API changes,
1443 requires renaming stuff to avoid dbus_connection_dispatch name
1446 * dbus/dbus-transport.c (_dbus_transport_queue_messages): new
1449 * dbus/dbus-message.c (_dbus_message_loader_queue_messages):
1450 separate from _dbus_message_loader_return_buffer()
1452 * dbus/dbus-connection.c (dbus_connection_get_n_messages): remove
1453 this, because it's now always broken to use; the number of
1454 messages in queue vs. the number still buffered by the message
1455 loader is undefined/meaningless. Should use
1456 dbus_connection_get_dispatch_state().
1457 (dbus_connection_dispatch): rename from
1458 dbus_connection_dispatch_message
1460 2003-03-16 Havoc Pennington <hp@pobox.com>
1462 * dbus/dbus-string.c (_dbus_string_validate_utf8): copy in a real
1465 2003-03-16 Anders Carlsson <andersca@codefactory.se>
1467 * dbus/dbus-connection.c:
1468 (dbus_connection_send_with_reply_and_block):
1469 Decrease connection->n_incoming when removing an entry
1471 * dbus/dbus-dict.c: (dbus_dict_entry_free),
1472 (dbus_dict_set_boolean_array), (dbus_dict_set_int32_array),
1473 (dbus_dict_set_uint32_array), (dbus_dict_set_double_array),
1474 (dbus_dict_set_byte_array), (dbus_dict_set_string_array),
1475 (dbus_dict_get_boolean_array), (dbus_dict_get_double_array),
1476 (dbus_dict_get_byte_array):
1477 Handle NULL arrays and strings. Also add support for byte arrays.
1479 * dbus/dbus-marshal.c: (_dbus_marshal_byte_array),
1480 (_dbus_marshal_dict), (_dbus_demarshal_byte_array),
1481 (_dbus_demarshal_int32_array), (_dbus_demarshal_uint32_array),
1482 (_dbus_demarshal_double_array), (_dbus_demarshal_string_array),
1483 (_dbus_demarshal_dict), (demarshal_and_validate_len),
1484 (_dbus_marshal_validate_arg), (_dbus_marshal_test):
1485 * dbus/dbus-marshal.h:
1486 Add support for marshalling and demarshalling empty arrays and strings.
1488 * dbus/dbus-message.c: (dbus_message_append_args_valist),
1489 (dbus_message_append_string_array),
1490 (dbus_message_iter_get_boolean),
1491 (dbus_message_iter_get_boolean_array),
1492 (dbus_message_iter_get_int32_array),
1493 (dbus_message_iter_get_uint32_array),
1494 (dbus_message_iter_get_double_array),
1495 (dbus_message_iter_get_byte_array),
1496 (dbus_message_iter_get_string_array), (dbus_message_iter_get_dict),
1497 (check_message_handling):
1498 Add support for getting empty arrays and dicts.
1500 * dbus/dbus-string.c: (_dbus_string_validate_utf8):
1501 Don't do any validation at all for now, that's better than just checking
1504 * test/data/valid-messages/emptiness.message:
1505 New test message with lots of empty arrays.
1507 2003-03-16 Havoc Pennington <hp@pobox.com>
1509 * dbus/dbus-connection.c
1510 (_dbus_connection_queue_received_message_link): new function that
1511 can't fail due to OOM
1513 * dbus/dbus-message.c (_dbus_message_loader_pop_message_link):
1514 new function pops a message together with a list link
1517 * dbus/dbus-transport-unix.c (queue_messages): use new link-based
1518 message queuing functions to avoid needing to alloc memory
1520 2003-03-16 Havoc Pennington <hp@pobox.com>
1522 Oops - test code was only testing failure of around 30 of the
1523 mallocs in the test path, but it turns out there are 500+
1524 mallocs. I believe this was due to misguided linking setup such
1525 that there was one copy of dbus_malloc etc. in the daemon and one
1526 in the shared lib, and only daemon mallocs were tested. In any
1527 case, the test case now tests all 500+ mallocs, and doesn't pass
1528 yet, though there are lots of fixes in this patch.
1530 * dbus/dbus-connection.c (dbus_connection_dispatch_message): fix
1531 this so that it doesn't need to allocate memory, since it
1532 has no way of indicating failure due to OOM (and would be
1533 annoying if it did).
1535 * dbus/dbus-list.c (_dbus_list_pop_first_link): new function
1537 * bus/Makefile.am: rearrange to create two self-contained
1538 libraries, to avoid having libraries with overlapping symbols.
1539 that was resulting in weirdness, e.g. I'm pretty sure there
1540 were two copies of global static variables.
1542 * dbus/dbus-internals.c: move the malloc debug stuff to
1545 * dbus/dbus-list.c (free_link): free list mempool if it becomes
1548 * dbus/dbus-memory.c (_dbus_disable_mem_pools): new function
1550 * dbus/dbus-address.c (dbus_parse_address): free list nodes
1553 * bus/dispatch.c (bus_dispatch_add_connection): free
1554 message_handler_slot when no longer using it, so
1555 memory leak checkers are happy for the test suite.
1557 * dbus/dbus-server-debug-pipe.c (debug_finalize): free server name
1559 * bus/bus.c (new_connection_callback): disconnect in here if
1560 bus_connections_setup_connection fails.
1562 * bus/connection.c (bus_connections_unref): fix to free the
1564 (bus_connections_setup_connection): if this fails, don't
1565 disconnect the connection, just be sure there are no side
1568 * dbus/dbus-string.c (undo_alignment): unbreak this
1570 * dbus/dbus-auth.c (_dbus_auth_unref): free some stuff we were
1572 (_dbus_auth_new): fix the order in which we free strings
1575 * bus/connection.c (bus_connection_disconnected): fix to
1576 not send ServiceDeleted multiple times in case of memory
1579 * dbus/dbus-bus.c (dbus_bus_get_base_service): new function to
1580 get the base service name
1581 (dbus_bus_register_client): don't return base service name,
1582 instead store it on the DBusConnection and have an accessor
1584 (dbus_bus_register_client): rename dbus_bus_register()
1586 * bus/dispatch.c (check_hello_message): verify that other
1587 connections on the bus also got the correct results, not
1588 just the one sending hello
1590 2003-03-15 Havoc Pennington <hp@pobox.com>
1592 Make it pass the Hello handling test including all OOM codepaths.
1593 Now to do other messages...
1595 * bus/services.c (bus_service_remove_owner): fix crash when
1596 removing owner from an empty list of owners
1597 (bus_registry_ensure): don't leave service in the list of
1598 a connection's owned services if we fail to put the service
1601 * bus/connection.c (bus_connection_preallocate_oom_error): set
1602 error flag on the OOM error.
1604 * dbus/dbus-connection.c (_dbus_connection_new_for_transport):
1605 handle _dbus_transport_set_connection failure
1607 * dbus/dbus-transport-unix.c (_dbus_transport_new_for_fd): modify
1608 to create watches up front and simply enable/disable them as
1610 (unix_connection_set): this can now fail on OOM
1612 * dbus/dbus-timeout.c, dbus/dbus-watch.c: add concept
1613 of enabling/disabling a watch or timeout.
1615 * bus/loop.c (bus_loop_iterate): don't touch disabled
1618 * glib/dbus-gmain.c: adapt to enable/disable watches and timeouts
1620 2003-03-15 Havoc Pennington <hp@pobox.com>
1622 * bus/dispatch.c (bus_dispatch_test): OK, now finally actually
1623 write useful test code, after all that futzing around ;-)
1625 Test does not yet pass because we can't handle OOM in
1626 _dbus_transport_messages_pending (basically,
1627 dbus_connection_preallocate_send() does not prealloc the write
1628 watch). To fix this, I think we need to add new stuff to
1629 set_watch_functions, namely a SetEnabled function so we can alloc
1630 the watch earlier, then enable it later.
1632 * dbus/Makefile.am (libdbus_convenience_la_SOURCES): move
1633 dbus-memory.c to the convenience lib
1635 * bus/test.c: rename some static functions to keep them clearly
1636 distinct from stuff in connection.c. Handle client disconnection.
1638 2003-03-14 Havoc Pennington <hp@pobox.com>
1640 * bus/dispatch.c (bus_dispatch_test): do test using debug-pipe
1641 transport, tests more of the real codepath. Set up clients
1642 with bus_setup_debug_client.
1644 * bus/test.c (bus_setup_debug_client): function to set up debug
1645 "clients" on the main loop
1647 * dbus/dbus-transport.c (_dbus_transport_open): add debug-pipe
1650 * dbus/dbus-server.c (dbus_server_listen): add debug-pipe
1653 * dbus/dbus-server-debug.c: support a debug server based on pipes
1655 * dbus/dbus-sysdeps.c (_dbus_full_duplex_pipe): new function
1656 (_dbus_close): new function
1658 * configure.in: check for socketpair
1660 2003-03-14 Havoc Pennington <hp@redhat.com>
1662 * dbus/dbus-memory.c: add a "detect buffer overwrites on free"
1665 * dbus/dbus-transport-debug.c: rework this a good bit to be
1666 less complicated. hopefully still works.
1668 * dbus/dbus-server-debug.c (handle_new_client): remove timeout
1671 * glib/dbus-gmain.c (timeout_handler): don't remove timeout
1674 * dbus/dbus-message.c (dbus_message_copy): rename from
1675 dbus_message_new_from_message, fix it up to copy
1676 all the message fields, add test case
1678 * bus/dispatch.c (bus_dispatch_test): add some more test code,
1679 not quite passing yet
1681 2003-03-14 Havoc Pennington <hp@pobox.com>
1683 * bus/loop.c (bus_loop_iterate): add this so we can "run loop
1684 until no work remains" in test code. (the large diff here
1685 is just code movement, no actual changes)
1687 * dbus/dbus-server-debug.c (DEFAULT_INTERVAL): change interval to
1688 1, no point waiting around for test code.
1689 (_dbus_server_debug_accept_transport): unref the timeout
1690 after adding it (right?)
1692 * dbus/dbus-transport-debug.c (DEFAULT_INTERVAL): ditto
1694 2003-03-13 Havoc Pennington <hp@redhat.com>
1696 * dbus/dbus-timeout.c (_dbus_timeout_list_set_functions): handle
1699 * dbus/dbus-watch.c (_dbus_watch_list_set_functions): handle out
1702 * dbus/dbus-connection.h: Make AddWatchFunction and
1703 AddTimeoutFunction return a bool so they can fail on out-of-memory
1705 * bus/bus.c (bus_context_new): set up timeout handlers
1707 * bus/connection.c (bus_connections_setup_connection): set up
1710 * glib/dbus-gmain.c: adapt to the fact that set_functions stuff
1713 * bus/bus.c (bus_context_new): adapt to changes
1715 * bus/connection.c: adapt to changes
1717 * test/watch.c: adapt to DBusWatch changes
1719 * bus/dispatch.c (bus_dispatch_test): started adding this but
1722 2003-03-14 Anders Carlsson <andersca@codefactory.se>
1724 * bus/dispatch.c (send_service_nonexistent_error): Fix typo.
1726 2003-03-13 Havoc Pennington <hp@pobox.com>
1728 * bus/test.c, bus/test.h, bus/Makefile.am, bus/test-main.c:
1729 set up a test framework as for the library
1731 2003-03-12 Havoc Pennington <hp@pobox.com>
1733 Throughout: purge global variables, introduce BusActivation,
1734 BusConnections, BusRegistry, etc. objects instead.
1736 * bus/bus.h, bus/bus.c: introduce BusContext as a global
1739 * test/Makefile.am (TEST_BINARIES): disable bus-test for now,
1740 going to redo this a bit differently I think
1742 2003-03-12 Havoc Pennington <hp@redhat.com>
1744 Mega-patch that gets the message bus daemon initially handling
1745 out-of-memory. Work still needed. Also lots of random
1746 moving stuff to DBusError instead of ResultCode.
1748 * dbus/dbus-list.c (_dbus_list_length_is_one): new function
1750 * dbus/dbus-connection.c
1751 (dbus_connection_send_with_reply_and_block): use DBusError
1753 * dbus/dbus-bus.c: adapt to API changes, make it use DBusError not
1756 * dbus/dbus-connection.c (dbus_connection_send): drop the result
1757 code here, as the only failure possible is OOM.
1759 * bus/connection.c (bus_connection_disconnect):
1760 rename bus_connection_disconnected as it's a notification only
1762 * bus/driver.c (bus_driver_handle_acquire_service): don't free
1763 "name" on get_args failure, should be done by get_args;
1764 don't disconnect client for bad args, just return an error.
1765 (bus_driver_handle_service_exists): ditto
1767 * bus/services.c (bus_services_list): NULL-terminate returned array
1769 * bus/driver.c (bus_driver_send_service_lost)
1770 (bus_driver_send_service_acquired): send messages from driver to a
1771 specific client to the client's unique name, not to the broadcast
1774 * dbus/dbus-message.c (decode_header_data): reject messages that
1775 contain no name field
1776 (_dbus_message_get_client_serial): rename to
1777 dbus_message_get_serial and make public
1778 (_dbus_message_set_serial): rename from set_client_serial
1779 (_dbus_message_set_reply_serial): make public
1780 (_dbus_message_get_reply_serial): make public
1782 * bus/connection.c (bus_connection_foreach): allow stopping
1783 iteration by returning FALSE from foreach function.
1785 * dbus/dbus-connection.c (dbus_connection_send_preallocated)
1786 (dbus_connection_free_preallocated_send)
1787 (dbus_connection_preallocate_send): new API for sending a message
1788 without possibility of malloc failure.
1789 (dbus_connection_send_message): rename to just
1790 dbus_connection_send (and same for whole function family)
1792 * dbus/dbus-errors.c (dbus_error_free): make this reinit the error
1794 * dbus/dbus-sysdeps.c (_dbus_exit): new function
1796 * bus/activation.c: handle/return errors
1798 * dbus/dbus-errors.h: add more DBUS_ERROR #define
1800 * dbus/dbus-sysdeps.c (_dbus_directory_open) (_dbus_file_get_contents)
1801 (_dbus_directory_get_next_file): use DBusError instead of DBusResultCode
1802 (_dbus_result_from_errno): move to this file
1804 2003-03-10 Anders Carlsson <andersca@codefactory.se>
1806 * dbus/dbus-marshal.c:
1807 (_dbus_marshal_set_string):
1808 Take a length argument so we can marshal the correct string
1811 (_dbus_marshal_dict), (_dbus_demarshal_dict),
1812 (_dbus_marshal_get_arg_end_pos), (_dbus_marshal_validate_arg),
1813 (_dbus_marshal_test):
1814 * dbus/dbus-marshal.h:
1815 Add support for marshalling and demarshalling dicts.
1817 * dbus/dbus-message-builder.c: (_dbus_message_data_load):
1818 Add support for TYPE DICT.
1820 * dbus/dbus-message.c: (set_string_field):
1821 Adjust header padding.
1823 (dbus_message_append_args_valist), (dbus_message_append_dict),
1824 (dbus_message_get_args_valist), (dbus_message_iter_get_arg_type),
1825 (dbus_message_iter_get_dict), (_dbus_message_loader_return_buffer),
1826 (check_message_handling), (check_have_valid_message):
1827 * dbus/dbus-message.h:
1828 Add functions for setting and getting dicts.
1830 * dbus/dbus-protocol.h:
1836 * doc/dbus-specification.sgml:
1837 Add information about how dicts are marshalled.
1839 * test/data/invalid-messages/dict-with-nil-value.message:
1840 * test/data/invalid-messages/too-short-dict.message:
1841 * test/data/valid-messages/dict-simple.message:
1842 * test/data/valid-messages/dict.message:
1843 Add sample messages containing dicts.
1845 2003-03-08 Anders Carlsson <andersca@codefactory.se>
1847 * dbus/dbus-dict.h: Add DBUS_END_DECLS.
1849 2003-03-07 Anders Carlsson <andersca@codefactory.se>
1852 * dbus/dbus-dict.c: (dbus_dict_entry_free), (dbus_dict_new),
1853 (dbus_dict_get_keys), (insert_entry), (dbus_dict_set_boolean),
1854 (dbus_dict_set_int32), (dbus_dict_set_uint32),
1855 (dbus_dict_set_double), (dbus_dict_set_string),
1856 (dbus_dict_set_boolean_array), (dbus_dict_set_int32_array),
1857 (dbus_dict_set_uint32_array), (dbus_dict_set_double_array),
1858 (dbus_dict_set_string_array), (_dbus_dict_test):
1860 Fix according to comments from Havoc.
1862 2003-03-06 Michael Meeks <michael@server.home>
1864 * configure.in: if we don't have kde-config, disable have_qt.
1866 2003-03-07 Anders Carlsson <andersca@codefactory.se>
1871 * dbus/dbus-dict.c: (dbus_dict_entry_free), (dbus_dict_new),
1872 (dbus_dict_ref), (dbus_dict_unref), (dbus_dict_contains),
1873 (dbus_dict_remove), (dbus_dict_get_value_type),
1874 (dbus_dict_get_keys), (dbus_dict_put_boolean),
1875 (dbus_dict_put_int32), (dbus_dict_put_uint32),
1876 (dbus_dict_put_double), (dbus_dict_put_string),
1877 (dbus_dict_put_boolean_array), (dbus_dict_put_int32_array),
1878 (dbus_dict_put_uint32_array), (dbus_dict_put_double_array),
1879 (dbus_dict_put_string_array), (dbus_dict_get_boolean),
1880 (dbus_dict_get_int32), (dbus_dict_get_uint32),
1881 (dbus_dict_get_double), (dbus_dict_get_string),
1882 (dbus_dict_get_boolean_array), (dbus_dict_get_int32_array),
1883 (dbus_dict_get_uint32_array), (dbus_dict_get_double_array),
1884 (dbus_dict_get_string_array), (_dbus_dict_test):
1886 Add DBusDict implementation
1888 * dbus/dbus-test.c: (dbus_internal_do_not_use_run_tests):
1892 2003-03-04 Havoc Pennington <hp@pobox.com>
1894 * test/data/auth/*: adapt to changes
1896 * dbus/dbus-auth-script.c (_dbus_auth_script_run): add
1897 USERID_BASE64 and change USERNAME_BASE64 to put in username not
1900 * dbus/dbus-keyring.c (_dbus_keyring_validate_context): prevent
1901 more stuff from being in a context name, to make the protocol
1902 simpler to deal with
1904 * dbus/dbus-errors.c (dbus_error_has_name): new function
1905 (dbus_error_is_set): new function
1907 * dbus/dbus-auth.c: replace DBUS_STUPID_TEST_MECH auth
1908 with DBUS_COOKIE_SHA1, implement DBUS_COOKIE_SHA1
1910 * dbus/dbus-connection.c (dbus_connection_flush): also read
1911 messages during a flush operation
1913 * dbus/Makefile.am: remove dbus-md5 since it isn't currently used.
1915 2003-03-05 Anders Carlsson <andersca@codefactory.se>
1917 * configure.in: Check for gethostbyname on Solaris.
1919 * dbus/dbus-transport.c: (_dbus_transport_open):
1920 Remove duplicate "tcp" entry.
1922 * doc/dbus-specification.sgml:
1923 Clarify some things.
1925 2003-03-05 Anders Carlsson <andersca@codefactory.se>
1927 * dbus/dbus-auth.c: (send_rejected), (process_test_subdir):
1928 * dbus/dbus-keyring.c: (_dbus_keyring_new_homedir),
1929 (_dbus_keyring_test):
1930 * dbus/dbus-md5.c: (_dbus_md5_compute):
1931 * dbus/dbus-sha.c: (_dbus_sha_compute):
1934 2003-03-05 Anders Carlsson <andersca@codefactory.se>
1936 * README: Add some things.
1938 2003-03-04 Anders Carlsson <andersca@codefactory.se>
1940 * dbus/dbus-message.c (dbus_message_append_args_valist): Add a break;
1941 after case DBUS_TYPE_BOOELAN.
1943 2003-03-02 Havoc Pennington <hp@pobox.com>
1945 * test/break-loader.c (randomly_set_extreme_ints): add test that
1946 sets really huge and small integers
1948 * dbus/dbus-marshal.c (_dbus_marshal_validate_arg): add check
1949 that length of boolean array fits in the string, and that
1950 string has room for boolean value in single-bool case.
1952 * dbus/dbus-message-builder.c (_dbus_message_data_load): add
1953 optional value to "ALIGN" command which is what to fill the
1956 * test/data/valid-messages/no-padding.message: add regression
1957 test for the message padding problem
1959 2003-03-02 Havoc Pennington <hp@pobox.com>
1961 * dbus/dbus-message.c (decode_header_data): fix to always init
1962 message_padding, from Benjamin Dauvergne
1964 2003-03-02 Havoc Pennington <hp@pobox.com>
1970 2003-03-01 Joe Shaw <joe@assbarn.com>
1972 * configure.in: Check for "struct cmsgcred" and try to access its
1973 members for BSD-like unices.
1975 * dbus/dbus-sysdeps.c (read_credentials_byte): Fold this back into
1976 _dbus_read_credentials_unix_socket().
1977 (_dbus_read_credentials_unix_socket): Use recvmsg() instead of
1978 read() for reading the credential byte off the unix socket. Use
1979 struct cmsgcred on systems that support it.
1981 2003-02-27 Alexander Larsson <alexl@redhat.com>
1985 Make gthreads-2.0 dependency optional. Don't build thread test if
1988 2003-02-27 Havoc Pennington <hp@pobox.com>
1990 * dbus/dbus-connection.c
1991 (dbus_connection_send_message_with_reply_and_block): fix doh!
1992 doh! doh! bug that resulted in never removing a reply from the
1993 queue, no wonder we called get_reply_serial so much ;-)
1995 * dbus/dbus-message.c (struct DBusMessage): cache reply serial
1996 and client serial instead of demarshaling them every time
1998 2003-02-27 Havoc Pennington <hp@pobox.com>
2000 * dbus/dbus-marshal.c (_dbus_demarshal_int32): rewrite to be much
2001 more inlined, using dbus-string-private.h, speeds things up
2004 * dbus/dbus-string.c (_dbus_string_free): apply align offset
2005 when freeing the string
2006 (_dbus_string_steal_data): fix for align offset
2007 (undo_alignment): new function
2009 2003-02-26 Havoc Pennington <hp@redhat.com>
2011 All kinds of audit fixes from Owen, plus initial attempt to
2012 handle unaligned memory returned from malloc.
2014 * dbus/dbus-string.c (_dbus_string_init): clamp max length to
2015 leave room for align_offset and nul byte
2016 (fixup_alignment): function to track an align_offset and
2017 ensure real->str is aligned
2018 (DBUS_GENERIC_STRING_PREAMBLE): len must be less than allocated,
2019 to allow a nul byte plus align offset
2020 (_dbus_string_lock): fix overflow issue
2021 (_dbus_string_init_const_len): add assertions on sanity of len,
2022 assign allocated to be ALLOCATION_PADDING larger than len
2023 (set_length): fixup the overflow handling
2024 (_dbus_string_get_data_len): fix overflow in assertion
2025 (open_gap): detect overflow in size of gap to be opened
2026 (_dbus_string_lengthen): add overflow check
2027 (_dbus_string_align_length): fix overflow with _DBUS_ALIGN_VALUE
2028 (_dbus_string_append): add overflow check
2029 (_dbus_string_append_unichar): overflow
2030 (_dbus_string_delete): fix overflow in assertion
2031 (_dbus_string_copy_len): overflow in assertion
2032 (_dbus_string_replace_len): overflows in assertions
2033 (_dbus_string_find): change to implement in terms of
2034 _dbus_string_find_to
2035 (_dbus_string_find_to): assorted fixage
2036 (_dbus_string_equal_c_str): assert c_str != NULL,
2037 fix logic so the function works
2038 (_dbus_string_ends_with_c_str): fix overflow thingy
2039 (_dbus_string_base64_encode): overflow fix
2040 (_dbus_string_validate_ascii): overflow
2041 (_dbus_string_validate_nul): overflow
2043 2003-02-26 Havoc Pennington <hp@redhat.com>
2045 * dbus/dbus-marshal.c (_dbus_marshal_test): fix to work with DISABLE_ASSERTS
2047 2003-02-26 Alexander Larsson <alexl@redhat.com>
2050 Set DBUS_GLIB_THREADS_LIBS for apps using gthread-2.0
2052 * dbus/dbus-connection.c:
2053 * dbus/dbus-connection.h:
2054 Fix _dbus_connection_acquire_io_path and _dbus_connection_acquire_dispatch.
2055 Add dbus_connection_set_wakeup_main_function and use it when queueing
2056 incoming and outgoing messages.
2059 * dbus/dbus-dataslot.c:
2060 Threadsafe usage of DBusDataSlotAllocator
2062 * dbus/dbus-message.c: (dbus_message_get_args_iter):
2065 * dbus/dbus-server-unix.c:
2068 * glib/dbus-gmain.c:
2069 Implement the new wakeup functions for glib.
2072 * glib/test-thread-client.c:
2073 * glib/test-thread-server.c:
2074 * glib/test-thread.h:
2075 Initial cut at some thread test code. Not really done yet.
2077 2003-02-26 Havoc Pennington <hp@pobox.com>
2079 * dbus/dbus-connection.c
2080 (dbus_connection_send_message_with_reply_and_block): fix crash
2081 where we ref'd the outgoing message instead of the returned reply
2083 * dbus/dbus-transport-unix.c (do_authentication): check read watch
2084 at the end of this function, so if we didn't need to read for
2085 authentication, we reinstall it for receiving messages
2087 * dbus/dbus-message.c (dbus_message_new_reply): allow replies to
2088 a NULL sender for peer-to-peer case
2090 * dbus/dbus-transport-unix.c (check_read_watch): handle
2091 !authenticated case correctly
2093 * glib/dbus-gmain.c: add support for DBusServer
2095 * dbus/dbus-server.c: add data slot support
2097 * glib/dbus-gmain.c (dbus_connection_setup_with_g_main): check
2098 return values and handle errors
2100 * dbus/dbus-dataslot.c: factor out the data slot stuff from
2103 * Doxyfile.in (INPUT): add glib subdir
2105 * glib/dbus-gmain.c (dbus_connection_setup_with_g_main): rename
2106 setup_with_g_main instead of hookup_with_g_main; write docs
2108 2003-02-24 Anders Carlsson <andersca@codefactory.se>
2110 * dbus/dbus-marshal.c: (_dbus_marshal_validate_arg):
2111 * dbus/dbus-message-builder.c: (_dbus_message_data_load):
2112 * dbus/dbus-message.c: (dbus_message_append_boolean),
2113 (dbus_message_append_boolean_array),
2114 (dbus_message_get_args_valist), (_dbus_message_test):
2115 * dbus/dbus-message.h:
2116 * doc/dbus-specification.sgml:
2117 Various fixes as pointed out by Havoc.
2119 * test/data/invalid-messages/bad-boolean-array.message:
2120 * test/data/invalid-messages/bad-boolean.message:
2121 Add invalid boolean value test cases.
2123 2003-02-24 Anders Carlsson <andersca@codefactory.se>
2125 * dbus/dbus-internals.c: (_dbus_type_to_string):
2126 * dbus/dbus-marshal.c: (_dbus_marshal_get_arg_end_pos),
2127 (_dbus_marshal_validate_arg):
2128 * dbus/dbus-message-builder.c: (_dbus_message_data_load):
2129 * dbus/dbus-message.c: (dbus_message_append_args_valist),
2130 (dbus_message_append_boolean), (dbus_message_append_boolean_array),
2131 (dbus_message_get_args_valist), (dbus_message_iter_get_boolean),
2132 (dbus_message_iter_get_int32), (dbus_message_iter_get_uint32),
2133 (dbus_message_iter_get_double),
2134 (dbus_message_iter_get_boolean_array), (message_iter_test):
2135 * dbus/dbus-message.h:
2136 * dbus/dbus-protocol.h:
2137 * doc/dbus-specification.sgml:
2138 * test/data/valid-messages/lots-of-arguments.message:
2139 Add support for boolean and boolean array types.
2141 2003-02-23 Havoc Pennington <hp@pobox.com>
2143 * dbus/dbus-keyring.c: finish most of this implementation and
2146 * dbus/dbus-errors.c (dbus_set_error_const, dbus_set_error): make
2147 these barf if the error isn't cleared to NULL
2149 * dbus/dbus-sysdeps.c (_dbus_delete_file): set error on failure
2150 (_dbus_create_directory): new function
2152 * dbus/dbus-errors.c (dbus_set_error): fix warning
2154 * dbus/dbus-string.c (_dbus_string_hex_encode): new function
2155 (_dbus_string_hex_decode): new function
2156 (test_hex_roundtrip): test code
2158 * dbus/dbus-sha.c (_dbus_sha_compute): use dbus_string_hex_encode
2160 * dbus/dbus-md5.c (_dbus_md5_compute): use dbus_string_hex_encode
2162 * dbus/dbus-sysdeps.c (_dbus_string_save_to_file): make this use
2163 the save-to-temp/rename trick to atomically write the new file
2164 (_dbus_string_parse_uint): new function
2166 2003-02-22 Havoc Pennington <hp@pobox.com>
2168 * test/Makefile.am (dist-hook): fix dist for test/data/sha-1
2170 2003-02-22 Havoc Pennington <hp@pobox.com>
2172 * dbus/dbus-message.c (dbus_message_iter_get_string_array):
2173 (dbus_message_iter_get_byte_array): Fix up doxygen warnings
2175 * dbus/dbus-sha.c: add implementation of SHA-1 algorithm
2177 * dbus/test/data/sha-1: add US government test suite for SHA-1
2179 2003-02-21 Anders Carlsson <andersca@codefactory.se>
2181 * dbus/dbus-marshal.c: (_dbus_demarshal_string_array):
2182 Make string arrays NULL-terminated.
2184 * dbus/dbus-memory.c: (dbus_free_string_array):
2185 * dbus/dbus-memory.h:
2186 New function for freeing NULL-terminated string arrays.
2188 * dbus/dbus-message-builder.c: (append_quoted_string),
2189 (_dbus_message_data_load):
2190 Add support for array types.
2192 * dbus/dbus-message.c: (check_message_handling):
2193 Add more types as test cases.
2195 * dbus/dbus-sysdeps.c: (_dbus_string_parse_int),
2196 (_dbus_string_parse_double):
2197 Add the start offset to the end offset.
2199 * test/data/valid-messages/lots-of-arguments.message:
2200 New test message with lots of arguments.
2202 2003-02-21 Anders Carlsson <andersca@codefactory.se>
2204 * dbus/dbus-message.c: (dbus_message_append_nil),
2205 (dbus_message_append_int32), (dbus_message_append_uint32),
2206 (dbus_message_append_double), (dbus_message_append_string),
2207 (dbus_message_append_int32_array),
2208 (dbus_message_append_uint32_array),
2209 (dbus_message_append_double_array),
2210 (dbus_message_append_byte_array),
2211 (dbus_message_append_string_array):
2212 Fix all out-of-memory handling in these functions.
2214 2003-02-21 Anders Carlsson <andersca@codefactory.se>
2216 * dbus/dbus-message.c: (dbus_message_append_nil):
2219 2003-02-21 Anders Carlsson <andersca@codefactory.se>
2221 * dbus/dbus-message.c: (dbus_message_append_args_valist),
2222 (dbus_message_append_nil), (dbus_message_append_int32_array),
2223 (dbus_message_append_uint32_array),
2224 (dbus_message_append_double_array),
2225 (dbus_message_append_byte_array),
2226 (dbus_message_append_string_array), (dbus_message_get_args_valist),
2227 (dbus_message_iter_get_int32_array),
2228 (dbus_message_iter_get_uint32_array),
2229 (dbus_message_iter_get_double_array),
2230 (dbus_message_iter_get_byte_array),
2231 (dbus_message_iter_get_string_array):
2233 * dbus/dbus-message.h:
2234 Add functions for appending and getting arrays.
2236 2003-02-21 Anders Carlsson <andersca@codefactory.se>
2238 * dbus/dbus-mempool.c (_dbus_mem_pool_new): Make the
2239 element size at least 8 bytes, fixes mempool tests on
2242 2003-02-20 Alexander Larsson <alexl@redhat.com>
2244 * dbus/dbus-transport-unix.c (unix_do_iteration):
2245 Unlock the connection mutex during a blocking select call.
2246 Add todo about how we need a way to wake up the select.
2248 * dbus/dbus-connection-internal.h:
2249 * dbus/dbus-connection.c:
2250 Add _dbus_connection_lock and _dbus_connection_unlock.
2252 2003-02-19 Havoc Pennington <hp@pobox.com>
2254 * Doxyfile.in (PREDEFINED): put DOXYGEN_SHOULD_SKIP_THIS in
2255 Doxyfile.in, not Doxyfile
2257 * dbus/dbus-keyring.c: do some hacking on this
2259 * dbus/dbus-sysdeps.c (_dbus_delete_file): new
2261 * dbus/dbus-errors.c (dbus_set_error_const): do not call
2263 (dbus_set_error): remove dbus_error_init, check for message ==
2264 NULL *before* we sprintf into it, and add @todo about including
2265 system headers in this file
2267 * dbus/dbus-sysdeps.c (_dbus_create_file_exclusively): new
2269 * dbus/dbus-errors.h (DBUS_ERROR_FAILED): add
2271 * dbus/dbus-sysdeps.c (get_user_info): break this function out to
2272 get various bits of user information based on either username
2274 (_dbus_homedir_from_username): new function
2276 2003-02-19 Anders Carlsson <andersca@codefactory.se>
2279 Add check for nonposix getpwnam_r
2281 * dbus/dbus-mempool.c: (_dbus_mem_pool_new):
2282 Align the pool element size to a sizeof (void *) boundary.
2284 * dbus/dbus-sysdeps.c: (_dbus_setenv), (_dbus_connect_unix_socket),
2285 (_dbus_listen_unix_socket), (_dbus_credentials_from_username):
2286 General Solaris fixes.
2288 * test/data/valid-messages/simplest-manual.message:
2289 Explicitly state that we want little-endian packing.
2291 2003-02-19 Mikael Hallendal <micke@codefactory.se>
2293 * dbus/dbus-server.c (dbus_server_listen): Support tcp: addresses.
2295 * dbus/dbus-transport-unix.c (_dbus_transport_new_for_tcp_socket):
2296 Added to create a transport connecting using a tcp/ip socket.
2298 * dbus/dbus-sysdeps.c (_dbus_connect_tcp_socket): Added to connect
2299 to a tcp socket at given host and port.
2300 (_dbus_listen_tcp_socket): added to listen on tcp socket for given
2303 * dbus/dbus-server.c (dbus_server_listen): Support tcp: addresses.
2305 * dbus/dbus-server-unix.c (_dbus_server_new_for_tcp_socket):
2306 Added to create a server listening on a TCP/IP socket.
2308 2003-02-19 Havoc Pennington <hp@pobox.com>
2310 Throughout: mop up all the Doxygen warnings and undocumented
2313 * dbus/dbus-sysdeps.c (do_exec): do not use execvp, we don't want
2314 to search any paths.
2316 * dbus/dbus-threads.c: move global mutex initializers to
2317 dbus-internals.h, multiple prototypes was confusing doxygen
2318 besides being kind of ugly
2320 * Doxyfile (PREDEFINED): have Doxygen define
2321 DOXYGEN_SHOULD_SKIP_THIS so we can exclude things from
2322 docs with #ifndef DOXYGEN_SHOULD_SKIP_THIS
2323 (do not abuse the feature! it's for stuff like the autogenerated
2324 macros in dbus-md5.c, not just for things you don't feel like
2327 2003-02-18 Havoc Pennington <hp@pobox.com>
2329 * dbus/dbus-string.c (_dbus_string_zero): new function
2331 * dbus/dbus-md5.c: include MD5 implementation by L. Peter Deutsch,
2332 wrap it in some dbus-friendly API
2334 * dbus/dbus-types.h: add 16-bit types
2336 2003-02-18 Joe Shaw <joe@assbarn.com>
2338 * dbus/dbus-auth.c (handle_server_data_stupid_test_mech): Just get
2339 credentials from our currently running process.
2340 (get_word): Fix a buglet where we were copying the entire length
2341 instead of relative to our position.
2343 * dbus/dbus-hash.c (_dbus_hash_test): Don't try to allocate the
2344 keys on the stack... it's 640k of data.
2346 * dbus/dbus-sysdeps.c (_dbus_read_credentials_unix_socket): Always
2347 read the credentials byte off the socket, even if we don't have
2349 (_dbus_poll): Implement poll() using select() for systems which
2352 * glib/test-dbus-glib.c (main): Print out an error if no
2353 parameters are given.
2355 * test/data/auth/fallback.auth-script: Added. Tests that a client
2356 can fallback to a secondary auth mechanism if the first fails.
2358 2003-02-18 Havoc Pennington <hp@pobox.com>
2362 2003-02-17 Havoc Pennington <hp@pobox.com>
2364 * doc/dbus-specification.sgml: lots of cosmetic
2365 cleanups/rearrangement, add assorted FIXME, change DBUS_ADDRESS
2366 env variable to DBUS_BUS_ADDRESS, s/client/application/,
2367 s/server/bus/ (except in authentication section). Add a section
2368 "Message Bus Message Routing"
2370 2003-02-17 Anders Carlsson <andersca@codefactory.se.>
2376 2003-02-17 Anders Carlsson <andersca@codefactory.se>
2378 * doc/dbus-specification.sgml:
2379 Specification updates.
2381 2003-02-17 Anders Carlsson <andersca@codefactory.se>
2383 * bus/activation.c: (bus_activation_init), (child_setup),
2384 (bus_activation_activate_service):
2386 * bus/main.c: (main):
2387 Set DBUS_ADDRESS environment variable.
2389 * dbus/dbus-errors.c: (dbus_set_error):
2390 Don't use va_copy since that's a C99 feature.
2392 * dbus/dbus-sysdeps.c: (_dbus_setenv), (do_exec),
2393 (_dbus_spawn_async):
2394 * dbus/dbus-sysdeps.h:
2395 Add child_setup_func to _dbus_spawn_async.
2397 * doc/dbus-specification.sgml:
2398 Update specification.
2400 * test/spawn-test.c: (setup_func), (main):
2403 2003-02-17 Alexander Larsson <alexl@redhat.com>
2405 * dbus/dbus-connection.c (_dbus_connection_handler_destroyed_locked):
2408 2003-02-17 Anders Carlsson <andersca@codefactory.se>
2412 * doc/dbus-test-plan.sgml:
2413 Add test plan document.
2418 2003-02-17 Anders Carlsson <andersca@codefactory.se>
2420 * dbus/dbus-message.c: (decode_header_data),
2421 (_dbus_message_loader_return_buffer):
2422 Set the header padding amount when loading a message.
2424 2003-02-16 Anders Carlsson <andersca@codefactory.se>
2426 * bus/dispatch.c: (send_one_message):
2427 Only send broadcast messages to registered connections.
2429 * dbus/dbus-message.c: (dbus_message_name_is):
2430 * dbus/dbus-message.h:
2431 New convenience function.
2433 * dbus/dbus-transport-debug.c: (do_reading):
2434 Only dispatch one message per run.
2437 * test/bus-test.c: (new_connection_callback), (die),
2438 (test_hello_client1_handler), (test_hello_client2_handler),
2439 (test_hello_replies), (main):
2441 * test/bus-test-loop.[ch]:
2444 2003-02-16 Havoc Pennington <hp@pobox.com>
2446 * dbus/dbus-connection.c (dbus_connection_dispatch_message): fix
2447 backward conditional
2449 2003-02-16 Alexander Larsson <alexl@redhat.com>
2451 * dbus/dbus-connection.c:
2452 Implement sent_message_with_reply. (with_reply_and block is still
2454 Made dispatch_message not lose message if OOM.
2456 * dbus/dbus-errors.h:
2457 Add NoReply error (for reply timeouts).
2459 2003-02-16 Alexander Larsson <alexl@redhat.com>
2461 * dbus/dbus-hash.c (_dbus_hash_table_unref):
2462 Actually free keys and values when destroying hashtable.
2464 2003-02-16 Anders Carlsson <andersca@codefactory.se>
2466 * dbus/dbus-auth.c: (client_try_next_mechanism):
2469 * dbus/dbus-threads.c: (dbus_condvar_wait_timeout):
2470 Return TRUE if there's no thread implementation around.
2472 * glib/dbus-gmain.c: (free_source),
2473 (dbus_connection_hookup_with_g_main):
2474 Make sure to remove the GSource when the connection is finalized.
2476 2003-02-16 Anders Carlsson <andersca@codefactory.se>
2478 * bus/dispatch.c: (bus_dispatch_message_handler):
2479 * dbus/dbus-errors.h:
2480 Return an error if someone tries to send a message to a service
2483 2003-02-16 Anders Carlsson <andersca@codefactory.se>
2485 * bus/activation.c: (load_directory), (bus_activation_init),
2486 (bus_activation_activate_service):
2489 (bus_driver_handle_activate_service), (bus_driver_handle_message):
2490 More work on the activation handling.
2492 * dbus/dbus-errors.h:
2493 Add some error messages
2495 * dbus/dbus-message.c: (dbus_message_new_error_reply):
2496 * dbus/dbus-message.h:
2497 New function that creates an error message.
2499 * dbus/dbus-protocol.h:
2500 Add ACTIVATE_SERVER message.
2502 * dbus/dbus-server-unix.c: (unix_handle_watch),
2503 (_dbus_server_new_for_domain_socket):
2504 Call _dbus_fd_set_close_on_exec.
2506 * dbus/dbus-sysdeps.c: (make_pipe), (do_exec),
2507 (_dbus_spawn_async), (_dbus_disable_sigpipe),
2508 (_dbus_fd_set_close_on_exec):
2509 * dbus/dbus-sysdeps.h:
2510 Add _dbus_fd_set_close_on exec function. Also add function that checks
2511 that all open fds are set to close-on-exec and warns otherwise.
2513 * dbus/dbus-transport-unix.c:
2514 (_dbus_transport_new_for_domain_socket):
2515 Call _dbus_fd_set_close_on_exec.
2517 2003-02-16 Havoc Pennington <hp@pobox.com>
2519 * dbus/dbus-connection.c (dbus_connection_set_change_sigpipe):
2520 allow people to avoid setting SIGPIPE to SIG_IGN
2521 (_dbus_connection_new_for_transport): disable SIGPIPE unless
2522 we've been asked not to
2524 2003-02-15 Anders Carlsson <andersca@codefactory.se>
2526 * dbus/dbus-list.c: (_dbus_list_append_link),
2527 (_dbus_list_prepend_link):
2528 * dbus/dbus-memory.c: (dbus_malloc), (dbus_malloc0),
2532 2003-02-15 Anders Carlsson <andersca@codefactory.se>
2535 * bus/activation.c: (bus_activation_entry_free),
2536 (add_desktop_file_entry), (load_directory), (bus_activation_init):
2538 * bus/main.c: (main):
2539 Add simple activation support, doesn't work yet though.
2541 2003-02-15 Zack Rusin <zack@kde.org>
2543 * qt/dbus-qthread.cpp: small casting fix
2545 2003-02-15 Anders Carlsson <andersca@codefactory.se>
2547 * dbus/dbus-errors.c: (dbus_set_error):
2548 * dbus/dbus-errors.h:
2549 Add a few errors and make dbus_set_error void.
2551 * dbus/dbus-sysdeps.c:
2552 (_dbus_errno_to_string), (close_and_invalidate), (make_pipe),
2553 (write_err_and_exit), (read_ints), (do_exec), (_dbus_spawn_async):
2554 * dbus/dbus-sysdeps.h:
2555 Add _dbus_spawn_async.
2557 * test/spawn-test.c: (main):
2558 Test for _dbus_spawn_async.
2560 2003-02-15 Anders Carlsson <andersca@codefactory.se>
2562 * dbus/dbus-internals.h:
2563 Fix build without tests.
2565 * dbus/dbus-list.c: (alloc_link):
2566 Fix a segfault when a malloc fails.
2568 * dbus/dbus-memory.c: (initialize_malloc_debug), (dbus_malloc),
2569 (dbus_malloc0), (dbus_realloc):
2570 Add support for malloc debugging.
2572 2003-02-15 Alexander Larsson <alexl@redhat.com>
2574 * dbus/dbus-threads.c:
2575 * dbus/dbus-threads.h:
2576 Add condvars. Remove static mutext from API.
2577 Implement static mutexes by initializing them from threads_init.
2579 * glib/dbus-gthread.c:
2580 * qt/dbus-qthread.cpp:
2581 Update with the thread api changes.
2586 Turn StaticMutex into normal mutex + init function.
2587 Export new functions _dbus_list_alloc_link, _dbus_list_free_link,
2588 _dbus_list_append_link, _dbus_list_prepend_link
2591 * dbus/dbus-sysdeps.c:
2592 * dbus/dbus-sysdeps.h:
2593 New type dbus_atomic_t, and new functions _dbus_atomic_inc,
2594 _dbus_atomic_dec. Only slow fallback implementation at the moment.
2596 * dbus/dbus-protocol.h:
2597 Add DBUS_MESSAGE_LOCAL_DISCONNECT define
2599 * dbus/dbus-message.c:
2600 Make ref/unref atomic.
2603 * dbus/dbus-connection-internal.h:
2604 * dbus/dbus-connection.c:
2605 * dbus/dbus-connection.h:
2607 Change _peek to _borrow,_return & _steal_borrowed.
2608 Change disconnect callback to event.
2609 Make dbus_connection_dispatch_messages reentrant.
2611 * dbus/dbus-transport.c:
2612 Don't ref the connection on calls to the transport
2615 * dbus/dbus-message-handler.c:
2618 * glib/dbus-gmain.c:
2619 Don't use peek_message anymore
2622 * test/debug-thread.c:
2623 * test/debug-thread.h:
2624 Simple thread implementation that asserts() on deadlocks in
2625 single-threaded code.
2628 (main) Call debug_threads_init.
2631 Use disconnect message instead of disconnect callback.
2635 Don't call dbus_connection_set_disconnect_function. Instead export
2636 bus_connection_disconnect.
2639 Call bus_connection_disconnect when we get a disconnected message.
2641 2003-02-15 Havoc Pennington <hp@pobox.com>
2643 * dbus/dbus-message.c (dbus_message_new): fool around with the
2646 2003-02-14 Havoc Pennington <hp@pobox.com>
2648 * dbus/dbus-mempool.c: fail if the debug functions so indicate
2650 * dbus/dbus-memory.c: fail if the debug functions indicate we
2653 * dbus/dbus-internals.c (_dbus_set_fail_alloc_counter)
2654 (_dbus_decrement_fail_alloc_counter): debug functions to
2655 simulate memory allocation failures
2657 2003-02-14 Havoc Pennington <hp@pobox.com>
2659 * dbus/dbus-errors.h (struct DBusError): add a word of padding
2662 2003-02-13 Anders Carlsson <andersca@codefactory.se>
2664 * bus/driver.c: (bus_driver_handle_hello):
2666 * bus/services.c: (bus_service_lookup):
2667 Reorder message sending so we get a more sane order.
2669 * test/bus-test.c: (message_handler):
2672 2003-02-13 Anders Carlsson <andersca@codefactory.se>
2674 * bus/driver.c: (bus_driver_send_service_deleted),
2675 (bus_driver_send_service_created), (bus_driver_send_service_lost),
2676 (bus_driver_send_service_acquired), (bus_driver_handle_hello),
2677 (bus_driver_send_welcome_message),
2678 (bus_driver_handle_list_services),
2679 (bus_driver_handle_acquire_service),
2680 (bus_driver_handle_service_exists):
2681 * dbus/dbus-bus.c: (dbus_bus_register_client),
2682 (dbus_bus_acquire_service), (dbus_bus_service_exists):
2683 * dbus/dbus-errors.c: (dbus_result_to_string):
2684 * dbus/dbus-errors.h:
2685 * dbus/dbus-message.c: (dbus_message_append_args),
2686 (dbus_message_append_args_valist), (dbus_message_get_args),
2687 (dbus_message_get_args_valist), (dbus_message_get_args_iter),
2688 (dbus_message_iter_get_arg_type), (dbus_message_iter_get_string),
2689 (dbus_message_iter_get_byte_array),
2690 (dbus_message_iter_get_string_array), (message_iter_test),
2691 (check_message_handling), (_dbus_message_test):
2692 * dbus/dbus-message.h:
2693 * test/bus-test.c: (main):
2694 Change fields to arguments in messages, so that they won't be
2695 confused with header fields.
2697 * glib/test-dbus-glib.c: (main):
2698 Remove append_fields from hello message.
2700 2003-02-13 Anders Carlsson <andersca@codefactory.se>
2702 * dbus/dbus-errors.c:
2703 * dbus/dbus-message.c:
2704 * dbus/dbus-string.c:
2705 Documentation fixes.
2707 2003-02-13 Anders Carlsson <andersca@codefactory.se>
2709 * glib/dbus-gmain.c: (timeout_handler), (add_timeout),
2711 Implement support for timeouts in dbus-glib.
2713 2003-02-13 Anders Carlsson <andersca@codefactory.se>
2715 * dbus/dbus-message-builder.c: (_dbus_message_data_load):
2716 * dbus/dbus-message.c: (process_test_subdir):
2717 * test/break-loader.c: (find_breaks_based_on):
2718 Plug some memory leaks.
2720 2003-02-13 Richard Hult <rhult@codefactory.se>
2722 * bus/main.c: Fix build.
2724 * dbus/dbus-errors.h:
2725 * dbus/dbus-errors.c: Fix copyright for Anders.
2727 2003-02-13 Anders Carlsson <andersca@codefactory.se>
2732 * bus/connection.c: (bus_connection_foreach):
2735 * bus/desktop-file.c: (grow_lines_in_section), (grow_sections),
2736 (unescape_string), (new_section), (parse_section_start),
2737 (parse_key_value), (report_error), (bus_desktop_file_load),
2738 (bus_desktop_file_get_string):
2739 * bus/desktop-file.h:
2740 Use DBusError for error reporting.
2742 * bus/dispatch.c: (send_one_message),
2743 (bus_dispatch_message_handler):
2744 * bus/driver.c: (bus_driver_send_service_deleted),
2745 (bus_driver_send_service_created), (bus_driver_send_service_lost),
2746 (bus_driver_send_service_acquired), (bus_driver_handle_hello),
2747 (bus_driver_send_welcome_message),
2748 (bus_driver_handle_list_services),
2749 (bus_driver_handle_acquire_service),
2750 (bus_driver_handle_service_exists):
2751 * bus/loop.c: (bus_loop_run):
2753 Use BUS_HANDLE_OOM instead of _DBUS_HANDLE_OOM.
2755 * bus/utils.c: (bus_wait_for_memory):
2757 New files with general utility functions.
2759 * dbus/dbus-internals.h:
2760 Remove _DBUS_HANDLE_OOM.
2762 2003-02-13 Anders Carlsson <andersca@codefactory.se>
2764 * dbus/dbus-errors.c: (dbus_result_to_string), (dbus_error_init),
2765 (dbus_error_free), (dbus_set_error_const), (dbus_set_error):
2766 * dbus/dbus-errors.h:
2767 Add DBusError structure.
2769 2003-02-13 Anders Carlsson <andersca@codefactory.se>
2771 * test/data/valid-messages/standard-acquire-service.message:
2772 * test/data/valid-messages/standard-hello.message:
2773 * test/data/valid-messages/standard-list-services.message:
2774 * test/data/valid-messages/standard-service-exists.message:
2775 Add some standard messages.
2777 2003-02-13 Anders Carlsson <andersca@codefactory.se>
2779 * bus/driver.c: (bus_driver_send_welcome_message),
2780 (bus_driver_handle_list_services),
2781 (bus_driver_handle_acquire_service),
2782 (bus_driver_handle_service_exists), (bus_driver_handle_message):
2783 Update for API changes in libdbus.
2785 * dbus/dbus-message.c: (dbus_message_new_reply):
2786 * dbus/dbus-message.h:
2787 Remove the name argument. The spec states that replies shouldn't
2790 2003-02-13 Anders Carlsson <andersca@codefactory.se>
2792 * bus/desktop-file.c: (parse_section_start), (parse_key_value),
2793 (report_error), (bus_desktop_file_load), (lookup_section),
2794 (lookup_line), (bus_desktop_file_get_raw),
2795 (bus_desktop_file_get_string):
2796 * bus/desktop-file.h:
2797 Some fixes, and new functions for getting a key value from a section.
2799 2003-02-13 Havoc Pennington <hp@pobox.com>
2801 * test/data/auth/fail-after-n-attempts.auth-script: new test
2803 * dbus/dbus-auth.c (send_rejected): shutdown_mech() when we
2806 2003-02-13 Havoc Pennington <hp@pobox.com>
2808 * dbus/dbus-auth.c (handle_server_data_external_mech): args to
2809 dbus_credentials_match were backward
2811 * dbus/dbus-auth-script.c (_dbus_auth_script_run): support
2812 NO_CREDENTIALS and ROOT_CREDENTIALS
2814 * dbus/dbus-auth.c (_dbus_auth_do_work): move get_state() routine
2815 into here. Never process more commands after we've reached an
2816 end state; store further data as unused bytes.
2818 * test/data/auth/*: add more auth tests
2820 * dbus/dbus-auth-script.c (_dbus_auth_script_run): support EXPECT
2821 command to match exact string and EXPECT_UNUSED to match unused
2824 * test/Makefile.am (dist-hook): fix to dist all the test stuff
2826 2003-02-12 Havoc Pennington <hp@pobox.com>
2828 * dbus/dbus-string.c (_dbus_string_pop_line): fix to also strip
2829 \r off of popped lines
2831 * dbus/dbus-auth.c (_dbus_auth_test): write code to run auth
2834 * dbus/dbus-auth-script.c (_dbus_auth_script_run): when doing a
2837 2003-02-12 Havoc Pennington <hp@pobox.com>
2839 * dbus/Makefile.am: remove break-loader from the build, since it
2842 * configure.in: add --enable-gcov to turn on coverage profiling
2843 flags and disable optimization
2845 2003-02-10 Havoc Pennington <hp@pobox.com>
2847 * dbus/dbus-auth-script.c, dbus/dbus-auth-script.h: sync
2848 initial cut at test framework for DBusAuth from laptop.
2849 Doesn't quite work yet but it compiles and I need to get
2850 it off the 266mhz laptop. ;-)
2852 * dbus/dbus-server-debug.c (_dbus_server_debug_accept_transport):
2853 fix a memleak in error case
2855 2003-02-12 Anders Carlsson <andersca@codefactory.se>
2858 * bus/desktop-file.c:
2859 * bus/desktop-file.h:
2860 Add a desktop file parser.
2862 2003-02-11 Zack Rusin <zack@kde.org>
2864 * qt/message.[h|cpp]: sample implementation
2865 of the KDE wrapper for DBusMessage
2867 2003-02-09 Zack Rusin <zack@kde.org>
2869 * test/bus-test.c: make_it_compile
2870 * doc/dbus-specification.sgml: minimal semantic fix
2872 2003-02-06 Anders Carlsson <andersca@codefactory.se>
2878 2003-02-06 Anders Carlsson <andersca@codefactory.se>
2881 * dbus/dbus-break-loader.c:
2883 * test/break-loader.c:
2884 Move dbus-break-loader to test/ and rename it to break-loader.
2886 2003-02-02 Havoc Pennington <hp@pobox.com>
2888 * dbus/dbus-keyring.c, dbus/dbus-keyring.h: template files
2889 for code to manage cookies in your home directory
2891 * dbus/dbus-sysdeps.c (_dbus_generate_random_bytes): new function
2893 * dbus/dbus-auth.c (get_state): impose a maximum number of tries
2894 to authenticate, then disconnect the client.
2896 2003-02-03 Alexander Larsson <alexl@redhat.com>
2898 * dbus/dbus-message.c (dbus_message_append_fields):
2901 2003-02-02 Anders Carlsson <andersca@codefactory.se>
2903 * doc/dbus-specification.sgml:
2904 Update address format section.
2906 2003-02-02 Anders Carlsson <andersca@codefactory.se>
2909 * test/bus-test.c: (get_time), (add_timeout), (remove_timeout),
2910 (message_handler), (new_connection_callback), (loop_quit),
2914 2003-02-02 Anders Carlsson <andersca@codefactory.se>
2916 * bus/driver.c: (bus_driver_handle_service_exists):
2917 Simplify the code a bit.
2919 * dbus/dbus-bus.c: (dbus_bus_service_exists):
2922 2003-02-02 Anders Carlsson <andersca@codefactory.se>
2925 Add libdbus-daemon.la and link to it.
2927 2003-02-01 James Willcox <jwillcox@gnome.org>
2929 * bus/driver.c: (bus_driver_handle_own_service):
2930 Actually include the service reply code in the message.
2932 2003-02-02 Anders Carlsson <andersca@codefactory.se>
2934 * bus/driver.c: (bus_driver_handle_service_exists):
2935 Don't unref the incoming message.
2937 2003-02-02 Anders Carlsson <andersca@codefactory.se>
2939 * dbus/dbus.h: Add dbus-address.h and dbus-bus.h
2941 2003-02-02 Anders Carlsson <andersca@codefactory.se>
2943 * dbus/dbus-server.c: (dbus_server_listen):
2944 * dbus/dbus-transport.c: (_dbus_transport_open):
2945 ifdef out the calls to the debug transport and server.
2947 2003-02-02 Alexander Larsson <alexl@redhat.com>
2949 * dbus/dbus-watch.c (dbus_watch_get_flags):
2950 Add note in the docs that ERROR or HANGUP won't be returned
2951 and are assumed always on.
2953 * glib/dbus-gmain.c (add_watch):
2954 Always add IO_ERR | IO_HUP
2956 * dbus/dbus-message.h:
2957 Add semicolon after dbus_message_iter_get_string_array().
2958 Makes qt code build again
2960 2003-02-01 Anders Carlsson <andersca@codefactory.se>
2962 * bus/driver.c: (create_unique_client_name),
2963 (bus_driver_handle_hello):
2964 Don't take a name, just use a numeric id to identify
2968 * dbus/dbus-bus.c: (dbus_bus_register_client),
2969 (dbus_bus_acquire_service), (dbus_bus_service_exists):
2971 Add new convenience functions for communicating with the bus.
2973 * dbus/dbus-message.h:
2975 * dbus/dbus-protocol.h:
2978 2003-02-01 Alexander Larsson <alexl@redhat.com>
2980 * dbus/dbus-message.c (dbus_message_append_fields):
2981 Add some more doc comments.
2983 2003-02-01 Havoc Pennington <hp@pobox.com>
2985 * dbus/dbus-break-loader.c (randomly_modify_length): change
2986 a 4-byte value in the message as if it were a length
2988 * dbus/dbus-sysdeps.c (_dbus_string_save_to_file): don't set
2989 execute bit on saved files
2991 2003-02-01 Havoc Pennington <hp@pobox.com>
2993 * dbus/dbus-break-loader.c (main): new program to find messages
2994 that break the loader.
2996 * dbus/dbus-sysdeps.c (_dbus_string_append_uint): new function
2997 * dbus/dbus-sysdeps.c (_dbus_string_save_to_file): new function
2999 * dbus/dbus-string.c (_dbus_string_set_byte): new
3001 2003-01-31 Havoc Pennington <hp@pobox.com>
3003 * dbus/dbus-message.c: refactor the test code to be more general,
3004 in preparation for writing a "randomly permute test cases to
3005 try to break the loader" program.
3007 2003-01-31 Havoc Pennington <hp@pobox.com>
3009 * doc/dbus-specification.sgml: work on the specification
3011 * dbus/dbus-message.c (_dbus_message_loader_return_buffer): check
3012 the protocol version of the message.
3014 * dbus/dbus-protocol.h: drop special _REPLY names, the spec
3015 no longer specifies that.
3016 (DBUS_SERVICE_REPLY_SERVICE_EXISTS): fix flags (1/2/4/8 not
3019 * dbus/dbus-marshal.c (_dbus_marshal_get_arg_end_pos): add missing
3020 "break" for DBUS_TYPE_NIL, remove @todo
3022 2003-01-31 Havoc Pennington <hp@pobox.com>
3024 * dbus/dbus-message.c (dbus_message_set_is_error_reply): rename
3025 just set_is_error/get_is_error as this is a commonly-used
3026 function, and write docs.
3028 2003-01-31 Anders Carlsson <andersca@codefactory.se>
3030 * dbus/dbus-address.c: (dbus_address_entry_free):
3031 Free key and value lists.
3033 * dbus/dbus-internals.c: (_dbus_type_to_string):
3034 Add the types we didn't have.
3036 * dbus/dbus-marshal.c: (_dbus_marshal_get_arg_end_pos),
3037 (_dbus_marshal_validate_arg):
3040 * dbus/dbus-message.c: (dbus_message_set_sender):
3041 Remove todo about being able to set sender to NULL.
3043 (dbus_message_set_is_error_reply),
3044 (dbus_message_get_is_error_reply):
3045 * dbus/dbus-message.h:
3048 * dbus/dbus-protocol.h:
3049 Add error reply flag.
3051 * test/data/valid-messages/opposite-endian.message:
3052 Add NIL type to test.
3054 2003-01-31 Havoc Pennington <hp@pobox.com>
3056 * doc/dbus-specification.sgml: fully specify the header. Add
3057 flags and major protocol version, and change header/body len to
3060 * dbus/dbus-message-builder.c (append_saved_length): append length
3063 * dbus/dbus-message.c (dbus_message_create_header): change header
3064 length and body length to unsigned. Add the new fields from the
3066 (_dbus_message_loader_return_buffer): unsigned header/body len
3068 2003-01-30 Havoc Pennington <hp@pobox.com>
3070 * dbus/dbus-auth.c: rework to use only REJECTED, no
3073 * doc/dbus-sasl-profile.txt: drop MECHANISMS and just
3074 use REJECTED, suggested by Mark McLoughlin
3076 2003-01-30 Havoc Pennington <hp@pobox.com>
3078 * dbus/dbus-server.c (dbus_server_listen): @todo about how we need
3079 a better way to report errors here. e.g. "unix address lacks
3080 path" or something. also "no such file" when the path doesn't
3083 * dbus/dbus-address.c (dbus_address_entries_free): add @todo about
3085 (dbus_parse_address): add @todo about documenting address format,
3086 and allowing , and ; to be escaped
3088 2003-01-30 Anders Carlsson <andersca@codefactory.se>
3091 Add dbus-address.[ch]
3093 * dbus/dbus-address.c: (dbus_address_entry_free),
3094 (dbus_address_entries_free), (create_entry),
3095 (dbus_address_entry_get_method), (dbus_address_entry_get_value),
3096 (dbus_parse_address), (_dbus_address_test):
3097 * dbus/dbus-address.h:
3098 New files for dealing with address parsing.
3100 * dbus/dbus-connection.c:
3101 Document timeout functions.
3103 * dbus/dbus-message.c:
3104 Document dbus_message_new_from_message.
3106 * dbus/dbus-server-debug.c:
3109 * dbus/dbus-server.c: (dbus_server_listen):
3110 Parse address and use correct server implementation.
3112 * dbus/dbus-string.c: (_dbus_string_find_to), (_dbus_string_test):
3113 * dbus/dbus-string.h:
3114 New function with test.
3116 * dbus/dbus-test.c: (dbus_internal_symbol_do_not_use_run_tests):
3120 * dbus/dbus-transport-debug.c:
3123 * dbus/dbus-transport.c: (_dbus_transport_open):
3124 Parse address and use correct transport implementation.
3126 2003-01-30 Havoc Pennington <hp@pobox.com>
3128 * dbus/dbus-message.c: use message->byte_order instead of
3129 DBUS_COMPILER_BYTE_ORDER throughout.
3130 (dbus_message_create_header): pad header to align the
3131 start of the body of the message to 8-byte boundary
3133 * dbus/dbus-marshal.h: make all the demarshalers take const
3134 DBusString arguments.
3136 * dbus/dbus-message.c (_dbus_message_loader_return_buffer):
3137 validate message args here, so we don't have to do slow validation
3138 later, and so we catch bad messages as they are incoming. Also add
3139 better checks on header_len and body_len. Also fill in
3142 * dbus/dbus-string.c (_dbus_string_validate_utf8): new (not
3143 implemented properly)
3144 (_dbus_string_validate_nul): new function to check all-nul
3146 * dbus/dbus-marshal.c (_dbus_marshal_get_field_end_pos): rename
3147 get_arg_end_pos and remove all validation
3148 (_dbus_marshal_validate_arg): actually do validation here.
3150 2003-01-29 Havoc Pennington <hp@pobox.com>
3152 * dbus/dbus-message.c (check_message_handling): fix assertion
3153 failure on set_client_serial
3155 2003-01-28 Havoc Pennington <hp@pobox.com>
3157 * dbus/dbus-server-debug.c: Add doc section comments
3159 * dbus/dbus-transport-debug.c: add doc section comments
3161 2003-01-28 Havoc Pennington <hp@redhat.com>
3163 * dbus/dbus-string.c (_dbus_string_base64_decode): append bytes in
3164 the reverse order from how I had it
3165 (_dbus_string_base64_encode): reverse encoding order. I was
3166 basically byteswapping everything during encoding.
3168 2003-01-28 Anders Carlsson <andersca@codefactory.se>
3170 * dbus/dbus-connection-internal.h:
3171 * dbus/dbus-connection.c: (_dbus_connection_add_timeout),
3172 (_dbus_connection_remove_timeout):
3173 Add functions for adding and removing timeouts.
3175 * dbus/dbus-message.c: (dbus_message_new_from_message):
3176 Add new function that takes a message and creates an exact
3177 copy of it, but with the refcount set to 1.
3178 (check_message_handling):
3181 * dbus/dbus-server-protected.h:
3182 * dbus/dbus-server.c: (_dbus_server_init_base),
3183 (_dbus_server_finalize_base), (_dbus_server_add_timeout),
3184 (dbus_server_set_timeout_functions):
3185 (_dbus_server_remove_timeout):
3186 New functions so that a server can add and remove timeouts.
3188 (dbus_server_listen):
3189 Add commented out call to dbus_server_debug_new.
3191 * dbus/dbus-timeout.c: (_dbus_timeout_new):
3192 Actually set the handler, doh.
3194 * dbus/dbus-transport.c: (_dbus_transport_open):
3195 Add commented out call to dbus_transport_debug_client_new.
3198 Add dbus-transport-debug.[ch] and dbus-server-debug.[ch]
3200 2003-01-28 Havoc Pennington <hp@pobox.com>
3202 * dbus/dbus-message.c (check_message_handling): function to check
3203 on the loaded message, iterates over it etc.
3205 2003-01-28 Havoc Pennington <hp@pobox.com>
3207 * test/Makefile.am (dist-hook): fix make distdir
3209 * dbus/Makefile.am (TESTS_ENVIRONMENT): fix make check
3211 2003-01-27 Havoc Pennington <hp@pobox.com>
3213 * dbus/dbus-mempool.c (time_for_size): replace printf with
3216 * dbus/dbus-message-builder.c (_dbus_message_data_load): allow
3217 empty lines; fix the SAVE_LENGTH stuff to be
3218 START_LENGTH/END_LENGTH so it actually works; couple other
3221 * test/Makefile.am (dist-hook): add dist-hook for .message files
3223 * dbus/dbus-string.c (DBUS_STRING_COPY_PREAMBLE): source of a copy
3224 can be constant or locked.
3225 (_dbus_string_free): allow freeing a const string as
3228 * dbus/dbus-sysdeps.c (_dbus_concat_dir_and_file): utility
3230 * dbus/dbus-test-main.c (main): take an argument which is the
3231 directory containing test data
3233 * dbus/dbus-message.c (_dbus_message_test): pass a test_data_dir
3234 argument to this and load all the messages in test/data/
3235 checking that they can be loaded or not loaded as appropriate.
3237 2003-01-27 Anders Carlsson <andersca@codefactory.se>
3239 * bus/dispatch.c: (bus_dispatch_message_handler):
3240 Dispatch messages sent to services.
3242 * bus/driver.c: (bus_driver_send_service_deleted),
3243 (bus_driver_send_service_created), (bus_driver_send_service_lost),
3244 (bus_driver_send_service_acquired):
3245 Add helper functions for sending service related messages.
3247 (bus_driver_send_welcome_message):
3248 Send HELLO_REPLY instead of WELCOME.
3250 (bus_driver_handle_list_services):
3251 Send LIST_SERVICES_REPLY instead of SERVICES.
3253 (bus_driver_handle_own_service),
3254 (bus_driver_handle_service_exists):
3255 New message handlers.
3257 (bus_driver_handle_message):
3258 Invoke new message handlers.
3260 (bus_driver_remove_connection):
3261 Don't remove any services here since that's done automatically
3262 by bus_service_remove_owner now.
3265 New function signatures.
3267 * bus/services.c: (bus_service_add_owner):
3268 Send ServiceAcquired message if we're the only primary owner.
3270 (bus_service_remove_owner):
3271 Send ServiceAcquired/ServiceLost messages.
3273 (bus_service_set_prohibit_replacement),
3274 (bus_service_get_prohibit_replacement):
3275 Functions for setting prohibit replacement.
3277 (bus_service_has_owner):
3278 New function that checks if a connection is in the owner queue of
3282 Add new function signatures.
3284 * dbus/dbus-list.c: (_dbus_list_test):
3285 Add tests for _dbus_list_remove_last and traversing the list backwards.
3288 Fix a typo in _dbus_list_get_prev_link, if we're at the first element we can't
3289 go any further, so return NULL then.
3291 * dbus/dbus-protocol.h:
3292 Add new messages, service flags and service replies.
3294 2003-01-26 Havoc Pennington <hp@pobox.com>
3296 * dbus/dbus-message-builder.c: implement, completely untested.
3298 * test/data/*: add data to be used in testing.
3299 ".message" files are our simple loadable text format.
3300 ".message-raw" will be binary dumps of messages.
3302 * dbus/dbus-string.c (_dbus_string_starts_with_c_str): new
3304 2003-01-26 Havoc Pennington <hp@pobox.com>
3306 * dbus/dbus-sysdeps.c (_dbus_file_get_contents): new function
3308 * dbus/dbus-errors.c (dbus_result_to_string): add
3311 * dbus/dbus-message-builder.c: new file, will contain code to load
3312 up messages from files. Not implemented yet.
3314 2003-01-26 Havoc Pennington <hp@pobox.com>
3316 * dbus/dbus-message.c (dbus_message_set_sender): support deleting
3317 the sender by setting to NULL
3319 2003-01-26 Havoc Pennington <hp@pobox.com>
3321 The unit tests pass, but otherwise untested. If it breaks, the
3322 tests should have been better. ;-)
3324 * bus/driver.c (bus_driver_handle_hello): return if we disconnect
3327 * dbus/dbus-message.c: redo everything so we maintain
3328 message->header as the only copy of the various fields.
3329 This avoids the possibility of out-of-memory in some cases,
3330 for example dbus_message_lock() can't run out of memory anymore,
3331 and avoids extra copying. Figured I may as well go ahead and do
3332 this since it was busted for dbus_message_lock to not return
3333 failure on OOM, and dbus_message_write_header was totally
3334 unchecked for OOM. Also fixed some random other bugs.
3336 * dbus/dbus-marshal.c (_dbus_marshal_get_field_end_pos): verify
3337 that strings are nul-terminated. Also, end_pos can be equal
3338 to string length just not greater than, I think.
3339 (_dbus_marshal_set_int32): new function
3340 (_dbus_marshal_set_uint32): new function
3341 (_dbus_marshal_set_string): new function
3343 * dbus/dbus-connection.c (_dbus_connection_new_for_transport): fix
3344 a warning, init timeout_list to NULL
3345 (dbus_connection_send_message): don't use uninitialized variable
3348 * dbus/dbus-string.c (_dbus_string_replace_len): new function
3350 2003-01-26 Anders Carlsson <andersca@codefactory.se>
3352 * bus/driver.c: (bus_driver_handle_hello),
3353 (bus_driver_send_welcome_message):
3356 2003-01-26 Anders Carlsson <andersca@codefactory.se>
3358 * dbus/dbus-auth.c: (process_auth), (_dbus_auth_unref):
3359 * dbus/dbus-connection.c: (_dbus_connection_new_for_transport),
3360 (dbus_connection_unref):
3361 * dbus/dbus-marshal.c: (_dbus_marshal_test):
3362 * dbus/dbus-message.c: (dbus_message_unref),
3365 (dbus_message_get_fields):
3366 Remove debugging printout.
3368 (_dbus_message_loader_return_buffer):
3369 Don't store the header string.
3371 (_dbus_message_test):
3374 2003-01-26 Richard Hult <rhult@codefactory.se>
3376 * glib/dbus-gmain.c (dbus_connection_dispatch): Traverse a copy of
3377 the file descriptor list, since it can change under us.
3379 2003-01-25 Anders Carlsson <andersca@codefactory.se>
3381 * glib/dbus-gmain.c: (dbus_connection_prepare),
3382 (dbus_connection_check), (dbus_connection_dispatch), (add_watch),
3383 (remove_watch), (dbus_connection_hookup_with_g_main):
3384 Rewrite the glib handling to use its own GSource instead of a
3385 GIOChannel so we can catch messages put in the queue while waiting
3388 2003-01-25 Anders Carlsson <andersca@codefactory.se>
3391 * bus/connection.c: (connection_disconnect_handler),
3392 (connection_watch_callback), (bus_connection_setup):
3393 * bus/dispatch.c: (send_one_message),
3394 (bus_dispatch_broadcast_message), (bus_dispatch_message_handler),
3395 (bus_dispatch_add_connection), (bus_dispatch_remove_connection):
3397 * bus/driver.c: (bus_driver_send_service_deleted),
3398 (bus_driver_send_service_created), (bus_driver_handle_hello),
3399 (bus_driver_send_welcome_message),
3400 (bus_driver_handle_list_services), (bus_driver_remove_connection),
3401 (bus_driver_handle_message):
3403 Refactor code, put the message dispatching in its own file. Use
3404 _DBUS_HANDLE_OOM. Also send ServiceDeleted messages when a client
3407 2003-01-25 Anders Carlsson <andersca@codefactory.se>
3409 * dbus/dbus-internals.h:
3410 Add _DBUS_HANDLE_OOM macro, it doesn't do anything currently.
3412 * dbus/dbus-message.c: (dbus_message_get_sender):
3413 * dbus/dbus-message.h:
3414 Implement dbus_message_get_sender.
3416 * dbus/dbus-protocol.h:
3417 Add message and service defines.
3419 2003-01-25 Anders Carlsson <andersca@codefactory.se>
3421 * dbus/dbus-connection.c: (dbus_connection_send_message):
3422 * dbus/dbus-message-internal.h:
3423 * dbus/dbus-message.c: (_dbus_message_get_client_serial),
3424 (dbus_message_write_header):
3425 Remove _dbus_messag_unlock and don't set the client serial on a
3426 message if one already exists.
3428 2003-01-24 Havoc Pennington <hp@pobox.com>
3430 * dbus/dbus-list.c (alloc_link): put a thread lock on the global
3433 * bus/driver.c (bus_driver_handle_list_services): fix a leak
3436 2003-01-25 Anders Carlsson <andersca@codefactory.se>
3438 * dbus/dbus-list.c: (alloc_link), (free_link):
3439 Use a memory pool for the links.
3441 2003-01-25 Anders Carlsson <andersca@codefactory.se>
3443 * bus/connection.c: (bus_connection_foreach):
3445 Add new bus_connection_foreach function.
3447 * bus/driver.c: (send_one_message), (bus_driver_broadcast_message):
3448 Add function that broadcasts a message to all clients.
3450 (bus_driver_send_service_created), (bus_driver_handle_hello),
3451 (bus_driver_send_welcome_message),
3452 (bus_driver_handle_list_services), (bus_driver_message_handler):
3453 Implement functions that take care of listing services, and notifying
3454 clients when new services are created.
3456 * bus/services.c: (bus_services_list):
3458 Add new function that returns an array of strings with the currently
3459 registered services.
3462 * glib/dbus-gmain.c:
3463 Update copyright year.
3465 2003-01-25 Anders Carlsson <andersca@codefactory.se>
3467 * dbus/dbus-connection.c: (dbus_connection_send_message):
3468 Unlock the message in case it was sent earlier.
3470 (dbus_connection_send_message_with_reply_and_block):
3471 Remove the reply message from the list.
3473 * dbus/dbus-marshal.c: (_dbus_demarshal_string_array):
3474 Set array_len and new_pos correctly.
3476 (_dbus_marshal_test):
3477 Remove debug output.
3479 * dbus/dbus-message-internal.h:
3480 * dbus/dbus-message.c: (_dbus_message_get_reply_serial):
3481 New function that returns the reply serial.
3483 (_dbus_message_unlock):
3484 New function that unlocks a message and resets its header.
3486 (dbus_message_append_string_array),
3487 (dbus_message_get_fields_valist),
3488 (dbus_message_iter_get_field_type),
3489 (dbus_message_iter_get_string_array),
3490 (dbus_message_get_fields),
3491 (dbus_message_append_fields_valist):
3492 Handle string arrays.
3494 (dbus_message_set_sender):
3495 Make this function public since the bus daemon needs it.
3497 (decode_header_data):
3498 Set the reply serial to -1 initially.
3500 * dbus/dbus-message.h:
3501 Add dbus_message_set_sender.
3503 2003-01-24 Havoc Pennington <hp@pobox.com>
3505 * doc/dbus-specification.sgml: add some stuff
3507 2003-01-22 Havoc Pennington <hp@pobox.com>
3509 * doc/dbus-specification.sgml: Start to document the protocol.
3511 2003-01-22 Havoc Pennington <hp@pobox.com>
3513 * dbus/dbus-connection.c
3514 (dbus_connection_send_message_with_reply_and_block): add some @todo
3516 * bus/driver.c (bus_driver_add_connection): add a FIXME about memleak
3518 2003-01-21 Havoc Pennington <hp@pobox.com>
3520 (patch untested because can't compile)
3522 * bus/driver.c (create_unique_client_name): make this function
3523 never recycle client names. Also, caller should initialize
3526 * dbus/dbus-sysdeps.c (_dbus_get_current_time): new function
3528 2003-01-21 Anders Carlsson <andersca@codefactory.se>
3530 * dbus/dbus-marshal.c: (_dbus_marshal_double),
3531 (_dbus_marshal_int32), (_dbus_marshal_uint32),
3532 (_dbus_marshal_int32_array), (_dbus_marshal_uint32_array),
3533 (_dbus_marshal_double_array), (_dbus_marshal_string_array),
3534 (_dbus_demarshal_int32_array), (_dbus_demarshal_uint32_array),
3535 (_dbus_demarshal_double_array), (_dbus_demarshal_string_array),
3536 (_dbus_marshal_get_field_end_pos), (_dbus_marshal_test):
3537 * dbus/dbus-marshal.h:
3538 * dbus/dbus-protocol.h:
3539 Add support for marshalling and demarshalling integer, double
3542 2003-01-21 Anders Carlsson <andersca@codefactory.se>
3547 * bus/connection.c: (connection_disconnect_handler):
3548 Remove the connection from the bus driver's list.
3550 (connection_watch_callback): Dispatch messages.
3552 (free_connection_data): Free connection name.
3554 (bus_connection_setup): Add connection to the bus driver's list.
3555 (bus_connection_remove_owned_service):
3556 (bus_connection_set_name), (bus_connection_get_name):
3557 Add functions for setting and getting the connection's name.
3560 Add function headers.
3562 * bus/driver.c: (create_unique_client_name),
3563 (bus_driver_handle_hello_message),
3564 (bus_driver_send_welcome_message), (bus_driver_message_handler),
3565 (bus_driver_add_connection), (bus_driver_remove_connection):
3568 * bus/services.c: (bus_service_free):
3570 New file that handles communication and registreation with the bus
3573 2003-01-21 Anders Carlsson <andersca@codefactory.se>
3575 * dbus/dbus-connection.c: (dbus_connection_send_message):
3576 Add a new client_serial parameter.
3578 (dbus_connection_send_message_with_reply):
3579 Remove a @todo since we've implemented the blocking function.
3581 (dbus_connection_send_message_with_reply_and_block):
3582 New function that sends a message and waits for a reply and
3583 then returns the reply.
3585 * dbus/dbus-connection.h:
3588 * dbus/dbus-errors.c: (dbus_result_to_string):
3589 * dbus/dbus-errors.h:
3590 Add new DBUS_RESULT.
3592 * dbus/dbus-message-internal.h:
3593 * dbus/dbus-message.c: (_dbus_message_get_reply_serial),
3594 (_dbus_message_set_sender), (dbus_message_write_header),
3595 (dbus_message_new_reply), (decode_header_data),
3596 (_dbus_message_loader_return_buffer), (_dbus_message_test):
3597 * dbus/dbus-message.h:
3598 Add new functions that set the reply serial and sender.
3599 Also marshal and demarshal them correctly and add test.
3601 * dbus/dbus-protocol.h:
3602 Add new DBUS_MESSAGE_TYPE_SENDER.
3605 * glib/dbus-gmain.c: (watch_callback), (free_callback_data),
3606 (add_watch), (remove_watch), (add_timeout), (remove_timeout),
3607 (dbus_connection_hookup_with_g_main):
3608 * glib/test-dbus-glib.c: (main):
3609 Rewrite to use GIOChannel and remove the GSource crack.
3611 * test/echo-client.c: (main):
3612 * test/watch.c: (check_messages):
3613 Update for changed APIs
3615 2003-01-19 Anders Carlsson <andersca@codefactory.se>
3617 * dbus/Makefile.am: Add dbus-timeout.[cħ]
3619 * dbus/dbus-connection.c: (_dbus_connection_new_for_transport):
3620 Create a DBusTimeoutList.
3621 (dbus_connection_set_timeout_functions): Add new function to
3622 set timeout callbacks
3624 * dbus/dbus-connection.h: Add public DBusTimeout API.
3626 * dbus/dbus-message.c: (dbus_message_get_service):
3627 * dbus/dbus-message.h: New function.
3629 * dbus/dbus-server.c: Fix small doc typo.
3631 * dbus/dbus-timeout.[ch]: New files for mainloop timeouts.
3633 2003-01-19 Anders Carlsson <andersca@codefactory.se>
3635 * dbus/dbus-string.c (_dbus_string_move_len): Don't delete all
3636 of the string, just as long as specified.
3638 2003-01-19 Havoc Pennington <hp@pobox.com>
3640 * dbus/dbus-connection.c (dbus_connection_get_is_authenticated):
3643 * dbus/dbus-server.c (dbus_server_set_max_connections)
3644 (dbus_server_get_max_connections, dbus_server_get_n_connections):
3645 keep track of current number of connections, and add API for
3646 setting a max (but haven't implemented enforcing the max yet)
3648 2003-01-18 Havoc Pennington <hp@pobox.com>
3650 * dbus/dbus-transport-unix.c (unix_do_iteration): only do the
3651 reading/writing if read_watch != NULL or write_watch != NULL.
3653 * dbus/dbus-message.c (_dbus_message_loader_return_buffer): fix
3654 the message loader code to actually load message->header and
3655 message->body into the newly-created message.
3657 * dbus/dbus-transport-unix.c (check_write_watch): fix a mem leak
3660 * dbus/dbus-connection.c (dbus_connection_set_max_message_size)
3661 (dbus_connection_get_max_message_size)
3662 (dbus_connection_set_max_live_messages_size)
3663 (dbus_connection_get_max_live_messages_size): implement some
3664 resource limitation functions
3666 * dbus/dbus-resources.c: new file implementing some of the
3667 resource limits stuff
3669 * dbus/dbus-message.c (dbus_message_iter_get_byte_array): add
3670 missing docs, add @todo to handle OOM etc.
3672 * dbus/dbus-marshal.c (_dbus_demarshal_byte_array): add missing
3675 2003-01-18 Havoc Pennington <hp@pobox.com>
3677 * dbus/dbus-connection.c (dbus_connection_unref): disconnect the
3678 connection if it hasn't been already.
3680 * dbus/dbus-connection.h: kill off the idea of an ErrorFunction,
3681 replace with DisconnectFunction.
3683 2003-01-18 Havoc Pennington <hp@pobox.com>
3685 Building --disable-verbose-mode --disable-asserts --disable-tests
3686 cuts the library from 112K to 45K or so
3688 * configure.in: check for varargs macro support,
3689 add --enable-verbose-mode, --enable-asserts.
3691 * dbus/dbus-internals.h (_dbus_assert): support
3693 (_dbus_verbose): support DBUS_ENABLE_VERBOSE_MODE
3695 2003-01-18 Havoc Pennington <hp@pobox.com>
3697 * dbus/dbus-test.c: include config.h so that tests actually run
3699 * dbus/dbus-string.c: add assertions that stuff is 8-byte aligned,
3700 so the failure mode when that assumption fails will be plenty
3703 2003-01-18 Havoc Pennington <hp@pobox.com>
3705 * configure.in: default --enable-tests to $USE_MAINTAINER_MODE
3707 * dbus/Makefile.am: fix it up so dubs-test-main.c is included in
3710 * test/Makefile.am: don't use special variable "TESTS" for echo-*
3711 since we don't want to use those in make check
3713 2003-01-15 Havoc Pennington <hp@redhat.com>
3719 2003-01-15 Havoc Pennington <hp@redhat.com>
3721 * test/Makefile.am: fix so that test source code ends up in the
3722 distribution on make distcheck
3724 2003-01-15 Havoc Pennington <hp@redhat.com>
3730 2003-01-15 Havoc Pennington <hp@redhat.com>
3732 * dbus/dbus-test.c (dbus_internal_symbol_do_not_use_run_tests):
3733 fix build when --disable-tests
3735 * Makefile.am (EXTRA_DIST): put HACKING in here
3737 * HACKING: document procedure for making a tarball release.
3739 2003-01-14 Anders Carlsson <andersca@codefactory.se>
3741 * bus/connection.c: (connection_error_handler),
3742 (bus_connection_setup):
3743 * bus/main.c: (main):
3744 Make sure that the DBusConnectionData struct is NULLed
3745 out to prevent a segfault.
3747 * dbus/dbus-errors.c: (dbus_result_to_string):
3748 * dbus/dbus-errors.h:
3749 * dbus/dbus-message.c: (dbus_message_get_fields),
3750 (dbus_message_get_fields_valist), (_dbus_message_test):
3751 * dbus/dbus-message.h:
3752 Make dbus_message_get_fields return a result code so we can
3753 track invalid fields as well as oom.
3755 2003-01-11 Havoc Pennington <hp@pobox.com>
3757 * configure.in: change --enable-test/--enable-ansi action-if-given
3758 to enable_foo=$enableval instead of enable_foo=yes
3760 2003-01-08 Havoc Pennington <hp@pobox.com>
3762 * dbus/dbus-string.c (_dbus_string_align_length): new function
3764 * dbus/dbus-test-main.c: move main() for test app here
3766 (dbus_internal_symbol_do_not_use_run_tests): we have to export a
3767 symbol to run tests, because dbus-test isn't in the main
3770 Code review nitpicks.
3772 * dbus/dbus-message.c (dbus_message_write_header): add newlines
3773 for people with narrow emacs ;-). Assert client_serial was filled
3774 in. Assert message->name != NULL.
3775 (dbus_message_append_fields): have "first_field_type" arg separate
3776 from va list, needed for C++ binding that also uses varargs IIRC
3777 and helps with type safety
3778 (dbus_message_new): add @todo about using DBusString to store
3779 service/name internally
3780 (dbus_message_new): don't leak ->service and ->name on OOM later
3782 (dbus_message_unref): free the service name
3783 (dbus_message_get_fields): same change to varargs
3784 i.e. first_field_type
3785 (_dbus_message_loader_return_buffer): assert that the message data
3786 is aligned (if not it's a bug in our code). Put in verbose griping
3787 about why we set corrupted = TRUE.
3788 (decode_header_data): add FIXME that char* is evil. Was going to
3789 add FIXME about evil locale-specific string.h strncmp, but just
3790 switched to wacky string-as-uint32 optimization. Move check for
3791 "no room for field name" above get_const_data_len() to avoid
3792 assertion failure in get_const_data_len if we have trailing 2
3793 bytes or the like. Check for service and name fields being
3794 provided twice. Don't leak service/name on error. Require field
3795 names to be aligned to 4 bytes.
3797 * dbus/dbus-marshal.c: move byte swap stuff to header
3798 (_dbus_pack_int32): uscore-prefix
3799 (_dbus_unpack_int32): uscore-prefix
3800 (_dbus_unpack_uint32): export
3801 (_dbus_demarshal_string): add @todo complaining about use of
3803 (_dbus_marshal_get_field_end_pos): add @todo about bad error
3804 handling allowing corrupt data to go unchecked
3806 2003-01-08 Havoc Pennington <hp@redhat.com>
3808 * dbus/dbus-transport-unix.c (unix_do_iteration): add read/write
3809 to the select() as needed for authentication. (should be using
3810 _dbus_poll() not select, but for another day)
3812 * dbus/dbus.h: include dbus/dbus-protocol.h
3814 2003-01-08 Anders Carlsson <andersca@codefactory.se>
3816 * dbus/Makefile.am (dbusinclude_HEADERS): Install
3819 2003-01-08 Anders Carlsson <andersca@codefactory.se>
3821 * dbus/dbus-internals.c: (_dbus_type_to_string):
3822 New function that returns a string describing a type.
3824 * dbus/dbus-marshal.c: (_dbus_demarshal_byte_array):
3825 * dbus/dbus-marshal.h:
3826 * dbus/dbus-message.c: (dbus_message_get_fields_valist),
3827 (dbus_message_iter_get_field_type), (dbus_message_iter_get_double),
3828 (dbus_message_iter_get_byte_array):
3829 * dbus/dbus-message.h:
3830 Add new convenience functions for appending and getting message fields.
3831 Also add demarshalling routines for byte arrays.
3833 2003-01-07 Anders Carlsson <andersca@codefactory.se>
3835 * dbus/dbus-connection-internal.h:
3836 * dbus/dbus-connection.c: (_dbus_connection_new_for_transport),
3837 (_dbus_connection_get_next_client_serial),
3838 (dbus_connection_send_message):
3839 * dbus/dbus-internals.h:
3840 * dbus/dbus-marshal.c: (unpack_uint32), (dbus_unpack_int32),
3841 (dbus_pack_int32), (_dbus_marshal_double), (_dbus_marshal_int32),
3842 (_dbus_marshal_uint32), (_dbus_demarshal_double),
3843 (_dbus_demarshal_int32), (_dbus_demarshal_uint32),
3844 (_dbus_demarshal_string), (_dbus_marshal_get_field_end_pos),
3845 (_dbus_verbose_bytes), (_dbus_marshal_test):
3846 * dbus/dbus-marshal.h:
3847 * dbus/dbus-message-internal.h:
3848 * dbus/dbus-message.c: (_dbus_message_set_client_serial),
3849 (dbus_message_write_header), (_dbus_message_lock),
3850 (dbus_message_new), (dbus_message_ref), (dbus_message_unref),
3851 (dbus_message_get_name), (dbus_message_append_int32),
3852 (dbus_message_append_uint32), (dbus_message_append_double),
3853 (dbus_message_append_string), (dbus_message_append_byte_array),
3854 (dbus_message_get_fields_iter), (dbus_message_iter_ref),
3855 (dbus_message_iter_unref), (dbus_message_iter_has_next),
3856 (dbus_message_iter_next), (dbus_message_iter_get_field_type),
3857 (dbus_message_iter_get_string), (dbus_message_iter_get_int32),
3858 (dbus_message_iter_get_uint32), (dbus_message_iter_get_double),
3859 (decode_header_data), (_dbus_message_loader_return_buffer),
3860 (message_iter_test), (_dbus_message_test):
3861 * dbus/dbus-message.h:
3862 * dbus/dbus-protocol.h:
3863 * dbus/dbus-test.c: (main):
3865 * glib/test-dbus-glib.c: (message_handler), (main):
3866 * test/echo-client.c: (main):
3867 * test/watch.c: (check_messages):
3868 Make messages sendable and receivable for real.
3870 2003-01-07 Anders Carlsson <andersca@codefactory.se>
3872 * dbus/dbus-marshal.c: (_dbus_marshal_double),
3873 (_dbus_marshal_string), (_dbus_marshal_byte_array):
3874 * dbus/dbus-message.c: (dbus_message_append_int32),
3875 (dbus_message_append_uint32), (dbus_message_append_double),
3876 (dbus_message_append_string), (dbus_message_append_byte_array):
3877 Handle OOM restoration.
3879 2003-01-07 Anders Carlsson <andersca@codefactory.se>
3881 * dbus/dbus-marshal.c: (_dbus_marshal_string),
3882 (_dbus_demarshal_string), (_dbus_marshal_test):
3883 * dbus/dbus-marshal.h:
3884 * dbus/dbus-message.c: (dbus_message_get_name),
3885 Document these functions.
3887 (dbus_message_append_int32), (dbus_message_append_uint32),
3888 (dbus_message_append_double), (dbus_message_append_string),
3889 (dbus_message_append_byte_array):
3890 * dbus/dbus-message.h:
3891 Add functions for adding message fields of different types.
3893 * dbus/dbus-protocol.h:
3894 Add the different types.
3896 2003-01-05 Havoc Pennington <hp@pobox.com>
3898 * bus/connection.c: implement routines for handling connections,
3899 first thing is keeping a list of owned services on each connection
3900 and setting up watches etc.
3902 * bus/services.c: implement a mapping from service names to lists
3905 * dbus/dbus-hash.c: add DBUS_HASH_POINTER
3907 * dbus/dbus-threads.c (dbus_static_mutex_lock): add functions
3908 to use static mutexes for global data
3910 * dbus/dbus-connection.c (dbus_connection_set_data): add new
3911 collection of functions to set/get application-specific data
3912 on the DBusConnection.
3914 2003-01-04 Havoc Pennington <hp@pobox.com>
3916 * dbus/dbus-sysdeps.c (_dbus_sleep_milliseconds): new function
3917 (_dbus_poll): new function
3919 * dbus/dbus-internals.h (_DBUS_STRUCT_OFFSET): new macro
3922 * bus/loop.c: initial code for the daemon main loop
3924 2003-01-04 Havoc Pennington <hp@pobox.com>
3926 * test/watch.c (error_handler): make it safe if the error handler
3927 is called multiple times (if we s/error handler/disconnect
3928 handler/ we should just guarantee it's called only once)
3930 * dbus/dbus-transport.c (_dbus_transport_disconnect): call the
3931 error handler on disconnect (it's quite possible we should
3932 just change the error handler to a "disconnect handler," I'm
3933 not sure we have any other meaningful errors)
3935 * configure.in: check for getpwnam_r
3937 * dbus/dbus-transport.c, dbus/dbus-transport-unix.c,
3938 dbus/dbus-auth.c: add credentials support, add EXTERNAL auth
3939 mechanism as in SASL spec, using socket credentials
3941 * dbus/dbus-sysdeps.c (_dbus_read_credentials_unix_socket): new function
3942 (_dbus_send_credentials_unix_socket): new function
3944 * dbus/dbus-sysdeps.c (_dbus_accept_unix_socket): rename just
3946 (_dbus_write): only check errno if <0 returned
3947 (_dbus_write_two): ditto
3949 2003-01-02 Anders Carlsson <andersca@codefactory.se>
3951 * dbus/dbus-marshal.c: (_dbus_marshal_utf8_string),
3952 (_dbus_marshal_byte_array), (_dbus_demarshal_utf8_string),
3953 (_dbus_marshal_test):
3954 * dbus/dbus-marshal.h:
3955 Add _dbus_marshal_byte_array and rename _dbus_marshal_string
3956 to _dbus_marshal_utf8_string. Also fix some tests.
3958 2002-12-28 Harri Porten <porten@kde.org>
3960 * configure.in: added check for C++ compiler and a very cheesy
3961 check for the Qt integration
3963 * Makefile.am (SUBDIRS): compile qt subdir if support is enabled
3965 * qt/Makefile.am: added
3967 * qt/.cvsignore: added
3969 * qt/dbus-qthread.cc, qt/dbus-qthread.cpp: renamed former to
3970 latter, added #ifdef QT_THREAD_SUPPORT guard.
3972 * dbus/Makefile.am: added missing headers for make dist
3974 2002-12-28 Kristian Rietveld <kris@gtk.org>
3976 * dbus/Makefile.am: fixup export-symbols-regex.
3978 2002-12-27 Anders Carlsson <andersca@codefactory.se>
3980 * acinclude.m4: Add this file and put the
3981 PKG_CHECK_MODULE macro in it.
3983 2002-12-27 Anders Carlsson <andersca@codefactory.se>
3985 * dbus/dbus-marshal.c: (_dbus_marshal_string),
3986 (_dbus_demarshal_double), (_dbus_demarshal_int32),
3987 (_dbus_demarshal_uint32), (_dbus_demarshal_string),
3988 (_dbus_marshal_test):
3989 Make the demarshalling routines align the pos argument.
3990 Add string marshalling tests and fix the obvious bugs
3993 2002-12-26 Havoc Pennington <hp@pobox.com>
3995 * dbus/dbus-auth.c: fixes fixes fixes
3997 * dbus/dbus-transport-unix.c: wire up support for
3998 encoding/decoding data on the wire
4000 * dbus/dbus-auth.c (_dbus_auth_encode_data)
4001 (_dbus_auth_decode_data): append to target string
4002 instead of nuking it.
4004 2002-12-26 Havoc Pennington <hp@pobox.com>
4006 * dbus/dbus-marshal.h (DBUS_COMPILER_BYTE_ORDER): #ifdef
4007 WORDS_BIGENDIAN then compiler byte order is DBUS_BIG_ENDIAN,
4010 * dbus/dbus-marshal.c: Add macros to do int swapping in-place and
4011 avoid swap_bytes() overhead (ignoring possible assembly stuff for
4012 now). Main point is because I wanted unpack_uint32 to implement
4014 (_dbus_verbose_bytes): new function
4016 * dbus/dbus-string.c (_dbus_string_validate_ascii): new function
4018 * dbus/dbus-message.c (_dbus_message_loader_get_is_corrupted): add
4019 mechanism to handle a corrupt message stream
4020 (_dbus_message_loader_new): fix preallocation to only prealloc,
4023 * dbus/dbus-string.c (_dbus_string_skip_blank): fix this function
4024 (_dbus_string_test): enhance tests for copy/move and fix the
4027 * dbus/dbus-transport-unix.c: Hold references in more places to
4028 avoid reentrancy problems
4030 * dbus/dbus-transport.c: ditto
4032 * dbus/dbus-connection.c (dbus_connection_dispatch_message): don't
4033 leak reference count in no-message case
4035 * test/watch.c (do_mainloop): handle adding/removing watches
4036 during iteration over the watches. Also, ref the connection/server
4037 stored on a watch, so we don't try to mangle a destroyed one.
4039 * dbus/dbus-transport-unix.c (do_authentication): perform
4042 * dbus/dbus-auth.c (get_state): add a state
4043 AUTHENTICATED_WITH_UNUSED_BYTES and return it if required
4044 (_dbus_auth_get_unused_bytes): append the unused bytes
4045 to the passed in string, rather than prepend
4047 * dbus/dbus-transport.c (_dbus_transport_init_base): create
4048 the auth conversation DBusAuth
4050 * dbus/dbus-transport-unix.c (_dbus_transport_new_for_fd)
4051 (_dbus_transport_new_for_domain_socket): when creating a
4052 transport, pass in whether it's a client-side or server-side
4053 transport so we know which DBusAuth to create
4055 2002-12-03 Havoc Pennington <hp@pobox.com>
4057 * dbus/dbus-transport-unix.c (unix_finalize): finalize base
4058 _after_ finalizing the derived members
4059 (unix_connection_set): unref watch if we fail to add it
4061 * dbus/dbus-connection.c (dbus_connection_unref): delete the
4062 transport first, so that the connection owned by the
4063 transport will be valid as the transport finalizes.
4065 * dbus/dbus-transport-unix.c (unix_finalize): free the write_watch
4066 if necessary, and remove watches from the connection.
4068 * dbus/dbus-watch.c (_dbus_watch_list_free): improve a comment
4070 2002-12-26 Anders Carlsson <andersca@codefactory.se>
4072 * dbus/dbus-marshal.c: (_dbus_marshal_string),
4073 (_dbus_demarshal_double), (_dbus_demarshal_int32),
4074 (_dbus_demarshal_uint32), (_dbus_demarshal_string),
4075 (_dbus_marshal_test):
4076 * dbus/dbus-marshal.h:
4077 Add string marshal functions and have the demarshal functions
4078 return the new position.
4080 2002-12-25 Havoc Pennington <hp@pobox.com>
4082 * doc/dbus-sasl-profile.txt: docs on the authentication protocol,
4083 it is a simple protocol that just maps directly to SASL.
4085 * dbus/dbus-auth.h, dbus/dbus-auth.c: authentication protocol
4086 initial implementation, not actually used yet.
4088 * dbus/dbus-string.c (_dbus_string_find): new function
4089 (_dbus_string_equal): new function
4090 (_dbus_string_base64_encode): new function
4091 (_dbus_string_base64_decode): new function
4093 2002-12-25 Anders Carlsson <andersca@codefactory.se>
4096 * dbus/dbus-marshal.c: (swap_bytes), (_dbus_marshal_double),
4097 (_dbus_marshal_int32), (_dbus_marshal_uint32),
4098 (_dbus_demarshal_double), (_dbus_demarshal_int32),
4099 (_dbus_demarshal_uint32), (_dbus_marshal_test):
4100 * dbus/dbus-marshal.h:
4101 * dbus/dbus-protocol.h:
4102 * dbus/dbus-test.c: (main):
4104 Add un-optimized marshalling/demarshalling routines.
4106 2002-12-25 Harri Porten <porten@kde.org>
4108 * qt/dbus-qt.h: adjusted ctor and getter to KDE/Qt conventions
4110 2002-12-24 Zack Rusin <zack@kde.org>
4112 * qt/dbus-qthread.cc: adding - integrates QMutex into Dbus
4113 * qt/dbus-qt.h: skeleton with two sample implemenatation of the
4116 2002-12-24 Havoc Pennington <hp@pobox.com>
4118 * glib/dbus-gthread.c: fix include
4120 * glib/dbus-glib.h: rename DBusMessageHandler for now.
4121 I think glib API needs to change, though, as you don't
4122 want to use DBusMessageFunction, you want to use the
4123 DBusMessageHandler object. Probably
4124 dbus_connection_open_with_g_main_loop()
4125 and dbus_connection_setup_g_main_loop() or something like that
4126 (but think of better names...) that just create a connection
4127 that has watch/timeout functions etc. already set up.
4129 * dbus/dbus-connection.c
4130 (dbus_connection_send_message_with_reply): new function just to
4131 show how the message handler helps us deal with replies.
4133 * dbus/dbus-list.c (_dbus_list_remove_last): new function
4135 * dbus/dbus-string.c (_dbus_string_test): free a string that
4138 * dbus/dbus-hash.c: use memory pools for the hash entries
4139 (rebuild_table): be more paranoid about overflow, and
4140 shrink table when we can
4141 (_dbus_hash_test): reduce number of sprintfs and write
4142 valid C89. Add tests for case where we grow and then
4143 shrink the hash table.
4145 * dbus/dbus-mempool.h, dbus/dbus-mempool.c: memory pools
4147 * dbus/dbus-connection.c (dbus_connection_register_handler)
4148 (dbus_connection_unregister_handler): new functions
4150 * dbus/dbus-message.c (dbus_message_get_name): new
4152 * dbus/dbus-list.c: fix docs typo
4154 * dbus/dbus-message-handler.h, dbus/dbus-message-handler.c:
4155 an object representing a handler for messages.
4157 2002-12-16 Anders Carlsson <andersca@codefactory.se>
4160 * glib/dbus-gthread.c: (dbus_gthread_init):
4161 Don't use the gdbus prefix for public functions.
4163 2002-12-16 Anders Carlsson <andersca@codefactory.se>
4167 Add GLib checks and fixup .pc files
4171 * glib/dbus-gmain.c: (gdbus_connection_prepare),
4172 (gdbus_connection_check), (gdbus_connection_dispatch),
4173 (gdbus_add_connection_watch), (gdbus_remove_connection_watch),
4174 (dbus_connection_gsource_new):
4175 * glib/dbus-gthread.c: (dbus_gmutex_new), (dbus_gmutex_free),
4176 (dbus_gmutex_lock), (dbus_gmutex_unlock), (dbus_gthread_init):
4177 * glib/test-dbus-glib.c: (message_handler), (main):
4180 2002-12-15 Harri Porten <porten@kde.org>
4182 * autogen.sh: check for libtoolize before attempting to use it
4184 * dbus/dbus-transport-unix.c: include <sys/time.h> for timeval
4187 * .cvsignore: ignore more stamp files
4189 * dbus/dbus-watch.c (_dbus_watch_list_new): fixed doc error
4191 * test/Makefile.am: added -I$(top_srcdir) to be able to compile
4192 without make install.
4194 2002-12-15 Havoc Pennington <hp@pobox.com>
4196 * dbus/dbus-threads.c: add thread stubs that a higher library
4197 layer can fill in. e.g. the GLib wrapper might fill them in with
4198 GThread stuff. We still need to use this thread API to
4199 thread-safe-ize the library.
4201 2002-12-12 Havoc Pennington <hp@pobox.com>
4203 * dbus/dbus-transport-unix.c, dbus/dbus-server-unix.c: use the
4204 below new interfaces and include fewer system headers.
4206 * dbus/dbus-sysdeps.c (_dbus_read): new function
4207 (_dbus_write): new function
4208 (_dbus_write_two): new function
4209 (_dbus_connect_unix_socket): new function
4210 (_dbus_listen_unix_socket): new function
4212 * dbus/dbus-message-internal.h: change interfaces to use
4215 2002-12-11 Havoc Pennington <hp@pobox.com>
4217 * dbus/dbus-types.h: add dbus_unichar
4219 * dbus/dbus-internals.c (_dbus_verbose): use _dbus_getenv
4221 * dbus/dbus-connection.c (dbus_connection_send_message): return
4224 * dbus/dbus-transport.c: include dbus-watch.h
4226 * dbus/dbus-connection.c: include dbus-message-internal.h
4228 * HACKING: add file with coding guidelines stuff.
4230 * dbus/dbus-string.h, dbus/dbus-string.c: Encapsulate all string
4231 handling here, for security purposes (as in vsftpd). Not actually
4232 using this class yet.
4234 * dbus/dbus-sysdeps.h, dbus/dbus-sysdeps.c: Encapsulate all
4235 system/libc usage here, as in vsftpd, for ease of auditing (and
4236 should also simplify portability). Haven't actually moved all the
4237 system/libc usage into here yet.
4239 2002-11-25 Havoc Pennington <hp@pobox.com>
4241 * dbus/dbus-internals.c (_dbus_verbose): fix to not
4242 always print the first verbose message.
4244 2002-11-24 Havoc Pennington <hp@pobox.com>
4246 * test/echo-client.c, test/echo-server.c: cheesy test
4249 * configure.in (AC_CHECK_FUNCS): check for writev
4251 * dbus/dbus-message.c (_dbus_message_get_network_data): new
4254 * dbus/dbus-list.c (_dbus_list_foreach): new function
4256 * dbus/dbus-internals.c (_dbus_verbose): new function
4258 * dbus/dbus-server.c, dbus/dbus-server.h: public object
4259 representing a server that listens for connections.
4261 * dbus/.cvsignore: create
4263 * dbus/dbus-errors.h, dbus/dbus-errors.c:
4264 public API for reporting errors
4266 * dbus/dbus-connection.h, dbus/dbus-connection.c:
4267 public object representing a connection that
4268 sends/receives messages. (Same object used for
4269 both client and server.)
4271 * dbus/dbus-transport.h, dbus/dbus-transport.c:
4272 Basic abstraction for different kinds of stream
4273 that we might read/write messages from.
4275 2002-11-23 Havoc Pennington <hp@pobox.com>
4277 * dbus/dbus-internals.h (_DBUS_INT_MAX): add _DBUS_INT_MIN
4280 * dbus/dbus-test.c (main): add list test, and include
4281 dbus-test.h as intended
4283 * dbus/dbus-hash.c (_dbus_hash_table_remove_string)
4284 (_dbus_hash_table_remove_int): return value indicates
4285 whether the entry existed to remove
4287 * dbus/dbus-list.c: add linked list utility class,
4290 * dbus/dbus-hash.c: add TODO item about shrinking the hash bucket
4293 2002-11-23 Havoc Pennington <hp@pobox.com>
4295 * Doxyfile.in (INCLUDE_FILE_PATTERNS): expand DBUS_BEGIN_DECLS/
4296 DBUS_END_DECLS to nothing, that should fix this once and for all
4298 * Doxyfile.in (JAVADOC_AUTOBRIEF): set to YES
4300 * dbus/dbus-message.c, dbus/dbus-hash.c:
4301 add some missing @brief
4303 2002-11-23 Havoc Pennington <hp@pobox.com>
4305 * dbus/dbus-message.h: put semicolons after DEBUG_BEGIN_DECLS
4306 to avoid confusing Doxygen
4308 * dbus/dbus-hash.c: @} not }@
4310 * dbus/dbus-message.c (struct DBusMessage): split out
4313 2002-11-23 Havoc Pennington <hp@pobox.com>
4315 * configure.in: pile on more warning flags if using gcc
4317 * Doxyfile.in (EXTRACT_STATIC): set to NO, so we don't have
4318 to document static functions
4320 * configure.in: add summary to end of configure so it
4321 looks nice and attractive
4323 * dbus/dbus-hash.c: finish implementation and write unit
4326 * configure.in: add --enable-tests to enable unit tests
4328 * dbus/dbus-test.c: test program to run unit tests
4329 for all files in dbus/*, initially runs a test for
4332 * dbus/dbus-internals.h: file to hold some internal utility stuff
4334 2002-11-22 Havoc Pennington <hp@redhat.com>
4336 * dbus/dbus-hash.c: copy in Tcl hash table, not yet
4337 "ported" away from Tcl
4339 * dbus/dbus-types.h: header for types such as dbus_bool_t
4341 2002-11-22 Havoc Pennington <hp@redhat.com>
4343 * dbus/dbus.h: fixups for doc warnings
4345 * Doxyfile.in (FILE_PATTERNS): we need to scan .h to pick up
4347 (QUIET): make it quiet so we can see warnings
4349 * dbus/dbus-memory.c: teach D-BUS to allocate and free memory
4351 2002-11-22 Havoc Pennington <hp@redhat.com>
4353 * Makefile.am: include "Doxyfile" target in all-local
4355 * configure.in: generate the Doxyfile
4357 * Doxyfile.in: move Doxyfile here, so we can use
4358 configure to generate a Doxyfile with the right
4361 2002-11-22 Havoc Pennington <hp@redhat.com>
4363 * dbus/dbus-message.c: move inline docs into .c file
4365 * Doxyfile (OUTPUT_DIRECTORY): move output to doc/api
4366 so all docs are under doc/
4367 (MAN_EXTENSION): generate man pages. Use extension
4368 ".3dbus" which matches ".3qt" on my system,
4369 I guess this is OK, I don't know really.
4370 (FILE_PATTERNS): look for .c files not .h, makes sense
4373 2002-11-22 Havoc Pennington <hp@pobox.com>
4375 * Makefile.am (SUBDIRS): rename subdir "server" to "bus"
4376 because any app can be a server, and any app can be a client,
4377 the bus is a special kind of server.
4379 Thu Nov 21 23:35:31 2002 Zack Rusin <zack@kde.org>
4381 * Doxyfile : adding. Still needs Makefile rules to be generated
4382 automatically (just run "doxygen" in the toplevel dir for now to
4385 * dbus/dbus-message.h : Adding sample docs (javadoc since
4386 resembles gtk-doc a little more)
4388 * dbus/dbus.h : Adding sample docs
4390 2002-11-21 Havoc Pennington <hp@redhat.com>
4392 * dbus/Makefile.am (INCLUDES): define DBUS_COMPILATION
4393 so we can allow ourselves to include files directly,
4394 instead of having to use dbus.h
4396 * dbus/dbus.h: fill in
4398 * dbus/dbus-message.h: sketch out a sample header file.
4399 Include griping if you include it directly instead of
4402 * dbus/dbus-macros.h: new file with macros for extern "C",
4403 TRUE/FALSE, NULL, etc.
4405 * doc/file-boilerplate.c: put include guards in here
4407 2002-11-21 Havoc Pennington <hp@redhat.com>
4409 * doc/file-boilerplate.c: include both AFL and GPL boilerplate.
4411 * COPYING: include the GPL as well, and license code
4412 under both AFL and GPL.
4414 2002-11-21 Havoc Pennington <hp@redhat.com>
4416 * acconfig.h: get rid of this
4418 * autogen.sh (run_configure): add --no-configure option
4420 * configure.in: remove AC_ARG_PROGRAM to make
4421 autoconf complain less. add AC_PREREQ.
4422 add AC_DEFINE third arg.
4424 2002-11-21 Anders Carlsson <andersca@codefactory.se>
4427 Fix references so we can distcheck.
4429 2002-11-21 Havoc Pennington <hp@redhat.com>
4431 * Initial module creation