1 2003-08-19 Havoc Pennington <hp@pobox.com>
3 * dbus/dbus-message.c (decode_string_field): support FIELD_SENDER
4 (dbus_message_is_error): fix this function
6 * bus/dbus-daemon-1.1: clarify logic on when <deny>/<allow> rules
9 * bus/policy.c (bus_client_policy_check_can_receive): fix code to
10 reflect clarified man page
11 (bus_client_policy_check_can_send): ditto
13 * bus/session.conf.in: fixup
15 * bus/system.conf.in: fixup
17 2003-08-18 Havoc Pennington <hp@redhat.com>
19 * dbus/dbus-hash.c (_dbus_hash_table_insert_two_strings): fix
21 * dbus/dbus-message.c (_dbus_message_loader_queue_messages): fix
22 dumb bug created earlier (wrong order of args to
25 * tools/dbus-send.c: port
27 * tools/dbus-print-message.c (print_message): port
29 * test/data/*messages: port all messages over
31 * dbus/dbus-message-builder.c: support including
34 * bus/driver.c: port over
36 * bus/dispatch.c: port over to new stuff
38 * dbus/dbus-connection.c (_dbus_connection_new_for_transport):
39 rename disconnect signal to "Disconnected"
41 2003-08-17 Havoc Pennington <hp@pobox.com>
43 This doesn't compile yet, but syncing up so I can hack on it from
44 work. What are branches for if not broken code? ;-)
46 * dbus/dbus-protocol.h: remove DBUS_HEADER_FIELD_NAME, add
47 DBUS_HEADER_FIELD_INTERFACE, DBUS_HEADER_FIELD_MEMBER,
48 DBUS_HEADER_FIELD_ERROR_NAME
50 * dbus/dbus-hash.c: Introduce DBUS_HASH_TWO_STRINGS as hack to use
51 for the interface+member pairs
52 (string_hash): change to use g_str_hash algorithm
53 (find_direct_function, find_string_function): refactor these to
56 * dbus/dbus-message.c: port all of this over to support
57 interface/member fields instead of name field
59 * dbus/dbus-object-registry.c: port over
61 * dbus/dbus-string.c (_dbus_string_validate_interface): rename
62 from _dbus_string_validate_name
64 * bus/dbus-daemon-1.1: change file format for the
65 <deny>/<allow> stuff to match new message naming scheme
67 * bus/policy.c: port over
69 * bus/config-parser.c: parse new format
71 2003-08-16 Havoc Pennington <hp@pobox.com>
73 * dbus/dbus-object-registry.c (add_and_remove_objects): remove
76 * glib/dbus-gproxy.c: some hacking
78 2003-08-15 Havoc Pennington <hp@redhat.com>
80 * dbus/dbus-pending-call.c (dbus_pending_call_block): implement
82 * dbus/dbus-connection.c
83 (dbus_connection_send_with_reply_and_block): factor out internals;
84 change to convert any error replies to DBusError instead of
85 returning them as a message
87 2003-08-15 Havoc Pennington <hp@pobox.com>
89 * dbus/dbus-connection.c,
90 dbus/dbus-pending-call.c: Finish the pending call stuff
92 2003-08-14 Havoc Pennington <hp@redhat.com>
94 * dbus/dbus-pending-call.c: start on new object that will replace
95 DBusMessageHandler and ReplyHandlerData for tracking outstanding
98 * dbus/dbus-gproxy.c: start on proxy object used to communicate
99 with remote interfaces
101 * dbus/dbus-gidl.c: do the boring boilerplate in here
103 2003-08-12 Havoc Pennington <hp@pobox.com>
105 * bus/dispatch.c (bus_dispatch): make this return proper
106 DBusHandlerResult to avoid DBUS_ERROR_UNKNOWN_METHOD
108 * dbus/dbus-errors.c (dbus_set_error): use
109 _dbus_string_append_printf_valist
111 * dbus/dbus-string.c (_dbus_string_append_printf_valist)
112 (_dbus_string_append_printf): new
114 * dbus/dbus-errors.h (DBUS_ERROR_UNKNOWN_MESSAGE): change to
117 * dbus/dbus-connection.c (dbus_connection_dispatch): handle
118 DBUS_HANDLER_RESULT_NEED_MEMORY; send default error reply if a
119 message is unhandled.
121 2003-08-11 Havoc Pennington <hp@pobox.com>
123 * bus/test.c (client_disconnect_handler): change to return
124 HANDLED (would have been REMOVE_MESSAGE)
126 * dbus/dbus-object.h (enum DBusHandlerResult): rename to
127 HANDLED/NOT_YET_HANDLED instead of
128 REMOVE_MESSAGE/ALLOW_MORE_HANDLERS to make it clearer how it
131 2003-08-10 Havoc Pennington <hp@pobox.com>
133 * tools/dbus-send.c (main): add --type argument, for now
134 supporting only method_call and signal types.
136 * tools/dbus-print-message.c: print message type
138 * dbus/dbus-connection.c (_dbus_connection_new_for_transport):
139 init connection->objects
141 * doc/dbus-specification.sgml: fix sgml
143 * bus/*.c: port over to object-instance API changes
145 * test/test-service.c: ditto
147 * dbus/dbus-message.c (dbus_message_create_header): allow #NULL
148 name, we will have to fix up the rest of the code to also handle
150 (dbus_message_new): generic message-creation call
151 (set_string_field): allow appending name field
153 2003-08-06 Havoc Pennington <hp@pobox.com>
155 * dbus/dbus-object-registry.c: implement signal connection
158 * dbus/dbus-connection.c (_dbus_connection_unref_unlocked): new
160 * dbus/dbus-internals.c (_dbus_memdup): new function
162 2003-08-02 Havoc Pennington <hp@pobox.com>
164 * dbus/dbus-message.c (dbus_message_get_no_reply)
165 (dbus_message_set_no_reply): add these and remove
166 set_is_error/get_is_error
168 * dbus/dbus-protocol.h, doc/dbus-specification.sgml:
169 remove the ERROR flag, since there's now an ERROR type
171 2003-08-01 Havoc Pennington <hp@pobox.com>
173 * dbus/dbus-object-registry.c (_dbus_object_registry_handle_and_unlock):
176 * dbus/dbus-message.c (dbus_message_get_type): new function
178 * doc/dbus-specification.sgml: add "type" byte to messages
180 2003-08-01 Havoc Pennington <hp@pobox.com>
182 * dbus/dbus-protocol.h (DBUS_MESSAGE_TYPE_*): introduce
183 a message type enum to distinguish kinds of message
184 (DBUS_HEADER_FLAG_NO_REPLY_EXPECTED): flag for a message
185 that need not be replied to
187 2003-08-01 Havoc Pennington <hp@pobox.com>
189 * dbus/dbus-marshal.c: adapt to DBusObjectID changes
190 (unpack_8_octets): fix no-64-bit-int bug
192 * dbus/dbus-object-registry.c (validate_id): validate the
193 connection ID bits, not just the instance ID.
195 * dbus/dbus-connection.c (_dbus_connection_init_id): initialize
196 the connection-global 33 bits of the object ID
198 * dbus/dbus-object-registry.c (info_from_entry): fill in
199 object ID in the new way
201 * dbus/dbus-objectid.h: rather than high/low bits, specifically
202 define server/client/instance bits.
204 2003-07-30 Havoc Pennington <hp@pobox.com>
206 * dbus/dbus-connection.c (dbus_connection_register_object): fix
209 2003-07-13 Havoc Pennington <hp@pobox.com>
211 * dbus/dbus-object.h (struct DBusObjectVTable): add padding
212 fields to DBusObjectVTable and DBusObjectInfo
214 2003-07-12 Havoc Pennington <hp@pobox.com>
216 * dbus/dbus-object-registry.c: implement unit test,
217 fix bugs discovered in process
219 * dbus/dbus-connection.c: remove handler_table and
220 register_handler(), add DBusObjectRegistry usage
222 * dbus/dbus-objectid.c (dbus_object_id_is_null)
223 (dbus_object_id_set_null): new functions
225 2003-07-08 Havoc Pennington <hp@pobox.com>
227 * dbus/dbus-object.c: implement some of this
229 * dbus/dbus-object-registry.c
230 (_dbus_object_registry_add_and_unlock): fill in the object_id out
232 (_dbus_object_registry_new): handle OOM
234 2003-07-08 Havoc Pennington <hp@pobox.com>
236 * dbus/dbus-object.h: sketch out an API for registering objects
237 with a connection, that allows us to use as little as 24 bytes
238 per object and lets application code represent an object in
241 * dbus/dbus-object-registry.c: implement the hard bits of the
242 DBusConnection aspect of object API. Not yet wired up.
244 2003-07-06 Havoc Pennington <hp@pobox.com>
246 * dbus/dbus-marshal.c (_dbus_marshal_set_object_id): new function
247 (_dbus_marshal_object_id): new
248 (_dbus_demarshal_object_id): new
249 (_dbus_marshal_get_arg_end_pos): support object ID type, and
250 consolidate identical switch cases. Don't conditionalize handling
251 of DBUS_TYPE_UINT64, need to handle the type always.
252 (_dbus_marshal_validate_arg): consolidate identical cases, and
253 handle DBUS_TYPE_OBJECT_ID
255 * dbus/dbus-objectid.c: new file with DBusObjectID data type.
257 * dbus/dbus-protocol.h: add DBUS_TYPE_OBJECT_ID
259 2003-06-29 Havoc Pennington <hp@pobox.com>
261 * mono/Test.cs (class Test): fire up a main loop and run it
263 * mono/DBus.cs (DBus): don't g_thread_init since it can only be
264 done once, the app has to do it
266 2003-06-26 Havoc Pennington <hp@pobox.com>
268 * mono/Connection.cs: set up connection with the glib main loop
270 2003-07-01 Havoc Pennington <hp@redhat.com>
272 * doc/dbus-specification.sgml: clarify the format of a type code,
273 change suggested by Jim Blandy
275 2003-06-29 Miloslav Trmac <mitr@volny.cz>
278 * tools/Makefile.am: Don't assume srcdir == builddir.
280 * dbus/dbus-memory.c (dbus_realloc): Don't check guards after shrinking
282 (_dbus_memory_test): New function.
283 * dbus/dbus-test.h: Add _dbus_memory_test ().
284 * dbus/dbus-test.c (dbus_internal_do_not_use_run_tests): Call it.
286 * dbus/dbus-message.c (decode_header_data): Use %.4s instead
288 (dbus_message_new): Remove obsolete @todo.
290 * dbus/dbus-marshal.c (_dbus_marshal_set_int64)
291 (_dbus_marshal_set_uint64): Fix comment.
293 * dbus/dbus-message.c (append_int_field, append_uint_field): Don't
294 hardcode FIELD_REPLY_SERIAL.
296 * dbus/dbus-mainloop.c (_dbus_loop_remove_watch)
297 (_dbus_loop_remove_timeout): Cast function pointers to (void *) for %p
299 * configure.in: Add -D_POSIX_C_SOURCE=199309L -DBSD_SOURCE to CFLAGS
300 and disable DBUS_USE_ATOMIC_INT_486 when --enable-ansi is used
302 2003-06-24 Havoc Pennington <hp@pobox.com>
304 * mono/*.cs: Use IntPtr.Zero instead of ((IntPtr) 0)
306 2003-06-23 Anders Carlsson <andersca@codefactory.se>
312 * gcj/TestMessage.java: (TestMessage), (TestMessage.main):
313 * gcj/org/.cvsignore:
314 * gcj/org/Makefile.am:
315 * gcj/org/freedesktop/.cvsignore:
316 * gcj/org/freedesktop/Makefile.am:
317 * gcj/org/freedesktop/dbus/.cvsignore:
318 * gcj/org/freedesktop/dbus/Makefile.am:
319 * gcj/org/freedesktop/dbus/Message.java: (Message),
321 * gcj/org/freedesktop/dbus/natMessage.cc:
322 Fix the build system.
324 2003-06-22 Havoc Pennington <hp@pobox.com>
326 * mono/Connection.cs: add more bindings
328 * dbus/dbus-threads.c (dbus_threads_init): allow calling this
331 2003-06-22 Havoc Pennington <hp@pobox.com>
333 * mono/Connection.cs, mono/DBus.cs, mono/Error.cs:
334 Start wrapping more stuff.
336 2003-06-22 Havoc Pennington <hp@pobox.com>
338 * mono/Message.cs: implement Message.Wrap() that ensures we only
339 have a single C# wrapper per DBusMessage, assuming it works which
342 * dbus/dbus-message.c (dbus_message_allocate_data_slot): new
343 (dbus_message_free_data_slot): new
344 (dbus_message_set_data): new
345 (dbus_message_get_data): new
347 2003-06-22 Havoc Pennington <hp@pobox.com>
349 * dbus/dbus-dataslot.c (_dbus_data_slot_allocator_unref)
350 (_dbus_data_slot_allocator_alloc): rework these to keep a
351 reference count on each slot and automatically manage a global
352 slot ID variable passed in by address
354 * bus/bus.c: convert to new dataslot API
356 * dbus/dbus-bus.c: convert to new dataslot API
358 * dbus/dbus-connection.c: convert to new dataslot API
360 * dbus/dbus-server.c: convert to new dataslot API
362 * glib/dbus-gmain.c: ditto
366 * bus/connection.c: ditto
368 2003-06-22 Anders Carlsson <andersca@codefactory.se>
370 * configure.in: Add AM_PROG_GCJ and move AM_PROG_LIBTOOL
371 after the gcj checks so that the correct configuration tags
372 will be added to libtool.
374 * dbus-glib-1.pc.in: No need to specify any includes since
375 dbus-1.pc.in has those.
377 2003-06-22 Havoc Pennington <hp@pobox.com>
379 * mono/*, gcj/*, configure.in, Makefile.am:
380 Check in makefiles and subdirs for mono and gcj bindings.
381 Neither binding actually exists, just trying to get through
382 all the build and other boring bits.
384 2003-06-21 Philip Blundell <philb@gnu.org>
386 * tools/dbus-monitor.1: Updated.
388 * tools/dbus-send.1: Likewise.
390 2003-06-20 Anders Carlsson <andersca@codefactory.se>
392 * dbus/dbus-transport-unix.c (unix_handle_watch): Check
393 for hangup and error after checking read so we won't discard
394 pending data if both hangup and read are set.
396 2003-06-19 Philip Blundell <philb@gnu.org>
398 * tools/dbus-print-message.c (print_message): Handle BOOLEAN.
400 * tools/dbus-send.c: Accept both --system and --session.
402 * tools/dbus-monitor.c: Same here.
404 2003-06-19 Anders Carlsson <andersca@codefactory.se>
406 * glib/dbus-glib.h: Fix so that dbus-glib.h can be used
407 from C++ (Patch by Miloslav Trmac).
409 2003-06-15 Joe Shaw <joe@assbarn.com>
411 * configure.in: Check for socklen_t.
413 * dbus/dbus-sysdeps.c: Define socklen_t if it's not defined.
415 * test/test-segfault.c: Add #include <sys/time.h>
417 * tools/Makefile.am: Add DBUS_X_CFLAGS to the INCLUDES since
418 dbus-launch needs it.
420 2003-06-09 Havoc Pennington <hp@redhat.com>
422 * dbus/dbus-sysdeps.c (_dbus_listen_unix_socket): don't use
423 SUN_LEN, it breaks abstract socket usage
425 * dbus/dbus-internals.c (_dbus_verbose_real): only print PID at
428 2003-06-04 Havoc Pennington <hp@pobox.com>
430 * dbus/dbus-server.c (dbus_server_listen): allow abstract sockets
431 using unix:abstract=/foo, and when listening in a tmpdir
432 i.e. unix:tmpdir=/tmp, always use abstract sockets if we can.
434 * dbus/dbus-transport.c (_dbus_transport_open): support
437 * dbus/dbus-server-unix.c (_dbus_server_new_for_domain_socket):
438 support abstract sockets
440 * dbus/dbus-transport-unix.c
441 (_dbus_transport_new_for_domain_socket): support abstract sockets
443 * dbus/dbus-sysdeps.c (_dbus_connect_unix_socket): add "abstract"
444 toggle as an argument, implement abstract namespace support
445 (_dbus_listen_unix_socket): ditto
447 * configure.in: add --enable-abstract-sockets and implement
448 a configure check for autodetection of the right value.
450 2003-06-01 Havoc Pennington <hp@pobox.com>
452 * tools/dbus-cleanup-sockets.c: add utility to clean up sockets
453 in /tmp (though on Linux this will end up being useless,
454 when we add abstract namespace support)
456 * configure.in: define DBUS_SESSION_SOCKET_DIR in addition to
459 2003-05-28 Colin Walters <walters@verbum.org>
461 * tools/dbus-monitor.c (main): Fix silly typo (s/--session/--system/).
463 2003-05-18 Anders Carlsson <andersca@codefactory.se>
465 * dbus/dbus-message.c (dbus_message_new): Remove @todo.
467 2003-05-17 Colin Walters <walters@gnu.org>
469 * tools/dbus-send.c: Don't exit with an error code if --help was
470 passed. Default to using the session bus instead of the system
473 * tools/dbus-launch.c: Ditto.
475 * tools/dbus-monitor.c: Ditto.
477 * tools/dbus-send.1: Update with new arguments.
479 * tools/dbus-launch.c: Emit code to export variables. New
480 arguments -s and -c to specify shell syntax, and a bit of code to
481 autodetect syntax. Also, allow specifying a program to run.
483 * tools/dbus-launch.1: Update with new arguments.
485 * tools/dbus-send.1: Ditto.
487 * tools/dbus-monitor.1: Ditto.
489 2003-05-17 Havoc Pennington <hp@pobox.com>
491 * bus/config-parser.c (merge_included): merge in policies from
492 child configuration file.
494 * bus/policy.c (bus_policy_merge): function to merge two policies
497 2003-05-16 Havoc Pennington <hp@redhat.com>
499 * dbus/dbus-connection.c: disable verbose lock spew
501 * tools/dbus-send.c: add --print-reply command line option
503 * tools/dbus-print-message.h (print_message): new util function
504 shared by dbus-send and dbus-monitor
506 * tools/dbus-monitor.c (handler_func): exit on disconnect
508 * dbus/dbus-transport-unix.c (do_reading): if the transport is
509 disconnected, don't try to use the read_watch
511 * dbus/dbus-watch.c (dbus_watch_get_enabled): assert watch != NULL
512 so we can find this bug more easily
514 2003-05-16 Havoc Pennington <hp@redhat.com>
516 * bus/policy.c (free_rule_list_func): avoid a crash when passed
517 NULL as DBusHashTable is annoyingly likely to do.
519 2003-05-16 Colin Walters <walters@verbum.org>
521 * tools/dbus-monitor.c: Add --session argument and usage()
524 * tools/dbus-monitor.1: Update with new --session arg.
526 * bus/Makefile.am (install-data-hook): Create
527 $(libdir)/dbus-1.0/services so that the session bus is happy.
529 2003-05-15 Havoc Pennington <hp@redhat.com>
531 * dbus/dbus-sysdeps.c (_dbus_atomic_dec, _dbus_atomic_inc): work
532 on non-x86. ifdef's are evil.
534 2003-05-15 Havoc Pennington <hp@redhat.com>
540 * bus/Makefile.am (initddir): apparently we are supposed to put
541 init scripts in /etc/rc.d/init.d not /etc/init.d
543 * bus/Makefile.am: remove the "you must --enable-tests to make
544 check" as it broke distcheck
546 * bus/Makefile.am (install-data-hook): create /etc/dbus-1/system.d
548 2003-05-13 James Willcox <jwillcox@gnome.org>
551 * bus/activation.c: (bus_activation_service_created),
552 (bus_activation_activate_service):
553 * bus/driver.c: (bus_driver_send_service_deleted),
554 (bus_driver_send_service_created), (bus_driver_send_service_lost),
555 (bus_driver_send_service_acquired),
556 (bus_driver_send_welcome_message),
557 (bus_driver_handle_list_services):
558 * bus/session.conf.in:
559 * dbus/dbus-bus.c: (dbus_bus_acquire_service),
560 (dbus_bus_service_exists), (dbus_bus_activate_service):
563 Add some convenience API which lets you activate a service, and did a
564 bunch of s/0/DBUS_TYPE_INVALID/ in calls to dbus_message_append_args()
565 and dbus_message_get_args()
567 2003-05-11 Havoc Pennington <hp@pobox.com>
569 * dbus/dbus-marshal.c (_dbus_marshal_validate_arg): fix to avoid
570 calling _dbus_marshal_validate_arg() for every byte in a byte
573 * dbus/dbus-message-handler.c: use atomic reference counting to
574 reduce number of locks slightly; the global lock in here sucks
576 * dbus/dbus-connection.c
577 (_dbus_connection_update_dispatch_status_and_unlock): variant of
578 update_dispatch_status that can be called with lock held; then use
579 in a couple places to reduce locking/unlocking
580 (dbus_connection_send): hold the lock over the whole function
581 instead of acquiring it twice.
583 * dbus/dbus-timeout.c (_dbus_timeout_new): handle OOM
585 * bus/connection.c (bus_connections_setup_connection): fix access
586 to already-freed memory.
588 * dbus/dbus-connection.c: keep a little cache of linked list
589 nodes, to avoid using the global linked list alloc lock in the
590 normal send-message case. Instead we just use the connection lock
591 that we already have to take.
593 * dbus/dbus-list.c (_dbus_list_find_last): new function
595 * dbus/dbus-sysdeps.c (_dbus_atomic_inc, _dbus_atomic_dec):
596 change to use a struct for the atomic type; fix docs,
597 they return value before increment, not after increment.
599 * dbus/dbus-string.c (_dbus_string_append_4_aligned)
600 (_dbus_string_append_8_aligned): new functions to try to
601 microoptimize this operation.
602 (reallocate_for_length): break this out of set_length(), to
603 improve profile info, and also so we can consider inlining the
606 * dbus/dbus-message.c (dbus_message_new_empty_header): init data
607 strings with some preallocation, cuts down on our calls to realloc
608 a fair bit. Though if we can get the "move entire string to empty
609 string" optimization below to kick in here, it would be better.
611 * dbus/dbus-string.c (_dbus_string_move): just call
612 _dbus_string_move_len
613 (_dbus_string_move_len): add a special case for moving
614 an entire string into an empty string; we can just
615 swap the string data instead of doing any reallocs.
616 (_dbus_string_init_preallocated): new function
618 2003-05-11 Havoc Pennington <hp@pobox.com>
620 Write a "test-profile" that does echo client-server with threads;
621 profile reveals lock contention, memcpy/realloc of buffers, and
622 UTF-8 validation as hot spots. 20% of lock contention eliminated
623 with dbus_atomic_inc/dec implementation on x86. Much remaining
624 contention is global mempool locks for GList and DBusList.
626 * dbus/dbus-sysdeps.c (_dbus_atomic_inc, _dbus_atomic_dec): add
629 * dbus/dbus-connection.c (struct DBusConnection): use
630 dbus_atomic_t for the reference count
632 * dbus/dbus-message.c (struct DBusMessage): declare
633 dbus_atomic_t values as volatile
635 * configure.in: code to detect ability to use atomic integer
636 operations in assembly, from GLib patch
638 * dbus/dbus-internals.c (_dbus_verbose_real): call getpid every
639 time, tired of it being wrong in threads and forked processes
641 * glib/test-profile.c: a little program to bounce messages back
642 and forth between threads and eat CPU
644 * dbus/dbus-connection.c: add debug spew macros for debugging
645 thread locks; include config.h at top; fix deadlock in
646 dbus_connection_flush()
648 2003-05-08 Havoc Pennington <hp@pobox.com>
650 * dbus/dbus-spawn.c: s/_exit/exit/ because it was keeping gcov
651 data from getting written, and there wasn't a good reason to
654 * test/decode-gcov.c (mark_inside_dbus_build_tests): don't count
655 dbus_verbose lines in test coverage
656 (main): add list of functions sorted by # of untested blocks
657 to the coverage report
659 * dbus/dbus-mempool.c: put some test-only code in DBUS_BUILD_TESTS
661 * dbus/dbus-marshal.c (_dbus_marshal_test): extend test coverage
663 * dbus/dbus-message-handler.c (_dbus_message_handler_test):
666 * test/data/auth/cancel.auth-script: test canceling an
669 * dbus/Makefile.am: remove dbus-server-debug.[hc] for now, as they
670 aren't used. in CVS history if we end up needing them.
672 2003-05-04 Havoc Pennington <hp@pobox.com>
674 * dbus/dbus-message-handler.c (_dbus_message_handler_test): add
677 * dbus/dbus-marshal.c (_dbus_demarshal_string_array): fix this
678 function, which assumed length was in # of strings, not bytes
680 * dbus/dbus-message.c (_dbus_message_test): add tests for some
683 * dbus/dbus-connection.c
684 (_dbus_connection_queue_received_message): disable function for
685 now, we are only using it in test mode
687 * dbus/dbus-message.c (_dbus_message_loader_queue_messages):
688 remove a mistaken FIXME
690 2003-05-04 Havoc Pennington <hp@pobox.com>
692 * dbus/dbus-connection.c (dbus_connection_preallocate_send):
693 unlock mutex on successful return, patch from Anders Gustafsson
695 2003-05-04 Havoc Pennington <hp@pobox.com>
697 * dbus-glib-1.pc.in (Requires): fix dependencies, from
700 2003-05-04 Havoc Pennington <hp@pobox.com>
702 * tools/dbus-launch.c: implement
704 * bus/main.c (main), bus/bus.c (bus_context_new):
705 implement --print-pid and --fork
707 2003-05-03 Havoc Pennington <hp@redhat.com>
709 * dbus/dbus-address.c (dbus_parse_address): fix bug when a key in
710 the address had no value, and add to test suite. Fix and
711 regression test from Miloslav Trmac
713 2003-05-03 Havoc Pennington <hp@pobox.com>
715 * dbus/dbus-watch.c (dbus_watch_handle): warn and return if a
716 watch is invalid when handled
718 * tools/Makefile.am, tools/dbus-launch.c, tools/dbus-launch.1: add
719 dbus-launch utility to launch the bus from a shell script. Didn't
720 actually implement dbus-launch yet, it's just a placeholder still.
722 2003-05-03 Havoc Pennington <hp@pobox.com>
724 * bus/Makefile.am, bus/dbus-daemon-1.1.in: man page for the
725 daemon; also documents daemon config file, so replaces
726 doc/config-file.txt. Corrected some stuff from config-file.txt in
727 the process of moving it.
729 2003-05-03 Havoc Pennington <hp@pobox.com>
731 * tools/Makefile.am, tools/dbus-send.1, tools/dbus-monitor.1:
734 2003-05-03 Colin Walters <walters@verbum.org>
736 * dbus/dbus-sysdeps.c (fill_user_info): Test against
737 DBUS_UID_UNSET to determine whether to do a uid lookup or not.
739 * Makefile.am: Update to use new .pc versioning scheme.
741 2003-05-02 Havoc Pennington <hp@redhat.com>
743 * bus/system.conf.in: allow send/receive to/from message bus
746 2003-04-30 Havoc Pennington <hp@redhat.com>
748 * configure.in: print a note when building with unit tests and
751 2003-04-30 Havoc Pennington <hp@redhat.com>
753 * Makefile.am: add a check-local that complains if you didn't
754 configure with --enable-tests
756 2003-04-29 Havoc Pennington <hp@redhat.com>
758 * glib/dbus-gmain.c: docs cleanups
760 * dbus/dbus-types.h: add docs on int64 types
762 * dbus/dbus-memory.c: fix docs to avoid putting private API in
763 public API docs section
765 2003-04-29 Havoc Pennington <hp@redhat.com>
767 * dbus-1.pc.in, dbus-glib-1.pc.in: rename these from
768 dbus-1.0.pc.in, dbus-glib-1.0.pc.in. As these change with the
769 parallel install API version, not with the D-BUS package version.
771 * HACKING: move some of README over here
773 * README: updates, and document API/ABI policy
775 * configure.in: reindentation
777 2003-04-29 Havoc Pennington <hp@redhat.com>
779 * dbus/dbus.h: add "you have to define DBUS_API_SUBJECT_TO_CHANGE
780 to use this library" to be sure people have the right
783 2003-04-28 Havoc Pennington <hp@redhat.com>
785 * configure.in: add --enable-docs which by default is auto yes if
786 doxygen and db2html found, no otherwise; but can be forced on/off
788 * doc/Makefile.am: conditionalize whether to build docs on
791 2003-04-28 Havoc Pennington <hp@redhat.com>
797 * bus/system.conf.in: add <includedir>system.d</includedir>
799 * dbus/dbus-userdb.c (_dbus_user_database_lookup): fix bug when
800 username was provided but not uid
802 * bus/config-parser.c (struct BusConfigParser): keep track of
803 whether the parser is toplevel or was included; change some
804 of the error handling if it's included.
806 2003-04-27 Havoc Pennington <hp@pobox.com>
810 * dbus/dbus-transport.c (_dbus_transport_get_dispatch_status):
811 report correct status if we finish processing authentication
812 inside this function.
814 * bus/activation.c (try_send_activation_failure): use
815 bus_transaction_send_error_reply
817 * bus/connection.c (bus_connection_get_groups): return an error
818 explaining the problem
820 * bus/bus.c (bus_context_check_security_policy): implement
821 restriction here that inactive connections can only send the
822 hello message. Also, allow bus driver to send anything to
825 * bus/connection.c (bus_connection_complete): create the
826 BusClientPolicy here instead of on-demand.
827 (bus_connection_get_policy): don't return an error
829 * dbus/dbus-message.c (dbus_message_new_error_reply): allow NULL
830 sender field in message being replied to
832 * bus/bus.c (bus_context_check_security_policy): fix silly typo
833 causing it to return FALSE always
835 * bus/policy.c (bus_client_policy_check_can_send): fix bug where
836 we checked sender rather than destination
838 2003-04-25 Havoc Pennington <hp@redhat.com>
840 test suite is slightly hosed at the moment, will fix soon
842 * bus/connection.c (bus_connections_expire_incomplete): fix to
843 properly disable the timeout when required
844 (bus_connection_set_name): check whether we can remove incomplete
845 connections timeout after we complete each connection.
847 * dbus/dbus-mainloop.c (check_timeout): fix this up a bit,
848 probably still broken.
850 * bus/services.c (bus_registry_acquire_service): implement max
851 number of services owned, and honor allow/deny rules on which
852 services a connection can own.
854 * bus/connection.c (bus_connection_get_policy): report errors here
856 * bus/activation.c: implement limit on number of pending
859 2003-04-25 Havoc Pennington <hp@redhat.com>
861 * dbus/dbus-transport.c (_dbus_transport_get_unix_user): fix bug
862 where we used >= 0 instead of != DBUS_UID_UNSET.
864 2003-04-25 Havoc Pennington <hp@redhat.com>
866 * glib/dbus-gmain.c (remove_watch): fix for a crash when watches
867 were toggled without add/remove, fix from Anders Gustafsson
869 2003-04-24 Havoc Pennington <hp@redhat.com>
871 * test/data/valid-config-files/basic.conf: add <limit> tags to
874 * bus/config-parser.h, bus/config-parser.c, bus/bus.c: Implement
875 <limit> tag in configuration file.
877 2003-04-24 Havoc Pennington <hp@redhat.com>
879 * bus/dispatch.c: somehow missed some name_is
881 * dbus/dbus-timeout.c (_dbus_timeout_set_enabled)
882 (_dbus_timeout_set_interval): new
884 * bus/connection.c (bus_connections_setup_connection): record time
885 when each connection is first set up, and expire them after the
888 2003-04-24 Havoc Pennington <hp@redhat.com>
890 * dbus/dbus-message.c (dbus_message_name_is): rename
891 (dbus_message_service_is): rename
892 (dbus_message_sender_is): rename
893 (dbus_message_get_service): rename
895 2003-04-24 Havoc Pennington <hp@redhat.com>
897 * configure.in: add --enable-checks
899 * dbus/dbus-message.c (dbus_message_new): reverse name/service arguments
901 * dbus/dbus-connection.c (dbus_connection_preallocate_send): fix
903 (_dbus_connection_handler_destroyed_locked): move some private
904 functions into proper docs group
906 * dbus/dbus-internals.h: add _dbus_return_if_fail,
907 _dbus_return_val_if_fail
909 Throughout: use dbus_return_if_fail
911 2003-04-23 James Willcox <jwillcox@gnome.org>
914 * glib/dbus-gmain.c: (add_timeout), (wakeup_main), (create_source),
915 (dbus_connection_setup_with_g_main),
916 (dbus_server_setup_with_g_main):
917 * glib/test-dbus-glib.c: (main):
918 * glib/test-thread-client.c: (main):
919 * glib/test-thread-server.c: (new_connection_callback), (main):
920 * tools/dbus-monitor.c: (main):
922 Added a GMainContext argument to dbus_connection_setup_with_g_main()
923 and dbus_server_setup_with_g_main().
925 2003-04-20 Havoc Pennington <hp@pobox.com>
927 * doc/dbus-specification.sgml: document the restrictions on
928 message and service names
930 2003-04-22 Havoc Pennington <hp@redhat.com>
932 * dbus/dbus-message.c, dbus/dbus-marshal.c: add 64-bit integer
933 support, and do some code cleanups to share more code and
934 speed up array marshal/demarshal.
936 * dbus-1.0.pc.in (Cflags): put libdir include file in cflags
938 * configure.in: generate dbus-arch-deps.h
940 * dbus/dbus-protocol.h (DBUS_TYPE_INT64, DBUS_TYPE_UINT64): add
943 2003-04-22 Havoc Pennington <hp@redhat.com>
945 * test/data/valid-messages/opposite-endian.message: fix test
946 to use proper type for rply field
948 * test/data/invalid-messages: add tests for below validation
950 * dbus/dbus-message.c (decode_header_data): validate field types,
951 and validate that named fields are valid names
952 (decode_name_field): consider messages in the
953 org.freedesktop.Local. namespace to be invalid.
955 * dbus/dbus-string.c (_dbus_string_validate_name): new
957 2003-04-19 Havoc Pennington <hp@pobox.com>
959 * bus/driver.c (bus_driver_handle_hello): check limits and
960 return an error if they are exceeded.
962 * bus/connection.c: maintain separate lists of active and inactive
963 connections, and a count of each. Maintain count of completed
964 connections per user. Implement code to check connection limits.
966 * dbus/dbus-list.c (_dbus_list_unlink): export
968 * bus/bus.c (bus_context_check_security_policy): enforce a maximum
969 number of bytes in the message queue for a connection
971 2003-04-18 Havoc Pennington <hp@pobox.com>
973 * dbus/dbus-auth.c (record_mechanisms): memleak fixes
975 * dbus/dbus-sysdeps.c (_dbus_string_save_to_file): fix some
978 * dbus/dbus-keyring.c (add_new_key): fix a memleak, and
979 on realloc be sure to update the pointer in the keyring
981 * dbus/dbus-string.c (_dbus_string_zero): compensate for align
982 offset to avoid writing to unallocated memory
984 * dbus/dbus-auth.c (process_rejected): return FALSE if we fail to
985 try the next mechanism, so we properly handle OOM
987 * dbus/dbus-keyring.c (_dbus_keyring_new_homedir): fix double-free
989 (_dbus_keyring_new): fix OOM bug
990 (_dbus_keyring_new_homedir): always set error; impose a maximum
991 number of keys we'll load from the file, mostly to speed up the
992 test suite and make its OOM checks more useful, but also for
995 * dbus/dbus-auth.c (process_error_server): reject authentication
996 if we get an error from the client
997 (process_cancel): on cancel, send REJECTED, per the spec
998 (process_error_client): send CANCEL if we get an error from the
1001 2003-04-18 Havoc Pennington <hp@pobox.com>
1003 * dbus/dbus-mainloop.c (_dbus_loop_iterate): fix UMR in verbose
1006 * dbus/dbus-auth.c (handle_client_data_cookie_sha1_mech): fix OOM
1009 * dbus/dbus-keyring.c (_dbus_keyring_new_homedir): only whine
1010 about DBUS_TEST_HOMEDIR once
1012 * bus/Makefile.am (TESTS_ENVIRONMENT): put DBUS_TEST_HOMEDIR in
1015 * bus/dispatch.c (bus_dispatch_sha1_test): actually load sha1
1016 config file so we test the right thing
1018 Throughout: assorted docs improvements
1020 2003-04-18 Havoc Pennington <hp@pobox.com>
1022 * glib/dbus-gmain.c: adapt to watch changes
1024 * bus/bus.c, bus/activation.c, etc.: adjust to watch changes
1026 * dbus/dbus-server.h: remove dbus_server_handle_watch
1028 * dbus/dbus-connection.h: remove dbus_connection_handle_watch
1030 * dbus/dbus-watch.c (dbus_watch_handle): change DBusWatch to work
1031 like DBusTimeout, so we don't need dbus_connection_handle_watch
1034 2003-04-17 Havoc Pennington <hp@redhat.com>
1036 * dbus/dbus-userdb.c, dbus/dbus-sysdeps.c: redo all the passwd
1037 database usage so it all goes via the DBusUserDatabase cache.
1039 2003-04-17 Havoc Pennington <hp@redhat.com>
1041 * dbus/dbus-mainloop.c (_dbus_loop_iterate): fix logic so that if
1042 there was an OOM watch we skipped, we always return TRUE so we
1043 iterate again to have a look at it again. Fixes test suite hang.
1044 Code rearrangement also lets us lose some memset and only iterate
1045 over callbacks once.
1047 * bus/driver.c (bus_driver_handle_message): sense of test for
1050 2003-04-16 Havoc Pennington <hp@pobox.com>
1052 * doc/dbus-specification.sgml: make spec say serials are unsigned
1054 * dbus/dbus-message.h: change message serials to unsigned
1056 * dbus/dbus-connection.c: adapt to message serials being unsigned
1058 2003-04-15 Havoc Pennington <hp@pobox.com>
1060 * bus/bus.c: create and keep around a shared DBusUserDatabase
1063 * bus/connection.c (bus_connection_get_groups): don't cache
1064 groups for user in the connection object, since user database
1065 object now does that.
1067 2003-04-16 Havoc Pennington <hp@redhat.com>
1069 * dbus/dbus-message.c (_dbus_message_add_size_counter): keep a
1070 list of size counters
1071 (_dbus_message_loader_putback_message_link): put back a popped link
1073 * dbus/dbus-connection.c
1074 (dbus_connection_set_max_live_messages_size): rename
1076 (dbus_connection_get_outgoing_size): get size of outgoing
1078 (_dbus_connection_set_connection_counter): remove this cruft
1080 2003-04-14 Havoc Pennington <hp@redhat.com>
1082 * dbus/dbus-userdb.c: user database abstraction, mostly to get
1083 caching, but at some point we might want to be able to use a
1086 * bus/dispatch.c (bus_dispatch_sha1_test): add a test that uses
1087 SHA1 conf file to test the sha1 auth mechanism, since the regular
1088 test always uses EXTERNAL when available.
1091 test/data/valid-config-files/debug-allow-all-sha1.conf.in:
1092 add conf file that requires use of sha1 auth
1094 2003-04-13 Havoc Pennington <hp@pobox.com>
1096 * tools/dbus-send.c, tools/dbus-monitor.c: two utility programs
1097 from Philip Blundell to send messages and monitor them.
1099 2003-04-13 Havoc Pennington <hp@pobox.com>
1101 * dbus/dbus-mainloop.c: fix some reentrancy issues by refcounting
1104 * test/data/valid-config-files/debug-allow-all.conf.in: allow all
1107 * dbus/dbus-transport.c (_dbus_transport_get_dispatch_status):
1108 fix to only recover unused bytes if we're already authenticated
1109 (_dbus_transport_get_is_authenticated): fix to still mark us
1110 authenticated if there are unused bytes.
1112 * bus/dispatch.c: implement security policy checking
1114 * bus/connection.c (bus_transaction_send_from_driver): new
1116 * bus/bus.c (bus_context_check_security_policy): new
1118 * bus/dispatch.c (send_service_nonexistent_error): delete this,
1119 now we just set the DBusError and it gets converted to an error
1122 * bus/connection.c (allow_user_function): enable code using actual
1123 data from the config file
1125 * bus/policy.c (list_allows_user): handle wildcard rules for
1126 user/group connection perms
1128 2003-04-13 Havoc Pennington <hp@pobox.com>
1130 * bus/config-parser.c: Load up the BusPolicy and BusPolicyRules
1132 * dbus/dbus-sysdeps.c (_dbus_get_user_id): new function
1134 * bus/policy.c (bus_policy_append_mandatory_rule)
1135 (bus_policy_append_default_rule, bus_policy_append_user_rule)
1136 (bus_policy_append_group_rule): new functions
1138 2003-04-12 Havoc Pennington <hp@pobox.com>
1140 * bus/config-parser.c (bus_config_parser_new): fix a memleak
1142 * dbus/dbus-sysdeps.c: change DBusCredentials to use longs for
1143 the pid/gid/uid, just for paranoia.
1145 * test/break-loader.c (randomly_do_n_things): find a byte
1146 containing a type code, and randomly change it to a different
1149 2003-04-12 Havoc Pennington <hp@pobox.com>
1151 * bus/policy.h: change BusPolicy to be the thing from the config
1152 file, and rename old BusPolicy to BusClientPolicy
1154 * bus/bus.c, bus/connection.c, bus/config-parser.c: change to
1155 match change in how policy works
1157 * dbus/dbus-internals.h: mark assert_not_reached as
1158 __attribute((noreturn))__
1160 2003-04-11 Havoc Pennington <hp@redhat.com>
1162 * doc/dbus-specification.sgml: fix a spot with the wrong name for
1163 the broadcast service. Use boolean return for ServiceExists.
1165 2003-04-11 Havoc Pennington <hp@redhat.com>
1167 * configure.in: add another directory to look for qt in.
1169 2003-04-11 Havoc Pennington <hp@redhat.com>
1171 * AUTHORS: add Colin Walters
1173 2003-04-11 Havoc Pennington <hp@redhat.com>
1179 2003-04-11 Havoc Pennington <hp@redhat.com>
1181 * bus/messagebus.in: remove pid file when stopping the
1182 message bus, since the bus won't have privileges to remove it
1185 2003-04-11 Havoc Pennington <hp@redhat.com>
1187 * bus/bus.c (bus_context_new): move credentials change after
1190 2003-04-11 Havoc Pennington <hp@pobox.com>
1192 * test/decode-gcov.c: add "below average functions" to the
1193 coverage report, and change how some of the code works.
1195 * bus/test-main.c: bracket some stuff in DBUS_BUILD_TESTS so it's
1196 not in the coverage stats.
1198 * test/test-service.c (main): use _dbus_verbose not fprintf in a
1199 couple places so running the test suite doesn't result in megaspam.
1201 2003-04-11 Havoc Pennington <hp@pobox.com>
1203 * bus/dispatch.c (check_existent_service_activation): accept a no
1204 memory error in a place we didn't before
1206 * bus/test.c (bus_test_run_everything): remove hacky "do it twice
1207 in case the first one failed," since the test suite is less
1210 2003-04-10 Havoc Pennington <hp@pobox.com>
1212 * bus/dispatch.c (check_segfault_service_activation): add test
1213 for launching an executable that just crashes.
1215 * test/test-segfault.c (main): try setting coredumpsize to 0 so we
1216 don't leave a million cores. We'll see how portable this is.
1218 2003-04-10 Havoc Pennington <hp@pobox.com>
1220 * dbus/dbus-spawn.c (_dbus_spawn_async_with_babysitter): move all
1221 the possible parent failures before we fork, so that we don't
1222 fail to create a babysitter after creating the child.
1224 * bus/activation.c (bus_activation_activate_service): kill child
1225 if we don't successfully complete the activation.
1227 2003-04-10 Havoc Pennington <hp@redhat.com>
1229 * dbus/dbus-connection.c (dbus_connection_flush): don't spin on
1230 the connection if it's disconnected
1232 * bus/activation.c (bus_activation_service_created): use new
1233 transaction features to roll back removal of pending activation if
1234 we don't successfully create the service after all. Don't remove
1235 pending activation if the function fails.
1237 * dbus/dbus-list.c (_dbus_list_insert_before_link)
1238 (_dbus_list_insert_after_link): new code to facilitate
1241 * dbus/dbus-hash.c (_dbus_hash_table_insert_string_preallocated):
1242 new functionality, so we can preallocate the ability to insert
1245 * bus/connection.c (bus_transaction_add_cancel_hook): new function
1246 allowing us to put custom hooks in a transaction to be used for
1247 cancelling said transaction
1249 * doc/dbus-specification.sgml: add some discussion of secondary
1250 service owners, and disallow zero-length service names
1252 * bus/services.c (bus_registry_acquire_service): new function,
1253 splits out part of bus_driver_handle_acquire_service() and fixes
1254 a bug where we didn't remove the service doing the acquiring
1255 from the secondary queue if we failed to remove the current owner
1256 from the front of the queue.
1258 2003-04-10 Alexander Larsson <alexl@redhat.com>
1260 * doc/dbus-specification.sgml:
1261 s/org.freedesktop.Broadcast/org.freedesktop.DBus.Broadcast/
1263 2003-04-10 Alexander Larsson <alexl@redhat.com>
1268 Added files to cvsignore
1270 * dbus/dbus-message.h:
1271 * dbus/dbus-message.c: (dbus_message_iter_get_named):
1272 Make get_named() take two out argument and return a boolean.
1273 (dbus_message_iter_get_args_valist):
1274 Update usage of get_named().
1275 (dbus_message_iter_append_byte):
1277 (dbus_message_iter_append_named)
1279 (message_iter_test), (check_message_handling_type), (_dbus_message_test):
1282 2003-04-10 Alexander Larsson <alexl@redhat.com>
1284 * dbus/dbus-marshal.[ch]:
1285 Add array_type_pos argument to _dbus_marshal_validate_arg.
1286 Let you pass a NULL end_pos to _dbus_marshal_validate_type.
1288 * dbus/dbus-message.[ch]:
1289 Multi-dimensional arrays have full type specification in the
1290 outermost array. Iter code re-arranged to handle this.
1291 Added some more iter tests.
1293 * doc/dbus-specification.sgml:
1296 Update new array encoding description.
1297 Correct DBUS_SERVICE_FLAGS_REPLACE_EXISTING description.
1299 * test/data/invalid-messages/array-with-mixed-types.message:
1300 * test/data/valid-messages/array-of-array-of-uint32.message:
1301 Change to the new array format.
1303 * test/data/invalid-messages/too-short-dict.message:
1306 * test/data/valid-messages/recursive-types.message:
1307 Fix up and extend test.
1309 2003-04-10 Havoc Pennington <hp@pobox.com>
1311 * bus/dispatch.c: lots of fixes
1313 * dbus/dbus-mainloop.c (_dbus_loop_dispatch): export
1314 (_dbus_loop_iterate): remove old "quit if no callbacks" code,
1315 that was crack, broke the test service.
1317 * dbus/dbus-transport.c (_dbus_transport_open): fix error
1318 handling to avoid piling up errors if we get a failure on the
1321 * dbus/dbus-internals.c (_dbus_real_assert_not_reached): include
1322 pid in assertion failures.
1324 * dbus/dbus-mainloop.c (_dbus_loop_iterate): use static arrays up
1325 to some fixed size of file descriptor array. Don't return TRUE
1326 anytime a timeout exists, that led to lots of busy loop silliness
1329 2003-04-09 Havoc Pennington <hp@redhat.com>
1331 * dbus/dbus-mainloop.c (check_timeout): fix timeouts, I thought
1332 I'd checked this in earlier but hadn't.
1334 2003-04-09 Havoc Pennington <hp@redhat.com>
1336 * bus/dispatch.c (bus_dispatch_test): get a bit further through
1337 the activation test (man this is getting old!)
1339 2003-04-09 Havoc Pennington <hp@redhat.com>
1341 * test/test-utils.c: use dispatch status function to fix this up
1343 * bus/connection.c (connection_watch_callback): don't dispatch
1345 (connection_timeout_callback): don't dispatch from here
1346 (bus_connections_setup_connection): set the dispatch status function
1347 (bus_connection_disconnected): unset it
1349 * dbus/dbus-mainloop.c (_dbus_loop_queue_dispatch): new function
1350 used to add a connection to be dispatched
1351 (_dbus_loop_iterate): do the dispatching at the end of each
1354 * dbus/dbus-connection.c
1355 (dbus_connection_set_dispatch_status_function): new function
1356 allowing us to fix up main loop usage
1357 (_dbus_connection_last_unref): free all the various function
1359 (dbus_connection_dispatch): call the DispatchStatusFunction
1360 whenever this function returns
1361 (dbus_connection_handle_watch): call DispatchStatusFunction
1362 (dbus_connection_send_with_reply_and_block): call DispatchStatusFunction
1363 (reply_handler_timeout): call DispatchStatusFunction
1364 (dbus_connection_flush): call DispatchStatusFunction
1366 2003-04-09 Havoc Pennington <hp@redhat.com>
1368 * dbus/dbus-bus.c (dbus_bus_register): fix up error handling and
1371 * bus/dispatch.c (check_service_activated): fix bug in test
1373 * dbus/dbus-mainloop.c (check_timeout): fix this up
1375 * dbus/dbus-internals.c (_dbus_verbose_real): include PID in
1376 verbose output so we can sort out output from different processes,
1377 e.g. in the activation case.
1379 2003-04-08 Colin Walters <walters@gnu.org>
1381 * bus/bus.c (struct BusContext) [pidfile]: New member, to store
1383 (bus_context_new): Set it.
1384 (bus_context_unref): Use it to delete the pid file.
1386 2003-04-08 Havoc Pennington <hp@redhat.com>
1388 * test/data/invalid-messages/array-with-mixed-types.message:
1389 regression test that fails for the moment
1391 * dbus/dbus-test.c (dbus_internal_do_not_use_run_tests): reorder
1392 tests for convenience
1394 * dbus/dbus-marshal.c (_dbus_marshal_validate_arg): don't allow
1395 array of nil, it broke things.
1397 * test/data/invalid-messages/array-of-nil.message: regression test
1399 * test/data/valid-messages/array-of-array-of-uint32.message:
1400 happened to write this so added it to suite
1402 2003-04-08 Havoc Pennington <hp@redhat.com>
1404 * bus/driver.c (bus_driver_handle_acquire_service): init
1405 retval/reply before checking name
1407 * dbus/dbus-marshal.c (_dbus_marshal_validate_arg): add a
1408 recursion depth argument
1410 * dbus/dbus-message.h (struct DBusMessageIter): put some padding
1411 in the public struct for future extension
1413 * dbus/dbus-message-builder.c (_dbus_message_data_load): fix
1416 * dbus/dbus-marshal.c (_dbus_marshal_validate_arg): fix a verbose
1419 * doc/dbus-specification.sgml: fix typo
1421 2003-04-08 Alexander Larsson <alexl@redhat.com>
1423 Implemented recursive types, named types and new-style iters
1426 * glib/test-thread-client.c: (thread_func):
1427 * glib/test-thread-server.c: (handle_test_message):
1428 * test/test-service.c: (handle_echo):
1437 * dbus/dbus-internals.c: (_dbus_type_to_string):
1438 Update for new types.
1440 * dbus/dbus-marshal.[ch]:
1441 Implement recursive types and the new marshalling format.
1442 Remove hardcoded dict marshalling.
1443 Marshal named types.
1445 * dbus/dbus-message-builder.c:
1447 Remove references to old types
1449 * dbus/dbus-message.[ch]:
1450 New non-refcounted iter API that supports recursive iters.
1451 Use iters for appending, including support for recursive
1453 Add byte and named type support.
1454 Update everything to new marshalling formats.
1455 Add tests for new API.
1457 * dbus/dbus-protocol.h:
1458 Remove old array types.
1459 Add types: BYTE, ARRAY, DICT, NAMED
1461 * dbus/dbus-string.c:
1462 * dbus/dbus-sysdeps.c:
1463 Make parse_double locale safe.
1465 * dbus/dbus-test-main.c:
1471 * doc/dbus-specification.sgml:
1474 * test/data/incomplete-messages/missing-body.message:
1475 * test/data/invalid-messages/bad-boolean.message:
1476 * test/data/invalid-messages/bad-boolean-array.message:
1477 * test/data/invalid-messages/boolean-array-length-too-long.message-raw:
1478 * test/data/invalid-messages/boolean-has-no-value.message-raw:
1479 * test/data/invalid-messages/too-short-dict.message:
1480 * test/data/valid-messages/dict-simple.message:
1481 * test/data/valid-messages/dict.message:
1482 * test/data/valid-messages/emptiness.message:
1483 * test/data/valid-messages/lots-of-arguments.message:
1484 * test/data/valid-messages/no-padding.message:
1485 * test/data/valid-messages/recursive-types.message:
1486 Add missing NAME fields
1487 Fix up dicts & arrays
1489 * test/data/invalid-messages/dict-with-nil-value.message:
1490 Removed, this is not invalid anymore.
1492 * test/data/valid-messages/recursive-types.message:
1493 Add new test for deeply recursive types.
1495 2003-04-07 Havoc Pennington <hp@pobox.com>
1497 * bus/driver.c (bus_driver_handle_acquire_service): return an
1498 error if you try to acquire a service that starts with ':'
1500 2003-04-07 Havoc Pennington <hp@redhat.com>
1502 * doc/dbus-specification.sgml: require that base service names
1503 start with ':' and that the base service is created/deleted
1504 as first and last things a connection does on the bus
1506 * bus/dispatch.c (check_existent_service_activation): lots more
1507 work on the activation test; it doesn't fully pass yet...
1509 * test/test-service.c (main): fix so we don't memleak the
1510 connection to the message bus
1511 (filter_func): accept a message asking us to exit
1513 2003-04-06 Havoc Pennington <hp@pobox.com>
1515 * qt/Makefile.am (dbusinclude_HEADERS): install dbus-qt.h,
1518 * configure.in: fixes to Qt detection from Colin Walters
1520 * doc/Makefile.am: Only remove generated docbook dirs if they
1521 exist, from Colin Walters
1523 * dbus/dbus-bus.c: change how we set well-known connections to
1524 NULL, so that it works if a single connection is stored in
1525 two well-known array slots.
1527 * test/Makefile.am: remove a lot of stuff that isn't immediately
1528 useful, it's in CVS history if we want it.
1530 * test/test-service.c: use dbus-mainloop instead of that
1533 2003-04-06 Havoc Pennington <hp@pobox.com>
1535 * dbus/Makefile.am: split lists of sources into stuff that goes in
1536 the library, util functions that go in the lib and are also used
1537 elsewhere, and util functions that are used in tests/daemon but
1538 don't go in the lib.
1540 * dbus/dbus-mainloop.h, dbus/dbus-mainloop.c: move bus/loop.[hc]
1541 here so it can be used in test binaries also
1543 2003-04-06 Havoc Pennington <hp@pobox.com>
1545 * dbus/dbus-sysdeps.c (_dbus_become_daemon): write the pidfile
1546 here in the parent process, so we can return an error if it
1547 fails. Also, move some of the code into the child so the parent
1548 is less hosed if we fail midway through.
1550 * bus/bus.c (bus_context_new): move pidfile detection further up
1551 in the function, before we start overwriting sockets and such.
1553 * bus/messagebus.in: adjust this a bit, not sure if it will work.
1555 * configure.in: add --with-system-pid-file and --with-system-socket
1557 2003-04-06 Colin Walters <walters@verbum.org>
1559 * configure.in (DBUS_SYSTEM_PID_FILE): New variable.
1561 * bus/system.conf.in: Declare a pidfile.
1563 * bus/bus.c (bus_context_new): Test for an existing pid file, and
1564 create one (if appropriate).
1566 * bus/config-parser.c (enum ElementType) [ELEMENT_PIDFILE]: New.
1567 (struct BusConfigParser) [pidfile]: New.
1568 (element_type_to_name, merge_included, start_busconfig_child)
1569 (bus_config_parser_end_element, bus_config_parser_content): Handle it.
1570 (bus_config_parser_unref): Free it.
1571 (bus_config_parser_get_pidfile): New function.
1573 * bus/config-parser.h (_dbus_write_pid_file): Prototype.
1575 * dbus/dbus-errors.h (DBUS_ERROR_PIDFILE_EXISTS): New error.
1577 * dbus/dbus-sysdeps.c (_dbus_write_pid_file): New function.
1579 * dbus/dbus-sysdeps.h: Prototype it.
1581 2003-04-06 Havoc Pennington <hp@pobox.com>
1583 * bus/bus.c (bus_context_new): print the address in here, rather
1584 than in main(), because we need to do it before forking the daemon
1586 * bus/dispatch.c (send_service_nonexistent_error): set the sender
1587 on the service nonexistent error
1589 * bus/driver.c (bus_driver_handle_acquire_service): set the
1590 sender on the AcquireService reply
1592 * test/data/valid-config-files/debug-allow-all.conf.in: Make test
1593 server also listen on a UNIX socket so services can connect to it.
1595 2003-04-06 Havoc Pennington <hp@pobox.com>
1597 * dbus/dbus-threads.c: Redo how the fake debug mutexes are done
1598 so it detects deadlocks and also we actually init threads when
1601 2003-04-06 Havoc Pennington <hp@pobox.com>
1603 * dbus/dbus-server-unix.c (_dbus_server_new_for_domain_socket):
1604 save the domain socket name, and unlink it when we disconnect the
1605 server. Means that at least when we exit normally, we won't leave
1606 a bunch of junk in /tmp
1608 * dbus/dbus-transport-unix.c
1609 (_dbus_transport_new_for_domain_socket): code cleanup (nicer
1610 memory management). (I was making a real change here but then
1613 2003-04-06 Havoc Pennington <hp@pobox.com>
1615 * bus/bus.c (bus_context_new): fix wrong handling of
1616 server_data_slot_unref() in the error case.
1618 * dbus/dbus-internals.h (_dbus_assert): change so it passes
1619 "(condition) != 0" to _dbus_real_assert so that
1620 "_dbus_assert (pointer)" doesn't cause a warning
1622 * bus/main.c (main): accept --print-address option to print out
1623 the message bus address
1625 * dbus/dbus-sysdeps.c (_dbus_generate_random_ascii): export this
1627 * dbus/dbus-transport.c (_dbus_transport_open): special error for
1628 "tmpdir" option to unix: address on client side
1630 * dbus/dbus-server.c (dbus_server_listen): handle "tmpdir" option
1633 * configure.in (TEST_SOCKET_DIR): locate a temporary directory
1634 we can use to create sockets in the test suite.
1636 * bus/main.c (signal_handler): on SIGTERM, exit the daemon
1637 cleanly. To be used for testing.
1639 * dbus/dbus-spawn.c (babysit): use _dbus_set_signal_handler()
1641 * dbus/dbus-sysdeps.c (_dbus_set_signal_handler): new
1643 * dbus/dbus-server-debug-pipe.c (_dbus_transport_debug_pipe_new):
1644 handle trying to call this when there's no servers active
1646 2003-04-05 Havoc Pennington <hp@pobox.com>
1652 2003-04-05 Havoc Pennington <hp@pobox.com>
1654 * bus/bus.c (setup_server): fix this so dbus-daemon-1 doesn't
1655 crash on startup. Need to get "try starting the daemon"
1656 in the test suite I guess. ;-)
1658 * dbus/dbus-server.h, dbus/dbus-server.c: remove the stuff that
1659 tracked the number of open connections; it's better done in
1660 application-specific code as you want it to span all servers etc.
1662 2003-04-05 Havoc Pennington <hp@pobox.com>
1664 * bus/Makefile.am (install-data-hook): add missing DESTDIR,
1665 patch from Colin Walters
1667 2003-04-05 Havoc Pennington <hp@pobox.com>
1669 * doc/config-file.txt (Elements): fix docs of <auth> to reflect
1670 reality; in fact multiple mechanisms are allowed.
1672 * dbus/dbus-internals.c (_dbus_real_assert)
1673 (_dbus_real_assert_not_reached): move guts of _dbus_assert() and
1674 _dbus_assert_not_reached() into functions, so that they don't show
1675 up in basic block counts for test coverage, and don't use up as
1676 much disk space. Does mean slower execution speed though, so
1677 assumes --disable-asserts is the normal production case.
1679 2003-04-05 Havoc Pennington <hp@pobox.com>
1681 * test/Makefile.am (dist-hook): also dist *.in files
1687 2003-04-05 Havoc Pennington <hp@pobox.com>
1689 * dbus/dbus-string.c: docs warning
1691 * dbus/dbus-spawn.c: missing docs
1693 * dbus/dbus-memory.c (struct ShutdownClosure): missing docs
1695 2003-04-05 Havoc Pennington <hp@pobox.com>
1697 * bus/loop.c (bus_loop_iterate): fix the timeout code, using
1700 * dbus/dbus-spawn.c (_dbus_babysitter_unref): set sitter_pid
1701 to -1 once we've reaped the babysitter
1702 (_dbus_babysitter_handle_watch): do as much work as we can, not
1705 * bus/activation.c: add code using DBusBabysitter so that we
1706 handle it when a service fails to start up properly.
1707 (bus_activation_service_created): don't remove the activation
1708 entries as we go, just let them get removed when we free the pending
1709 activation. Unref reply messages after sending them.
1711 2003-04-05 Havoc Pennington <hp@pobox.com>
1713 * test/decode-gcov.c (main): print per-directory stats in the report
1715 * Makefile.am (coverage-report.txt): don't include test/* in gcov stats
1717 2003-04-05 Havoc Pennington <hp@pobox.com>
1719 * Makefile.am (coverage-report.txt): add target "coverage-report.txt"
1721 * test/decode-gcov.c: hack up a little program to suck data
1722 out of gcov files. Yes this is sort of silly.
1724 * configure.in: define something in config.h and do an
1725 AM_CONDITIONAL when gcov is enabled
1727 2003-04-04 Havoc Pennington <hp@redhat.com>
1729 * dbus/dbus-spawn.c, dbus/dbus-spawn.h: Change dbus_spawn to
1730 return a "babysitter" object that is used to monitor the status of
1731 the spawned process and reap it when required.
1733 * test/test-segfault.c, test/test-exit.c,
1734 test/test-sleep-forever.c: binaries that do various lame things,
1735 used in the test suite.
1737 * dbus/dbus-sysdeps.c: kill _dbus_errno_to_string()
1739 2003-04-03 Havoc Pennington <hp@pobox.com>
1741 * dbus/dbus-spawn.c: Move dbus-spawn into a separate file
1742 in preparation for modifying it, dbus-sysdeps is getting
1745 2003-04-03 Havoc Pennington <hp@redhat.com>
1747 * bus/loop.h, bus/loop.c: make the mainloop an object so we can
1750 * bus/*.[hc]: adapt to mainloop change
1752 2003-04-03 Havoc Pennington <hp@redhat.com>
1754 * bus/activation.c (load_directory): fix up memleaks
1755 (bus_activation_entry_free): free the entry
1757 * dbus/dbus-bus.c (dbus_bus_acquire_service): return an error if
1758 we get one from the message bus; fix memleaks.
1760 * dbus/dbus-message.c (dbus_set_error_from_message): new function
1762 2003-04-03 Havoc Pennington <hp@pobox.com>
1764 * bus/config-parser.c (bus_config_parser_unref): free
1765 list of mechanisms, bug discovered by test suite enhancements
1766 (putting system.conf and session.conf into suite)
1768 * test/Makefile.am, test/test-service.c: add placeholder for a
1769 test service that we'll activate as part of test suite. Doesn't
1772 * dbus/dbus-sysdeps.c (_dbus_setenv): support unsetenv by
1773 setting NULL value, and use system malloc not dbus_malloc()
1774 when we have unavoidable memleakage.
1776 * dbus/dbus-bus.c (dbus_bus_get): fix bug where bus type of 0
1777 didn't work, and support DBUS_BUS_ACTIVATION.
1779 * bus/activation.c (child_setup): pass our well-known bus type to
1782 * bus/config-parser.c: support <type> to specify well-known type
1784 * doc/dbus-specification.sgml: document the env variables to
1785 locate well-known buses and find service activator
1787 2003-04-02 Havoc Pennington <hp@redhat.com>
1789 * test/Makefile.am (all-local): add a rule to copy tests to
1790 builddir, so we can have generated tests. Use this to remove the
1791 silly hack for testing system.conf and session.conf. Will use this
1792 shortly to generate .service files pointing to test binaries.
1794 2003-04-02 Havoc Pennington <hp@redhat.com>
1796 * dbus/dbus-string.c (set_length): fix a bug - we allocated max of
1797 current alloc and needed new length, not max of the doubled
1798 allocation and needed new length. Also, when building tests,
1799 don't do the double-allocation stuff, just realloc every time.
1801 2003-04-02 Havoc Pennington <hp@redhat.com>
1803 * dbus/dbus-sysdeps.c (_dbus_file_get_contents): include filenames
1805 (_dbus_string_get_dirname): new
1806 (_dbus_sysdeps_test): new
1807 (_dbus_directory_open): include dirnames in error messages
1809 * bus/config-parser.c: interpret <include> and <includedir> and
1810 <servicedir> relative to config file location if the given
1811 filename is not absolute.
1813 * dbus/dbus-string.c (_dbus_string_find_byte_backward): new
1815 2003-04-02 Havoc Pennington <hp@redhat.com>
1817 * bus/connection.c (bus_transaction_send_error_reply): set sender
1818 service for the error, and unref the reply on success
1820 * bus/activation.c: convert to use BusTransaction so OOM can be
1822 (bus_activation_service_created): set sender of the message
1824 2003-04-01 Havoc Pennington <hp@redhat.com>
1826 * bus/config-parser.c, bus/bus.c: implement <servicedir> and
1827 <includedir> (at least mostly)
1829 * dbus/dbus-sysdeps.c (_dbus_change_identity): set the group ID
1830 first, then the user ID
1832 2003-04-01 Havoc Pennington <hp@pobox.com>
1834 * dbus/dbus-server.c (dbus_server_set_auth_mechanisms): new
1837 * dbus/dbus-auth.c (_dbus_auth_set_mechanisms): new
1839 * dbus/dbus-internals.c (_dbus_dup_string_array): new function
1841 * dbus/dbus-sysdeps.c (_dbus_listen_unix_socket): chmod the
1842 socket 0777, and unlink any existing socket.
1844 * bus/bus.c (bus_context_new): change our UID/GID and fork if
1845 the configuration file so specifies; set up auth mechanism
1848 * bus/config-parser.c (bus_config_parser_content): add support
1849 for <fork> option and fill in code for <auth>
1851 * bus/system.conf.in: add <fork/> to default configuration,
1852 and limit auth mechanisms to EXTERNAL
1854 * doc/config-file.txt (Elements): add <fork>
1856 * dbus/dbus-sysdeps.c (_dbus_become_daemon): new function
1857 (_dbus_change_identity): new function
1859 2003-03-31 Havoc Pennington <hp@redhat.com>
1861 * dbus/dbus-sysdeps.c (_dbus_connect_unix_socket)
1862 (_dbus_listen_unix_socket): fix off-by-one error in null
1863 termination spotted by Nalin
1865 2003-03-31 Havoc Pennington <hp@redhat.com>
1867 * dbus/dbus-keyring.c (_dbus_keyring_new_homedir): allow setting
1868 DBUS_TEST_HOMEDIR when tests are enabled, so we can test without
1869 having a real home directory available.
1871 2003-03-31 Havoc Pennington <hp@redhat.com>
1873 * bus/Makefile.am (install-data-hook): create /var/run/dbus
1875 * bus/messagebus.in: add init script for Red Hat /etc/init.d
1877 * configure.in: add support for specifying a style of init script
1880 2003-03-31 Havoc Pennington <hp@redhat.com>
1882 Fix some annoying DBusString API and fix all affected code.
1884 * dbus/dbus-string.c (_dbus_string_init): get rid of annoying
1886 (_dbus_string_get_data): change to return string instead of using
1888 (_dbus_string_get_const_data): ditto
1889 (_dbus_string_get_data_len): ditto
1890 (_dbus_string_get_const_data_len): ditto
1892 2003-03-31 Havoc Pennington <hp@redhat.com>
1894 * bus/main.c (main): fix up the command line arguments to be nicer
1896 2003-03-31 Havoc Pennington <hp@redhat.com>
1898 * dbus/Makefile.am (INCLUDES): use EXPANDED_LOCALSTATEDIR to
1899 define DBUS_SYSTEM_BUS_PATH as we want to compile in the same
1900 final location that lands in the config file
1902 * bus/config-loader-expat.c (bus_config_load): fix type of
1905 * doc/TODO: remove TODO item for dbus_bus_get()
1907 * dbus/dbus-bus.c (bus_data_free): add missing lock/unlock
1909 2003-03-31 Havoc Pennington <hp@pobox.com>
1911 * dbus/dbus-transport-unix.c (_dbus_transport_new_for_domain_socket)
1912 (_dbus_transport_new_for_tcp_socket): these didn't need the "server"
1913 argument since they are always client side
1915 * dbus/dbus-server.c (dbus_server_get_address): new function
1917 * bus/main.c (main): take the configuration file as an argument.
1919 * test/data/valid-config-files/debug-allow-all.conf: new file to
1920 use with dispatch.c tests for example
1922 * bus/test-main.c (main): require test data dir
1924 * bus/bus.c (bus_context_new): change this to take a
1925 configuration file name as argument
1927 * doc/config-file.txt (Elements): add <servicedir>
1929 * bus/system.conf, bus/session.conf: new files
1931 * dbus/dbus-bus.c (dbus_bus_get): look for system bus on
1932 well-known socket if none set
1934 * configure.in: create system.conf and session.conf
1936 2003-03-30 Havoc Pennington <hp@pobox.com>
1938 * bus/config-parser.c: hacking
1940 * dbus/dbus-memory.c: don't use DBusList for the list of stuff
1941 to shut down, since it could cause weirdness with the DBusList
1944 * dbus/dbus-list.c (_dbus_list_test): add tests for the
1945 link-oriented stack routines
1946 (alloc_link): free the mempool if the first alloc from it fails
1948 * dbus/dbus-mempool.c (struct DBusMemBlock): fix alignment issue
1950 * dbus/dbus-string.c (UNICODE_VALID): sync new version of this
1952 (_dbus_string_skip_white): new
1954 * doc/config-file.txt (Elements): add <includedir>
1956 2003-03-28 Havoc Pennington <hp@pobox.com>
1958 * dbus/dbus-string.c (_dbus_string_copy_data_len)
1959 (_dbus_string_copy_data): new functions
1961 2003-03-28 Anders Carlsson <andersca@codefactory.se>
1963 * dbus/dbus-bus.c: (bus_data_free), (dbus_bus_get):
1967 * dbus/dbus-memory.c:
1970 2003-03-28 Havoc Pennington <hp@pobox.com>
1972 * bus/test.c (bus_test_flush_bus): remove the sleep from here,
1973 I think it may have just been superstition. Not sure.
1975 * dbus/dbus-string.c (_dbus_string_base64_decode): catch some OOM
1976 failures that were not being handled.
1978 * dbus/dbus-auth.c (process_auth): fix a memleak in OOM handling
1980 * dbus/dbus-memory.c: add ability to set number of mallocs in a
1981 row that will fail on out-of-memory.
1983 * dbus/dbus-internals.c (_dbus_test_oom_handling): convenience
1984 function for testing out-of-memory handling.
1986 * bus/config-loader-expat.c (memsuite): don't wrap the dbus
1987 allocation functions, they do map exactly to the expat ones.
1989 2003-03-27 Havoc Pennington <hp@redhat.com>
1991 * bus/config-loader-libxml.c (bus_config_load): add another error
1994 2003-03-26 Anders Carlsson <andersca@codefactory.se>
1997 Add note about automatic service activation.
1999 * doc/dbus-specification.sgml:
2000 Rename the specification and clarify a few things.
2002 2003-03-26 Anders Carlsson <andersca@codefactory.se>
2005 * dbus/dbus-address.c:
2007 * dbus/dbus-marshal.c:
2008 * dbus/dbus-server-debug-pipe.c:
2009 * dbus/dbus-transport-unix.c:
2010 Fix documentation warnings.
2012 2003-03-26 Havoc Pennington <hp@pobox.com>
2014 * bus/test-main.c, dbus/dbus-test.c (main): check memleaks
2015 after every test so it's quick and easy to see which leaked, and
2016 so we test multiple dbus_shutdown() calls
2018 * configure.in: change configure.in XML stuff to also support
2021 * config-loader-libxml.c: some hacking
2023 * config-loader-expat.c: some hacking
2025 * config-parser.c: some hacking, plus tests
2027 2003-03-25 Havoc Pennington <hp@redhat.com>
2029 * throughout - add more _DBUS_ASSERT_ERROR_IS_CLEAR
2031 * configure.in: add --with-xml option to specify XML library,
2032 right now only libxml is supported.
2034 * bus/config-loader-libxml.c, config-parser.c: sync some minor
2035 nonworking code between home and work, still just stubs
2037 2003-03-24 Havoc Pennington <hp@redhat.com>
2039 * dbus/dbus-sysdeps.c (_dbus_set_fd_nonblocking): move to this
2042 * dbus/dbus-errors.c (dbus_set_error, dbus_set_error_const): allow
2043 NULL argument for "message" if the error is a well-known one,
2044 fill in a generic message in this case.
2046 * dbus/dbus-errors.h (DBusResultCode): Kill DBusResultCode in
2049 * bus/test.c (bus_test_flush_bus): add
2051 * bus/policy.c (bus_policy_test): test code stub
2053 2003-03-24 Havoc Pennington <hp@pobox.com>
2055 * bus/connection.c (bus_connections_setup_connection): set up
2056 the "can this user connect" function, but it always returns
2057 TRUE until we have a config file parser so we can have a config
2058 file that allows connections.
2060 2003-03-23 Havoc Pennington <hp@pobox.com>
2062 * dbus/dbus-threads.c (dbus_mutex_new, dbus_condvar_new): with
2063 DBUS_BUILD_TESTS, actually alloc/free a block of memory for
2064 the mutex, so we can check for proper memory management
2067 * dbus/dbus-dataslot.c: remove the mutex from
2068 DBusDataSlotAllocator and lock it manually when using it,
2069 to simplify fitting it into the global slots framework.
2071 * dbus/dbus-threads.c (init_static_locks): rework how we're
2072 handling global locks so they are easily shut down.
2074 * bus/policy.c (bus_policy_append_rule): fix
2076 * bus/test-main.c (main): check for memleaks
2078 * dbus/dbus-test.c (dbus_internal_do_not_use_run_tests): make
2079 test suite check for memleaks
2081 * dbus/dbus-memory.c: add support in test mode for tracking
2082 number of outstanding blocks
2084 2003-03-23 Havoc Pennington <hp@pobox.com>
2086 * bus/policy.c, bus/bus.c, bus/connection.c: implement allow/deny
2089 * dbus/dbus-hash.h: add ULONG hash keys
2091 * dbus/dbus-sysdeps.c (_dbus_get_groups): new
2092 (_dbus_get_group_id): new function
2094 2003-03-20 Havoc Pennington <hp@redhat.com>
2096 * dbus/dbus-connection.c (dbus_connection_set_unix_user_function):
2098 (dbus_connection_get_unix_user): new function
2100 2003-03-20 Havoc Pennington <hp@pobox.com>
2102 * bus/connection.c (bus_connection_send_oom_error): assert that
2103 message has a sender
2104 (connection_execute_transaction): ditto
2105 (bus_connection_preallocate_oom_error): fix to set the sender, and
2106 set recipient to the destination service, not the bus driver
2108 * bus/policy.c: hacking
2110 * dbus/dbus-message.c (dbus_message_service_is): new function
2111 (dbus_message_sender_is): new
2113 2003-03-19 Havoc Pennington <hp@redhat.com>
2115 * bus/policy.c: start sketching code for policy restrictions on
2116 what connections can do.
2118 2003-03-18 Havoc Pennington <hp@redhat.com>
2120 * doc/TODO: some notes on high-level todo items. Little nitpick
2121 stuff is all in @todo, so no need to add it here.
2123 * doc/config-file.txt: some notes on how config file might look
2125 2003-03-18 Anders Carlsson <andersca@codefactory.se>
2131 2003-03-17 Havoc Pennington <hp@redhat.com>
2133 * dbus/dbus-internals.h: add gcc attributes so that
2134 our printf-style functions warn on bad arguments to
2137 * dbus/dbus-sysdeps.c (_dbus_connect_tcp_socket): fix printf
2140 * dbus/dbus-message.c (_dbus_message_loader_queue_messages): fix
2143 2003-03-17 Havoc Pennington <hp@redhat.com>
2145 * bus/test-main.c (main): make it print something as it runs
2146 so make check doesn't look stuck
2148 * doc/negotiation.txt, doc/dbus-sasl-profile.txt: remove
2149 from CVS, now obsolete
2151 2003-03-17 Anders Carlsson <andersca@codefactory.se>
2153 * bus/dispatch.c: (bus_dispatch):
2154 Refetch the service name since it may have been reallocated
2155 when dbus_message_set_sender was called.
2157 * dbus/dbus-sysdeps.c: (_dbus_accept):
2158 Add address and address length variables and use them to stop
2159 valgrind from complaining.
2161 2003-03-17 Havoc Pennington <hp@pobox.com>
2163 All tests pass, no memleaks, no valgrind complaints.
2165 * bus/test.c: refcount handler_slot
2167 * bus/connection.c (bus_connections_new): refcount
2168 connection_data_slot
2170 * dbus/dbus-auth-script.c (_dbus_auth_script_run): delete unused
2171 bytes so that auth scripts pass.
2173 * bus/dispatch.c: init message_handler_slot so it gets allocated
2176 * bus/dispatch.c (message_handler_slot_ref): fix memleak
2178 * dbus/dbus-server-debug-pipe.c (_dbus_server_debug_pipe_new):
2179 dealloc server_pipe_hash when no longer used for benefit of
2182 * dbus/dbus-auth.c (process_command): memleak fix
2184 * bus/dispatch.c (check_hello_message): memleak fix
2186 2003-03-16 Havoc Pennington <hp@pobox.com>
2188 * dbus/dbus-bus.c (ensure_bus_data): fix double-unref of the data slot
2190 2003-03-17 Anders Carlsson <andersca@codefactory.se>
2192 * bus/activation.c (bus_activation_activate_service): Append
2193 the pending activation entry to the list of pending activations.
2195 2003-03-16 Havoc Pennington <hp@pobox.com>
2197 * bus/dispatch.c (bus_dispatch_test): remove double-unrefs of
2200 * dbus/dbus-address.c (create_entry): fix OOM handling when
2201 failing to alloc entry->method
2203 2003-03-16 Havoc Pennington <hp@pobox.com>
2205 * dbus/dbus-watch.c (_dbus_watch_new): handle failure to malloc
2208 * dbus/dbus-server-debug-pipe.c (_dbus_transport_debug_pipe_new):
2209 add some missing dbus_set_result
2211 * bus/dispatch.c (bus_dispatch_add_connection): handle failure to
2212 alloc the DBusMessageHandler
2214 * dbus/dbus-transport.c (_dbus_transport_disconnect): don't ref
2215 the transport here, since we call this from the finalizer; it
2216 resulted in a double-finalize.
2218 * dbus/dbus-transport.c (_dbus_transport_disconnect): fix a bug
2219 where we tried to use transport->connection that was NULL,
2220 happened when transport was disconnected early on due to OOM
2222 * bus/*.c: adapt to handle OOM for watches/timeouts
2224 * dbus/dbus-transport-unix.c: port to handle OOM during
2227 * dbus/dbus-auth.c (_dbus_auth_get_unused_bytes): return a
2228 reference to unused bytes instead of a copy
2230 * dbus/dbus-server.c (dbus_server_handle_watch): return FALSE for
2233 * dbus/dbus-connection.c (dbus_connection_handle_watch): return
2236 * dbus/dbus-timeout.c (dbus_timeout_handle): return FALSE for out
2239 2003-03-16 Anders Carlsson <andersca@codefactory.se>
2241 * doc/dbus-specification.sgml:
2242 Document reply message for ActivateService.
2244 2003-03-16 Anders Carlsson <andersca@codefactory.se>
2246 * bus/activation.c: (bus_pending_activation_entry_free),
2247 (bus_pending_activation_free), (bus_activation_new),
2248 (bus_activation_unref), (bus_activation_service_created),
2249 (bus_activation_activate_service):
2251 * bus/bus.c: (bus_context_new):
2252 * bus/desktop-file.c: (new_section):
2253 * bus/driver.c: (bus_driver_send_service_deleted),
2254 (bus_driver_handle_activate_service):
2255 * bus/services.c: (bus_registry_new), (bus_registry_ensure):
2257 * dbus/dbus-connection.c:
2258 (dbus_connection_send_with_reply_and_block):
2259 * dbus/dbus-message.c: (dbus_message_append_args_valist):
2260 * dbus/dbus-protocol.h:
2261 Make activation work better. Now pending activations will be queued
2262 and the daemon won't try to activate services that are already registered.
2264 2003-03-16 Havoc Pennington <hp@pobox.com>
2266 * dbus/dbus-bus.c (ensure_bus_data): handle failure to set
2269 * dbus/dbus-memory.c (_dbus_initialize_malloc_debug): support
2270 DBUS_MALLOC_BACKTRACES to print trace when failing an alloc
2272 2003-03-16 Havoc Pennington <hp@pobox.com>
2274 * dbus/dbus-string.c (_dbus_string_validate_utf8): oops, unbreak
2275 this. always run the test suite before commit...
2277 * bus/*: adapt to DBusConnection API changes
2279 * glib/dbus-gmain.c: adapt to DBusConnection API changes,
2280 requires renaming stuff to avoid dbus_connection_dispatch name
2283 * dbus/dbus-transport.c (_dbus_transport_queue_messages): new
2286 * dbus/dbus-message.c (_dbus_message_loader_queue_messages):
2287 separate from _dbus_message_loader_return_buffer()
2289 * dbus/dbus-connection.c (dbus_connection_get_n_messages): remove
2290 this, because it's now always broken to use; the number of
2291 messages in queue vs. the number still buffered by the message
2292 loader is undefined/meaningless. Should use
2293 dbus_connection_get_dispatch_state().
2294 (dbus_connection_dispatch): rename from
2295 dbus_connection_dispatch_message
2297 2003-03-16 Havoc Pennington <hp@pobox.com>
2299 * dbus/dbus-string.c (_dbus_string_validate_utf8): copy in a real
2302 2003-03-16 Anders Carlsson <andersca@codefactory.se>
2304 * dbus/dbus-connection.c:
2305 (dbus_connection_send_with_reply_and_block):
2306 Decrease connection->n_incoming when removing an entry
2308 * dbus/dbus-dict.c: (dbus_dict_entry_free),
2309 (dbus_dict_set_boolean_array), (dbus_dict_set_int32_array),
2310 (dbus_dict_set_uint32_array), (dbus_dict_set_double_array),
2311 (dbus_dict_set_byte_array), (dbus_dict_set_string_array),
2312 (dbus_dict_get_boolean_array), (dbus_dict_get_double_array),
2313 (dbus_dict_get_byte_array):
2314 Handle NULL arrays and strings. Also add support for byte arrays.
2316 * dbus/dbus-marshal.c: (_dbus_marshal_byte_array),
2317 (_dbus_marshal_dict), (_dbus_demarshal_byte_array),
2318 (_dbus_demarshal_int32_array), (_dbus_demarshal_uint32_array),
2319 (_dbus_demarshal_double_array), (_dbus_demarshal_string_array),
2320 (_dbus_demarshal_dict), (demarshal_and_validate_len),
2321 (_dbus_marshal_validate_arg), (_dbus_marshal_test):
2322 * dbus/dbus-marshal.h:
2323 Add support for marshalling and demarshalling empty arrays and strings.
2325 * dbus/dbus-message.c: (dbus_message_append_args_valist),
2326 (dbus_message_append_string_array),
2327 (dbus_message_iter_get_boolean),
2328 (dbus_message_iter_get_boolean_array),
2329 (dbus_message_iter_get_int32_array),
2330 (dbus_message_iter_get_uint32_array),
2331 (dbus_message_iter_get_double_array),
2332 (dbus_message_iter_get_byte_array),
2333 (dbus_message_iter_get_string_array), (dbus_message_iter_get_dict),
2334 (check_message_handling):
2335 Add support for getting empty arrays and dicts.
2337 * dbus/dbus-string.c: (_dbus_string_validate_utf8):
2338 Don't do any validation at all for now, that's better than just checking
2341 * test/data/valid-messages/emptiness.message:
2342 New test message with lots of empty arrays.
2344 2003-03-16 Havoc Pennington <hp@pobox.com>
2346 * dbus/dbus-connection.c
2347 (_dbus_connection_queue_received_message_link): new function that
2348 can't fail due to OOM
2350 * dbus/dbus-message.c (_dbus_message_loader_pop_message_link):
2351 new function pops a message together with a list link
2354 * dbus/dbus-transport-unix.c (queue_messages): use new link-based
2355 message queuing functions to avoid needing to alloc memory
2357 2003-03-16 Havoc Pennington <hp@pobox.com>
2359 Oops - test code was only testing failure of around 30 of the
2360 mallocs in the test path, but it turns out there are 500+
2361 mallocs. I believe this was due to misguided linking setup such
2362 that there was one copy of dbus_malloc etc. in the daemon and one
2363 in the shared lib, and only daemon mallocs were tested. In any
2364 case, the test case now tests all 500+ mallocs, and doesn't pass
2365 yet, though there are lots of fixes in this patch.
2367 * dbus/dbus-connection.c (dbus_connection_dispatch_message): fix
2368 this so that it doesn't need to allocate memory, since it
2369 has no way of indicating failure due to OOM (and would be
2370 annoying if it did).
2372 * dbus/dbus-list.c (_dbus_list_pop_first_link): new function
2374 * bus/Makefile.am: rearrange to create two self-contained
2375 libraries, to avoid having libraries with overlapping symbols.
2376 that was resulting in weirdness, e.g. I'm pretty sure there
2377 were two copies of global static variables.
2379 * dbus/dbus-internals.c: move the malloc debug stuff to
2382 * dbus/dbus-list.c (free_link): free list mempool if it becomes
2385 * dbus/dbus-memory.c (_dbus_disable_mem_pools): new function
2387 * dbus/dbus-address.c (dbus_parse_address): free list nodes
2390 * bus/dispatch.c (bus_dispatch_add_connection): free
2391 message_handler_slot when no longer using it, so
2392 memory leak checkers are happy for the test suite.
2394 * dbus/dbus-server-debug-pipe.c (debug_finalize): free server name
2396 * bus/bus.c (new_connection_callback): disconnect in here if
2397 bus_connections_setup_connection fails.
2399 * bus/connection.c (bus_connections_unref): fix to free the
2401 (bus_connections_setup_connection): if this fails, don't
2402 disconnect the connection, just be sure there are no side
2405 * dbus/dbus-string.c (undo_alignment): unbreak this
2407 * dbus/dbus-auth.c (_dbus_auth_unref): free some stuff we were
2409 (_dbus_auth_new): fix the order in which we free strings
2412 * bus/connection.c (bus_connection_disconnected): fix to
2413 not send ServiceDeleted multiple times in case of memory
2416 * dbus/dbus-bus.c (dbus_bus_get_base_service): new function to
2417 get the base service name
2418 (dbus_bus_register_client): don't return base service name,
2419 instead store it on the DBusConnection and have an accessor
2421 (dbus_bus_register_client): rename dbus_bus_register()
2423 * bus/dispatch.c (check_hello_message): verify that other
2424 connections on the bus also got the correct results, not
2425 just the one sending hello
2427 2003-03-15 Havoc Pennington <hp@pobox.com>
2429 Make it pass the Hello handling test including all OOM codepaths.
2430 Now to do other messages...
2432 * bus/services.c (bus_service_remove_owner): fix crash when
2433 removing owner from an empty list of owners
2434 (bus_registry_ensure): don't leave service in the list of
2435 a connection's owned services if we fail to put the service
2438 * bus/connection.c (bus_connection_preallocate_oom_error): set
2439 error flag on the OOM error.
2441 * dbus/dbus-connection.c (_dbus_connection_new_for_transport):
2442 handle _dbus_transport_set_connection failure
2444 * dbus/dbus-transport-unix.c (_dbus_transport_new_for_fd): modify
2445 to create watches up front and simply enable/disable them as
2447 (unix_connection_set): this can now fail on OOM
2449 * dbus/dbus-timeout.c, dbus/dbus-watch.c: add concept
2450 of enabling/disabling a watch or timeout.
2452 * bus/loop.c (bus_loop_iterate): don't touch disabled
2455 * glib/dbus-gmain.c: adapt to enable/disable watches and timeouts
2457 2003-03-15 Havoc Pennington <hp@pobox.com>
2459 * bus/dispatch.c (bus_dispatch_test): OK, now finally actually
2460 write useful test code, after all that futzing around ;-)
2462 Test does not yet pass because we can't handle OOM in
2463 _dbus_transport_messages_pending (basically,
2464 dbus_connection_preallocate_send() does not prealloc the write
2465 watch). To fix this, I think we need to add new stuff to
2466 set_watch_functions, namely a SetEnabled function so we can alloc
2467 the watch earlier, then enable it later.
2469 * dbus/Makefile.am (libdbus_convenience_la_SOURCES): move
2470 dbus-memory.c to the convenience lib
2472 * bus/test.c: rename some static functions to keep them clearly
2473 distinct from stuff in connection.c. Handle client disconnection.
2475 2003-03-14 Havoc Pennington <hp@pobox.com>
2477 * bus/dispatch.c (bus_dispatch_test): do test using debug-pipe
2478 transport, tests more of the real codepath. Set up clients
2479 with bus_setup_debug_client.
2481 * bus/test.c (bus_setup_debug_client): function to set up debug
2482 "clients" on the main loop
2484 * dbus/dbus-transport.c (_dbus_transport_open): add debug-pipe
2487 * dbus/dbus-server.c (dbus_server_listen): add debug-pipe
2490 * dbus/dbus-server-debug.c: support a debug server based on pipes
2492 * dbus/dbus-sysdeps.c (_dbus_full_duplex_pipe): new function
2493 (_dbus_close): new function
2495 * configure.in: check for socketpair
2497 2003-03-14 Havoc Pennington <hp@redhat.com>
2499 * dbus/dbus-memory.c: add a "detect buffer overwrites on free"
2502 * dbus/dbus-transport-debug.c: rework this a good bit to be
2503 less complicated. hopefully still works.
2505 * dbus/dbus-server-debug.c (handle_new_client): remove timeout
2508 * glib/dbus-gmain.c (timeout_handler): don't remove timeout
2511 * dbus/dbus-message.c (dbus_message_copy): rename from
2512 dbus_message_new_from_message, fix it up to copy
2513 all the message fields, add test case
2515 * bus/dispatch.c (bus_dispatch_test): add some more test code,
2516 not quite passing yet
2518 2003-03-14 Havoc Pennington <hp@pobox.com>
2520 * bus/loop.c (bus_loop_iterate): add this so we can "run loop
2521 until no work remains" in test code. (the large diff here
2522 is just code movement, no actual changes)
2524 * dbus/dbus-server-debug.c (DEFAULT_INTERVAL): change interval to
2525 1, no point waiting around for test code.
2526 (_dbus_server_debug_accept_transport): unref the timeout
2527 after adding it (right?)
2529 * dbus/dbus-transport-debug.c (DEFAULT_INTERVAL): ditto
2531 2003-03-13 Havoc Pennington <hp@redhat.com>
2533 * dbus/dbus-timeout.c (_dbus_timeout_list_set_functions): handle
2536 * dbus/dbus-watch.c (_dbus_watch_list_set_functions): handle out
2539 * dbus/dbus-connection.h: Make AddWatchFunction and
2540 AddTimeoutFunction return a bool so they can fail on out-of-memory
2542 * bus/bus.c (bus_context_new): set up timeout handlers
2544 * bus/connection.c (bus_connections_setup_connection): set up
2547 * glib/dbus-gmain.c: adapt to the fact that set_functions stuff
2550 * bus/bus.c (bus_context_new): adapt to changes
2552 * bus/connection.c: adapt to changes
2554 * test/watch.c: adapt to DBusWatch changes
2556 * bus/dispatch.c (bus_dispatch_test): started adding this but
2559 2003-03-14 Anders Carlsson <andersca@codefactory.se>
2561 * bus/dispatch.c (send_service_nonexistent_error): Fix typo.
2563 2003-03-13 Havoc Pennington <hp@pobox.com>
2565 * bus/test.c, bus/test.h, bus/Makefile.am, bus/test-main.c:
2566 set up a test framework as for the library
2568 2003-03-12 Havoc Pennington <hp@pobox.com>
2570 Throughout: purge global variables, introduce BusActivation,
2571 BusConnections, BusRegistry, etc. objects instead.
2573 * bus/bus.h, bus/bus.c: introduce BusContext as a global
2576 * test/Makefile.am (TEST_BINARIES): disable bus-test for now,
2577 going to redo this a bit differently I think
2579 2003-03-12 Havoc Pennington <hp@redhat.com>
2581 Mega-patch that gets the message bus daemon initially handling
2582 out-of-memory. Work still needed. Also lots of random
2583 moving stuff to DBusError instead of ResultCode.
2585 * dbus/dbus-list.c (_dbus_list_length_is_one): new function
2587 * dbus/dbus-connection.c
2588 (dbus_connection_send_with_reply_and_block): use DBusError
2590 * dbus/dbus-bus.c: adapt to API changes, make it use DBusError not
2593 * dbus/dbus-connection.c (dbus_connection_send): drop the result
2594 code here, as the only failure possible is OOM.
2596 * bus/connection.c (bus_connection_disconnect):
2597 rename bus_connection_disconnected as it's a notification only
2599 * bus/driver.c (bus_driver_handle_acquire_service): don't free
2600 "name" on get_args failure, should be done by get_args;
2601 don't disconnect client for bad args, just return an error.
2602 (bus_driver_handle_service_exists): ditto
2604 * bus/services.c (bus_services_list): NULL-terminate returned array
2606 * bus/driver.c (bus_driver_send_service_lost)
2607 (bus_driver_send_service_acquired): send messages from driver to a
2608 specific client to the client's unique name, not to the broadcast
2611 * dbus/dbus-message.c (decode_header_data): reject messages that
2612 contain no name field
2613 (_dbus_message_get_client_serial): rename to
2614 dbus_message_get_serial and make public
2615 (_dbus_message_set_serial): rename from set_client_serial
2616 (_dbus_message_set_reply_serial): make public
2617 (_dbus_message_get_reply_serial): make public
2619 * bus/connection.c (bus_connection_foreach): allow stopping
2620 iteration by returning FALSE from foreach function.
2622 * dbus/dbus-connection.c (dbus_connection_send_preallocated)
2623 (dbus_connection_free_preallocated_send)
2624 (dbus_connection_preallocate_send): new API for sending a message
2625 without possibility of malloc failure.
2626 (dbus_connection_send_message): rename to just
2627 dbus_connection_send (and same for whole function family)
2629 * dbus/dbus-errors.c (dbus_error_free): make this reinit the error
2631 * dbus/dbus-sysdeps.c (_dbus_exit): new function
2633 * bus/activation.c: handle/return errors
2635 * dbus/dbus-errors.h: add more DBUS_ERROR #define
2637 * dbus/dbus-sysdeps.c (_dbus_directory_open) (_dbus_file_get_contents)
2638 (_dbus_directory_get_next_file): use DBusError instead of DBusResultCode
2639 (_dbus_result_from_errno): move to this file
2641 2003-03-10 Anders Carlsson <andersca@codefactory.se>
2643 * dbus/dbus-marshal.c:
2644 (_dbus_marshal_set_string):
2645 Take a length argument so we can marshal the correct string
2648 (_dbus_marshal_dict), (_dbus_demarshal_dict),
2649 (_dbus_marshal_get_arg_end_pos), (_dbus_marshal_validate_arg),
2650 (_dbus_marshal_test):
2651 * dbus/dbus-marshal.h:
2652 Add support for marshalling and demarshalling dicts.
2654 * dbus/dbus-message-builder.c: (_dbus_message_data_load):
2655 Add support for TYPE DICT.
2657 * dbus/dbus-message.c: (set_string_field):
2658 Adjust header padding.
2660 (dbus_message_append_args_valist), (dbus_message_append_dict),
2661 (dbus_message_get_args_valist), (dbus_message_iter_get_arg_type),
2662 (dbus_message_iter_get_dict), (_dbus_message_loader_return_buffer),
2663 (check_message_handling), (check_have_valid_message):
2664 * dbus/dbus-message.h:
2665 Add functions for setting and getting dicts.
2667 * dbus/dbus-protocol.h:
2673 * doc/dbus-specification.sgml:
2674 Add information about how dicts are marshalled.
2676 * test/data/invalid-messages/dict-with-nil-value.message:
2677 * test/data/invalid-messages/too-short-dict.message:
2678 * test/data/valid-messages/dict-simple.message:
2679 * test/data/valid-messages/dict.message:
2680 Add sample messages containing dicts.
2682 2003-03-08 Anders Carlsson <andersca@codefactory.se>
2684 * dbus/dbus-dict.h: Add DBUS_END_DECLS.
2686 2003-03-07 Anders Carlsson <andersca@codefactory.se>
2689 * dbus/dbus-dict.c: (dbus_dict_entry_free), (dbus_dict_new),
2690 (dbus_dict_get_keys), (insert_entry), (dbus_dict_set_boolean),
2691 (dbus_dict_set_int32), (dbus_dict_set_uint32),
2692 (dbus_dict_set_double), (dbus_dict_set_string),
2693 (dbus_dict_set_boolean_array), (dbus_dict_set_int32_array),
2694 (dbus_dict_set_uint32_array), (dbus_dict_set_double_array),
2695 (dbus_dict_set_string_array), (_dbus_dict_test):
2697 Fix according to comments from Havoc.
2699 2003-03-06 Michael Meeks <michael@server.home>
2701 * configure.in: if we don't have kde-config, disable have_qt.
2703 2003-03-07 Anders Carlsson <andersca@codefactory.se>
2708 * dbus/dbus-dict.c: (dbus_dict_entry_free), (dbus_dict_new),
2709 (dbus_dict_ref), (dbus_dict_unref), (dbus_dict_contains),
2710 (dbus_dict_remove), (dbus_dict_get_value_type),
2711 (dbus_dict_get_keys), (dbus_dict_put_boolean),
2712 (dbus_dict_put_int32), (dbus_dict_put_uint32),
2713 (dbus_dict_put_double), (dbus_dict_put_string),
2714 (dbus_dict_put_boolean_array), (dbus_dict_put_int32_array),
2715 (dbus_dict_put_uint32_array), (dbus_dict_put_double_array),
2716 (dbus_dict_put_string_array), (dbus_dict_get_boolean),
2717 (dbus_dict_get_int32), (dbus_dict_get_uint32),
2718 (dbus_dict_get_double), (dbus_dict_get_string),
2719 (dbus_dict_get_boolean_array), (dbus_dict_get_int32_array),
2720 (dbus_dict_get_uint32_array), (dbus_dict_get_double_array),
2721 (dbus_dict_get_string_array), (_dbus_dict_test):
2723 Add DBusDict implementation
2725 * dbus/dbus-test.c: (dbus_internal_do_not_use_run_tests):
2729 2003-03-04 Havoc Pennington <hp@pobox.com>
2731 * test/data/auth/*: adapt to changes
2733 * dbus/dbus-auth-script.c (_dbus_auth_script_run): add
2734 USERID_BASE64 and change USERNAME_BASE64 to put in username not
2737 * dbus/dbus-keyring.c (_dbus_keyring_validate_context): prevent
2738 more stuff from being in a context name, to make the protocol
2739 simpler to deal with
2741 * dbus/dbus-errors.c (dbus_error_has_name): new function
2742 (dbus_error_is_set): new function
2744 * dbus/dbus-auth.c: replace DBUS_STUPID_TEST_MECH auth
2745 with DBUS_COOKIE_SHA1, implement DBUS_COOKIE_SHA1
2747 * dbus/dbus-connection.c (dbus_connection_flush): also read
2748 messages during a flush operation
2750 * dbus/Makefile.am: remove dbus-md5 since it isn't currently used.
2752 2003-03-05 Anders Carlsson <andersca@codefactory.se>
2754 * configure.in: Check for gethostbyname on Solaris.
2756 * dbus/dbus-transport.c: (_dbus_transport_open):
2757 Remove duplicate "tcp" entry.
2759 * doc/dbus-specification.sgml:
2760 Clarify some things.
2762 2003-03-05 Anders Carlsson <andersca@codefactory.se>
2764 * dbus/dbus-auth.c: (send_rejected), (process_test_subdir):
2765 * dbus/dbus-keyring.c: (_dbus_keyring_new_homedir),
2766 (_dbus_keyring_test):
2767 * dbus/dbus-md5.c: (_dbus_md5_compute):
2768 * dbus/dbus-sha.c: (_dbus_sha_compute):
2771 2003-03-05 Anders Carlsson <andersca@codefactory.se>
2773 * README: Add some things.
2775 2003-03-04 Anders Carlsson <andersca@codefactory.se>
2777 * dbus/dbus-message.c (dbus_message_append_args_valist): Add a break;
2778 after case DBUS_TYPE_BOOELAN.
2780 2003-03-02 Havoc Pennington <hp@pobox.com>
2782 * test/break-loader.c (randomly_set_extreme_ints): add test that
2783 sets really huge and small integers
2785 * dbus/dbus-marshal.c (_dbus_marshal_validate_arg): add check
2786 that length of boolean array fits in the string, and that
2787 string has room for boolean value in single-bool case.
2789 * dbus/dbus-message-builder.c (_dbus_message_data_load): add
2790 optional value to "ALIGN" command which is what to fill the
2793 * test/data/valid-messages/no-padding.message: add regression
2794 test for the message padding problem
2796 2003-03-02 Havoc Pennington <hp@pobox.com>
2798 * dbus/dbus-message.c (decode_header_data): fix to always init
2799 message_padding, from Benjamin Dauvergne
2801 2003-03-02 Havoc Pennington <hp@pobox.com>
2807 2003-03-01 Joe Shaw <joe@assbarn.com>
2809 * configure.in: Check for "struct cmsgcred" and try to access its
2810 members for BSD-like unices.
2812 * dbus/dbus-sysdeps.c (read_credentials_byte): Fold this back into
2813 _dbus_read_credentials_unix_socket().
2814 (_dbus_read_credentials_unix_socket): Use recvmsg() instead of
2815 read() for reading the credential byte off the unix socket. Use
2816 struct cmsgcred on systems that support it.
2818 2003-02-27 Alexander Larsson <alexl@redhat.com>
2822 Make gthreads-2.0 dependency optional. Don't build thread test if
2825 2003-02-27 Havoc Pennington <hp@pobox.com>
2827 * dbus/dbus-connection.c
2828 (dbus_connection_send_message_with_reply_and_block): fix doh!
2829 doh! doh! bug that resulted in never removing a reply from the
2830 queue, no wonder we called get_reply_serial so much ;-)
2832 * dbus/dbus-message.c (struct DBusMessage): cache reply serial
2833 and client serial instead of demarshaling them every time
2835 2003-02-27 Havoc Pennington <hp@pobox.com>
2837 * dbus/dbus-marshal.c (_dbus_demarshal_int32): rewrite to be much
2838 more inlined, using dbus-string-private.h, speeds things up
2841 * dbus/dbus-string.c (_dbus_string_free): apply align offset
2842 when freeing the string
2843 (_dbus_string_steal_data): fix for align offset
2844 (undo_alignment): new function
2846 2003-02-26 Havoc Pennington <hp@redhat.com>
2848 All kinds of audit fixes from Owen, plus initial attempt to
2849 handle unaligned memory returned from malloc.
2851 * dbus/dbus-string.c (_dbus_string_init): clamp max length to
2852 leave room for align_offset and nul byte
2853 (fixup_alignment): function to track an align_offset and
2854 ensure real->str is aligned
2855 (DBUS_GENERIC_STRING_PREAMBLE): len must be less than allocated,
2856 to allow a nul byte plus align offset
2857 (_dbus_string_lock): fix overflow issue
2858 (_dbus_string_init_const_len): add assertions on sanity of len,
2859 assign allocated to be ALLOCATION_PADDING larger than len
2860 (set_length): fixup the overflow handling
2861 (_dbus_string_get_data_len): fix overflow in assertion
2862 (open_gap): detect overflow in size of gap to be opened
2863 (_dbus_string_lengthen): add overflow check
2864 (_dbus_string_align_length): fix overflow with _DBUS_ALIGN_VALUE
2865 (_dbus_string_append): add overflow check
2866 (_dbus_string_append_unichar): overflow
2867 (_dbus_string_delete): fix overflow in assertion
2868 (_dbus_string_copy_len): overflow in assertion
2869 (_dbus_string_replace_len): overflows in assertions
2870 (_dbus_string_find): change to implement in terms of
2871 _dbus_string_find_to
2872 (_dbus_string_find_to): assorted fixage
2873 (_dbus_string_equal_c_str): assert c_str != NULL,
2874 fix logic so the function works
2875 (_dbus_string_ends_with_c_str): fix overflow thingy
2876 (_dbus_string_base64_encode): overflow fix
2877 (_dbus_string_validate_ascii): overflow
2878 (_dbus_string_validate_nul): overflow
2880 2003-02-26 Havoc Pennington <hp@redhat.com>
2882 * dbus/dbus-marshal.c (_dbus_marshal_test): fix to work with DISABLE_ASSERTS
2884 2003-02-26 Alexander Larsson <alexl@redhat.com>
2887 Set DBUS_GLIB_THREADS_LIBS for apps using gthread-2.0
2889 * dbus/dbus-connection.c:
2890 * dbus/dbus-connection.h:
2891 Fix _dbus_connection_acquire_io_path and _dbus_connection_acquire_dispatch.
2892 Add dbus_connection_set_wakeup_main_function and use it when queueing
2893 incoming and outgoing messages.
2896 * dbus/dbus-dataslot.c:
2897 Threadsafe usage of DBusDataSlotAllocator
2899 * dbus/dbus-message.c: (dbus_message_get_args_iter):
2902 * dbus/dbus-server-unix.c:
2905 * glib/dbus-gmain.c:
2906 Implement the new wakeup functions for glib.
2909 * glib/test-thread-client.c:
2910 * glib/test-thread-server.c:
2911 * glib/test-thread.h:
2912 Initial cut at some thread test code. Not really done yet.
2914 2003-02-26 Havoc Pennington <hp@pobox.com>
2916 * dbus/dbus-connection.c
2917 (dbus_connection_send_message_with_reply_and_block): fix crash
2918 where we ref'd the outgoing message instead of the returned reply
2920 * dbus/dbus-transport-unix.c (do_authentication): check read watch
2921 at the end of this function, so if we didn't need to read for
2922 authentication, we reinstall it for receiving messages
2924 * dbus/dbus-message.c (dbus_message_new_reply): allow replies to
2925 a NULL sender for peer-to-peer case
2927 * dbus/dbus-transport-unix.c (check_read_watch): handle
2928 !authenticated case correctly
2930 * glib/dbus-gmain.c: add support for DBusServer
2932 * dbus/dbus-server.c: add data slot support
2934 * glib/dbus-gmain.c (dbus_connection_setup_with_g_main): check
2935 return values and handle errors
2937 * dbus/dbus-dataslot.c: factor out the data slot stuff from
2940 * Doxyfile.in (INPUT): add glib subdir
2942 * glib/dbus-gmain.c (dbus_connection_setup_with_g_main): rename
2943 setup_with_g_main instead of hookup_with_g_main; write docs
2945 2003-02-24 Anders Carlsson <andersca@codefactory.se>
2947 * dbus/dbus-marshal.c: (_dbus_marshal_validate_arg):
2948 * dbus/dbus-message-builder.c: (_dbus_message_data_load):
2949 * dbus/dbus-message.c: (dbus_message_append_boolean),
2950 (dbus_message_append_boolean_array),
2951 (dbus_message_get_args_valist), (_dbus_message_test):
2952 * dbus/dbus-message.h:
2953 * doc/dbus-specification.sgml:
2954 Various fixes as pointed out by Havoc.
2956 * test/data/invalid-messages/bad-boolean-array.message:
2957 * test/data/invalid-messages/bad-boolean.message:
2958 Add invalid boolean value test cases.
2960 2003-02-24 Anders Carlsson <andersca@codefactory.se>
2962 * dbus/dbus-internals.c: (_dbus_type_to_string):
2963 * dbus/dbus-marshal.c: (_dbus_marshal_get_arg_end_pos),
2964 (_dbus_marshal_validate_arg):
2965 * dbus/dbus-message-builder.c: (_dbus_message_data_load):
2966 * dbus/dbus-message.c: (dbus_message_append_args_valist),
2967 (dbus_message_append_boolean), (dbus_message_append_boolean_array),
2968 (dbus_message_get_args_valist), (dbus_message_iter_get_boolean),
2969 (dbus_message_iter_get_int32), (dbus_message_iter_get_uint32),
2970 (dbus_message_iter_get_double),
2971 (dbus_message_iter_get_boolean_array), (message_iter_test):
2972 * dbus/dbus-message.h:
2973 * dbus/dbus-protocol.h:
2974 * doc/dbus-specification.sgml:
2975 * test/data/valid-messages/lots-of-arguments.message:
2976 Add support for boolean and boolean array types.
2978 2003-02-23 Havoc Pennington <hp@pobox.com>
2980 * dbus/dbus-keyring.c: finish most of this implementation and
2983 * dbus/dbus-errors.c (dbus_set_error_const, dbus_set_error): make
2984 these barf if the error isn't cleared to NULL
2986 * dbus/dbus-sysdeps.c (_dbus_delete_file): set error on failure
2987 (_dbus_create_directory): new function
2989 * dbus/dbus-errors.c (dbus_set_error): fix warning
2991 * dbus/dbus-string.c (_dbus_string_hex_encode): new function
2992 (_dbus_string_hex_decode): new function
2993 (test_hex_roundtrip): test code
2995 * dbus/dbus-sha.c (_dbus_sha_compute): use dbus_string_hex_encode
2997 * dbus/dbus-md5.c (_dbus_md5_compute): use dbus_string_hex_encode
2999 * dbus/dbus-sysdeps.c (_dbus_string_save_to_file): make this use
3000 the save-to-temp/rename trick to atomically write the new file
3001 (_dbus_string_parse_uint): new function
3003 2003-02-22 Havoc Pennington <hp@pobox.com>
3005 * test/Makefile.am (dist-hook): fix dist for test/data/sha-1
3007 2003-02-22 Havoc Pennington <hp@pobox.com>
3009 * dbus/dbus-message.c (dbus_message_iter_get_string_array):
3010 (dbus_message_iter_get_byte_array): Fix up doxygen warnings
3012 * dbus/dbus-sha.c: add implementation of SHA-1 algorithm
3014 * dbus/test/data/sha-1: add US government test suite for SHA-1
3016 2003-02-21 Anders Carlsson <andersca@codefactory.se>
3018 * dbus/dbus-marshal.c: (_dbus_demarshal_string_array):
3019 Make string arrays NULL-terminated.
3021 * dbus/dbus-memory.c: (dbus_free_string_array):
3022 * dbus/dbus-memory.h:
3023 New function for freeing NULL-terminated string arrays.
3025 * dbus/dbus-message-builder.c: (append_quoted_string),
3026 (_dbus_message_data_load):
3027 Add support for array types.
3029 * dbus/dbus-message.c: (check_message_handling):
3030 Add more types as test cases.
3032 * dbus/dbus-sysdeps.c: (_dbus_string_parse_int),
3033 (_dbus_string_parse_double):
3034 Add the start offset to the end offset.
3036 * test/data/valid-messages/lots-of-arguments.message:
3037 New test message with lots of arguments.
3039 2003-02-21 Anders Carlsson <andersca@codefactory.se>
3041 * dbus/dbus-message.c: (dbus_message_append_nil),
3042 (dbus_message_append_int32), (dbus_message_append_uint32),
3043 (dbus_message_append_double), (dbus_message_append_string),
3044 (dbus_message_append_int32_array),
3045 (dbus_message_append_uint32_array),
3046 (dbus_message_append_double_array),
3047 (dbus_message_append_byte_array),
3048 (dbus_message_append_string_array):
3049 Fix all out-of-memory handling in these functions.
3051 2003-02-21 Anders Carlsson <andersca@codefactory.se>
3053 * dbus/dbus-message.c: (dbus_message_append_nil):
3056 2003-02-21 Anders Carlsson <andersca@codefactory.se>
3058 * dbus/dbus-message.c: (dbus_message_append_args_valist),
3059 (dbus_message_append_nil), (dbus_message_append_int32_array),
3060 (dbus_message_append_uint32_array),
3061 (dbus_message_append_double_array),
3062 (dbus_message_append_byte_array),
3063 (dbus_message_append_string_array), (dbus_message_get_args_valist),
3064 (dbus_message_iter_get_int32_array),
3065 (dbus_message_iter_get_uint32_array),
3066 (dbus_message_iter_get_double_array),
3067 (dbus_message_iter_get_byte_array),
3068 (dbus_message_iter_get_string_array):
3070 * dbus/dbus-message.h:
3071 Add functions for appending and getting arrays.
3073 2003-02-21 Anders Carlsson <andersca@codefactory.se>
3075 * dbus/dbus-mempool.c (_dbus_mem_pool_new): Make the
3076 element size at least 8 bytes, fixes mempool tests on
3079 2003-02-20 Alexander Larsson <alexl@redhat.com>
3081 * dbus/dbus-transport-unix.c (unix_do_iteration):
3082 Unlock the connection mutex during a blocking select call.
3083 Add todo about how we need a way to wake up the select.
3085 * dbus/dbus-connection-internal.h:
3086 * dbus/dbus-connection.c:
3087 Add _dbus_connection_lock and _dbus_connection_unlock.
3089 2003-02-19 Havoc Pennington <hp@pobox.com>
3091 * Doxyfile.in (PREDEFINED): put DOXYGEN_SHOULD_SKIP_THIS in
3092 Doxyfile.in, not Doxyfile
3094 * dbus/dbus-keyring.c: do some hacking on this
3096 * dbus/dbus-sysdeps.c (_dbus_delete_file): new
3098 * dbus/dbus-errors.c (dbus_set_error_const): do not call
3100 (dbus_set_error): remove dbus_error_init, check for message ==
3101 NULL *before* we sprintf into it, and add @todo about including
3102 system headers in this file
3104 * dbus/dbus-sysdeps.c (_dbus_create_file_exclusively): new
3106 * dbus/dbus-errors.h (DBUS_ERROR_FAILED): add
3108 * dbus/dbus-sysdeps.c (get_user_info): break this function out to
3109 get various bits of user information based on either username
3111 (_dbus_homedir_from_username): new function
3113 2003-02-19 Anders Carlsson <andersca@codefactory.se>
3116 Add check for nonposix getpwnam_r
3118 * dbus/dbus-mempool.c: (_dbus_mem_pool_new):
3119 Align the pool element size to a sizeof (void *) boundary.
3121 * dbus/dbus-sysdeps.c: (_dbus_setenv), (_dbus_connect_unix_socket),
3122 (_dbus_listen_unix_socket), (_dbus_credentials_from_username):
3123 General Solaris fixes.
3125 * test/data/valid-messages/simplest-manual.message:
3126 Explicitly state that we want little-endian packing.
3128 2003-02-19 Mikael Hallendal <micke@codefactory.se>
3130 * dbus/dbus-server.c (dbus_server_listen): Support tcp: addresses.
3132 * dbus/dbus-transport-unix.c (_dbus_transport_new_for_tcp_socket):
3133 Added to create a transport connecting using a tcp/ip socket.
3135 * dbus/dbus-sysdeps.c (_dbus_connect_tcp_socket): Added to connect
3136 to a tcp socket at given host and port.
3137 (_dbus_listen_tcp_socket): added to listen on tcp socket for given
3140 * dbus/dbus-server.c (dbus_server_listen): Support tcp: addresses.
3142 * dbus/dbus-server-unix.c (_dbus_server_new_for_tcp_socket):
3143 Added to create a server listening on a TCP/IP socket.
3145 2003-02-19 Havoc Pennington <hp@pobox.com>
3147 Throughout: mop up all the Doxygen warnings and undocumented
3150 * dbus/dbus-sysdeps.c (do_exec): do not use execvp, we don't want
3151 to search any paths.
3153 * dbus/dbus-threads.c: move global mutex initializers to
3154 dbus-internals.h, multiple prototypes was confusing doxygen
3155 besides being kind of ugly
3157 * Doxyfile (PREDEFINED): have Doxygen define
3158 DOXYGEN_SHOULD_SKIP_THIS so we can exclude things from
3159 docs with #ifndef DOXYGEN_SHOULD_SKIP_THIS
3160 (do not abuse the feature! it's for stuff like the autogenerated
3161 macros in dbus-md5.c, not just for things you don't feel like
3164 2003-02-18 Havoc Pennington <hp@pobox.com>
3166 * dbus/dbus-string.c (_dbus_string_zero): new function
3168 * dbus/dbus-md5.c: include MD5 implementation by L. Peter Deutsch,
3169 wrap it in some dbus-friendly API
3171 * dbus/dbus-types.h: add 16-bit types
3173 2003-02-18 Joe Shaw <joe@assbarn.com>
3175 * dbus/dbus-auth.c (handle_server_data_stupid_test_mech): Just get
3176 credentials from our currently running process.
3177 (get_word): Fix a buglet where we were copying the entire length
3178 instead of relative to our position.
3180 * dbus/dbus-hash.c (_dbus_hash_test): Don't try to allocate the
3181 keys on the stack... it's 640k of data.
3183 * dbus/dbus-sysdeps.c (_dbus_read_credentials_unix_socket): Always
3184 read the credentials byte off the socket, even if we don't have
3186 (_dbus_poll): Implement poll() using select() for systems which
3189 * glib/test-dbus-glib.c (main): Print out an error if no
3190 parameters are given.
3192 * test/data/auth/fallback.auth-script: Added. Tests that a client
3193 can fallback to a secondary auth mechanism if the first fails.
3195 2003-02-18 Havoc Pennington <hp@pobox.com>
3199 2003-02-17 Havoc Pennington <hp@pobox.com>
3201 * doc/dbus-specification.sgml: lots of cosmetic
3202 cleanups/rearrangement, add assorted FIXME, change DBUS_ADDRESS
3203 env variable to DBUS_BUS_ADDRESS, s/client/application/,
3204 s/server/bus/ (except in authentication section). Add a section
3205 "Message Bus Message Routing"
3207 2003-02-17 Anders Carlsson <andersca@codefactory.se.>
3213 2003-02-17 Anders Carlsson <andersca@codefactory.se>
3215 * doc/dbus-specification.sgml:
3216 Specification updates.
3218 2003-02-17 Anders Carlsson <andersca@codefactory.se>
3220 * bus/activation.c: (bus_activation_init), (child_setup),
3221 (bus_activation_activate_service):
3223 * bus/main.c: (main):
3224 Set DBUS_ADDRESS environment variable.
3226 * dbus/dbus-errors.c: (dbus_set_error):
3227 Don't use va_copy since that's a C99 feature.
3229 * dbus/dbus-sysdeps.c: (_dbus_setenv), (do_exec),
3230 (_dbus_spawn_async):
3231 * dbus/dbus-sysdeps.h:
3232 Add child_setup_func to _dbus_spawn_async.
3234 * doc/dbus-specification.sgml:
3235 Update specification.
3237 * test/spawn-test.c: (setup_func), (main):
3240 2003-02-17 Alexander Larsson <alexl@redhat.com>
3242 * dbus/dbus-connection.c (_dbus_connection_handler_destroyed_locked):
3245 2003-02-17 Anders Carlsson <andersca@codefactory.se>
3249 * doc/dbus-test-plan.sgml:
3250 Add test plan document.
3255 2003-02-17 Anders Carlsson <andersca@codefactory.se>
3257 * dbus/dbus-message.c: (decode_header_data),
3258 (_dbus_message_loader_return_buffer):
3259 Set the header padding amount when loading a message.
3261 2003-02-16 Anders Carlsson <andersca@codefactory.se>
3263 * bus/dispatch.c: (send_one_message):
3264 Only send broadcast messages to registered connections.
3266 * dbus/dbus-message.c: (dbus_message_name_is):
3267 * dbus/dbus-message.h:
3268 New convenience function.
3270 * dbus/dbus-transport-debug.c: (do_reading):
3271 Only dispatch one message per run.
3274 * test/bus-test.c: (new_connection_callback), (die),
3275 (test_hello_client1_handler), (test_hello_client2_handler),
3276 (test_hello_replies), (main):
3278 * test/bus-test-loop.[ch]:
3281 2003-02-16 Havoc Pennington <hp@pobox.com>
3283 * dbus/dbus-connection.c (dbus_connection_dispatch_message): fix
3284 backward conditional
3286 2003-02-16 Alexander Larsson <alexl@redhat.com>
3288 * dbus/dbus-connection.c:
3289 Implement sent_message_with_reply. (with_reply_and block is still
3291 Made dispatch_message not lose message if OOM.
3293 * dbus/dbus-errors.h:
3294 Add NoReply error (for reply timeouts).
3296 2003-02-16 Alexander Larsson <alexl@redhat.com>
3298 * dbus/dbus-hash.c (_dbus_hash_table_unref):
3299 Actually free keys and values when destroying hashtable.
3301 2003-02-16 Anders Carlsson <andersca@codefactory.se>
3303 * dbus/dbus-auth.c: (client_try_next_mechanism):
3306 * dbus/dbus-threads.c: (dbus_condvar_wait_timeout):
3307 Return TRUE if there's no thread implementation around.
3309 * glib/dbus-gmain.c: (free_source),
3310 (dbus_connection_hookup_with_g_main):
3311 Make sure to remove the GSource when the connection is finalized.
3313 2003-02-16 Anders Carlsson <andersca@codefactory.se>
3315 * bus/dispatch.c: (bus_dispatch_message_handler):
3316 * dbus/dbus-errors.h:
3317 Return an error if someone tries to send a message to a service
3320 2003-02-16 Anders Carlsson <andersca@codefactory.se>
3322 * bus/activation.c: (load_directory), (bus_activation_init),
3323 (bus_activation_activate_service):
3326 (bus_driver_handle_activate_service), (bus_driver_handle_message):
3327 More work on the activation handling.
3329 * dbus/dbus-errors.h:
3330 Add some error messages
3332 * dbus/dbus-message.c: (dbus_message_new_error_reply):
3333 * dbus/dbus-message.h:
3334 New function that creates an error message.
3336 * dbus/dbus-protocol.h:
3337 Add ACTIVATE_SERVER message.
3339 * dbus/dbus-server-unix.c: (unix_handle_watch),
3340 (_dbus_server_new_for_domain_socket):
3341 Call _dbus_fd_set_close_on_exec.
3343 * dbus/dbus-sysdeps.c: (make_pipe), (do_exec),
3344 (_dbus_spawn_async), (_dbus_disable_sigpipe),
3345 (_dbus_fd_set_close_on_exec):
3346 * dbus/dbus-sysdeps.h:
3347 Add _dbus_fd_set_close_on exec function. Also add function that checks
3348 that all open fds are set to close-on-exec and warns otherwise.
3350 * dbus/dbus-transport-unix.c:
3351 (_dbus_transport_new_for_domain_socket):
3352 Call _dbus_fd_set_close_on_exec.
3354 2003-02-16 Havoc Pennington <hp@pobox.com>
3356 * dbus/dbus-connection.c (dbus_connection_set_change_sigpipe):
3357 allow people to avoid setting SIGPIPE to SIG_IGN
3358 (_dbus_connection_new_for_transport): disable SIGPIPE unless
3359 we've been asked not to
3361 2003-02-15 Anders Carlsson <andersca@codefactory.se>
3363 * dbus/dbus-list.c: (_dbus_list_append_link),
3364 (_dbus_list_prepend_link):
3365 * dbus/dbus-memory.c: (dbus_malloc), (dbus_malloc0),
3369 2003-02-15 Anders Carlsson <andersca@codefactory.se>
3372 * bus/activation.c: (bus_activation_entry_free),
3373 (add_desktop_file_entry), (load_directory), (bus_activation_init):
3375 * bus/main.c: (main):
3376 Add simple activation support, doesn't work yet though.
3378 2003-02-15 Zack Rusin <zack@kde.org>
3380 * qt/dbus-qthread.cpp: small casting fix
3382 2003-02-15 Anders Carlsson <andersca@codefactory.se>
3384 * dbus/dbus-errors.c: (dbus_set_error):
3385 * dbus/dbus-errors.h:
3386 Add a few errors and make dbus_set_error void.
3388 * dbus/dbus-sysdeps.c:
3389 (_dbus_errno_to_string), (close_and_invalidate), (make_pipe),
3390 (write_err_and_exit), (read_ints), (do_exec), (_dbus_spawn_async):
3391 * dbus/dbus-sysdeps.h:
3392 Add _dbus_spawn_async.
3394 * test/spawn-test.c: (main):
3395 Test for _dbus_spawn_async.
3397 2003-02-15 Anders Carlsson <andersca@codefactory.se>
3399 * dbus/dbus-internals.h:
3400 Fix build without tests.
3402 * dbus/dbus-list.c: (alloc_link):
3403 Fix a segfault when a malloc fails.
3405 * dbus/dbus-memory.c: (initialize_malloc_debug), (dbus_malloc),
3406 (dbus_malloc0), (dbus_realloc):
3407 Add support for malloc debugging.
3409 2003-02-15 Alexander Larsson <alexl@redhat.com>
3411 * dbus/dbus-threads.c:
3412 * dbus/dbus-threads.h:
3413 Add condvars. Remove static mutext from API.
3414 Implement static mutexes by initializing them from threads_init.
3416 * glib/dbus-gthread.c:
3417 * qt/dbus-qthread.cpp:
3418 Update with the thread api changes.
3423 Turn StaticMutex into normal mutex + init function.
3424 Export new functions _dbus_list_alloc_link, _dbus_list_free_link,
3425 _dbus_list_append_link, _dbus_list_prepend_link
3428 * dbus/dbus-sysdeps.c:
3429 * dbus/dbus-sysdeps.h:
3430 New type dbus_atomic_t, and new functions _dbus_atomic_inc,
3431 _dbus_atomic_dec. Only slow fallback implementation at the moment.
3433 * dbus/dbus-protocol.h:
3434 Add DBUS_MESSAGE_LOCAL_DISCONNECT define
3436 * dbus/dbus-message.c:
3437 Make ref/unref atomic.
3440 * dbus/dbus-connection-internal.h:
3441 * dbus/dbus-connection.c:
3442 * dbus/dbus-connection.h:
3444 Change _peek to _borrow,_return & _steal_borrowed.
3445 Change disconnect callback to event.
3446 Make dbus_connection_dispatch_messages reentrant.
3448 * dbus/dbus-transport.c:
3449 Don't ref the connection on calls to the transport
3452 * dbus/dbus-message-handler.c:
3455 * glib/dbus-gmain.c:
3456 Don't use peek_message anymore
3459 * test/debug-thread.c:
3460 * test/debug-thread.h:
3461 Simple thread implementation that asserts() on deadlocks in
3462 single-threaded code.
3465 (main) Call debug_threads_init.
3468 Use disconnect message instead of disconnect callback.
3472 Don't call dbus_connection_set_disconnect_function. Instead export
3473 bus_connection_disconnect.
3476 Call bus_connection_disconnect when we get a disconnected message.
3478 2003-02-15 Havoc Pennington <hp@pobox.com>
3480 * dbus/dbus-message.c (dbus_message_new): fool around with the
3483 2003-02-14 Havoc Pennington <hp@pobox.com>
3485 * dbus/dbus-mempool.c: fail if the debug functions so indicate
3487 * dbus/dbus-memory.c: fail if the debug functions indicate we
3490 * dbus/dbus-internals.c (_dbus_set_fail_alloc_counter)
3491 (_dbus_decrement_fail_alloc_counter): debug functions to
3492 simulate memory allocation failures
3494 2003-02-14 Havoc Pennington <hp@pobox.com>
3496 * dbus/dbus-errors.h (struct DBusError): add a word of padding
3499 2003-02-13 Anders Carlsson <andersca@codefactory.se>
3501 * bus/driver.c: (bus_driver_handle_hello):
3503 * bus/services.c: (bus_service_lookup):
3504 Reorder message sending so we get a more sane order.
3506 * test/bus-test.c: (message_handler):
3509 2003-02-13 Anders Carlsson <andersca@codefactory.se>
3511 * bus/driver.c: (bus_driver_send_service_deleted),
3512 (bus_driver_send_service_created), (bus_driver_send_service_lost),
3513 (bus_driver_send_service_acquired), (bus_driver_handle_hello),
3514 (bus_driver_send_welcome_message),
3515 (bus_driver_handle_list_services),
3516 (bus_driver_handle_acquire_service),
3517 (bus_driver_handle_service_exists):
3518 * dbus/dbus-bus.c: (dbus_bus_register_client),
3519 (dbus_bus_acquire_service), (dbus_bus_service_exists):
3520 * dbus/dbus-errors.c: (dbus_result_to_string):
3521 * dbus/dbus-errors.h:
3522 * dbus/dbus-message.c: (dbus_message_append_args),
3523 (dbus_message_append_args_valist), (dbus_message_get_args),
3524 (dbus_message_get_args_valist), (dbus_message_get_args_iter),
3525 (dbus_message_iter_get_arg_type), (dbus_message_iter_get_string),
3526 (dbus_message_iter_get_byte_array),
3527 (dbus_message_iter_get_string_array), (message_iter_test),
3528 (check_message_handling), (_dbus_message_test):
3529 * dbus/dbus-message.h:
3530 * test/bus-test.c: (main):
3531 Change fields to arguments in messages, so that they won't be
3532 confused with header fields.
3534 * glib/test-dbus-glib.c: (main):
3535 Remove append_fields from hello message.
3537 2003-02-13 Anders Carlsson <andersca@codefactory.se>
3539 * dbus/dbus-errors.c:
3540 * dbus/dbus-message.c:
3541 * dbus/dbus-string.c:
3542 Documentation fixes.
3544 2003-02-13 Anders Carlsson <andersca@codefactory.se>
3546 * glib/dbus-gmain.c: (timeout_handler), (add_timeout),
3548 Implement support for timeouts in dbus-glib.
3550 2003-02-13 Anders Carlsson <andersca@codefactory.se>
3552 * dbus/dbus-message-builder.c: (_dbus_message_data_load):
3553 * dbus/dbus-message.c: (process_test_subdir):
3554 * test/break-loader.c: (find_breaks_based_on):
3555 Plug some memory leaks.
3557 2003-02-13 Richard Hult <rhult@codefactory.se>
3559 * bus/main.c: Fix build.
3561 * dbus/dbus-errors.h:
3562 * dbus/dbus-errors.c: Fix copyright for Anders.
3564 2003-02-13 Anders Carlsson <andersca@codefactory.se>
3569 * bus/connection.c: (bus_connection_foreach):
3572 * bus/desktop-file.c: (grow_lines_in_section), (grow_sections),
3573 (unescape_string), (new_section), (parse_section_start),
3574 (parse_key_value), (report_error), (bus_desktop_file_load),
3575 (bus_desktop_file_get_string):
3576 * bus/desktop-file.h:
3577 Use DBusError for error reporting.
3579 * bus/dispatch.c: (send_one_message),
3580 (bus_dispatch_message_handler):
3581 * bus/driver.c: (bus_driver_send_service_deleted),
3582 (bus_driver_send_service_created), (bus_driver_send_service_lost),
3583 (bus_driver_send_service_acquired), (bus_driver_handle_hello),
3584 (bus_driver_send_welcome_message),
3585 (bus_driver_handle_list_services),
3586 (bus_driver_handle_acquire_service),
3587 (bus_driver_handle_service_exists):
3588 * bus/loop.c: (bus_loop_run):
3590 Use BUS_HANDLE_OOM instead of _DBUS_HANDLE_OOM.
3592 * bus/utils.c: (bus_wait_for_memory):
3594 New files with general utility functions.
3596 * dbus/dbus-internals.h:
3597 Remove _DBUS_HANDLE_OOM.
3599 2003-02-13 Anders Carlsson <andersca@codefactory.se>
3601 * dbus/dbus-errors.c: (dbus_result_to_string), (dbus_error_init),
3602 (dbus_error_free), (dbus_set_error_const), (dbus_set_error):
3603 * dbus/dbus-errors.h:
3604 Add DBusError structure.
3606 2003-02-13 Anders Carlsson <andersca@codefactory.se>
3608 * test/data/valid-messages/standard-acquire-service.message:
3609 * test/data/valid-messages/standard-hello.message:
3610 * test/data/valid-messages/standard-list-services.message:
3611 * test/data/valid-messages/standard-service-exists.message:
3612 Add some standard messages.
3614 2003-02-13 Anders Carlsson <andersca@codefactory.se>
3616 * bus/driver.c: (bus_driver_send_welcome_message),
3617 (bus_driver_handle_list_services),
3618 (bus_driver_handle_acquire_service),
3619 (bus_driver_handle_service_exists), (bus_driver_handle_message):
3620 Update for API changes in libdbus.
3622 * dbus/dbus-message.c: (dbus_message_new_reply):
3623 * dbus/dbus-message.h:
3624 Remove the name argument. The spec states that replies shouldn't
3627 2003-02-13 Anders Carlsson <andersca@codefactory.se>
3629 * bus/desktop-file.c: (parse_section_start), (parse_key_value),
3630 (report_error), (bus_desktop_file_load), (lookup_section),
3631 (lookup_line), (bus_desktop_file_get_raw),
3632 (bus_desktop_file_get_string):
3633 * bus/desktop-file.h:
3634 Some fixes, and new functions for getting a key value from a section.
3636 2003-02-13 Havoc Pennington <hp@pobox.com>
3638 * test/data/auth/fail-after-n-attempts.auth-script: new test
3640 * dbus/dbus-auth.c (send_rejected): shutdown_mech() when we
3643 2003-02-13 Havoc Pennington <hp@pobox.com>
3645 * dbus/dbus-auth.c (handle_server_data_external_mech): args to
3646 dbus_credentials_match were backward
3648 * dbus/dbus-auth-script.c (_dbus_auth_script_run): support
3649 NO_CREDENTIALS and ROOT_CREDENTIALS
3651 * dbus/dbus-auth.c (_dbus_auth_do_work): move get_state() routine
3652 into here. Never process more commands after we've reached an
3653 end state; store further data as unused bytes.
3655 * test/data/auth/*: add more auth tests
3657 * dbus/dbus-auth-script.c (_dbus_auth_script_run): support EXPECT
3658 command to match exact string and EXPECT_UNUSED to match unused
3661 * test/Makefile.am (dist-hook): fix to dist all the test stuff
3663 2003-02-12 Havoc Pennington <hp@pobox.com>
3665 * dbus/dbus-string.c (_dbus_string_pop_line): fix to also strip
3666 \r off of popped lines
3668 * dbus/dbus-auth.c (_dbus_auth_test): write code to run auth
3671 * dbus/dbus-auth-script.c (_dbus_auth_script_run): when doing a
3674 2003-02-12 Havoc Pennington <hp@pobox.com>
3676 * dbus/Makefile.am: remove break-loader from the build, since it
3679 * configure.in: add --enable-gcov to turn on coverage profiling
3680 flags and disable optimization
3682 2003-02-10 Havoc Pennington <hp@pobox.com>
3684 * dbus/dbus-auth-script.c, dbus/dbus-auth-script.h: sync
3685 initial cut at test framework for DBusAuth from laptop.
3686 Doesn't quite work yet but it compiles and I need to get
3687 it off the 266mhz laptop. ;-)
3689 * dbus/dbus-server-debug.c (_dbus_server_debug_accept_transport):
3690 fix a memleak in error case
3692 2003-02-12 Anders Carlsson <andersca@codefactory.se>
3695 * bus/desktop-file.c:
3696 * bus/desktop-file.h:
3697 Add a desktop file parser.
3699 2003-02-11 Zack Rusin <zack@kde.org>
3701 * qt/message.[h|cpp]: sample implementation
3702 of the KDE wrapper for DBusMessage
3704 2003-02-09 Zack Rusin <zack@kde.org>
3706 * test/bus-test.c: make_it_compile
3707 * doc/dbus-specification.sgml: minimal semantic fix
3709 2003-02-06 Anders Carlsson <andersca@codefactory.se>
3715 2003-02-06 Anders Carlsson <andersca@codefactory.se>
3718 * dbus/dbus-break-loader.c:
3720 * test/break-loader.c:
3721 Move dbus-break-loader to test/ and rename it to break-loader.
3723 2003-02-02 Havoc Pennington <hp@pobox.com>
3725 * dbus/dbus-keyring.c, dbus/dbus-keyring.h: template files
3726 for code to manage cookies in your home directory
3728 * dbus/dbus-sysdeps.c (_dbus_generate_random_bytes): new function
3730 * dbus/dbus-auth.c (get_state): impose a maximum number of tries
3731 to authenticate, then disconnect the client.
3733 2003-02-03 Alexander Larsson <alexl@redhat.com>
3735 * dbus/dbus-message.c (dbus_message_append_fields):
3738 2003-02-02 Anders Carlsson <andersca@codefactory.se>
3740 * doc/dbus-specification.sgml:
3741 Update address format section.
3743 2003-02-02 Anders Carlsson <andersca@codefactory.se>
3746 * test/bus-test.c: (get_time), (add_timeout), (remove_timeout),
3747 (message_handler), (new_connection_callback), (loop_quit),
3751 2003-02-02 Anders Carlsson <andersca@codefactory.se>
3753 * bus/driver.c: (bus_driver_handle_service_exists):
3754 Simplify the code a bit.
3756 * dbus/dbus-bus.c: (dbus_bus_service_exists):
3759 2003-02-02 Anders Carlsson <andersca@codefactory.se>
3762 Add libdbus-daemon.la and link to it.
3764 2003-02-01 James Willcox <jwillcox@gnome.org>
3766 * bus/driver.c: (bus_driver_handle_own_service):
3767 Actually include the service reply code in the message.
3769 2003-02-02 Anders Carlsson <andersca@codefactory.se>
3771 * bus/driver.c: (bus_driver_handle_service_exists):
3772 Don't unref the incoming message.
3774 2003-02-02 Anders Carlsson <andersca@codefactory.se>
3776 * dbus/dbus.h: Add dbus-address.h and dbus-bus.h
3778 2003-02-02 Anders Carlsson <andersca@codefactory.se>
3780 * dbus/dbus-server.c: (dbus_server_listen):
3781 * dbus/dbus-transport.c: (_dbus_transport_open):
3782 ifdef out the calls to the debug transport and server.
3784 2003-02-02 Alexander Larsson <alexl@redhat.com>
3786 * dbus/dbus-watch.c (dbus_watch_get_flags):
3787 Add note in the docs that ERROR or HANGUP won't be returned
3788 and are assumed always on.
3790 * glib/dbus-gmain.c (add_watch):
3791 Always add IO_ERR | IO_HUP
3793 * dbus/dbus-message.h:
3794 Add semicolon after dbus_message_iter_get_string_array().
3795 Makes qt code build again
3797 2003-02-01 Anders Carlsson <andersca@codefactory.se>
3799 * bus/driver.c: (create_unique_client_name),
3800 (bus_driver_handle_hello):
3801 Don't take a name, just use a numeric id to identify
3805 * dbus/dbus-bus.c: (dbus_bus_register_client),
3806 (dbus_bus_acquire_service), (dbus_bus_service_exists):
3808 Add new convenience functions for communicating with the bus.
3810 * dbus/dbus-message.h:
3812 * dbus/dbus-protocol.h:
3815 2003-02-01 Alexander Larsson <alexl@redhat.com>
3817 * dbus/dbus-message.c (dbus_message_append_fields):
3818 Add some more doc comments.
3820 2003-02-01 Havoc Pennington <hp@pobox.com>
3822 * dbus/dbus-break-loader.c (randomly_modify_length): change
3823 a 4-byte value in the message as if it were a length
3825 * dbus/dbus-sysdeps.c (_dbus_string_save_to_file): don't set
3826 execute bit on saved files
3828 2003-02-01 Havoc Pennington <hp@pobox.com>
3830 * dbus/dbus-break-loader.c (main): new program to find messages
3831 that break the loader.
3833 * dbus/dbus-sysdeps.c (_dbus_string_append_uint): new function
3834 * dbus/dbus-sysdeps.c (_dbus_string_save_to_file): new function
3836 * dbus/dbus-string.c (_dbus_string_set_byte): new
3838 2003-01-31 Havoc Pennington <hp@pobox.com>
3840 * dbus/dbus-message.c: refactor the test code to be more general,
3841 in preparation for writing a "randomly permute test cases to
3842 try to break the loader" program.
3844 2003-01-31 Havoc Pennington <hp@pobox.com>
3846 * doc/dbus-specification.sgml: work on the specification
3848 * dbus/dbus-message.c (_dbus_message_loader_return_buffer): check
3849 the protocol version of the message.
3851 * dbus/dbus-protocol.h: drop special _REPLY names, the spec
3852 no longer specifies that.
3853 (DBUS_SERVICE_REPLY_SERVICE_EXISTS): fix flags (1/2/4/8 not
3856 * dbus/dbus-marshal.c (_dbus_marshal_get_arg_end_pos): add missing
3857 "break" for DBUS_TYPE_NIL, remove @todo
3859 2003-01-31 Havoc Pennington <hp@pobox.com>
3861 * dbus/dbus-message.c (dbus_message_set_is_error_reply): rename
3862 just set_is_error/get_is_error as this is a commonly-used
3863 function, and write docs.
3865 2003-01-31 Anders Carlsson <andersca@codefactory.se>
3867 * dbus/dbus-address.c: (dbus_address_entry_free):
3868 Free key and value lists.
3870 * dbus/dbus-internals.c: (_dbus_type_to_string):
3871 Add the types we didn't have.
3873 * dbus/dbus-marshal.c: (_dbus_marshal_get_arg_end_pos),
3874 (_dbus_marshal_validate_arg):
3877 * dbus/dbus-message.c: (dbus_message_set_sender):
3878 Remove todo about being able to set sender to NULL.
3880 (dbus_message_set_is_error_reply),
3881 (dbus_message_get_is_error_reply):
3882 * dbus/dbus-message.h:
3885 * dbus/dbus-protocol.h:
3886 Add error reply flag.
3888 * test/data/valid-messages/opposite-endian.message:
3889 Add NIL type to test.
3891 2003-01-31 Havoc Pennington <hp@pobox.com>
3893 * doc/dbus-specification.sgml: fully specify the header. Add
3894 flags and major protocol version, and change header/body len to
3897 * dbus/dbus-message-builder.c (append_saved_length): append length
3900 * dbus/dbus-message.c (dbus_message_create_header): change header
3901 length and body length to unsigned. Add the new fields from the
3903 (_dbus_message_loader_return_buffer): unsigned header/body len
3905 2003-01-30 Havoc Pennington <hp@pobox.com>
3907 * dbus/dbus-auth.c: rework to use only REJECTED, no
3910 * doc/dbus-sasl-profile.txt: drop MECHANISMS and just
3911 use REJECTED, suggested by Mark McLoughlin
3913 2003-01-30 Havoc Pennington <hp@pobox.com>
3915 * dbus/dbus-server.c (dbus_server_listen): @todo about how we need
3916 a better way to report errors here. e.g. "unix address lacks
3917 path" or something. also "no such file" when the path doesn't
3920 * dbus/dbus-address.c (dbus_address_entries_free): add @todo about
3922 (dbus_parse_address): add @todo about documenting address format,
3923 and allowing , and ; to be escaped
3925 2003-01-30 Anders Carlsson <andersca@codefactory.se>
3928 Add dbus-address.[ch]
3930 * dbus/dbus-address.c: (dbus_address_entry_free),
3931 (dbus_address_entries_free), (create_entry),
3932 (dbus_address_entry_get_method), (dbus_address_entry_get_value),
3933 (dbus_parse_address), (_dbus_address_test):
3934 * dbus/dbus-address.h:
3935 New files for dealing with address parsing.
3937 * dbus/dbus-connection.c:
3938 Document timeout functions.
3940 * dbus/dbus-message.c:
3941 Document dbus_message_new_from_message.
3943 * dbus/dbus-server-debug.c:
3946 * dbus/dbus-server.c: (dbus_server_listen):
3947 Parse address and use correct server implementation.
3949 * dbus/dbus-string.c: (_dbus_string_find_to), (_dbus_string_test):
3950 * dbus/dbus-string.h:
3951 New function with test.
3953 * dbus/dbus-test.c: (dbus_internal_symbol_do_not_use_run_tests):
3957 * dbus/dbus-transport-debug.c:
3960 * dbus/dbus-transport.c: (_dbus_transport_open):
3961 Parse address and use correct transport implementation.
3963 2003-01-30 Havoc Pennington <hp@pobox.com>
3965 * dbus/dbus-message.c: use message->byte_order instead of
3966 DBUS_COMPILER_BYTE_ORDER throughout.
3967 (dbus_message_create_header): pad header to align the
3968 start of the body of the message to 8-byte boundary
3970 * dbus/dbus-marshal.h: make all the demarshalers take const
3971 DBusString arguments.
3973 * dbus/dbus-message.c (_dbus_message_loader_return_buffer):
3974 validate message args here, so we don't have to do slow validation
3975 later, and so we catch bad messages as they are incoming. Also add
3976 better checks on header_len and body_len. Also fill in
3979 * dbus/dbus-string.c (_dbus_string_validate_utf8): new (not
3980 implemented properly)
3981 (_dbus_string_validate_nul): new function to check all-nul
3983 * dbus/dbus-marshal.c (_dbus_marshal_get_field_end_pos): rename
3984 get_arg_end_pos and remove all validation
3985 (_dbus_marshal_validate_arg): actually do validation here.
3987 2003-01-29 Havoc Pennington <hp@pobox.com>
3989 * dbus/dbus-message.c (check_message_handling): fix assertion
3990 failure on set_client_serial
3992 2003-01-28 Havoc Pennington <hp@pobox.com>
3994 * dbus/dbus-server-debug.c: Add doc section comments
3996 * dbus/dbus-transport-debug.c: add doc section comments
3998 2003-01-28 Havoc Pennington <hp@redhat.com>
4000 * dbus/dbus-string.c (_dbus_string_base64_decode): append bytes in
4001 the reverse order from how I had it
4002 (_dbus_string_base64_encode): reverse encoding order. I was
4003 basically byteswapping everything during encoding.
4005 2003-01-28 Anders Carlsson <andersca@codefactory.se>
4007 * dbus/dbus-connection-internal.h:
4008 * dbus/dbus-connection.c: (_dbus_connection_add_timeout),
4009 (_dbus_connection_remove_timeout):
4010 Add functions for adding and removing timeouts.
4012 * dbus/dbus-message.c: (dbus_message_new_from_message):
4013 Add new function that takes a message and creates an exact
4014 copy of it, but with the refcount set to 1.
4015 (check_message_handling):
4018 * dbus/dbus-server-protected.h:
4019 * dbus/dbus-server.c: (_dbus_server_init_base),
4020 (_dbus_server_finalize_base), (_dbus_server_add_timeout),
4021 (dbus_server_set_timeout_functions):
4022 (_dbus_server_remove_timeout):
4023 New functions so that a server can add and remove timeouts.
4025 (dbus_server_listen):
4026 Add commented out call to dbus_server_debug_new.
4028 * dbus/dbus-timeout.c: (_dbus_timeout_new):
4029 Actually set the handler, doh.
4031 * dbus/dbus-transport.c: (_dbus_transport_open):
4032 Add commented out call to dbus_transport_debug_client_new.
4035 Add dbus-transport-debug.[ch] and dbus-server-debug.[ch]
4037 2003-01-28 Havoc Pennington <hp@pobox.com>
4039 * dbus/dbus-message.c (check_message_handling): function to check
4040 on the loaded message, iterates over it etc.
4042 2003-01-28 Havoc Pennington <hp@pobox.com>
4044 * test/Makefile.am (dist-hook): fix make distdir
4046 * dbus/Makefile.am (TESTS_ENVIRONMENT): fix make check
4048 2003-01-27 Havoc Pennington <hp@pobox.com>
4050 * dbus/dbus-mempool.c (time_for_size): replace printf with
4053 * dbus/dbus-message-builder.c (_dbus_message_data_load): allow
4054 empty lines; fix the SAVE_LENGTH stuff to be
4055 START_LENGTH/END_LENGTH so it actually works; couple other
4058 * test/Makefile.am (dist-hook): add dist-hook for .message files
4060 * dbus/dbus-string.c (DBUS_STRING_COPY_PREAMBLE): source of a copy
4061 can be constant or locked.
4062 (_dbus_string_free): allow freeing a const string as
4065 * dbus/dbus-sysdeps.c (_dbus_concat_dir_and_file): utility
4067 * dbus/dbus-test-main.c (main): take an argument which is the
4068 directory containing test data
4070 * dbus/dbus-message.c (_dbus_message_test): pass a test_data_dir
4071 argument to this and load all the messages in test/data/
4072 checking that they can be loaded or not loaded as appropriate.
4074 2003-01-27 Anders Carlsson <andersca@codefactory.se>
4076 * bus/dispatch.c: (bus_dispatch_message_handler):
4077 Dispatch messages sent to services.
4079 * bus/driver.c: (bus_driver_send_service_deleted),
4080 (bus_driver_send_service_created), (bus_driver_send_service_lost),
4081 (bus_driver_send_service_acquired):
4082 Add helper functions for sending service related messages.
4084 (bus_driver_send_welcome_message):
4085 Send HELLO_REPLY instead of WELCOME.
4087 (bus_driver_handle_list_services):
4088 Send LIST_SERVICES_REPLY instead of SERVICES.
4090 (bus_driver_handle_own_service),
4091 (bus_driver_handle_service_exists):
4092 New message handlers.
4094 (bus_driver_handle_message):
4095 Invoke new message handlers.
4097 (bus_driver_remove_connection):
4098 Don't remove any services here since that's done automatically
4099 by bus_service_remove_owner now.
4102 New function signatures.
4104 * bus/services.c: (bus_service_add_owner):
4105 Send ServiceAcquired message if we're the only primary owner.
4107 (bus_service_remove_owner):
4108 Send ServiceAcquired/ServiceLost messages.
4110 (bus_service_set_prohibit_replacement),
4111 (bus_service_get_prohibit_replacement):
4112 Functions for setting prohibit replacement.
4114 (bus_service_has_owner):
4115 New function that checks if a connection is in the owner queue of
4119 Add new function signatures.
4121 * dbus/dbus-list.c: (_dbus_list_test):
4122 Add tests for _dbus_list_remove_last and traversing the list backwards.
4125 Fix a typo in _dbus_list_get_prev_link, if we're at the first element we can't
4126 go any further, so return NULL then.
4128 * dbus/dbus-protocol.h:
4129 Add new messages, service flags and service replies.
4131 2003-01-26 Havoc Pennington <hp@pobox.com>
4133 * dbus/dbus-message-builder.c: implement, completely untested.
4135 * test/data/*: add data to be used in testing.
4136 ".message" files are our simple loadable text format.
4137 ".message-raw" will be binary dumps of messages.
4139 * dbus/dbus-string.c (_dbus_string_starts_with_c_str): new
4141 2003-01-26 Havoc Pennington <hp@pobox.com>
4143 * dbus/dbus-sysdeps.c (_dbus_file_get_contents): new function
4145 * dbus/dbus-errors.c (dbus_result_to_string): add
4148 * dbus/dbus-message-builder.c: new file, will contain code to load
4149 up messages from files. Not implemented yet.
4151 2003-01-26 Havoc Pennington <hp@pobox.com>
4153 * dbus/dbus-message.c (dbus_message_set_sender): support deleting
4154 the sender by setting to NULL
4156 2003-01-26 Havoc Pennington <hp@pobox.com>
4158 The unit tests pass, but otherwise untested. If it breaks, the
4159 tests should have been better. ;-)
4161 * bus/driver.c (bus_driver_handle_hello): return if we disconnect
4164 * dbus/dbus-message.c: redo everything so we maintain
4165 message->header as the only copy of the various fields.
4166 This avoids the possibility of out-of-memory in some cases,
4167 for example dbus_message_lock() can't run out of memory anymore,
4168 and avoids extra copying. Figured I may as well go ahead and do
4169 this since it was busted for dbus_message_lock to not return
4170 failure on OOM, and dbus_message_write_header was totally
4171 unchecked for OOM. Also fixed some random other bugs.
4173 * dbus/dbus-marshal.c (_dbus_marshal_get_field_end_pos): verify
4174 that strings are nul-terminated. Also, end_pos can be equal
4175 to string length just not greater than, I think.
4176 (_dbus_marshal_set_int32): new function
4177 (_dbus_marshal_set_uint32): new function
4178 (_dbus_marshal_set_string): new function
4180 * dbus/dbus-connection.c (_dbus_connection_new_for_transport): fix
4181 a warning, init timeout_list to NULL
4182 (dbus_connection_send_message): don't use uninitialized variable
4185 * dbus/dbus-string.c (_dbus_string_replace_len): new function
4187 2003-01-26 Anders Carlsson <andersca@codefactory.se>
4189 * bus/driver.c: (bus_driver_handle_hello),
4190 (bus_driver_send_welcome_message):
4193 2003-01-26 Anders Carlsson <andersca@codefactory.se>
4195 * dbus/dbus-auth.c: (process_auth), (_dbus_auth_unref):
4196 * dbus/dbus-connection.c: (_dbus_connection_new_for_transport),
4197 (dbus_connection_unref):
4198 * dbus/dbus-marshal.c: (_dbus_marshal_test):
4199 * dbus/dbus-message.c: (dbus_message_unref),
4202 (dbus_message_get_fields):
4203 Remove debugging printout.
4205 (_dbus_message_loader_return_buffer):
4206 Don't store the header string.
4208 (_dbus_message_test):
4211 2003-01-26 Richard Hult <rhult@codefactory.se>
4213 * glib/dbus-gmain.c (dbus_connection_dispatch): Traverse a copy of
4214 the file descriptor list, since it can change under us.
4216 2003-01-25 Anders Carlsson <andersca@codefactory.se>
4218 * glib/dbus-gmain.c: (dbus_connection_prepare),
4219 (dbus_connection_check), (dbus_connection_dispatch), (add_watch),
4220 (remove_watch), (dbus_connection_hookup_with_g_main):
4221 Rewrite the glib handling to use its own GSource instead of a
4222 GIOChannel so we can catch messages put in the queue while waiting
4225 2003-01-25 Anders Carlsson <andersca@codefactory.se>
4228 * bus/connection.c: (connection_disconnect_handler),
4229 (connection_watch_callback), (bus_connection_setup):
4230 * bus/dispatch.c: (send_one_message),
4231 (bus_dispatch_broadcast_message), (bus_dispatch_message_handler),
4232 (bus_dispatch_add_connection), (bus_dispatch_remove_connection):
4234 * bus/driver.c: (bus_driver_send_service_deleted),
4235 (bus_driver_send_service_created), (bus_driver_handle_hello),
4236 (bus_driver_send_welcome_message),
4237 (bus_driver_handle_list_services), (bus_driver_remove_connection),
4238 (bus_driver_handle_message):
4240 Refactor code, put the message dispatching in its own file. Use
4241 _DBUS_HANDLE_OOM. Also send ServiceDeleted messages when a client
4244 2003-01-25 Anders Carlsson <andersca@codefactory.se>
4246 * dbus/dbus-internals.h:
4247 Add _DBUS_HANDLE_OOM macro, it doesn't do anything currently.
4249 * dbus/dbus-message.c: (dbus_message_get_sender):
4250 * dbus/dbus-message.h:
4251 Implement dbus_message_get_sender.
4253 * dbus/dbus-protocol.h:
4254 Add message and service defines.
4256 2003-01-25 Anders Carlsson <andersca@codefactory.se>
4258 * dbus/dbus-connection.c: (dbus_connection_send_message):
4259 * dbus/dbus-message-internal.h:
4260 * dbus/dbus-message.c: (_dbus_message_get_client_serial),
4261 (dbus_message_write_header):
4262 Remove _dbus_messag_unlock and don't set the client serial on a
4263 message if one already exists.
4265 2003-01-24 Havoc Pennington <hp@pobox.com>
4267 * dbus/dbus-list.c (alloc_link): put a thread lock on the global
4270 * bus/driver.c (bus_driver_handle_list_services): fix a leak
4273 2003-01-25 Anders Carlsson <andersca@codefactory.se>
4275 * dbus/dbus-list.c: (alloc_link), (free_link):
4276 Use a memory pool for the links.
4278 2003-01-25 Anders Carlsson <andersca@codefactory.se>
4280 * bus/connection.c: (bus_connection_foreach):
4282 Add new bus_connection_foreach function.
4284 * bus/driver.c: (send_one_message), (bus_driver_broadcast_message):
4285 Add function that broadcasts a message to all clients.
4287 (bus_driver_send_service_created), (bus_driver_handle_hello),
4288 (bus_driver_send_welcome_message),
4289 (bus_driver_handle_list_services), (bus_driver_message_handler):
4290 Implement functions that take care of listing services, and notifying
4291 clients when new services are created.
4293 * bus/services.c: (bus_services_list):
4295 Add new function that returns an array of strings with the currently
4296 registered services.
4299 * glib/dbus-gmain.c:
4300 Update copyright year.
4302 2003-01-25 Anders Carlsson <andersca@codefactory.se>
4304 * dbus/dbus-connection.c: (dbus_connection_send_message):
4305 Unlock the message in case it was sent earlier.
4307 (dbus_connection_send_message_with_reply_and_block):
4308 Remove the reply message from the list.
4310 * dbus/dbus-marshal.c: (_dbus_demarshal_string_array):
4311 Set array_len and new_pos correctly.
4313 (_dbus_marshal_test):
4314 Remove debug output.
4316 * dbus/dbus-message-internal.h:
4317 * dbus/dbus-message.c: (_dbus_message_get_reply_serial):
4318 New function that returns the reply serial.
4320 (_dbus_message_unlock):
4321 New function that unlocks a message and resets its header.
4323 (dbus_message_append_string_array),
4324 (dbus_message_get_fields_valist),
4325 (dbus_message_iter_get_field_type),
4326 (dbus_message_iter_get_string_array),
4327 (dbus_message_get_fields),
4328 (dbus_message_append_fields_valist):
4329 Handle string arrays.
4331 (dbus_message_set_sender):
4332 Make this function public since the bus daemon needs it.
4334 (decode_header_data):
4335 Set the reply serial to -1 initially.
4337 * dbus/dbus-message.h:
4338 Add dbus_message_set_sender.
4340 2003-01-24 Havoc Pennington <hp@pobox.com>
4342 * doc/dbus-specification.sgml: add some stuff
4344 2003-01-22 Havoc Pennington <hp@pobox.com>
4346 * doc/dbus-specification.sgml: Start to document the protocol.
4348 2003-01-22 Havoc Pennington <hp@pobox.com>
4350 * dbus/dbus-connection.c
4351 (dbus_connection_send_message_with_reply_and_block): add some @todo
4353 * bus/driver.c (bus_driver_add_connection): add a FIXME about memleak
4355 2003-01-21 Havoc Pennington <hp@pobox.com>
4357 (patch untested because can't compile)
4359 * bus/driver.c (create_unique_client_name): make this function
4360 never recycle client names. Also, caller should initialize
4363 * dbus/dbus-sysdeps.c (_dbus_get_current_time): new function
4365 2003-01-21 Anders Carlsson <andersca@codefactory.se>
4367 * dbus/dbus-marshal.c: (_dbus_marshal_double),
4368 (_dbus_marshal_int32), (_dbus_marshal_uint32),
4369 (_dbus_marshal_int32_array), (_dbus_marshal_uint32_array),
4370 (_dbus_marshal_double_array), (_dbus_marshal_string_array),
4371 (_dbus_demarshal_int32_array), (_dbus_demarshal_uint32_array),
4372 (_dbus_demarshal_double_array), (_dbus_demarshal_string_array),
4373 (_dbus_marshal_get_field_end_pos), (_dbus_marshal_test):
4374 * dbus/dbus-marshal.h:
4375 * dbus/dbus-protocol.h:
4376 Add support for marshalling and demarshalling integer, double
4379 2003-01-21 Anders Carlsson <andersca@codefactory.se>
4384 * bus/connection.c: (connection_disconnect_handler):
4385 Remove the connection from the bus driver's list.
4387 (connection_watch_callback): Dispatch messages.
4389 (free_connection_data): Free connection name.
4391 (bus_connection_setup): Add connection to the bus driver's list.
4392 (bus_connection_remove_owned_service):
4393 (bus_connection_set_name), (bus_connection_get_name):
4394 Add functions for setting and getting the connection's name.
4397 Add function headers.
4399 * bus/driver.c: (create_unique_client_name),
4400 (bus_driver_handle_hello_message),
4401 (bus_driver_send_welcome_message), (bus_driver_message_handler),
4402 (bus_driver_add_connection), (bus_driver_remove_connection):
4405 * bus/services.c: (bus_service_free):
4407 New file that handles communication and registreation with the bus
4410 2003-01-21 Anders Carlsson <andersca@codefactory.se>
4412 * dbus/dbus-connection.c: (dbus_connection_send_message):
4413 Add a new client_serial parameter.
4415 (dbus_connection_send_message_with_reply):
4416 Remove a @todo since we've implemented the blocking function.
4418 (dbus_connection_send_message_with_reply_and_block):
4419 New function that sends a message and waits for a reply and
4420 then returns the reply.
4422 * dbus/dbus-connection.h:
4425 * dbus/dbus-errors.c: (dbus_result_to_string):
4426 * dbus/dbus-errors.h:
4427 Add new DBUS_RESULT.
4429 * dbus/dbus-message-internal.h:
4430 * dbus/dbus-message.c: (_dbus_message_get_reply_serial),
4431 (_dbus_message_set_sender), (dbus_message_write_header),
4432 (dbus_message_new_reply), (decode_header_data),
4433 (_dbus_message_loader_return_buffer), (_dbus_message_test):
4434 * dbus/dbus-message.h:
4435 Add new functions that set the reply serial and sender.
4436 Also marshal and demarshal them correctly and add test.
4438 * dbus/dbus-protocol.h:
4439 Add new DBUS_MESSAGE_TYPE_SENDER.
4442 * glib/dbus-gmain.c: (watch_callback), (free_callback_data),
4443 (add_watch), (remove_watch), (add_timeout), (remove_timeout),
4444 (dbus_connection_hookup_with_g_main):
4445 * glib/test-dbus-glib.c: (main):
4446 Rewrite to use GIOChannel and remove the GSource crack.
4448 * test/echo-client.c: (main):
4449 * test/watch.c: (check_messages):
4450 Update for changed APIs
4452 2003-01-19 Anders Carlsson <andersca@codefactory.se>
4454 * dbus/Makefile.am: Add dbus-timeout.[cħ]
4456 * dbus/dbus-connection.c: (_dbus_connection_new_for_transport):
4457 Create a DBusTimeoutList.
4458 (dbus_connection_set_timeout_functions): Add new function to
4459 set timeout callbacks
4461 * dbus/dbus-connection.h: Add public DBusTimeout API.
4463 * dbus/dbus-message.c: (dbus_message_get_service):
4464 * dbus/dbus-message.h: New function.
4466 * dbus/dbus-server.c: Fix small doc typo.
4468 * dbus/dbus-timeout.[ch]: New files for mainloop timeouts.
4470 2003-01-19 Anders Carlsson <andersca@codefactory.se>
4472 * dbus/dbus-string.c (_dbus_string_move_len): Don't delete all
4473 of the string, just as long as specified.
4475 2003-01-19 Havoc Pennington <hp@pobox.com>
4477 * dbus/dbus-connection.c (dbus_connection_get_is_authenticated):
4480 * dbus/dbus-server.c (dbus_server_set_max_connections)
4481 (dbus_server_get_max_connections, dbus_server_get_n_connections):
4482 keep track of current number of connections, and add API for
4483 setting a max (but haven't implemented enforcing the max yet)
4485 2003-01-18 Havoc Pennington <hp@pobox.com>
4487 * dbus/dbus-transport-unix.c (unix_do_iteration): only do the
4488 reading/writing if read_watch != NULL or write_watch != NULL.
4490 * dbus/dbus-message.c (_dbus_message_loader_return_buffer): fix
4491 the message loader code to actually load message->header and
4492 message->body into the newly-created message.
4494 * dbus/dbus-transport-unix.c (check_write_watch): fix a mem leak
4497 * dbus/dbus-connection.c (dbus_connection_set_max_message_size)
4498 (dbus_connection_get_max_message_size)
4499 (dbus_connection_set_max_live_messages_size)
4500 (dbus_connection_get_max_live_messages_size): implement some
4501 resource limitation functions
4503 * dbus/dbus-resources.c: new file implementing some of the
4504 resource limits stuff
4506 * dbus/dbus-message.c (dbus_message_iter_get_byte_array): add
4507 missing docs, add @todo to handle OOM etc.
4509 * dbus/dbus-marshal.c (_dbus_demarshal_byte_array): add missing
4512 2003-01-18 Havoc Pennington <hp@pobox.com>
4514 * dbus/dbus-connection.c (dbus_connection_unref): disconnect the
4515 connection if it hasn't been already.
4517 * dbus/dbus-connection.h: kill off the idea of an ErrorFunction,
4518 replace with DisconnectFunction.
4520 2003-01-18 Havoc Pennington <hp@pobox.com>
4522 Building --disable-verbose-mode --disable-asserts --disable-tests
4523 cuts the library from 112K to 45K or so
4525 * configure.in: check for varargs macro support,
4526 add --enable-verbose-mode, --enable-asserts.
4528 * dbus/dbus-internals.h (_dbus_assert): support
4530 (_dbus_verbose): support DBUS_ENABLE_VERBOSE_MODE
4532 2003-01-18 Havoc Pennington <hp@pobox.com>
4534 * dbus/dbus-test.c: include config.h so that tests actually run
4536 * dbus/dbus-string.c: add assertions that stuff is 8-byte aligned,
4537 so the failure mode when that assumption fails will be plenty
4540 2003-01-18 Havoc Pennington <hp@pobox.com>
4542 * configure.in: default --enable-tests to $USE_MAINTAINER_MODE
4544 * dbus/Makefile.am: fix it up so dubs-test-main.c is included in
4547 * test/Makefile.am: don't use special variable "TESTS" for echo-*
4548 since we don't want to use those in make check
4550 2003-01-15 Havoc Pennington <hp@redhat.com>
4556 2003-01-15 Havoc Pennington <hp@redhat.com>
4558 * test/Makefile.am: fix so that test source code ends up in the
4559 distribution on make distcheck
4561 2003-01-15 Havoc Pennington <hp@redhat.com>
4567 2003-01-15 Havoc Pennington <hp@redhat.com>
4569 * dbus/dbus-test.c (dbus_internal_symbol_do_not_use_run_tests):
4570 fix build when --disable-tests
4572 * Makefile.am (EXTRA_DIST): put HACKING in here
4574 * HACKING: document procedure for making a tarball release.
4576 2003-01-14 Anders Carlsson <andersca@codefactory.se>
4578 * bus/connection.c: (connection_error_handler),
4579 (bus_connection_setup):
4580 * bus/main.c: (main):
4581 Make sure that the DBusConnectionData struct is NULLed
4582 out to prevent a segfault.
4584 * dbus/dbus-errors.c: (dbus_result_to_string):
4585 * dbus/dbus-errors.h:
4586 * dbus/dbus-message.c: (dbus_message_get_fields),
4587 (dbus_message_get_fields_valist), (_dbus_message_test):
4588 * dbus/dbus-message.h:
4589 Make dbus_message_get_fields return a result code so we can
4590 track invalid fields as well as oom.
4592 2003-01-11 Havoc Pennington <hp@pobox.com>
4594 * configure.in: change --enable-test/--enable-ansi action-if-given
4595 to enable_foo=$enableval instead of enable_foo=yes
4597 2003-01-08 Havoc Pennington <hp@pobox.com>
4599 * dbus/dbus-string.c (_dbus_string_align_length): new function
4601 * dbus/dbus-test-main.c: move main() for test app here
4603 (dbus_internal_symbol_do_not_use_run_tests): we have to export a
4604 symbol to run tests, because dbus-test isn't in the main
4607 Code review nitpicks.
4609 * dbus/dbus-message.c (dbus_message_write_header): add newlines
4610 for people with narrow emacs ;-). Assert client_serial was filled
4611 in. Assert message->name != NULL.
4612 (dbus_message_append_fields): have "first_field_type" arg separate
4613 from va list, needed for C++ binding that also uses varargs IIRC
4614 and helps with type safety
4615 (dbus_message_new): add @todo about using DBusString to store
4616 service/name internally
4617 (dbus_message_new): don't leak ->service and ->name on OOM later
4619 (dbus_message_unref): free the service name
4620 (dbus_message_get_fields): same change to varargs
4621 i.e. first_field_type
4622 (_dbus_message_loader_return_buffer): assert that the message data
4623 is aligned (if not it's a bug in our code). Put in verbose griping
4624 about why we set corrupted = TRUE.
4625 (decode_header_data): add FIXME that char* is evil. Was going to
4626 add FIXME about evil locale-specific string.h strncmp, but just
4627 switched to wacky string-as-uint32 optimization. Move check for
4628 "no room for field name" above get_const_data_len() to avoid
4629 assertion failure in get_const_data_len if we have trailing 2
4630 bytes or the like. Check for service and name fields being
4631 provided twice. Don't leak service/name on error. Require field
4632 names to be aligned to 4 bytes.
4634 * dbus/dbus-marshal.c: move byte swap stuff to header
4635 (_dbus_pack_int32): uscore-prefix
4636 (_dbus_unpack_int32): uscore-prefix
4637 (_dbus_unpack_uint32): export
4638 (_dbus_demarshal_string): add @todo complaining about use of
4640 (_dbus_marshal_get_field_end_pos): add @todo about bad error
4641 handling allowing corrupt data to go unchecked
4643 2003-01-08 Havoc Pennington <hp@redhat.com>
4645 * dbus/dbus-transport-unix.c (unix_do_iteration): add read/write
4646 to the select() as needed for authentication. (should be using
4647 _dbus_poll() not select, but for another day)
4649 * dbus/dbus.h: include dbus/dbus-protocol.h
4651 2003-01-08 Anders Carlsson <andersca@codefactory.se>
4653 * dbus/Makefile.am (dbusinclude_HEADERS): Install
4656 2003-01-08 Anders Carlsson <andersca@codefactory.se>
4658 * dbus/dbus-internals.c: (_dbus_type_to_string):
4659 New function that returns a string describing a type.
4661 * dbus/dbus-marshal.c: (_dbus_demarshal_byte_array):
4662 * dbus/dbus-marshal.h:
4663 * dbus/dbus-message.c: (dbus_message_get_fields_valist),
4664 (dbus_message_iter_get_field_type), (dbus_message_iter_get_double),
4665 (dbus_message_iter_get_byte_array):
4666 * dbus/dbus-message.h:
4667 Add new convenience functions for appending and getting message fields.
4668 Also add demarshalling routines for byte arrays.
4670 2003-01-07 Anders Carlsson <andersca@codefactory.se>
4672 * dbus/dbus-connection-internal.h:
4673 * dbus/dbus-connection.c: (_dbus_connection_new_for_transport),
4674 (_dbus_connection_get_next_client_serial),
4675 (dbus_connection_send_message):
4676 * dbus/dbus-internals.h:
4677 * dbus/dbus-marshal.c: (unpack_uint32), (dbus_unpack_int32),
4678 (dbus_pack_int32), (_dbus_marshal_double), (_dbus_marshal_int32),
4679 (_dbus_marshal_uint32), (_dbus_demarshal_double),
4680 (_dbus_demarshal_int32), (_dbus_demarshal_uint32),
4681 (_dbus_demarshal_string), (_dbus_marshal_get_field_end_pos),
4682 (_dbus_verbose_bytes), (_dbus_marshal_test):
4683 * dbus/dbus-marshal.h:
4684 * dbus/dbus-message-internal.h:
4685 * dbus/dbus-message.c: (_dbus_message_set_client_serial),
4686 (dbus_message_write_header), (_dbus_message_lock),
4687 (dbus_message_new), (dbus_message_ref), (dbus_message_unref),
4688 (dbus_message_get_name), (dbus_message_append_int32),
4689 (dbus_message_append_uint32), (dbus_message_append_double),
4690 (dbus_message_append_string), (dbus_message_append_byte_array),
4691 (dbus_message_get_fields_iter), (dbus_message_iter_ref),
4692 (dbus_message_iter_unref), (dbus_message_iter_has_next),
4693 (dbus_message_iter_next), (dbus_message_iter_get_field_type),
4694 (dbus_message_iter_get_string), (dbus_message_iter_get_int32),
4695 (dbus_message_iter_get_uint32), (dbus_message_iter_get_double),
4696 (decode_header_data), (_dbus_message_loader_return_buffer),
4697 (message_iter_test), (_dbus_message_test):
4698 * dbus/dbus-message.h:
4699 * dbus/dbus-protocol.h:
4700 * dbus/dbus-test.c: (main):
4702 * glib/test-dbus-glib.c: (message_handler), (main):
4703 * test/echo-client.c: (main):
4704 * test/watch.c: (check_messages):
4705 Make messages sendable and receivable for real.
4707 2003-01-07 Anders Carlsson <andersca@codefactory.se>
4709 * dbus/dbus-marshal.c: (_dbus_marshal_double),
4710 (_dbus_marshal_string), (_dbus_marshal_byte_array):
4711 * dbus/dbus-message.c: (dbus_message_append_int32),
4712 (dbus_message_append_uint32), (dbus_message_append_double),
4713 (dbus_message_append_string), (dbus_message_append_byte_array):
4714 Handle OOM restoration.
4716 2003-01-07 Anders Carlsson <andersca@codefactory.se>
4718 * dbus/dbus-marshal.c: (_dbus_marshal_string),
4719 (_dbus_demarshal_string), (_dbus_marshal_test):
4720 * dbus/dbus-marshal.h:
4721 * dbus/dbus-message.c: (dbus_message_get_name),
4722 Document these functions.
4724 (dbus_message_append_int32), (dbus_message_append_uint32),
4725 (dbus_message_append_double), (dbus_message_append_string),
4726 (dbus_message_append_byte_array):
4727 * dbus/dbus-message.h:
4728 Add functions for adding message fields of different types.
4730 * dbus/dbus-protocol.h:
4731 Add the different types.
4733 2003-01-05 Havoc Pennington <hp@pobox.com>
4735 * bus/connection.c: implement routines for handling connections,
4736 first thing is keeping a list of owned services on each connection
4737 and setting up watches etc.
4739 * bus/services.c: implement a mapping from service names to lists
4742 * dbus/dbus-hash.c: add DBUS_HASH_POINTER
4744 * dbus/dbus-threads.c (dbus_static_mutex_lock): add functions
4745 to use static mutexes for global data
4747 * dbus/dbus-connection.c (dbus_connection_set_data): add new
4748 collection of functions to set/get application-specific data
4749 on the DBusConnection.
4751 2003-01-04 Havoc Pennington <hp@pobox.com>
4753 * dbus/dbus-sysdeps.c (_dbus_sleep_milliseconds): new function
4754 (_dbus_poll): new function
4756 * dbus/dbus-internals.h (_DBUS_STRUCT_OFFSET): new macro
4759 * bus/loop.c: initial code for the daemon main loop
4761 2003-01-04 Havoc Pennington <hp@pobox.com>
4763 * test/watch.c (error_handler): make it safe if the error handler
4764 is called multiple times (if we s/error handler/disconnect
4765 handler/ we should just guarantee it's called only once)
4767 * dbus/dbus-transport.c (_dbus_transport_disconnect): call the
4768 error handler on disconnect (it's quite possible we should
4769 just change the error handler to a "disconnect handler," I'm
4770 not sure we have any other meaningful errors)
4772 * configure.in: check for getpwnam_r
4774 * dbus/dbus-transport.c, dbus/dbus-transport-unix.c,
4775 dbus/dbus-auth.c: add credentials support, add EXTERNAL auth
4776 mechanism as in SASL spec, using socket credentials
4778 * dbus/dbus-sysdeps.c (_dbus_read_credentials_unix_socket): new function
4779 (_dbus_send_credentials_unix_socket): new function
4781 * dbus/dbus-sysdeps.c (_dbus_accept_unix_socket): rename just
4783 (_dbus_write): only check errno if <0 returned
4784 (_dbus_write_two): ditto
4786 2003-01-02 Anders Carlsson <andersca@codefactory.se>
4788 * dbus/dbus-marshal.c: (_dbus_marshal_utf8_string),
4789 (_dbus_marshal_byte_array), (_dbus_demarshal_utf8_string),
4790 (_dbus_marshal_test):
4791 * dbus/dbus-marshal.h:
4792 Add _dbus_marshal_byte_array and rename _dbus_marshal_string
4793 to _dbus_marshal_utf8_string. Also fix some tests.
4795 2002-12-28 Harri Porten <porten@kde.org>
4797 * configure.in: added check for C++ compiler and a very cheesy
4798 check for the Qt integration
4800 * Makefile.am (SUBDIRS): compile qt subdir if support is enabled
4802 * qt/Makefile.am: added
4804 * qt/.cvsignore: added
4806 * qt/dbus-qthread.cc, qt/dbus-qthread.cpp: renamed former to
4807 latter, added #ifdef QT_THREAD_SUPPORT guard.
4809 * dbus/Makefile.am: added missing headers for make dist
4811 2002-12-28 Kristian Rietveld <kris@gtk.org>
4813 * dbus/Makefile.am: fixup export-symbols-regex.
4815 2002-12-27 Anders Carlsson <andersca@codefactory.se>
4817 * acinclude.m4: Add this file and put the
4818 PKG_CHECK_MODULE macro in it.
4820 2002-12-27 Anders Carlsson <andersca@codefactory.se>
4822 * dbus/dbus-marshal.c: (_dbus_marshal_string),
4823 (_dbus_demarshal_double), (_dbus_demarshal_int32),
4824 (_dbus_demarshal_uint32), (_dbus_demarshal_string),
4825 (_dbus_marshal_test):
4826 Make the demarshalling routines align the pos argument.
4827 Add string marshalling tests and fix the obvious bugs
4830 2002-12-26 Havoc Pennington <hp@pobox.com>
4832 * dbus/dbus-auth.c: fixes fixes fixes
4834 * dbus/dbus-transport-unix.c: wire up support for
4835 encoding/decoding data on the wire
4837 * dbus/dbus-auth.c (_dbus_auth_encode_data)
4838 (_dbus_auth_decode_data): append to target string
4839 instead of nuking it.
4841 2002-12-26 Havoc Pennington <hp@pobox.com>
4843 * dbus/dbus-marshal.h (DBUS_COMPILER_BYTE_ORDER): #ifdef
4844 WORDS_BIGENDIAN then compiler byte order is DBUS_BIG_ENDIAN,
4847 * dbus/dbus-marshal.c: Add macros to do int swapping in-place and
4848 avoid swap_bytes() overhead (ignoring possible assembly stuff for
4849 now). Main point is because I wanted unpack_uint32 to implement
4851 (_dbus_verbose_bytes): new function
4853 * dbus/dbus-string.c (_dbus_string_validate_ascii): new function
4855 * dbus/dbus-message.c (_dbus_message_loader_get_is_corrupted): add
4856 mechanism to handle a corrupt message stream
4857 (_dbus_message_loader_new): fix preallocation to only prealloc,
4860 * dbus/dbus-string.c (_dbus_string_skip_blank): fix this function
4861 (_dbus_string_test): enhance tests for copy/move and fix the
4864 * dbus/dbus-transport-unix.c: Hold references in more places to
4865 avoid reentrancy problems
4867 * dbus/dbus-transport.c: ditto
4869 * dbus/dbus-connection.c (dbus_connection_dispatch_message): don't
4870 leak reference count in no-message case
4872 * test/watch.c (do_mainloop): handle adding/removing watches
4873 during iteration over the watches. Also, ref the connection/server
4874 stored on a watch, so we don't try to mangle a destroyed one.
4876 * dbus/dbus-transport-unix.c (do_authentication): perform
4879 * dbus/dbus-auth.c (get_state): add a state
4880 AUTHENTICATED_WITH_UNUSED_BYTES and return it if required
4881 (_dbus_auth_get_unused_bytes): append the unused bytes
4882 to the passed in string, rather than prepend
4884 * dbus/dbus-transport.c (_dbus_transport_init_base): create
4885 the auth conversation DBusAuth
4887 * dbus/dbus-transport-unix.c (_dbus_transport_new_for_fd)
4888 (_dbus_transport_new_for_domain_socket): when creating a
4889 transport, pass in whether it's a client-side or server-side
4890 transport so we know which DBusAuth to create
4892 2002-12-03 Havoc Pennington <hp@pobox.com>
4894 * dbus/dbus-transport-unix.c (unix_finalize): finalize base
4895 _after_ finalizing the derived members
4896 (unix_connection_set): unref watch if we fail to add it
4898 * dbus/dbus-connection.c (dbus_connection_unref): delete the
4899 transport first, so that the connection owned by the
4900 transport will be valid as the transport finalizes.
4902 * dbus/dbus-transport-unix.c (unix_finalize): free the write_watch
4903 if necessary, and remove watches from the connection.
4905 * dbus/dbus-watch.c (_dbus_watch_list_free): improve a comment
4907 2002-12-26 Anders Carlsson <andersca@codefactory.se>
4909 * dbus/dbus-marshal.c: (_dbus_marshal_string),
4910 (_dbus_demarshal_double), (_dbus_demarshal_int32),
4911 (_dbus_demarshal_uint32), (_dbus_demarshal_string),
4912 (_dbus_marshal_test):
4913 * dbus/dbus-marshal.h:
4914 Add string marshal functions and have the demarshal functions
4915 return the new position.
4917 2002-12-25 Havoc Pennington <hp@pobox.com>
4919 * doc/dbus-sasl-profile.txt: docs on the authentication protocol,
4920 it is a simple protocol that just maps directly to SASL.
4922 * dbus/dbus-auth.h, dbus/dbus-auth.c: authentication protocol
4923 initial implementation, not actually used yet.
4925 * dbus/dbus-string.c (_dbus_string_find): new function
4926 (_dbus_string_equal): new function
4927 (_dbus_string_base64_encode): new function
4928 (_dbus_string_base64_decode): new function
4930 2002-12-25 Anders Carlsson <andersca@codefactory.se>
4933 * dbus/dbus-marshal.c: (swap_bytes), (_dbus_marshal_double),
4934 (_dbus_marshal_int32), (_dbus_marshal_uint32),
4935 (_dbus_demarshal_double), (_dbus_demarshal_int32),
4936 (_dbus_demarshal_uint32), (_dbus_marshal_test):
4937 * dbus/dbus-marshal.h:
4938 * dbus/dbus-protocol.h:
4939 * dbus/dbus-test.c: (main):
4941 Add un-optimized marshalling/demarshalling routines.
4943 2002-12-25 Harri Porten <porten@kde.org>
4945 * qt/dbus-qt.h: adjusted ctor and getter to KDE/Qt conventions
4947 2002-12-24 Zack Rusin <zack@kde.org>
4949 * qt/dbus-qthread.cc: adding - integrates QMutex into Dbus
4950 * qt/dbus-qt.h: skeleton with two sample implemenatation of the
4953 2002-12-24 Havoc Pennington <hp@pobox.com>
4955 * glib/dbus-gthread.c: fix include
4957 * glib/dbus-glib.h: rename DBusMessageHandler for now.
4958 I think glib API needs to change, though, as you don't
4959 want to use DBusMessageFunction, you want to use the
4960 DBusMessageHandler object. Probably
4961 dbus_connection_open_with_g_main_loop()
4962 and dbus_connection_setup_g_main_loop() or something like that
4963 (but think of better names...) that just create a connection
4964 that has watch/timeout functions etc. already set up.
4966 * dbus/dbus-connection.c
4967 (dbus_connection_send_message_with_reply): new function just to
4968 show how the message handler helps us deal with replies.
4970 * dbus/dbus-list.c (_dbus_list_remove_last): new function
4972 * dbus/dbus-string.c (_dbus_string_test): free a string that
4975 * dbus/dbus-hash.c: use memory pools for the hash entries
4976 (rebuild_table): be more paranoid about overflow, and
4977 shrink table when we can
4978 (_dbus_hash_test): reduce number of sprintfs and write
4979 valid C89. Add tests for case where we grow and then
4980 shrink the hash table.
4982 * dbus/dbus-mempool.h, dbus/dbus-mempool.c: memory pools
4984 * dbus/dbus-connection.c (dbus_connection_register_handler)
4985 (dbus_connection_unregister_handler): new functions
4987 * dbus/dbus-message.c (dbus_message_get_name): new
4989 * dbus/dbus-list.c: fix docs typo
4991 * dbus/dbus-message-handler.h, dbus/dbus-message-handler.c:
4992 an object representing a handler for messages.
4994 2002-12-16 Anders Carlsson <andersca@codefactory.se>
4997 * glib/dbus-gthread.c: (dbus_gthread_init):
4998 Don't use the gdbus prefix for public functions.
5000 2002-12-16 Anders Carlsson <andersca@codefactory.se>
5004 Add GLib checks and fixup .pc files
5008 * glib/dbus-gmain.c: (gdbus_connection_prepare),
5009 (gdbus_connection_check), (gdbus_connection_dispatch),
5010 (gdbus_add_connection_watch), (gdbus_remove_connection_watch),
5011 (dbus_connection_gsource_new):
5012 * glib/dbus-gthread.c: (dbus_gmutex_new), (dbus_gmutex_free),
5013 (dbus_gmutex_lock), (dbus_gmutex_unlock), (dbus_gthread_init):
5014 * glib/test-dbus-glib.c: (message_handler), (main):
5017 2002-12-15 Harri Porten <porten@kde.org>
5019 * autogen.sh: check for libtoolize before attempting to use it
5021 * dbus/dbus-transport-unix.c: include <sys/time.h> for timeval
5024 * .cvsignore: ignore more stamp files
5026 * dbus/dbus-watch.c (_dbus_watch_list_new): fixed doc error
5028 * test/Makefile.am: added -I$(top_srcdir) to be able to compile
5029 without make install.
5031 2002-12-15 Havoc Pennington <hp@pobox.com>
5033 * dbus/dbus-threads.c: add thread stubs that a higher library
5034 layer can fill in. e.g. the GLib wrapper might fill them in with
5035 GThread stuff. We still need to use this thread API to
5036 thread-safe-ize the library.
5038 2002-12-12 Havoc Pennington <hp@pobox.com>
5040 * dbus/dbus-transport-unix.c, dbus/dbus-server-unix.c: use the
5041 below new interfaces and include fewer system headers.
5043 * dbus/dbus-sysdeps.c (_dbus_read): new function
5044 (_dbus_write): new function
5045 (_dbus_write_two): new function
5046 (_dbus_connect_unix_socket): new function
5047 (_dbus_listen_unix_socket): new function
5049 * dbus/dbus-message-internal.h: change interfaces to use
5052 2002-12-11 Havoc Pennington <hp@pobox.com>
5054 * dbus/dbus-types.h: add dbus_unichar
5056 * dbus/dbus-internals.c (_dbus_verbose): use _dbus_getenv
5058 * dbus/dbus-connection.c (dbus_connection_send_message): return
5061 * dbus/dbus-transport.c: include dbus-watch.h
5063 * dbus/dbus-connection.c: include dbus-message-internal.h
5065 * HACKING: add file with coding guidelines stuff.
5067 * dbus/dbus-string.h, dbus/dbus-string.c: Encapsulate all string
5068 handling here, for security purposes (as in vsftpd). Not actually
5069 using this class yet.
5071 * dbus/dbus-sysdeps.h, dbus/dbus-sysdeps.c: Encapsulate all
5072 system/libc usage here, as in vsftpd, for ease of auditing (and
5073 should also simplify portability). Haven't actually moved all the
5074 system/libc usage into here yet.
5076 2002-11-25 Havoc Pennington <hp@pobox.com>
5078 * dbus/dbus-internals.c (_dbus_verbose): fix to not
5079 always print the first verbose message.
5081 2002-11-24 Havoc Pennington <hp@pobox.com>
5083 * test/echo-client.c, test/echo-server.c: cheesy test
5086 * configure.in (AC_CHECK_FUNCS): check for writev
5088 * dbus/dbus-message.c (_dbus_message_get_network_data): new
5091 * dbus/dbus-list.c (_dbus_list_foreach): new function
5093 * dbus/dbus-internals.c (_dbus_verbose): new function
5095 * dbus/dbus-server.c, dbus/dbus-server.h: public object
5096 representing a server that listens for connections.
5098 * dbus/.cvsignore: create
5100 * dbus/dbus-errors.h, dbus/dbus-errors.c:
5101 public API for reporting errors
5103 * dbus/dbus-connection.h, dbus/dbus-connection.c:
5104 public object representing a connection that
5105 sends/receives messages. (Same object used for
5106 both client and server.)
5108 * dbus/dbus-transport.h, dbus/dbus-transport.c:
5109 Basic abstraction for different kinds of stream
5110 that we might read/write messages from.
5112 2002-11-23 Havoc Pennington <hp@pobox.com>
5114 * dbus/dbus-internals.h (_DBUS_INT_MAX): add _DBUS_INT_MIN
5117 * dbus/dbus-test.c (main): add list test, and include
5118 dbus-test.h as intended
5120 * dbus/dbus-hash.c (_dbus_hash_table_remove_string)
5121 (_dbus_hash_table_remove_int): return value indicates
5122 whether the entry existed to remove
5124 * dbus/dbus-list.c: add linked list utility class,
5127 * dbus/dbus-hash.c: add TODO item about shrinking the hash bucket
5130 2002-11-23 Havoc Pennington <hp@pobox.com>
5132 * Doxyfile.in (INCLUDE_FILE_PATTERNS): expand DBUS_BEGIN_DECLS/
5133 DBUS_END_DECLS to nothing, that should fix this once and for all
5135 * Doxyfile.in (JAVADOC_AUTOBRIEF): set to YES
5137 * dbus/dbus-message.c, dbus/dbus-hash.c:
5138 add some missing @brief
5140 2002-11-23 Havoc Pennington <hp@pobox.com>
5142 * dbus/dbus-message.h: put semicolons after DEBUG_BEGIN_DECLS
5143 to avoid confusing Doxygen
5145 * dbus/dbus-hash.c: @} not }@
5147 * dbus/dbus-message.c (struct DBusMessage): split out
5150 2002-11-23 Havoc Pennington <hp@pobox.com>
5152 * configure.in: pile on more warning flags if using gcc
5154 * Doxyfile.in (EXTRACT_STATIC): set to NO, so we don't have
5155 to document static functions
5157 * configure.in: add summary to end of configure so it
5158 looks nice and attractive
5160 * dbus/dbus-hash.c: finish implementation and write unit
5163 * configure.in: add --enable-tests to enable unit tests
5165 * dbus/dbus-test.c: test program to run unit tests
5166 for all files in dbus/*, initially runs a test for
5169 * dbus/dbus-internals.h: file to hold some internal utility stuff
5171 2002-11-22 Havoc Pennington <hp@redhat.com>
5173 * dbus/dbus-hash.c: copy in Tcl hash table, not yet
5174 "ported" away from Tcl
5176 * dbus/dbus-types.h: header for types such as dbus_bool_t
5178 2002-11-22 Havoc Pennington <hp@redhat.com>
5180 * dbus/dbus.h: fixups for doc warnings
5182 * Doxyfile.in (FILE_PATTERNS): we need to scan .h to pick up
5184 (QUIET): make it quiet so we can see warnings
5186 * dbus/dbus-memory.c: teach D-BUS to allocate and free memory
5188 2002-11-22 Havoc Pennington <hp@redhat.com>
5190 * Makefile.am: include "Doxyfile" target in all-local
5192 * configure.in: generate the Doxyfile
5194 * Doxyfile.in: move Doxyfile here, so we can use
5195 configure to generate a Doxyfile with the right
5198 2002-11-22 Havoc Pennington <hp@redhat.com>
5200 * dbus/dbus-message.c: move inline docs into .c file
5202 * Doxyfile (OUTPUT_DIRECTORY): move output to doc/api
5203 so all docs are under doc/
5204 (MAN_EXTENSION): generate man pages. Use extension
5205 ".3dbus" which matches ".3qt" on my system,
5206 I guess this is OK, I don't know really.
5207 (FILE_PATTERNS): look for .c files not .h, makes sense
5210 2002-11-22 Havoc Pennington <hp@pobox.com>
5212 * Makefile.am (SUBDIRS): rename subdir "server" to "bus"
5213 because any app can be a server, and any app can be a client,
5214 the bus is a special kind of server.
5216 Thu Nov 21 23:35:31 2002 Zack Rusin <zack@kde.org>
5218 * Doxyfile : adding. Still needs Makefile rules to be generated
5219 automatically (just run "doxygen" in the toplevel dir for now to
5222 * dbus/dbus-message.h : Adding sample docs (javadoc since
5223 resembles gtk-doc a little more)
5225 * dbus/dbus.h : Adding sample docs
5227 2002-11-21 Havoc Pennington <hp@redhat.com>
5229 * dbus/Makefile.am (INCLUDES): define DBUS_COMPILATION
5230 so we can allow ourselves to include files directly,
5231 instead of having to use dbus.h
5233 * dbus/dbus.h: fill in
5235 * dbus/dbus-message.h: sketch out a sample header file.
5236 Include griping if you include it directly instead of
5239 * dbus/dbus-macros.h: new file with macros for extern "C",
5240 TRUE/FALSE, NULL, etc.
5242 * doc/file-boilerplate.c: put include guards in here
5244 2002-11-21 Havoc Pennington <hp@redhat.com>
5246 * doc/file-boilerplate.c: include both AFL and GPL boilerplate.
5248 * COPYING: include the GPL as well, and license code
5249 under both AFL and GPL.
5251 2002-11-21 Havoc Pennington <hp@redhat.com>
5253 * acconfig.h: get rid of this
5255 * autogen.sh (run_configure): add --no-configure option
5257 * configure.in: remove AC_ARG_PROGRAM to make
5258 autoconf complain less. add AC_PREREQ.
5259 add AC_DEFINE third arg.
5261 2002-11-21 Anders Carlsson <andersca@codefactory.se>
5264 Fix references so we can distcheck.
5266 2002-11-21 Havoc Pennington <hp@redhat.com>
5268 * Initial module creation