1 2003-03-16 Havoc Pennington <hp@pobox.com>
3 * dbus/dbus-bus.c (ensure_bus_data): fix double-unref of the data slot
5 2003-03-17 Anders Carlsson <andersca@codefactory.se>
7 * bus/activation.c (bus_activation_activate_service): Append
8 the pending activation entry to the list of pending activations.
10 2003-03-16 Havoc Pennington <hp@pobox.com>
12 * bus/dispatch.c (bus_dispatch_test): remove double-unrefs of
15 * dbus/dbus-address.c (create_entry): fix OOM handling when
16 failing to alloc entry->method
18 2003-03-16 Havoc Pennington <hp@pobox.com>
20 * dbus/dbus-watch.c (_dbus_watch_new): handle failure to malloc
23 * dbus/dbus-server-debug-pipe.c (_dbus_transport_debug_pipe_new):
24 add some missing dbus_set_result
26 * bus/dispatch.c (bus_dispatch_add_connection): handle failure to
27 alloc the DBusMessageHandler
29 * dbus/dbus-transport.c (_dbus_transport_disconnect): don't ref
30 the transport here, since we call this from the finalizer; it
31 resulted in a double-finalize.
33 * dbus/dbus-transport.c (_dbus_transport_disconnect): fix a bug
34 where we tried to use transport->connection that was NULL,
35 happened when transport was disconnected early on due to OOM
37 * bus/*.c: adapt to handle OOM for watches/timeouts
39 * dbus/dbus-transport-unix.c: port to handle OOM during
42 * dbus/dbus-auth.c (_dbus_auth_get_unused_bytes): return a
43 reference to unused bytes instead of a copy
45 * dbus/dbus-server.c (dbus_server_handle_watch): return FALSE for
48 * dbus/dbus-connection.c (dbus_connection_handle_watch): return
51 * dbus/dbus-timeout.c (dbus_timeout_handle): return FALSE for out
54 2003-03-16 Anders Carlsson <andersca@codefactory.se>
56 * doc/dbus-specification.sgml:
57 Document reply message for ActivateService.
59 2003-03-16 Anders Carlsson <andersca@codefactory.se>
61 * bus/activation.c: (bus_pending_activation_entry_free),
62 (bus_pending_activation_free), (bus_activation_new),
63 (bus_activation_unref), (bus_activation_service_created),
64 (bus_activation_activate_service):
66 * bus/bus.c: (bus_context_new):
67 * bus/desktop-file.c: (new_section):
68 * bus/driver.c: (bus_driver_send_service_deleted),
69 (bus_driver_handle_activate_service):
70 * bus/services.c: (bus_registry_new), (bus_registry_ensure):
72 * dbus/dbus-connection.c:
73 (dbus_connection_send_with_reply_and_block):
74 * dbus/dbus-message.c: (dbus_message_append_args_valist):
75 * dbus/dbus-protocol.h:
76 Make activation work better. Now pending activations will be queued
77 and the daemon won't try to activate services that are already registered.
79 2003-03-16 Havoc Pennington <hp@pobox.com>
81 * dbus/dbus-bus.c (ensure_bus_data): handle failure to set
84 * dbus/dbus-memory.c (_dbus_initialize_malloc_debug): support
85 DBUS_MALLOC_BACKTRACES to print trace when failing an alloc
87 2003-03-16 Havoc Pennington <hp@pobox.com>
89 * dbus/dbus-string.c (_dbus_string_validate_utf8): oops, unbreak
90 this. always run the test suite before commit...
92 * bus/*: adapt to DBusConnection API changes
94 * glib/dbus-gmain.c: adapt to DBusConnection API changes,
95 requires renaming stuff to avoid dbus_connection_dispatch name
98 * dbus/dbus-transport.c (_dbus_transport_queue_messages): new
101 * dbus/dbus-message.c (_dbus_message_loader_queue_messages):
102 separate from _dbus_message_loader_return_buffer()
104 * dbus/dbus-connection.c (dbus_connection_get_n_messages): remove
105 this, because it's now always broken to use; the number of
106 messages in queue vs. the number still buffered by the message
107 loader is undefined/meaningless. Should use
108 dbus_connection_get_dispatch_state().
109 (dbus_connection_dispatch): rename from
110 dbus_connection_dispatch_message
112 2003-03-16 Havoc Pennington <hp@pobox.com>
114 * dbus/dbus-string.c (_dbus_string_validate_utf8): copy in a real
117 2003-03-16 Anders Carlsson <andersca@codefactory.se>
119 * dbus/dbus-connection.c:
120 (dbus_connection_send_with_reply_and_block):
121 Decrease connection->n_incoming when removing an entry
123 * dbus/dbus-dict.c: (dbus_dict_entry_free),
124 (dbus_dict_set_boolean_array), (dbus_dict_set_int32_array),
125 (dbus_dict_set_uint32_array), (dbus_dict_set_double_array),
126 (dbus_dict_set_byte_array), (dbus_dict_set_string_array),
127 (dbus_dict_get_boolean_array), (dbus_dict_get_double_array),
128 (dbus_dict_get_byte_array):
129 Handle NULL arrays and strings. Also add support for byte arrays.
131 * dbus/dbus-marshal.c: (_dbus_marshal_byte_array),
132 (_dbus_marshal_dict), (_dbus_demarshal_byte_array),
133 (_dbus_demarshal_int32_array), (_dbus_demarshal_uint32_array),
134 (_dbus_demarshal_double_array), (_dbus_demarshal_string_array),
135 (_dbus_demarshal_dict), (demarshal_and_validate_len),
136 (_dbus_marshal_validate_arg), (_dbus_marshal_test):
137 * dbus/dbus-marshal.h:
138 Add support for marshalling and demarshalling empty arrays and strings.
140 * dbus/dbus-message.c: (dbus_message_append_args_valist),
141 (dbus_message_append_string_array),
142 (dbus_message_iter_get_boolean),
143 (dbus_message_iter_get_boolean_array),
144 (dbus_message_iter_get_int32_array),
145 (dbus_message_iter_get_uint32_array),
146 (dbus_message_iter_get_double_array),
147 (dbus_message_iter_get_byte_array),
148 (dbus_message_iter_get_string_array), (dbus_message_iter_get_dict),
149 (check_message_handling):
150 Add support for getting empty arrays and dicts.
152 * dbus/dbus-string.c: (_dbus_string_validate_utf8):
153 Don't do any validation at all for now, that's better than just checking
156 * test/data/valid-messages/emptiness.message:
157 New test message with lots of empty arrays.
159 2003-03-16 Havoc Pennington <hp@pobox.com>
161 * dbus/dbus-connection.c
162 (_dbus_connection_queue_received_message_link): new function that
163 can't fail due to OOM
165 * dbus/dbus-message.c (_dbus_message_loader_pop_message_link):
166 new function pops a message together with a list link
169 * dbus/dbus-transport-unix.c (queue_messages): use new link-based
170 message queuing functions to avoid needing to alloc memory
172 2003-03-16 Havoc Pennington <hp@pobox.com>
174 Oops - test code was only testing failure of around 30 of the
175 mallocs in the test path, but it turns out there are 500+
176 mallocs. I believe this was due to misguided linking setup such
177 that there was one copy of dbus_malloc etc. in the daemon and one
178 in the shared lib, and only daemon mallocs were tested. In any
179 case, the test case now tests all 500+ mallocs, and doesn't pass
180 yet, though there are lots of fixes in this patch.
182 * dbus/dbus-connection.c (dbus_connection_dispatch_message): fix
183 this so that it doesn't need to allocate memory, since it
184 has no way of indicating failure due to OOM (and would be
187 * dbus/dbus-list.c (_dbus_list_pop_first_link): new function
189 * bus/Makefile.am: rearrange to create two self-contained
190 libraries, to avoid having libraries with overlapping symbols.
191 that was resulting in weirdness, e.g. I'm pretty sure there
192 were two copies of global static variables.
194 * dbus/dbus-internals.c: move the malloc debug stuff to
197 * dbus/dbus-list.c (free_link): free list mempool if it becomes
200 * dbus/dbus-memory.c (_dbus_disable_mem_pools): new function
202 * dbus/dbus-address.c (dbus_parse_address): free list nodes
205 * bus/dispatch.c (bus_dispatch_add_connection): free
206 message_handler_slot when no longer using it, so
207 memory leak checkers are happy for the test suite.
209 * dbus/dbus-server-debug-pipe.c (debug_finalize): free server name
211 * bus/bus.c (new_connection_callback): disconnect in here if
212 bus_connections_setup_connection fails.
214 * bus/connection.c (bus_connections_unref): fix to free the
216 (bus_connections_setup_connection): if this fails, don't
217 disconnect the connection, just be sure there are no side
220 * dbus/dbus-string.c (undo_alignment): unbreak this
222 * dbus/dbus-auth.c (_dbus_auth_unref): free some stuff we were
224 (_dbus_auth_new): fix the order in which we free strings
227 * bus/connection.c (bus_connection_disconnected): fix to
228 not send ServiceDeleted multiple times in case of memory
231 * dbus/dbus-bus.c (dbus_bus_get_base_service): new function to
232 get the base service name
233 (dbus_bus_register_client): don't return base service name,
234 instead store it on the DBusConnection and have an accessor
236 (dbus_bus_register_client): rename dbus_bus_register()
238 * bus/dispatch.c (check_hello_message): verify that other
239 connections on the bus also got the correct results, not
240 just the one sending hello
242 2003-03-15 Havoc Pennington <hp@pobox.com>
244 Make it pass the Hello handling test including all OOM codepaths.
245 Now to do other messages...
247 * bus/services.c (bus_service_remove_owner): fix crash when
248 removing owner from an empty list of owners
249 (bus_registry_ensure): don't leave service in the list of
250 a connection's owned services if we fail to put the service
253 * bus/connection.c (bus_connection_preallocate_oom_error): set
254 error flag on the OOM error.
256 * dbus/dbus-connection.c (_dbus_connection_new_for_transport):
257 handle _dbus_transport_set_connection failure
259 * dbus/dbus-transport-unix.c (_dbus_transport_new_for_fd): modify
260 to create watches up front and simply enable/disable them as
262 (unix_connection_set): this can now fail on OOM
264 * dbus/dbus-timeout.c, dbus/dbus-watch.c: add concept
265 of enabling/disabling a watch or timeout.
267 * bus/loop.c (bus_loop_iterate): don't touch disabled
270 * glib/dbus-gmain.c: adapt to enable/disable watches and timeouts
272 2003-03-15 Havoc Pennington <hp@pobox.com>
274 * bus/dispatch.c (bus_dispatch_test): OK, now finally actually
275 write useful test code, after all that futzing around ;-)
277 Test does not yet pass because we can't handle OOM in
278 _dbus_transport_messages_pending (basically,
279 dbus_connection_preallocate_send() does not prealloc the write
280 watch). To fix this, I think we need to add new stuff to
281 set_watch_functions, namely a SetEnabled function so we can alloc
282 the watch earlier, then enable it later.
284 * dbus/Makefile.am (libdbus_convenience_la_SOURCES): move
285 dbus-memory.c to the convenience lib
287 * bus/test.c: rename some static functions to keep them clearly
288 distinct from stuff in connection.c. Handle client disconnection.
290 2003-03-14 Havoc Pennington <hp@pobox.com>
292 * bus/dispatch.c (bus_dispatch_test): do test using debug-pipe
293 transport, tests more of the real codepath. Set up clients
294 with bus_setup_debug_client.
296 * bus/test.c (bus_setup_debug_client): function to set up debug
297 "clients" on the main loop
299 * dbus/dbus-transport.c (_dbus_transport_open): add debug-pipe
302 * dbus/dbus-server.c (dbus_server_listen): add debug-pipe
305 * dbus/dbus-server-debug.c: support a debug server based on pipes
307 * dbus/dbus-sysdeps.c (_dbus_full_duplex_pipe): new function
308 (_dbus_close): new function
310 * configure.in: check for socketpair
312 2003-03-14 Havoc Pennington <hp@redhat.com>
314 * dbus/dbus-memory.c: add a "detect buffer overwrites on free"
317 * dbus/dbus-transport-debug.c: rework this a good bit to be
318 less complicated. hopefully still works.
320 * dbus/dbus-server-debug.c (handle_new_client): remove timeout
323 * glib/dbus-gmain.c (timeout_handler): don't remove timeout
326 * dbus/dbus-message.c (dbus_message_copy): rename from
327 dbus_message_new_from_message, fix it up to copy
328 all the message fields, add test case
330 * bus/dispatch.c (bus_dispatch_test): add some more test code,
331 not quite passing yet
333 2003-03-14 Havoc Pennington <hp@pobox.com>
335 * bus/loop.c (bus_loop_iterate): add this so we can "run loop
336 until no work remains" in test code. (the large diff here
337 is just code movement, no actual changes)
339 * dbus/dbus-server-debug.c (DEFAULT_INTERVAL): change interval to
340 1, no point waiting around for test code.
341 (_dbus_server_debug_accept_transport): unref the timeout
342 after adding it (right?)
344 * dbus/dbus-transport-debug.c (DEFAULT_INTERVAL): ditto
346 2003-03-13 Havoc Pennington <hp@redhat.com>
348 * dbus/dbus-timeout.c (_dbus_timeout_list_set_functions): handle
351 * dbus/dbus-watch.c (_dbus_watch_list_set_functions): handle out
354 * dbus/dbus-connection.h: Make AddWatchFunction and
355 AddTimeoutFunction return a bool so they can fail on out-of-memory
357 * bus/bus.c (bus_context_new): set up timeout handlers
359 * bus/connection.c (bus_connections_setup_connection): set up
362 * glib/dbus-gmain.c: adapt to the fact that set_functions stuff
365 * bus/bus.c (bus_context_new): adapt to changes
367 * bus/connection.c: adapt to changes
369 * test/watch.c: adapt to DBusWatch changes
371 * bus/dispatch.c (bus_dispatch_test): started adding this but
374 2003-03-14 Anders Carlsson <andersca@codefactory.se>
376 * bus/dispatch.c (send_service_nonexistent_error): Fix typo.
378 2003-03-13 Havoc Pennington <hp@pobox.com>
380 * bus/test.c, bus/test.h, bus/Makefile.am, bus/test-main.c:
381 set up a test framework as for the library
383 2003-03-12 Havoc Pennington <hp@pobox.com>
385 Throughout: purge global variables, introduce BusActivation,
386 BusConnections, BusRegistry, etc. objects instead.
388 * bus/bus.h, bus/bus.c: introduce BusContext as a global
391 * test/Makefile.am (TEST_BINARIES): disable bus-test for now,
392 going to redo this a bit differently I think
394 2003-03-12 Havoc Pennington <hp@redhat.com>
396 Mega-patch that gets the message bus daemon initially handling
397 out-of-memory. Work still needed. Also lots of random
398 moving stuff to DBusError instead of ResultCode.
400 * dbus/dbus-list.c (_dbus_list_length_is_one): new function
402 * dbus/dbus-connection.c
403 (dbus_connection_send_with_reply_and_block): use DBusError
405 * dbus/dbus-bus.c: adapt to API changes, make it use DBusError not
408 * dbus/dbus-connection.c (dbus_connection_send): drop the result
409 code here, as the only failure possible is OOM.
411 * bus/connection.c (bus_connection_disconnect):
412 rename bus_connection_disconnected as it's a notification only
414 * bus/driver.c (bus_driver_handle_acquire_service): don't free
415 "name" on get_args failure, should be done by get_args;
416 don't disconnect client for bad args, just return an error.
417 (bus_driver_handle_service_exists): ditto
419 * bus/services.c (bus_services_list): NULL-terminate returned array
421 * bus/driver.c (bus_driver_send_service_lost)
422 (bus_driver_send_service_acquired): send messages from driver to a
423 specific client to the client's unique name, not to the broadcast
426 * dbus/dbus-message.c (decode_header_data): reject messages that
427 contain no name field
428 (_dbus_message_get_client_serial): rename to
429 dbus_message_get_serial and make public
430 (_dbus_message_set_serial): rename from set_client_serial
431 (_dbus_message_set_reply_serial): make public
432 (_dbus_message_get_reply_serial): make public
434 * bus/connection.c (bus_connection_foreach): allow stopping
435 iteration by returning FALSE from foreach function.
437 * dbus/dbus-connection.c (dbus_connection_send_preallocated)
438 (dbus_connection_free_preallocated_send)
439 (dbus_connection_preallocate_send): new API for sending a message
440 without possibility of malloc failure.
441 (dbus_connection_send_message): rename to just
442 dbus_connection_send (and same for whole function family)
444 * dbus/dbus-errors.c (dbus_error_free): make this reinit the error
446 * dbus/dbus-sysdeps.c (_dbus_exit): new function
448 * bus/activation.c: handle/return errors
450 * dbus/dbus-errors.h: add more DBUS_ERROR #define
452 * dbus/dbus-sysdeps.c (_dbus_directory_open) (_dbus_file_get_contents)
453 (_dbus_directory_get_next_file): use DBusError instead of DBusResultCode
454 (_dbus_result_from_errno): move to this file
456 2003-03-10 Anders Carlsson <andersca@codefactory.se>
458 * dbus/dbus-marshal.c:
459 (_dbus_marshal_set_string):
460 Take a length argument so we can marshal the correct string
463 (_dbus_marshal_dict), (_dbus_demarshal_dict),
464 (_dbus_marshal_get_arg_end_pos), (_dbus_marshal_validate_arg),
465 (_dbus_marshal_test):
466 * dbus/dbus-marshal.h:
467 Add support for marshalling and demarshalling dicts.
469 * dbus/dbus-message-builder.c: (_dbus_message_data_load):
470 Add support for TYPE DICT.
472 * dbus/dbus-message.c: (set_string_field):
473 Adjust header padding.
475 (dbus_message_append_args_valist), (dbus_message_append_dict),
476 (dbus_message_get_args_valist), (dbus_message_iter_get_arg_type),
477 (dbus_message_iter_get_dict), (_dbus_message_loader_return_buffer),
478 (check_message_handling), (check_have_valid_message):
479 * dbus/dbus-message.h:
480 Add functions for setting and getting dicts.
482 * dbus/dbus-protocol.h:
488 * doc/dbus-specification.sgml:
489 Add information about how dicts are marshalled.
491 * test/data/invalid-messages/dict-with-nil-value.message:
492 * test/data/invalid-messages/too-short-dict.message:
493 * test/data/valid-messages/dict-simple.message:
494 * test/data/valid-messages/dict.message:
495 Add sample messages containing dicts.
497 2003-03-08 Anders Carlsson <andersca@codefactory.se>
499 * dbus/dbus-dict.h: Add DBUS_END_DECLS.
501 2003-03-07 Anders Carlsson <andersca@codefactory.se>
504 * dbus/dbus-dict.c: (dbus_dict_entry_free), (dbus_dict_new),
505 (dbus_dict_get_keys), (insert_entry), (dbus_dict_set_boolean),
506 (dbus_dict_set_int32), (dbus_dict_set_uint32),
507 (dbus_dict_set_double), (dbus_dict_set_string),
508 (dbus_dict_set_boolean_array), (dbus_dict_set_int32_array),
509 (dbus_dict_set_uint32_array), (dbus_dict_set_double_array),
510 (dbus_dict_set_string_array), (_dbus_dict_test):
512 Fix according to comments from Havoc.
514 2003-03-06 Michael Meeks <michael@server.home>
516 * configure.in: if we don't have kde-config, disable have_qt.
518 2003-03-07 Anders Carlsson <andersca@codefactory.se>
523 * dbus/dbus-dict.c: (dbus_dict_entry_free), (dbus_dict_new),
524 (dbus_dict_ref), (dbus_dict_unref), (dbus_dict_contains),
525 (dbus_dict_remove), (dbus_dict_get_value_type),
526 (dbus_dict_get_keys), (dbus_dict_put_boolean),
527 (dbus_dict_put_int32), (dbus_dict_put_uint32),
528 (dbus_dict_put_double), (dbus_dict_put_string),
529 (dbus_dict_put_boolean_array), (dbus_dict_put_int32_array),
530 (dbus_dict_put_uint32_array), (dbus_dict_put_double_array),
531 (dbus_dict_put_string_array), (dbus_dict_get_boolean),
532 (dbus_dict_get_int32), (dbus_dict_get_uint32),
533 (dbus_dict_get_double), (dbus_dict_get_string),
534 (dbus_dict_get_boolean_array), (dbus_dict_get_int32_array),
535 (dbus_dict_get_uint32_array), (dbus_dict_get_double_array),
536 (dbus_dict_get_string_array), (_dbus_dict_test):
538 Add DBusDict implementation
540 * dbus/dbus-test.c: (dbus_internal_do_not_use_run_tests):
544 2003-03-04 Havoc Pennington <hp@pobox.com>
546 * test/data/auth/*: adapt to changes
548 * dbus/dbus-auth-script.c (_dbus_auth_script_run): add
549 USERID_BASE64 and change USERNAME_BASE64 to put in username not
552 * dbus/dbus-keyring.c (_dbus_keyring_validate_context): prevent
553 more stuff from being in a context name, to make the protocol
556 * dbus/dbus-errors.c (dbus_error_has_name): new function
557 (dbus_error_is_set): new function
559 * dbus/dbus-auth.c: replace DBUS_STUPID_TEST_MECH auth
560 with DBUS_COOKIE_SHA1, implement DBUS_COOKIE_SHA1
562 * dbus/dbus-connection.c (dbus_connection_flush): also read
563 messages during a flush operation
565 * dbus/Makefile.am: remove dbus-md5 since it isn't currently used.
567 2003-03-05 Anders Carlsson <andersca@codefactory.se>
569 * configure.in: Check for gethostbyname on Solaris.
571 * dbus/dbus-transport.c: (_dbus_transport_open):
572 Remove duplicate "tcp" entry.
574 * doc/dbus-specification.sgml:
577 2003-03-05 Anders Carlsson <andersca@codefactory.se>
579 * dbus/dbus-auth.c: (send_rejected), (process_test_subdir):
580 * dbus/dbus-keyring.c: (_dbus_keyring_new_homedir),
581 (_dbus_keyring_test):
582 * dbus/dbus-md5.c: (_dbus_md5_compute):
583 * dbus/dbus-sha.c: (_dbus_sha_compute):
586 2003-03-05 Anders Carlsson <andersca@codefactory.se>
588 * README: Add some things.
590 2003-03-04 Anders Carlsson <andersca@codefactory.se>
592 * dbus/dbus-message.c (dbus_message_append_args_valist): Add a break;
593 after case DBUS_TYPE_BOOELAN.
595 2003-03-02 Havoc Pennington <hp@pobox.com>
597 * test/break-loader.c (randomly_set_extreme_ints): add test that
598 sets really huge and small integers
600 * dbus/dbus-marshal.c (_dbus_marshal_validate_arg): add check
601 that length of boolean array fits in the string, and that
602 string has room for boolean value in single-bool case.
604 * dbus/dbus-message-builder.c (_dbus_message_data_load): add
605 optional value to "ALIGN" command which is what to fill the
608 * test/data/valid-messages/no-padding.message: add regression
609 test for the message padding problem
611 2003-03-02 Havoc Pennington <hp@pobox.com>
613 * dbus/dbus-message.c (decode_header_data): fix to always init
614 message_padding, from Benjamin Dauvergne
616 2003-03-02 Havoc Pennington <hp@pobox.com>
622 2003-03-01 Joe Shaw <joe@assbarn.com>
624 * configure.in: Check for "struct cmsgcred" and try to access its
625 members for BSD-like unices.
627 * dbus/dbus-sysdeps.c (read_credentials_byte): Fold this back into
628 _dbus_read_credentials_unix_socket().
629 (_dbus_read_credentials_unix_socket): Use recvmsg() instead of
630 read() for reading the credential byte off the unix socket. Use
631 struct cmsgcred on systems that support it.
633 2003-02-27 Alexander Larsson <alexl@redhat.com>
637 Make gthreads-2.0 dependency optional. Don't build thread test if
640 2003-02-27 Havoc Pennington <hp@pobox.com>
642 * dbus/dbus-connection.c
643 (dbus_connection_send_message_with_reply_and_block): fix doh!
644 doh! doh! bug that resulted in never removing a reply from the
645 queue, no wonder we called get_reply_serial so much ;-)
647 * dbus/dbus-message.c (struct DBusMessage): cache reply serial
648 and client serial instead of demarshaling them every time
650 2003-02-27 Havoc Pennington <hp@pobox.com>
652 * dbus/dbus-marshal.c (_dbus_demarshal_int32): rewrite to be much
653 more inlined, using dbus-string-private.h, speeds things up
656 * dbus/dbus-string.c (_dbus_string_free): apply align offset
657 when freeing the string
658 (_dbus_string_steal_data): fix for align offset
659 (undo_alignment): new function
661 2003-02-26 Havoc Pennington <hp@redhat.com>
663 All kinds of audit fixes from Owen, plus initial attempt to
664 handle unaligned memory returned from malloc.
666 * dbus/dbus-string.c (_dbus_string_init): clamp max length to
667 leave room for align_offset and nul byte
668 (fixup_alignment): function to track an align_offset and
669 ensure real->str is aligned
670 (DBUS_GENERIC_STRING_PREAMBLE): len must be less than allocated,
671 to allow a nul byte plus align offset
672 (_dbus_string_lock): fix overflow issue
673 (_dbus_string_init_const_len): add assertions on sanity of len,
674 assign allocated to be ALLOCATION_PADDING larger than len
675 (set_length): fixup the overflow handling
676 (_dbus_string_get_data_len): fix overflow in assertion
677 (open_gap): detect overflow in size of gap to be opened
678 (_dbus_string_lengthen): add overflow check
679 (_dbus_string_align_length): fix overflow with _DBUS_ALIGN_VALUE
680 (_dbus_string_append): add overflow check
681 (_dbus_string_append_unichar): overflow
682 (_dbus_string_delete): fix overflow in assertion
683 (_dbus_string_copy_len): overflow in assertion
684 (_dbus_string_replace_len): overflows in assertions
685 (_dbus_string_find): change to implement in terms of
687 (_dbus_string_find_to): assorted fixage
688 (_dbus_string_equal_c_str): assert c_str != NULL,
689 fix logic so the function works
690 (_dbus_string_ends_with_c_str): fix overflow thingy
691 (_dbus_string_base64_encode): overflow fix
692 (_dbus_string_validate_ascii): overflow
693 (_dbus_string_validate_nul): overflow
695 2003-02-26 Havoc Pennington <hp@redhat.com>
697 * dbus/dbus-marshal.c (_dbus_marshal_test): fix to work with DISABLE_ASSERTS
699 2003-02-26 Alexander Larsson <alexl@redhat.com>
702 Set DBUS_GLIB_THREADS_LIBS for apps using gthread-2.0
704 * dbus/dbus-connection.c:
705 * dbus/dbus-connection.h:
706 Fix _dbus_connection_acquire_io_path and _dbus_connection_acquire_dispatch.
707 Add dbus_connection_set_wakeup_main_function and use it when queueing
708 incoming and outgoing messages.
711 * dbus/dbus-dataslot.c:
712 Threadsafe usage of DBusDataSlotAllocator
714 * dbus/dbus-message.c: (dbus_message_get_args_iter):
717 * dbus/dbus-server-unix.c:
721 Implement the new wakeup functions for glib.
724 * glib/test-thread-client.c:
725 * glib/test-thread-server.c:
726 * glib/test-thread.h:
727 Initial cut at some thread test code. Not really done yet.
729 2003-02-26 Havoc Pennington <hp@pobox.com>
731 * dbus/dbus-connection.c
732 (dbus_connection_send_message_with_reply_and_block): fix crash
733 where we ref'd the outgoing message instead of the returned reply
735 * dbus/dbus-transport-unix.c (do_authentication): check read watch
736 at the end of this function, so if we didn't need to read for
737 authentication, we reinstall it for receiving messages
739 * dbus/dbus-message.c (dbus_message_new_reply): allow replies to
740 a NULL sender for peer-to-peer case
742 * dbus/dbus-transport-unix.c (check_read_watch): handle
743 !authenticated case correctly
745 * glib/dbus-gmain.c: add support for DBusServer
747 * dbus/dbus-server.c: add data slot support
749 * glib/dbus-gmain.c (dbus_connection_setup_with_g_main): check
750 return values and handle errors
752 * dbus/dbus-dataslot.c: factor out the data slot stuff from
755 * Doxyfile.in (INPUT): add glib subdir
757 * glib/dbus-gmain.c (dbus_connection_setup_with_g_main): rename
758 setup_with_g_main instead of hookup_with_g_main; write docs
760 2003-02-24 Anders Carlsson <andersca@codefactory.se>
762 * dbus/dbus-marshal.c: (_dbus_marshal_validate_arg):
763 * dbus/dbus-message-builder.c: (_dbus_message_data_load):
764 * dbus/dbus-message.c: (dbus_message_append_boolean),
765 (dbus_message_append_boolean_array),
766 (dbus_message_get_args_valist), (_dbus_message_test):
767 * dbus/dbus-message.h:
768 * doc/dbus-specification.sgml:
769 Various fixes as pointed out by Havoc.
771 * test/data/invalid-messages/bad-boolean-array.message:
772 * test/data/invalid-messages/bad-boolean.message:
773 Add invalid boolean value test cases.
775 2003-02-24 Anders Carlsson <andersca@codefactory.se>
777 * dbus/dbus-internals.c: (_dbus_type_to_string):
778 * dbus/dbus-marshal.c: (_dbus_marshal_get_arg_end_pos),
779 (_dbus_marshal_validate_arg):
780 * dbus/dbus-message-builder.c: (_dbus_message_data_load):
781 * dbus/dbus-message.c: (dbus_message_append_args_valist),
782 (dbus_message_append_boolean), (dbus_message_append_boolean_array),
783 (dbus_message_get_args_valist), (dbus_message_iter_get_boolean),
784 (dbus_message_iter_get_int32), (dbus_message_iter_get_uint32),
785 (dbus_message_iter_get_double),
786 (dbus_message_iter_get_boolean_array), (message_iter_test):
787 * dbus/dbus-message.h:
788 * dbus/dbus-protocol.h:
789 * doc/dbus-specification.sgml:
790 * test/data/valid-messages/lots-of-arguments.message:
791 Add support for boolean and boolean array types.
793 2003-02-23 Havoc Pennington <hp@pobox.com>
795 * dbus/dbus-keyring.c: finish most of this implementation and
798 * dbus/dbus-errors.c (dbus_set_error_const, dbus_set_error): make
799 these barf if the error isn't cleared to NULL
801 * dbus/dbus-sysdeps.c (_dbus_delete_file): set error on failure
802 (_dbus_create_directory): new function
804 * dbus/dbus-errors.c (dbus_set_error): fix warning
806 * dbus/dbus-string.c (_dbus_string_hex_encode): new function
807 (_dbus_string_hex_decode): new function
808 (test_hex_roundtrip): test code
810 * dbus/dbus-sha.c (_dbus_sha_compute): use dbus_string_hex_encode
812 * dbus/dbus-md5.c (_dbus_md5_compute): use dbus_string_hex_encode
814 * dbus/dbus-sysdeps.c (_dbus_string_save_to_file): make this use
815 the save-to-temp/rename trick to atomically write the new file
816 (_dbus_string_parse_uint): new function
818 2003-02-22 Havoc Pennington <hp@pobox.com>
820 * test/Makefile.am (dist-hook): fix dist for test/data/sha-1
822 2003-02-22 Havoc Pennington <hp@pobox.com>
824 * dbus/dbus-message.c (dbus_message_iter_get_string_array):
825 (dbus_message_iter_get_byte_array): Fix up doxygen warnings
827 * dbus/dbus-sha.c: add implementation of SHA-1 algorithm
829 * dbus/test/data/sha-1: add US government test suite for SHA-1
831 2003-02-21 Anders Carlsson <andersca@codefactory.se>
833 * dbus/dbus-marshal.c: (_dbus_demarshal_string_array):
834 Make string arrays NULL-terminated.
836 * dbus/dbus-memory.c: (dbus_free_string_array):
837 * dbus/dbus-memory.h:
838 New function for freeing NULL-terminated string arrays.
840 * dbus/dbus-message-builder.c: (append_quoted_string),
841 (_dbus_message_data_load):
842 Add support for array types.
844 * dbus/dbus-message.c: (check_message_handling):
845 Add more types as test cases.
847 * dbus/dbus-sysdeps.c: (_dbus_string_parse_int),
848 (_dbus_string_parse_double):
849 Add the start offset to the end offset.
851 * test/data/valid-messages/lots-of-arguments.message:
852 New test message with lots of arguments.
854 2003-02-21 Anders Carlsson <andersca@codefactory.se>
856 * dbus/dbus-message.c: (dbus_message_append_nil),
857 (dbus_message_append_int32), (dbus_message_append_uint32),
858 (dbus_message_append_double), (dbus_message_append_string),
859 (dbus_message_append_int32_array),
860 (dbus_message_append_uint32_array),
861 (dbus_message_append_double_array),
862 (dbus_message_append_byte_array),
863 (dbus_message_append_string_array):
864 Fix all out-of-memory handling in these functions.
866 2003-02-21 Anders Carlsson <andersca@codefactory.se>
868 * dbus/dbus-message.c: (dbus_message_append_nil):
871 2003-02-21 Anders Carlsson <andersca@codefactory.se>
873 * dbus/dbus-message.c: (dbus_message_append_args_valist),
874 (dbus_message_append_nil), (dbus_message_append_int32_array),
875 (dbus_message_append_uint32_array),
876 (dbus_message_append_double_array),
877 (dbus_message_append_byte_array),
878 (dbus_message_append_string_array), (dbus_message_get_args_valist),
879 (dbus_message_iter_get_int32_array),
880 (dbus_message_iter_get_uint32_array),
881 (dbus_message_iter_get_double_array),
882 (dbus_message_iter_get_byte_array),
883 (dbus_message_iter_get_string_array):
885 * dbus/dbus-message.h:
886 Add functions for appending and getting arrays.
888 2003-02-21 Anders Carlsson <andersca@codefactory.se>
890 * dbus/dbus-mempool.c (_dbus_mem_pool_new): Make the
891 element size at least 8 bytes, fixes mempool tests on
894 2003-02-20 Alexander Larsson <alexl@redhat.com>
896 * dbus/dbus-transport-unix.c (unix_do_iteration):
897 Unlock the connection mutex during a blocking select call.
898 Add todo about how we need a way to wake up the select.
900 * dbus/dbus-connection-internal.h:
901 * dbus/dbus-connection.c:
902 Add _dbus_connection_lock and _dbus_connection_unlock.
904 2003-02-19 Havoc Pennington <hp@pobox.com>
906 * Doxyfile.in (PREDEFINED): put DOXYGEN_SHOULD_SKIP_THIS in
907 Doxyfile.in, not Doxyfile
909 * dbus/dbus-keyring.c: do some hacking on this
911 * dbus/dbus-sysdeps.c (_dbus_delete_file): new
913 * dbus/dbus-errors.c (dbus_set_error_const): do not call
915 (dbus_set_error): remove dbus_error_init, check for message ==
916 NULL *before* we sprintf into it, and add @todo about including
917 system headers in this file
919 * dbus/dbus-sysdeps.c (_dbus_create_file_exclusively): new
921 * dbus/dbus-errors.h (DBUS_ERROR_FAILED): add
923 * dbus/dbus-sysdeps.c (get_user_info): break this function out to
924 get various bits of user information based on either username
926 (_dbus_homedir_from_username): new function
928 2003-02-19 Anders Carlsson <andersca@codefactory.se>
931 Add check for nonposix getpwnam_r
933 * dbus/dbus-mempool.c: (_dbus_mem_pool_new):
934 Align the pool element size to a sizeof (void *) boundary.
936 * dbus/dbus-sysdeps.c: (_dbus_setenv), (_dbus_connect_unix_socket),
937 (_dbus_listen_unix_socket), (_dbus_credentials_from_username):
938 General Solaris fixes.
940 * test/data/valid-messages/simplest-manual.message:
941 Explicitly state that we want little-endian packing.
943 2003-02-19 Mikael Hallendal <micke@codefactory.se>
945 * dbus/dbus-server.c (dbus_server_listen): Support tcp: addresses.
947 * dbus/dbus-transport-unix.c (_dbus_transport_new_for_tcp_socket):
948 Added to create a transport connecting using a tcp/ip socket.
950 * dbus/dbus-sysdeps.c (_dbus_connect_tcp_socket): Added to connect
951 to a tcp socket at given host and port.
952 (_dbus_listen_tcp_socket): added to listen on tcp socket for given
955 * dbus/dbus-server.c (dbus_server_listen): Support tcp: addresses.
957 * dbus/dbus-server-unix.c (_dbus_server_new_for_tcp_socket):
958 Added to create a server listening on a TCP/IP socket.
960 2003-02-19 Havoc Pennington <hp@pobox.com>
962 Throughout: mop up all the Doxygen warnings and undocumented
965 * dbus/dbus-sysdeps.c (do_exec): do not use execvp, we don't want
968 * dbus/dbus-threads.c: move global mutex initializers to
969 dbus-internals.h, multiple prototypes was confusing doxygen
970 besides being kind of ugly
972 * Doxyfile (PREDEFINED): have Doxygen define
973 DOXYGEN_SHOULD_SKIP_THIS so we can exclude things from
974 docs with #ifndef DOXYGEN_SHOULD_SKIP_THIS
975 (do not abuse the feature! it's for stuff like the autogenerated
976 macros in dbus-md5.c, not just for things you don't feel like
979 2003-02-18 Havoc Pennington <hp@pobox.com>
981 * dbus/dbus-string.c (_dbus_string_zero): new function
983 * dbus/dbus-md5.c: include MD5 implementation by L. Peter Deutsch,
984 wrap it in some dbus-friendly API
986 * dbus/dbus-types.h: add 16-bit types
988 2003-02-18 Joe Shaw <joe@assbarn.com>
990 * dbus/dbus-auth.c (handle_server_data_stupid_test_mech): Just get
991 credentials from our currently running process.
992 (get_word): Fix a buglet where we were copying the entire length
993 instead of relative to our position.
995 * dbus/dbus-hash.c (_dbus_hash_test): Don't try to allocate the
996 keys on the stack... it's 640k of data.
998 * dbus/dbus-sysdeps.c (_dbus_read_credentials_unix_socket): Always
999 read the credentials byte off the socket, even if we don't have
1001 (_dbus_poll): Implement poll() using select() for systems which
1004 * glib/test-dbus-glib.c (main): Print out an error if no
1005 parameters are given.
1007 * test/data/auth/fallback.auth-script: Added. Tests that a client
1008 can fallback to a secondary auth mechanism if the first fails.
1010 2003-02-18 Havoc Pennington <hp@pobox.com>
1014 2003-02-17 Havoc Pennington <hp@pobox.com>
1016 * doc/dbus-specification.sgml: lots of cosmetic
1017 cleanups/rearrangement, add assorted FIXME, change DBUS_ADDRESS
1018 env variable to DBUS_BUS_ADDRESS, s/client/application/,
1019 s/server/bus/ (except in authentication section). Add a section
1020 "Message Bus Message Routing"
1022 2003-02-17 Anders Carlsson <andersca@codefactory.se.>
1028 2003-02-17 Anders Carlsson <andersca@codefactory.se>
1030 * doc/dbus-specification.sgml:
1031 Specification updates.
1033 2003-02-17 Anders Carlsson <andersca@codefactory.se>
1035 * bus/activation.c: (bus_activation_init), (child_setup),
1036 (bus_activation_activate_service):
1038 * bus/main.c: (main):
1039 Set DBUS_ADDRESS environment variable.
1041 * dbus/dbus-errors.c: (dbus_set_error):
1042 Don't use va_copy since that's a C99 feature.
1044 * dbus/dbus-sysdeps.c: (_dbus_setenv), (do_exec),
1045 (_dbus_spawn_async):
1046 * dbus/dbus-sysdeps.h:
1047 Add child_setup_func to _dbus_spawn_async.
1049 * doc/dbus-specification.sgml:
1050 Update specification.
1052 * test/spawn-test.c: (setup_func), (main):
1055 2003-02-17 Alexander Larsson <alexl@redhat.com>
1057 * dbus/dbus-connection.c (_dbus_connection_handler_destroyed_locked):
1060 2003-02-17 Anders Carlsson <andersca@codefactory.se>
1064 * doc/dbus-test-plan.sgml:
1065 Add test plan document.
1070 2003-02-17 Anders Carlsson <andersca@codefactory.se>
1072 * dbus/dbus-message.c: (decode_header_data),
1073 (_dbus_message_loader_return_buffer):
1074 Set the header padding amount when loading a message.
1076 2003-02-16 Anders Carlsson <andersca@codefactory.se>
1078 * bus/dispatch.c: (send_one_message):
1079 Only send broadcast messages to registered connections.
1081 * dbus/dbus-message.c: (dbus_message_name_is):
1082 * dbus/dbus-message.h:
1083 New convenience function.
1085 * dbus/dbus-transport-debug.c: (do_reading):
1086 Only dispatch one message per run.
1089 * test/bus-test.c: (new_connection_callback), (die),
1090 (test_hello_client1_handler), (test_hello_client2_handler),
1091 (test_hello_replies), (main):
1093 * test/bus-test-loop.[ch]:
1096 2003-02-16 Havoc Pennington <hp@pobox.com>
1098 * dbus/dbus-connection.c (dbus_connection_dispatch_message): fix
1099 backward conditional
1101 2003-02-16 Alexander Larsson <alexl@redhat.com>
1103 * dbus/dbus-connection.c:
1104 Implement sent_message_with_reply. (with_reply_and block is still
1106 Made dispatch_message not lose message if OOM.
1108 * dbus/dbus-errors.h:
1109 Add NoReply error (for reply timeouts).
1111 2003-02-16 Alexander Larsson <alexl@redhat.com>
1113 * dbus/dbus-hash.c (_dbus_hash_table_unref):
1114 Actually free keys and values when destroying hashtable.
1116 2003-02-16 Anders Carlsson <andersca@codefactory.se>
1118 * dbus/dbus-auth.c: (client_try_next_mechanism):
1121 * dbus/dbus-threads.c: (dbus_condvar_wait_timeout):
1122 Return TRUE if there's no thread implementation around.
1124 * glib/dbus-gmain.c: (free_source),
1125 (dbus_connection_hookup_with_g_main):
1126 Make sure to remove the GSource when the connection is finalized.
1128 2003-02-16 Anders Carlsson <andersca@codefactory.se>
1130 * bus/dispatch.c: (bus_dispatch_message_handler):
1131 * dbus/dbus-errors.h:
1132 Return an error if someone tries to send a message to a service
1135 2003-02-16 Anders Carlsson <andersca@codefactory.se>
1137 * bus/activation.c: (load_directory), (bus_activation_init),
1138 (bus_activation_activate_service):
1141 (bus_driver_handle_activate_service), (bus_driver_handle_message):
1142 More work on the activation handling.
1144 * dbus/dbus-errors.h:
1145 Add some error messages
1147 * dbus/dbus-message.c: (dbus_message_new_error_reply):
1148 * dbus/dbus-message.h:
1149 New function that creates an error message.
1151 * dbus/dbus-protocol.h:
1152 Add ACTIVATE_SERVER message.
1154 * dbus/dbus-server-unix.c: (unix_handle_watch),
1155 (_dbus_server_new_for_domain_socket):
1156 Call _dbus_fd_set_close_on_exec.
1158 * dbus/dbus-sysdeps.c: (make_pipe), (do_exec),
1159 (_dbus_spawn_async), (_dbus_disable_sigpipe),
1160 (_dbus_fd_set_close_on_exec):
1161 * dbus/dbus-sysdeps.h:
1162 Add _dbus_fd_set_close_on exec function. Also add function that checks
1163 that all open fds are set to close-on-exec and warns otherwise.
1165 * dbus/dbus-transport-unix.c:
1166 (_dbus_transport_new_for_domain_socket):
1167 Call _dbus_fd_set_close_on_exec.
1169 2003-02-16 Havoc Pennington <hp@pobox.com>
1171 * dbus/dbus-connection.c (dbus_connection_set_change_sigpipe):
1172 allow people to avoid setting SIGPIPE to SIG_IGN
1173 (_dbus_connection_new_for_transport): disable SIGPIPE unless
1174 we've been asked not to
1176 2003-02-15 Anders Carlsson <andersca@codefactory.se>
1178 * dbus/dbus-list.c: (_dbus_list_append_link),
1179 (_dbus_list_prepend_link):
1180 * dbus/dbus-memory.c: (dbus_malloc), (dbus_malloc0),
1184 2003-02-15 Anders Carlsson <andersca@codefactory.se>
1187 * bus/activation.c: (bus_activation_entry_free),
1188 (add_desktop_file_entry), (load_directory), (bus_activation_init):
1190 * bus/main.c: (main):
1191 Add simple activation support, doesn't work yet though.
1193 2003-02-15 Zack Rusin <zack@kde.org>
1195 * qt/dbus-qthread.cpp: small casting fix
1197 2003-02-15 Anders Carlsson <andersca@codefactory.se>
1199 * dbus/dbus-errors.c: (dbus_set_error):
1200 * dbus/dbus-errors.h:
1201 Add a few errors and make dbus_set_error void.
1203 * dbus/dbus-sysdeps.c:
1204 (_dbus_errno_to_string), (close_and_invalidate), (make_pipe),
1205 (write_err_and_exit), (read_ints), (do_exec), (_dbus_spawn_async):
1206 * dbus/dbus-sysdeps.h:
1207 Add _dbus_spawn_async.
1209 * test/spawn-test.c: (main):
1210 Test for _dbus_spawn_async.
1212 2003-02-15 Anders Carlsson <andersca@codefactory.se>
1214 * dbus/dbus-internals.h:
1215 Fix build without tests.
1217 * dbus/dbus-list.c: (alloc_link):
1218 Fix a segfault when a malloc fails.
1220 * dbus/dbus-memory.c: (initialize_malloc_debug), (dbus_malloc),
1221 (dbus_malloc0), (dbus_realloc):
1222 Add support for malloc debugging.
1224 2003-02-15 Alexander Larsson <alexl@redhat.com>
1226 * dbus/dbus-threads.c:
1227 * dbus/dbus-threads.h:
1228 Add condvars. Remove static mutext from API.
1229 Implement static mutexes by initializing them from threads_init.
1231 * glib/dbus-gthread.c:
1232 * qt/dbus-qthread.cpp:
1233 Update with the thread api changes.
1238 Turn StaticMutex into normal mutex + init function.
1239 Export new functions _dbus_list_alloc_link, _dbus_list_free_link,
1240 _dbus_list_append_link, _dbus_list_prepend_link
1243 * dbus/dbus-sysdeps.c:
1244 * dbus/dbus-sysdeps.h:
1245 New type dbus_atomic_t, and new functions _dbus_atomic_inc,
1246 _dbus_atomic_dec. Only slow fallback implementation at the moment.
1248 * dbus/dbus-protocol.h:
1249 Add DBUS_MESSAGE_LOCAL_DISCONNECT define
1251 * dbus/dbus-message.c:
1252 Make ref/unref atomic.
1255 * dbus/dbus-connection-internal.h:
1256 * dbus/dbus-connection.c:
1257 * dbus/dbus-connection.h:
1259 Change _peek to _borrow,_return & _steal_borrowed.
1260 Change disconnect callback to event.
1261 Make dbus_connection_dispatch_messages reentrant.
1263 * dbus/dbus-transport.c:
1264 Don't ref the connection on calls to the transport
1267 * dbus/dbus-message-handler.c:
1270 * glib/dbus-gmain.c:
1271 Don't use peek_message anymore
1274 * test/debug-thread.c:
1275 * test/debug-thread.h:
1276 Simple thread implementation that asserts() on deadlocks in
1277 single-threaded code.
1280 (main) Call debug_threads_init.
1283 Use disconnect message instead of disconnect callback.
1287 Don't call dbus_connection_set_disconnect_function. Instead export
1288 bus_connection_disconnect.
1291 Call bus_connection_disconnect when we get a disconnected message.
1293 2003-02-15 Havoc Pennington <hp@pobox.com>
1295 * dbus/dbus-message.c (dbus_message_new): fool around with the
1298 2003-02-14 Havoc Pennington <hp@pobox.com>
1300 * dbus/dbus-mempool.c: fail if the debug functions so indicate
1302 * dbus/dbus-memory.c: fail if the debug functions indicate we
1305 * dbus/dbus-internals.c (_dbus_set_fail_alloc_counter)
1306 (_dbus_decrement_fail_alloc_counter): debug functions to
1307 simulate memory allocation failures
1309 2003-02-14 Havoc Pennington <hp@pobox.com>
1311 * dbus/dbus-errors.h (struct DBusError): add a word of padding
1314 2003-02-13 Anders Carlsson <andersca@codefactory.se>
1316 * bus/driver.c: (bus_driver_handle_hello):
1318 * bus/services.c: (bus_service_lookup):
1319 Reorder message sending so we get a more sane order.
1321 * test/bus-test.c: (message_handler):
1324 2003-02-13 Anders Carlsson <andersca@codefactory.se>
1326 * bus/driver.c: (bus_driver_send_service_deleted),
1327 (bus_driver_send_service_created), (bus_driver_send_service_lost),
1328 (bus_driver_send_service_acquired), (bus_driver_handle_hello),
1329 (bus_driver_send_welcome_message),
1330 (bus_driver_handle_list_services),
1331 (bus_driver_handle_acquire_service),
1332 (bus_driver_handle_service_exists):
1333 * dbus/dbus-bus.c: (dbus_bus_register_client),
1334 (dbus_bus_acquire_service), (dbus_bus_service_exists):
1335 * dbus/dbus-errors.c: (dbus_result_to_string):
1336 * dbus/dbus-errors.h:
1337 * dbus/dbus-message.c: (dbus_message_append_args),
1338 (dbus_message_append_args_valist), (dbus_message_get_args),
1339 (dbus_message_get_args_valist), (dbus_message_get_args_iter),
1340 (dbus_message_iter_get_arg_type), (dbus_message_iter_get_string),
1341 (dbus_message_iter_get_byte_array),
1342 (dbus_message_iter_get_string_array), (message_iter_test),
1343 (check_message_handling), (_dbus_message_test):
1344 * dbus/dbus-message.h:
1345 * test/bus-test.c: (main):
1346 Change fields to arguments in messages, so that they won't be
1347 confused with header fields.
1349 * glib/test-dbus-glib.c: (main):
1350 Remove append_fields from hello message.
1352 2003-02-13 Anders Carlsson <andersca@codefactory.se>
1354 * dbus/dbus-errors.c:
1355 * dbus/dbus-message.c:
1356 * dbus/dbus-string.c:
1357 Documentation fixes.
1359 2003-02-13 Anders Carlsson <andersca@codefactory.se>
1361 * glib/dbus-gmain.c: (timeout_handler), (add_timeout),
1363 Implement support for timeouts in dbus-glib.
1365 2003-02-13 Anders Carlsson <andersca@codefactory.se>
1367 * dbus/dbus-message-builder.c: (_dbus_message_data_load):
1368 * dbus/dbus-message.c: (process_test_subdir):
1369 * test/break-loader.c: (find_breaks_based_on):
1370 Plug some memory leaks.
1372 2003-02-13 Richard Hult <rhult@codefactory.se>
1374 * bus/main.c: Fix build.
1376 * dbus/dbus-errors.h:
1377 * dbus/dbus-errors.c: Fix copyright for Anders.
1379 2003-02-13 Anders Carlsson <andersca@codefactory.se>
1384 * bus/connection.c: (bus_connection_foreach):
1387 * bus/desktop-file.c: (grow_lines_in_section), (grow_sections),
1388 (unescape_string), (new_section), (parse_section_start),
1389 (parse_key_value), (report_error), (bus_desktop_file_load),
1390 (bus_desktop_file_get_string):
1391 * bus/desktop-file.h:
1392 Use DBusError for error reporting.
1394 * bus/dispatch.c: (send_one_message),
1395 (bus_dispatch_message_handler):
1396 * bus/driver.c: (bus_driver_send_service_deleted),
1397 (bus_driver_send_service_created), (bus_driver_send_service_lost),
1398 (bus_driver_send_service_acquired), (bus_driver_handle_hello),
1399 (bus_driver_send_welcome_message),
1400 (bus_driver_handle_list_services),
1401 (bus_driver_handle_acquire_service),
1402 (bus_driver_handle_service_exists):
1403 * bus/loop.c: (bus_loop_run):
1405 Use BUS_HANDLE_OOM instead of _DBUS_HANDLE_OOM.
1407 * bus/utils.c: (bus_wait_for_memory):
1409 New files with general utility functions.
1411 * dbus/dbus-internals.h:
1412 Remove _DBUS_HANDLE_OOM.
1414 2003-02-13 Anders Carlsson <andersca@codefactory.se>
1416 * dbus/dbus-errors.c: (dbus_result_to_string), (dbus_error_init),
1417 (dbus_error_free), (dbus_set_error_const), (dbus_set_error):
1418 * dbus/dbus-errors.h:
1419 Add DBusError structure.
1421 2003-02-13 Anders Carlsson <andersca@codefactory.se>
1423 * test/data/valid-messages/standard-acquire-service.message:
1424 * test/data/valid-messages/standard-hello.message:
1425 * test/data/valid-messages/standard-list-services.message:
1426 * test/data/valid-messages/standard-service-exists.message:
1427 Add some standard messages.
1429 2003-02-13 Anders Carlsson <andersca@codefactory.se>
1431 * bus/driver.c: (bus_driver_send_welcome_message),
1432 (bus_driver_handle_list_services),
1433 (bus_driver_handle_acquire_service),
1434 (bus_driver_handle_service_exists), (bus_driver_handle_message):
1435 Update for API changes in libdbus.
1437 * dbus/dbus-message.c: (dbus_message_new_reply):
1438 * dbus/dbus-message.h:
1439 Remove the name argument. The spec states that replies shouldn't
1442 2003-02-13 Anders Carlsson <andersca@codefactory.se>
1444 * bus/desktop-file.c: (parse_section_start), (parse_key_value),
1445 (report_error), (bus_desktop_file_load), (lookup_section),
1446 (lookup_line), (bus_desktop_file_get_raw),
1447 (bus_desktop_file_get_string):
1448 * bus/desktop-file.h:
1449 Some fixes, and new functions for getting a key value from a section.
1451 2003-02-13 Havoc Pennington <hp@pobox.com>
1453 * test/data/auth/fail-after-n-attempts.auth-script: new test
1455 * dbus/dbus-auth.c (send_rejected): shutdown_mech() when we
1458 2003-02-13 Havoc Pennington <hp@pobox.com>
1460 * dbus/dbus-auth.c (handle_server_data_external_mech): args to
1461 dbus_credentials_match were backward
1463 * dbus/dbus-auth-script.c (_dbus_auth_script_run): support
1464 NO_CREDENTIALS and ROOT_CREDENTIALS
1466 * dbus/dbus-auth.c (_dbus_auth_do_work): move get_state() routine
1467 into here. Never process more commands after we've reached an
1468 end state; store further data as unused bytes.
1470 * test/data/auth/*: add more auth tests
1472 * dbus/dbus-auth-script.c (_dbus_auth_script_run): support EXPECT
1473 command to match exact string and EXPECT_UNUSED to match unused
1476 * test/Makefile.am (dist-hook): fix to dist all the test stuff
1478 2003-02-12 Havoc Pennington <hp@pobox.com>
1480 * dbus/dbus-string.c (_dbus_string_pop_line): fix to also strip
1481 \r off of popped lines
1483 * dbus/dbus-auth.c (_dbus_auth_test): write code to run auth
1486 * dbus/dbus-auth-script.c (_dbus_auth_script_run): when doing a
1489 2003-02-12 Havoc Pennington <hp@pobox.com>
1491 * dbus/Makefile.am: remove break-loader from the build, since it
1494 * configure.in: add --enable-gcov to turn on coverage profiling
1495 flags and disable optimization
1497 2003-02-10 Havoc Pennington <hp@pobox.com>
1499 * dbus/dbus-auth-script.c, dbus/dbus-auth-script.h: sync
1500 initial cut at test framework for DBusAuth from laptop.
1501 Doesn't quite work yet but it compiles and I need to get
1502 it off the 266mhz laptop. ;-)
1504 * dbus/dbus-server-debug.c (_dbus_server_debug_accept_transport):
1505 fix a memleak in error case
1507 2003-02-12 Anders Carlsson <andersca@codefactory.se>
1510 * bus/desktop-file.c:
1511 * bus/desktop-file.h:
1512 Add a desktop file parser.
1514 2003-02-11 Zack Rusin <zack@kde.org>
1516 * qt/message.[h|cpp]: sample implementation
1517 of the KDE wrapper for DBusMessage
1519 2003-02-09 Zack Rusin <zack@kde.org>
1521 * test/bus-test.c: make_it_compile
1522 * doc/dbus-specification.sgml: minimal semantic fix
1524 2003-02-06 Anders Carlsson <andersca@codefactory.se>
1530 2003-02-06 Anders Carlsson <andersca@codefactory.se>
1533 * dbus/dbus-break-loader.c:
1535 * test/break-loader.c:
1536 Move dbus-break-loader to test/ and rename it to break-loader.
1538 2003-02-02 Havoc Pennington <hp@pobox.com>
1540 * dbus/dbus-keyring.c, dbus/dbus-keyring.h: template files
1541 for code to manage cookies in your home directory
1543 * dbus/dbus-sysdeps.c (_dbus_generate_random_bytes): new function
1545 * dbus/dbus-auth.c (get_state): impose a maximum number of tries
1546 to authenticate, then disconnect the client.
1548 2003-02-03 Alexander Larsson <alexl@redhat.com>
1550 * dbus/dbus-message.c (dbus_message_append_fields):
1553 2003-02-02 Anders Carlsson <andersca@codefactory.se>
1555 * doc/dbus-specification.sgml:
1556 Update address format section.
1558 2003-02-02 Anders Carlsson <andersca@codefactory.se>
1561 * test/bus-test.c: (get_time), (add_timeout), (remove_timeout),
1562 (message_handler), (new_connection_callback), (loop_quit),
1566 2003-02-02 Anders Carlsson <andersca@codefactory.se>
1568 * bus/driver.c: (bus_driver_handle_service_exists):
1569 Simplify the code a bit.
1571 * dbus/dbus-bus.c: (dbus_bus_service_exists):
1574 2003-02-02 Anders Carlsson <andersca@codefactory.se>
1577 Add libdbus-daemon.la and link to it.
1579 2003-02-01 James Willcox <jwillcox@gnome.org>
1581 * bus/driver.c: (bus_driver_handle_own_service):
1582 Actually include the service reply code in the message.
1584 2003-02-02 Anders Carlsson <andersca@codefactory.se>
1586 * bus/driver.c: (bus_driver_handle_service_exists):
1587 Don't unref the incoming message.
1589 2003-02-02 Anders Carlsson <andersca@codefactory.se>
1591 * dbus/dbus.h: Add dbus-address.h and dbus-bus.h
1593 2003-02-02 Anders Carlsson <andersca@codefactory.se>
1595 * dbus/dbus-server.c: (dbus_server_listen):
1596 * dbus/dbus-transport.c: (_dbus_transport_open):
1597 ifdef out the calls to the debug transport and server.
1599 2003-02-02 Alexander Larsson <alexl@redhat.com>
1601 * dbus/dbus-watch.c (dbus_watch_get_flags):
1602 Add note in the docs that ERROR or HANGUP won't be returned
1603 and are assumed always on.
1605 * glib/dbus-gmain.c (add_watch):
1606 Always add IO_ERR | IO_HUP
1608 * dbus/dbus-message.h:
1609 Add semicolon after dbus_message_iter_get_string_array().
1610 Makes qt code build again
1612 2003-02-01 Anders Carlsson <andersca@codefactory.se>
1614 * bus/driver.c: (create_unique_client_name),
1615 (bus_driver_handle_hello):
1616 Don't take a name, just use a numeric id to identify
1620 * dbus/dbus-bus.c: (dbus_bus_register_client),
1621 (dbus_bus_acquire_service), (dbus_bus_service_exists):
1623 Add new convenience functions for communicating with the bus.
1625 * dbus/dbus-message.h:
1627 * dbus/dbus-protocol.h:
1630 2003-02-01 Alexander Larsson <alexl@redhat.com>
1632 * dbus/dbus-message.c (dbus_message_append_fields):
1633 Add some more doc comments.
1635 2003-02-01 Havoc Pennington <hp@pobox.com>
1637 * dbus/dbus-break-loader.c (randomly_modify_length): change
1638 a 4-byte value in the message as if it were a length
1640 * dbus/dbus-sysdeps.c (_dbus_string_save_to_file): don't set
1641 execute bit on saved files
1643 2003-02-01 Havoc Pennington <hp@pobox.com>
1645 * dbus/dbus-break-loader.c (main): new program to find messages
1646 that break the loader.
1648 * dbus/dbus-sysdeps.c (_dbus_string_append_uint): new function
1649 * dbus/dbus-sysdeps.c (_dbus_string_save_to_file): new function
1651 * dbus/dbus-string.c (_dbus_string_set_byte): new
1653 2003-01-31 Havoc Pennington <hp@pobox.com>
1655 * dbus/dbus-message.c: refactor the test code to be more general,
1656 in preparation for writing a "randomly permute test cases to
1657 try to break the loader" program.
1659 2003-01-31 Havoc Pennington <hp@pobox.com>
1661 * doc/dbus-specification.sgml: work on the specification
1663 * dbus/dbus-message.c (_dbus_message_loader_return_buffer): check
1664 the protocol version of the message.
1666 * dbus/dbus-protocol.h: drop special _REPLY names, the spec
1667 no longer specifies that.
1668 (DBUS_SERVICE_REPLY_SERVICE_EXISTS): fix flags (1/2/4/8 not
1671 * dbus/dbus-marshal.c (_dbus_marshal_get_arg_end_pos): add missing
1672 "break" for DBUS_TYPE_NIL, remove @todo
1674 2003-01-31 Havoc Pennington <hp@pobox.com>
1676 * dbus/dbus-message.c (dbus_message_set_is_error_reply): rename
1677 just set_is_error/get_is_error as this is a commonly-used
1678 function, and write docs.
1680 2003-01-31 Anders Carlsson <andersca@codefactory.se>
1682 * dbus/dbus-address.c: (dbus_address_entry_free):
1683 Free key and value lists.
1685 * dbus/dbus-internals.c: (_dbus_type_to_string):
1686 Add the types we didn't have.
1688 * dbus/dbus-marshal.c: (_dbus_marshal_get_arg_end_pos),
1689 (_dbus_marshal_validate_arg):
1692 * dbus/dbus-message.c: (dbus_message_set_sender):
1693 Remove todo about being able to set sender to NULL.
1695 (dbus_message_set_is_error_reply),
1696 (dbus_message_get_is_error_reply):
1697 * dbus/dbus-message.h:
1700 * dbus/dbus-protocol.h:
1701 Add error reply flag.
1703 * test/data/valid-messages/opposite-endian.message:
1704 Add NIL type to test.
1706 2003-01-31 Havoc Pennington <hp@pobox.com>
1708 * doc/dbus-specification.sgml: fully specify the header. Add
1709 flags and major protocol version, and change header/body len to
1712 * dbus/dbus-message-builder.c (append_saved_length): append length
1715 * dbus/dbus-message.c (dbus_message_create_header): change header
1716 length and body length to unsigned. Add the new fields from the
1718 (_dbus_message_loader_return_buffer): unsigned header/body len
1720 2003-01-30 Havoc Pennington <hp@pobox.com>
1722 * dbus/dbus-auth.c: rework to use only REJECTED, no
1725 * doc/dbus-sasl-profile.txt: drop MECHANISMS and just
1726 use REJECTED, suggested by Mark McLoughlin
1728 2003-01-30 Havoc Pennington <hp@pobox.com>
1730 * dbus/dbus-server.c (dbus_server_listen): @todo about how we need
1731 a better way to report errors here. e.g. "unix address lacks
1732 path" or something. also "no such file" when the path doesn't
1735 * dbus/dbus-address.c (dbus_address_entries_free): add @todo about
1737 (dbus_parse_address): add @todo about documenting address format,
1738 and allowing , and ; to be escaped
1740 2003-01-30 Anders Carlsson <andersca@codefactory.se>
1743 Add dbus-address.[ch]
1745 * dbus/dbus-address.c: (dbus_address_entry_free),
1746 (dbus_address_entries_free), (create_entry),
1747 (dbus_address_entry_get_method), (dbus_address_entry_get_value),
1748 (dbus_parse_address), (_dbus_address_test):
1749 * dbus/dbus-address.h:
1750 New files for dealing with address parsing.
1752 * dbus/dbus-connection.c:
1753 Document timeout functions.
1755 * dbus/dbus-message.c:
1756 Document dbus_message_new_from_message.
1758 * dbus/dbus-server-debug.c:
1761 * dbus/dbus-server.c: (dbus_server_listen):
1762 Parse address and use correct server implementation.
1764 * dbus/dbus-string.c: (_dbus_string_find_to), (_dbus_string_test):
1765 * dbus/dbus-string.h:
1766 New function with test.
1768 * dbus/dbus-test.c: (dbus_internal_symbol_do_not_use_run_tests):
1772 * dbus/dbus-transport-debug.c:
1775 * dbus/dbus-transport.c: (_dbus_transport_open):
1776 Parse address and use correct transport implementation.
1778 2003-01-30 Havoc Pennington <hp@pobox.com>
1780 * dbus/dbus-message.c: use message->byte_order instead of
1781 DBUS_COMPILER_BYTE_ORDER throughout.
1782 (dbus_message_create_header): pad header to align the
1783 start of the body of the message to 8-byte boundary
1785 * dbus/dbus-marshal.h: make all the demarshalers take const
1786 DBusString arguments.
1788 * dbus/dbus-message.c (_dbus_message_loader_return_buffer):
1789 validate message args here, so we don't have to do slow validation
1790 later, and so we catch bad messages as they are incoming. Also add
1791 better checks on header_len and body_len. Also fill in
1794 * dbus/dbus-string.c (_dbus_string_validate_utf8): new (not
1795 implemented properly)
1796 (_dbus_string_validate_nul): new function to check all-nul
1798 * dbus/dbus-marshal.c (_dbus_marshal_get_field_end_pos): rename
1799 get_arg_end_pos and remove all validation
1800 (_dbus_marshal_validate_arg): actually do validation here.
1802 2003-01-29 Havoc Pennington <hp@pobox.com>
1804 * dbus/dbus-message.c (check_message_handling): fix assertion
1805 failure on set_client_serial
1807 2003-01-28 Havoc Pennington <hp@pobox.com>
1809 * dbus/dbus-server-debug.c: Add doc section comments
1811 * dbus/dbus-transport-debug.c: add doc section comments
1813 2003-01-28 Havoc Pennington <hp@redhat.com>
1815 * dbus/dbus-string.c (_dbus_string_base64_decode): append bytes in
1816 the reverse order from how I had it
1817 (_dbus_string_base64_encode): reverse encoding order. I was
1818 basically byteswapping everything during encoding.
1820 2003-01-28 Anders Carlsson <andersca@codefactory.se>
1822 * dbus/dbus-connection-internal.h:
1823 * dbus/dbus-connection.c: (_dbus_connection_add_timeout),
1824 (_dbus_connection_remove_timeout):
1825 Add functions for adding and removing timeouts.
1827 * dbus/dbus-message.c: (dbus_message_new_from_message):
1828 Add new function that takes a message and creates an exact
1829 copy of it, but with the refcount set to 1.
1830 (check_message_handling):
1833 * dbus/dbus-server-protected.h:
1834 * dbus/dbus-server.c: (_dbus_server_init_base),
1835 (_dbus_server_finalize_base), (_dbus_server_add_timeout),
1836 (dbus_server_set_timeout_functions):
1837 (_dbus_server_remove_timeout):
1838 New functions so that a server can add and remove timeouts.
1840 (dbus_server_listen):
1841 Add commented out call to dbus_server_debug_new.
1843 * dbus/dbus-timeout.c: (_dbus_timeout_new):
1844 Actually set the handler, doh.
1846 * dbus/dbus-transport.c: (_dbus_transport_open):
1847 Add commented out call to dbus_transport_debug_client_new.
1850 Add dbus-transport-debug.[ch] and dbus-server-debug.[ch]
1852 2003-01-28 Havoc Pennington <hp@pobox.com>
1854 * dbus/dbus-message.c (check_message_handling): function to check
1855 on the loaded message, iterates over it etc.
1857 2003-01-28 Havoc Pennington <hp@pobox.com>
1859 * test/Makefile.am (dist-hook): fix make distdir
1861 * dbus/Makefile.am (TESTS_ENVIRONMENT): fix make check
1863 2003-01-27 Havoc Pennington <hp@pobox.com>
1865 * dbus/dbus-mempool.c (time_for_size): replace printf with
1868 * dbus/dbus-message-builder.c (_dbus_message_data_load): allow
1869 empty lines; fix the SAVE_LENGTH stuff to be
1870 START_LENGTH/END_LENGTH so it actually works; couple other
1873 * test/Makefile.am (dist-hook): add dist-hook for .message files
1875 * dbus/dbus-string.c (DBUS_STRING_COPY_PREAMBLE): source of a copy
1876 can be constant or locked.
1877 (_dbus_string_free): allow freeing a const string as
1880 * dbus/dbus-sysdeps.c (_dbus_concat_dir_and_file): utility
1882 * dbus/dbus-test-main.c (main): take an argument which is the
1883 directory containing test data
1885 * dbus/dbus-message.c (_dbus_message_test): pass a test_data_dir
1886 argument to this and load all the messages in test/data/
1887 checking that they can be loaded or not loaded as appropriate.
1889 2003-01-27 Anders Carlsson <andersca@codefactory.se>
1891 * bus/dispatch.c: (bus_dispatch_message_handler):
1892 Dispatch messages sent to services.
1894 * bus/driver.c: (bus_driver_send_service_deleted),
1895 (bus_driver_send_service_created), (bus_driver_send_service_lost),
1896 (bus_driver_send_service_acquired):
1897 Add helper functions for sending service related messages.
1899 (bus_driver_send_welcome_message):
1900 Send HELLO_REPLY instead of WELCOME.
1902 (bus_driver_handle_list_services):
1903 Send LIST_SERVICES_REPLY instead of SERVICES.
1905 (bus_driver_handle_own_service),
1906 (bus_driver_handle_service_exists):
1907 New message handlers.
1909 (bus_driver_handle_message):
1910 Invoke new message handlers.
1912 (bus_driver_remove_connection):
1913 Don't remove any services here since that's done automatically
1914 by bus_service_remove_owner now.
1917 New function signatures.
1919 * bus/services.c: (bus_service_add_owner):
1920 Send ServiceAcquired message if we're the only primary owner.
1922 (bus_service_remove_owner):
1923 Send ServiceAcquired/ServiceLost messages.
1925 (bus_service_set_prohibit_replacement),
1926 (bus_service_get_prohibit_replacement):
1927 Functions for setting prohibit replacement.
1929 (bus_service_has_owner):
1930 New function that checks if a connection is in the owner queue of
1934 Add new function signatures.
1936 * dbus/dbus-list.c: (_dbus_list_test):
1937 Add tests for _dbus_list_remove_last and traversing the list backwards.
1940 Fix a typo in _dbus_list_get_prev_link, if we're at the first element we can't
1941 go any further, so return NULL then.
1943 * dbus/dbus-protocol.h:
1944 Add new messages, service flags and service replies.
1946 2003-01-26 Havoc Pennington <hp@pobox.com>
1948 * dbus/dbus-message-builder.c: implement, completely untested.
1950 * test/data/*: add data to be used in testing.
1951 ".message" files are our simple loadable text format.
1952 ".message-raw" will be binary dumps of messages.
1954 * dbus/dbus-string.c (_dbus_string_starts_with_c_str): new
1956 2003-01-26 Havoc Pennington <hp@pobox.com>
1958 * dbus/dbus-sysdeps.c (_dbus_file_get_contents): new function
1960 * dbus/dbus-errors.c (dbus_result_to_string): add
1963 * dbus/dbus-message-builder.c: new file, will contain code to load
1964 up messages from files. Not implemented yet.
1966 2003-01-26 Havoc Pennington <hp@pobox.com>
1968 * dbus/dbus-message.c (dbus_message_set_sender): support deleting
1969 the sender by setting to NULL
1971 2003-01-26 Havoc Pennington <hp@pobox.com>
1973 The unit tests pass, but otherwise untested. If it breaks, the
1974 tests should have been better. ;-)
1976 * bus/driver.c (bus_driver_handle_hello): return if we disconnect
1979 * dbus/dbus-message.c: redo everything so we maintain
1980 message->header as the only copy of the various fields.
1981 This avoids the possibility of out-of-memory in some cases,
1982 for example dbus_message_lock() can't run out of memory anymore,
1983 and avoids extra copying. Figured I may as well go ahead and do
1984 this since it was busted for dbus_message_lock to not return
1985 failure on OOM, and dbus_message_write_header was totally
1986 unchecked for OOM. Also fixed some random other bugs.
1988 * dbus/dbus-marshal.c (_dbus_marshal_get_field_end_pos): verify
1989 that strings are nul-terminated. Also, end_pos can be equal
1990 to string length just not greater than, I think.
1991 (_dbus_marshal_set_int32): new function
1992 (_dbus_marshal_set_uint32): new function
1993 (_dbus_marshal_set_string): new function
1995 * dbus/dbus-connection.c (_dbus_connection_new_for_transport): fix
1996 a warning, init timeout_list to NULL
1997 (dbus_connection_send_message): don't use uninitialized variable
2000 * dbus/dbus-string.c (_dbus_string_replace_len): new function
2002 2003-01-26 Anders Carlsson <andersca@codefactory.se>
2004 * bus/driver.c: (bus_driver_handle_hello),
2005 (bus_driver_send_welcome_message):
2008 2003-01-26 Anders Carlsson <andersca@codefactory.se>
2010 * dbus/dbus-auth.c: (process_auth), (_dbus_auth_unref):
2011 * dbus/dbus-connection.c: (_dbus_connection_new_for_transport),
2012 (dbus_connection_unref):
2013 * dbus/dbus-marshal.c: (_dbus_marshal_test):
2014 * dbus/dbus-message.c: (dbus_message_unref),
2017 (dbus_message_get_fields):
2018 Remove debugging printout.
2020 (_dbus_message_loader_return_buffer):
2021 Don't store the header string.
2023 (_dbus_message_test):
2026 2003-01-26 Richard Hult <rhult@codefactory.se>
2028 * glib/dbus-gmain.c (dbus_connection_dispatch): Traverse a copy of
2029 the file descriptor list, since it can change under us.
2031 2003-01-25 Anders Carlsson <andersca@codefactory.se>
2033 * glib/dbus-gmain.c: (dbus_connection_prepare),
2034 (dbus_connection_check), (dbus_connection_dispatch), (add_watch),
2035 (remove_watch), (dbus_connection_hookup_with_g_main):
2036 Rewrite the glib handling to use its own GSource instead of a
2037 GIOChannel so we can catch messages put in the queue while waiting
2040 2003-01-25 Anders Carlsson <andersca@codefactory.se>
2043 * bus/connection.c: (connection_disconnect_handler),
2044 (connection_watch_callback), (bus_connection_setup):
2045 * bus/dispatch.c: (send_one_message),
2046 (bus_dispatch_broadcast_message), (bus_dispatch_message_handler),
2047 (bus_dispatch_add_connection), (bus_dispatch_remove_connection):
2049 * bus/driver.c: (bus_driver_send_service_deleted),
2050 (bus_driver_send_service_created), (bus_driver_handle_hello),
2051 (bus_driver_send_welcome_message),
2052 (bus_driver_handle_list_services), (bus_driver_remove_connection),
2053 (bus_driver_handle_message):
2055 Refactor code, put the message dispatching in its own file. Use
2056 _DBUS_HANDLE_OOM. Also send ServiceDeleted messages when a client
2059 2003-01-25 Anders Carlsson <andersca@codefactory.se>
2061 * dbus/dbus-internals.h:
2062 Add _DBUS_HANDLE_OOM macro, it doesn't do anything currently.
2064 * dbus/dbus-message.c: (dbus_message_get_sender):
2065 * dbus/dbus-message.h:
2066 Implement dbus_message_get_sender.
2068 * dbus/dbus-protocol.h:
2069 Add message and service defines.
2071 2003-01-25 Anders Carlsson <andersca@codefactory.se>
2073 * dbus/dbus-connection.c: (dbus_connection_send_message):
2074 * dbus/dbus-message-internal.h:
2075 * dbus/dbus-message.c: (_dbus_message_get_client_serial),
2076 (dbus_message_write_header):
2077 Remove _dbus_messag_unlock and don't set the client serial on a
2078 message if one already exists.
2080 2003-01-24 Havoc Pennington <hp@pobox.com>
2082 * dbus/dbus-list.c (alloc_link): put a thread lock on the global
2085 * bus/driver.c (bus_driver_handle_list_services): fix a leak
2088 2003-01-25 Anders Carlsson <andersca@codefactory.se>
2090 * dbus/dbus-list.c: (alloc_link), (free_link):
2091 Use a memory pool for the links.
2093 2003-01-25 Anders Carlsson <andersca@codefactory.se>
2095 * bus/connection.c: (bus_connection_foreach):
2097 Add new bus_connection_foreach function.
2099 * bus/driver.c: (send_one_message), (bus_driver_broadcast_message):
2100 Add function that broadcasts a message to all clients.
2102 (bus_driver_send_service_created), (bus_driver_handle_hello),
2103 (bus_driver_send_welcome_message),
2104 (bus_driver_handle_list_services), (bus_driver_message_handler):
2105 Implement functions that take care of listing services, and notifying
2106 clients when new services are created.
2108 * bus/services.c: (bus_services_list):
2110 Add new function that returns an array of strings with the currently
2111 registered services.
2114 * glib/dbus-gmain.c:
2115 Update copyright year.
2117 2003-01-25 Anders Carlsson <andersca@codefactory.se>
2119 * dbus/dbus-connection.c: (dbus_connection_send_message):
2120 Unlock the message in case it was sent earlier.
2122 (dbus_connection_send_message_with_reply_and_block):
2123 Remove the reply message from the list.
2125 * dbus/dbus-marshal.c: (_dbus_demarshal_string_array):
2126 Set array_len and new_pos correctly.
2128 (_dbus_marshal_test):
2129 Remove debug output.
2131 * dbus/dbus-message-internal.h:
2132 * dbus/dbus-message.c: (_dbus_message_get_reply_serial):
2133 New function that returns the reply serial.
2135 (_dbus_message_unlock):
2136 New function that unlocks a message and resets its header.
2138 (dbus_message_append_string_array),
2139 (dbus_message_get_fields_valist),
2140 (dbus_message_iter_get_field_type),
2141 (dbus_message_iter_get_string_array),
2142 (dbus_message_get_fields),
2143 (dbus_message_append_fields_valist):
2144 Handle string arrays.
2146 (dbus_message_set_sender):
2147 Make this function public since the bus daemon needs it.
2149 (decode_header_data):
2150 Set the reply serial to -1 initially.
2152 * dbus/dbus-message.h:
2153 Add dbus_message_set_sender.
2155 2003-01-24 Havoc Pennington <hp@pobox.com>
2157 * doc/dbus-specification.sgml: add some stuff
2159 2003-01-22 Havoc Pennington <hp@pobox.com>
2161 * doc/dbus-specification.sgml: Start to document the protocol.
2163 2003-01-22 Havoc Pennington <hp@pobox.com>
2165 * dbus/dbus-connection.c
2166 (dbus_connection_send_message_with_reply_and_block): add some @todo
2168 * bus/driver.c (bus_driver_add_connection): add a FIXME about memleak
2170 2003-01-21 Havoc Pennington <hp@pobox.com>
2172 (patch untested because can't compile)
2174 * bus/driver.c (create_unique_client_name): make this function
2175 never recycle client names. Also, caller should initialize
2178 * dbus/dbus-sysdeps.c (_dbus_get_current_time): new function
2180 2003-01-21 Anders Carlsson <andersca@codefactory.se>
2182 * dbus/dbus-marshal.c: (_dbus_marshal_double),
2183 (_dbus_marshal_int32), (_dbus_marshal_uint32),
2184 (_dbus_marshal_int32_array), (_dbus_marshal_uint32_array),
2185 (_dbus_marshal_double_array), (_dbus_marshal_string_array),
2186 (_dbus_demarshal_int32_array), (_dbus_demarshal_uint32_array),
2187 (_dbus_demarshal_double_array), (_dbus_demarshal_string_array),
2188 (_dbus_marshal_get_field_end_pos), (_dbus_marshal_test):
2189 * dbus/dbus-marshal.h:
2190 * dbus/dbus-protocol.h:
2191 Add support for marshalling and demarshalling integer, double
2194 2003-01-21 Anders Carlsson <andersca@codefactory.se>
2199 * bus/connection.c: (connection_disconnect_handler):
2200 Remove the connection from the bus driver's list.
2202 (connection_watch_callback): Dispatch messages.
2204 (free_connection_data): Free connection name.
2206 (bus_connection_setup): Add connection to the bus driver's list.
2207 (bus_connection_remove_owned_service):
2208 (bus_connection_set_name), (bus_connection_get_name):
2209 Add functions for setting and getting the connection's name.
2212 Add function headers.
2214 * bus/driver.c: (create_unique_client_name),
2215 (bus_driver_handle_hello_message),
2216 (bus_driver_send_welcome_message), (bus_driver_message_handler),
2217 (bus_driver_add_connection), (bus_driver_remove_connection):
2220 * bus/services.c: (bus_service_free):
2222 New file that handles communication and registreation with the bus
2225 2003-01-21 Anders Carlsson <andersca@codefactory.se>
2227 * dbus/dbus-connection.c: (dbus_connection_send_message):
2228 Add a new client_serial parameter.
2230 (dbus_connection_send_message_with_reply):
2231 Remove a @todo since we've implemented the blocking function.
2233 (dbus_connection_send_message_with_reply_and_block):
2234 New function that sends a message and waits for a reply and
2235 then returns the reply.
2237 * dbus/dbus-connection.h:
2240 * dbus/dbus-errors.c: (dbus_result_to_string):
2241 * dbus/dbus-errors.h:
2242 Add new DBUS_RESULT.
2244 * dbus/dbus-message-internal.h:
2245 * dbus/dbus-message.c: (_dbus_message_get_reply_serial),
2246 (_dbus_message_set_sender), (dbus_message_write_header),
2247 (dbus_message_new_reply), (decode_header_data),
2248 (_dbus_message_loader_return_buffer), (_dbus_message_test):
2249 * dbus/dbus-message.h:
2250 Add new functions that set the reply serial and sender.
2251 Also marshal and demarshal them correctly and add test.
2253 * dbus/dbus-protocol.h:
2254 Add new DBUS_MESSAGE_TYPE_SENDER.
2257 * glib/dbus-gmain.c: (watch_callback), (free_callback_data),
2258 (add_watch), (remove_watch), (add_timeout), (remove_timeout),
2259 (dbus_connection_hookup_with_g_main):
2260 * glib/test-dbus-glib.c: (main):
2261 Rewrite to use GIOChannel and remove the GSource crack.
2263 * test/echo-client.c: (main):
2264 * test/watch.c: (check_messages):
2265 Update for changed APIs
2267 2003-01-19 Anders Carlsson <andersca@codefactory.se>
2269 * dbus/Makefile.am: Add dbus-timeout.[cħ]
2271 * dbus/dbus-connection.c: (_dbus_connection_new_for_transport):
2272 Create a DBusTimeoutList.
2273 (dbus_connection_set_timeout_functions): Add new function to
2274 set timeout callbacks
2276 * dbus/dbus-connection.h: Add public DBusTimeout API.
2278 * dbus/dbus-message.c: (dbus_message_get_service):
2279 * dbus/dbus-message.h: New function.
2281 * dbus/dbus-server.c: Fix small doc typo.
2283 * dbus/dbus-timeout.[ch]: New files for mainloop timeouts.
2285 2003-01-19 Anders Carlsson <andersca@codefactory.se>
2287 * dbus/dbus-string.c (_dbus_string_move_len): Don't delete all
2288 of the string, just as long as specified.
2290 2003-01-19 Havoc Pennington <hp@pobox.com>
2292 * dbus/dbus-connection.c (dbus_connection_get_is_authenticated):
2295 * dbus/dbus-server.c (dbus_server_set_max_connections)
2296 (dbus_server_get_max_connections, dbus_server_get_n_connections):
2297 keep track of current number of connections, and add API for
2298 setting a max (but haven't implemented enforcing the max yet)
2300 2003-01-18 Havoc Pennington <hp@pobox.com>
2302 * dbus/dbus-transport-unix.c (unix_do_iteration): only do the
2303 reading/writing if read_watch != NULL or write_watch != NULL.
2305 * dbus/dbus-message.c (_dbus_message_loader_return_buffer): fix
2306 the message loader code to actually load message->header and
2307 message->body into the newly-created message.
2309 * dbus/dbus-transport-unix.c (check_write_watch): fix a mem leak
2312 * dbus/dbus-connection.c (dbus_connection_set_max_message_size)
2313 (dbus_connection_get_max_message_size)
2314 (dbus_connection_set_max_live_messages_size)
2315 (dbus_connection_get_max_live_messages_size): implement some
2316 resource limitation functions
2318 * dbus/dbus-resources.c: new file implementing some of the
2319 resource limits stuff
2321 * dbus/dbus-message.c (dbus_message_iter_get_byte_array): add
2322 missing docs, add @todo to handle OOM etc.
2324 * dbus/dbus-marshal.c (_dbus_demarshal_byte_array): add missing
2327 2003-01-18 Havoc Pennington <hp@pobox.com>
2329 * dbus/dbus-connection.c (dbus_connection_unref): disconnect the
2330 connection if it hasn't been already.
2332 * dbus/dbus-connection.h: kill off the idea of an ErrorFunction,
2333 replace with DisconnectFunction.
2335 2003-01-18 Havoc Pennington <hp@pobox.com>
2337 Building --disable-verbose-mode --disable-asserts --disable-tests
2338 cuts the library from 112K to 45K or so
2340 * configure.in: check for varargs macro support,
2341 add --enable-verbose-mode, --enable-asserts.
2343 * dbus/dbus-internals.h (_dbus_assert): support
2345 (_dbus_verbose): support DBUS_ENABLE_VERBOSE_MODE
2347 2003-01-18 Havoc Pennington <hp@pobox.com>
2349 * dbus/dbus-test.c: include config.h so that tests actually run
2351 * dbus/dbus-string.c: add assertions that stuff is 8-byte aligned,
2352 so the failure mode when that assumption fails will be plenty
2355 2003-01-18 Havoc Pennington <hp@pobox.com>
2357 * configure.in: default --enable-tests to $USE_MAINTAINER_MODE
2359 * dbus/Makefile.am: fix it up so dubs-test-main.c is included in
2362 * test/Makefile.am: don't use special variable "TESTS" for echo-*
2363 since we don't want to use those in make check
2365 2003-01-15 Havoc Pennington <hp@redhat.com>
2371 2003-01-15 Havoc Pennington <hp@redhat.com>
2373 * test/Makefile.am: fix so that test source code ends up in the
2374 distribution on make distcheck
2376 2003-01-15 Havoc Pennington <hp@redhat.com>
2382 2003-01-15 Havoc Pennington <hp@redhat.com>
2384 * dbus/dbus-test.c (dbus_internal_symbol_do_not_use_run_tests):
2385 fix build when --disable-tests
2387 * Makefile.am (EXTRA_DIST): put HACKING in here
2389 * HACKING: document procedure for making a tarball release.
2391 2003-01-14 Anders Carlsson <andersca@codefactory.se>
2393 * bus/connection.c: (connection_error_handler),
2394 (bus_connection_setup):
2395 * bus/main.c: (main):
2396 Make sure that the DBusConnectionData struct is NULLed
2397 out to prevent a segfault.
2399 * dbus/dbus-errors.c: (dbus_result_to_string):
2400 * dbus/dbus-errors.h:
2401 * dbus/dbus-message.c: (dbus_message_get_fields),
2402 (dbus_message_get_fields_valist), (_dbus_message_test):
2403 * dbus/dbus-message.h:
2404 Make dbus_message_get_fields return a result code so we can
2405 track invalid fields as well as oom.
2407 2003-01-11 Havoc Pennington <hp@pobox.com>
2409 * configure.in: change --enable-test/--enable-ansi action-if-given
2410 to enable_foo=$enableval instead of enable_foo=yes
2412 2003-01-08 Havoc Pennington <hp@pobox.com>
2414 * dbus/dbus-string.c (_dbus_string_align_length): new function
2416 * dbus/dbus-test-main.c: move main() for test app here
2418 (dbus_internal_symbol_do_not_use_run_tests): we have to export a
2419 symbol to run tests, because dbus-test isn't in the main
2422 Code review nitpicks.
2424 * dbus/dbus-message.c (dbus_message_write_header): add newlines
2425 for people with narrow emacs ;-). Assert client_serial was filled
2426 in. Assert message->name != NULL.
2427 (dbus_message_append_fields): have "first_field_type" arg separate
2428 from va list, needed for C++ binding that also uses varargs IIRC
2429 and helps with type safety
2430 (dbus_message_new): add @todo about using DBusString to store
2431 service/name internally
2432 (dbus_message_new): don't leak ->service and ->name on OOM later
2434 (dbus_message_unref): free the service name
2435 (dbus_message_get_fields): same change to varargs
2436 i.e. first_field_type
2437 (_dbus_message_loader_return_buffer): assert that the message data
2438 is aligned (if not it's a bug in our code). Put in verbose griping
2439 about why we set corrupted = TRUE.
2440 (decode_header_data): add FIXME that char* is evil. Was going to
2441 add FIXME about evil locale-specific string.h strncmp, but just
2442 switched to wacky string-as-uint32 optimization. Move check for
2443 "no room for field name" above get_const_data_len() to avoid
2444 assertion failure in get_const_data_len if we have trailing 2
2445 bytes or the like. Check for service and name fields being
2446 provided twice. Don't leak service/name on error. Require field
2447 names to be aligned to 4 bytes.
2449 * dbus/dbus-marshal.c: move byte swap stuff to header
2450 (_dbus_pack_int32): uscore-prefix
2451 (_dbus_unpack_int32): uscore-prefix
2452 (_dbus_unpack_uint32): export
2453 (_dbus_demarshal_string): add @todo complaining about use of
2455 (_dbus_marshal_get_field_end_pos): add @todo about bad error
2456 handling allowing corrupt data to go unchecked
2458 2003-01-08 Havoc Pennington <hp@redhat.com>
2460 * dbus/dbus-transport-unix.c (unix_do_iteration): add read/write
2461 to the select() as needed for authentication. (should be using
2462 _dbus_poll() not select, but for another day)
2464 * dbus/dbus.h: include dbus/dbus-protocol.h
2466 2003-01-08 Anders Carlsson <andersca@codefactory.se>
2468 * dbus/Makefile.am (dbusinclude_HEADERS): Install
2471 2003-01-08 Anders Carlsson <andersca@codefactory.se>
2473 * dbus/dbus-internals.c: (_dbus_type_to_string):
2474 New function that returns a string describing a type.
2476 * dbus/dbus-marshal.c: (_dbus_demarshal_byte_array):
2477 * dbus/dbus-marshal.h:
2478 * dbus/dbus-message.c: (dbus_message_get_fields_valist),
2479 (dbus_message_iter_get_field_type), (dbus_message_iter_get_double),
2480 (dbus_message_iter_get_byte_array):
2481 * dbus/dbus-message.h:
2482 Add new convenience functions for appending and getting message fields.
2483 Also add demarshalling routines for byte arrays.
2485 2003-01-07 Anders Carlsson <andersca@codefactory.se>
2487 * dbus/dbus-connection-internal.h:
2488 * dbus/dbus-connection.c: (_dbus_connection_new_for_transport),
2489 (_dbus_connection_get_next_client_serial),
2490 (dbus_connection_send_message):
2491 * dbus/dbus-internals.h:
2492 * dbus/dbus-marshal.c: (unpack_uint32), (dbus_unpack_int32),
2493 (dbus_pack_int32), (_dbus_marshal_double), (_dbus_marshal_int32),
2494 (_dbus_marshal_uint32), (_dbus_demarshal_double),
2495 (_dbus_demarshal_int32), (_dbus_demarshal_uint32),
2496 (_dbus_demarshal_string), (_dbus_marshal_get_field_end_pos),
2497 (_dbus_verbose_bytes), (_dbus_marshal_test):
2498 * dbus/dbus-marshal.h:
2499 * dbus/dbus-message-internal.h:
2500 * dbus/dbus-message.c: (_dbus_message_set_client_serial),
2501 (dbus_message_write_header), (_dbus_message_lock),
2502 (dbus_message_new), (dbus_message_ref), (dbus_message_unref),
2503 (dbus_message_get_name), (dbus_message_append_int32),
2504 (dbus_message_append_uint32), (dbus_message_append_double),
2505 (dbus_message_append_string), (dbus_message_append_byte_array),
2506 (dbus_message_get_fields_iter), (dbus_message_iter_ref),
2507 (dbus_message_iter_unref), (dbus_message_iter_has_next),
2508 (dbus_message_iter_next), (dbus_message_iter_get_field_type),
2509 (dbus_message_iter_get_string), (dbus_message_iter_get_int32),
2510 (dbus_message_iter_get_uint32), (dbus_message_iter_get_double),
2511 (decode_header_data), (_dbus_message_loader_return_buffer),
2512 (message_iter_test), (_dbus_message_test):
2513 * dbus/dbus-message.h:
2514 * dbus/dbus-protocol.h:
2515 * dbus/dbus-test.c: (main):
2517 * glib/test-dbus-glib.c: (message_handler), (main):
2518 * test/echo-client.c: (main):
2519 * test/watch.c: (check_messages):
2520 Make messages sendable and receivable for real.
2522 2003-01-07 Anders Carlsson <andersca@codefactory.se>
2524 * dbus/dbus-marshal.c: (_dbus_marshal_double),
2525 (_dbus_marshal_string), (_dbus_marshal_byte_array):
2526 * dbus/dbus-message.c: (dbus_message_append_int32),
2527 (dbus_message_append_uint32), (dbus_message_append_double),
2528 (dbus_message_append_string), (dbus_message_append_byte_array):
2529 Handle OOM restoration.
2531 2003-01-07 Anders Carlsson <andersca@codefactory.se>
2533 * dbus/dbus-marshal.c: (_dbus_marshal_string),
2534 (_dbus_demarshal_string), (_dbus_marshal_test):
2535 * dbus/dbus-marshal.h:
2536 * dbus/dbus-message.c: (dbus_message_get_name),
2537 Document these functions.
2539 (dbus_message_append_int32), (dbus_message_append_uint32),
2540 (dbus_message_append_double), (dbus_message_append_string),
2541 (dbus_message_append_byte_array):
2542 * dbus/dbus-message.h:
2543 Add functions for adding message fields of different types.
2545 * dbus/dbus-protocol.h:
2546 Add the different types.
2548 2003-01-05 Havoc Pennington <hp@pobox.com>
2550 * bus/connection.c: implement routines for handling connections,
2551 first thing is keeping a list of owned services on each connection
2552 and setting up watches etc.
2554 * bus/services.c: implement a mapping from service names to lists
2557 * dbus/dbus-hash.c: add DBUS_HASH_POINTER
2559 * dbus/dbus-threads.c (dbus_static_mutex_lock): add functions
2560 to use static mutexes for global data
2562 * dbus/dbus-connection.c (dbus_connection_set_data): add new
2563 collection of functions to set/get application-specific data
2564 on the DBusConnection.
2566 2003-01-04 Havoc Pennington <hp@pobox.com>
2568 * dbus/dbus-sysdeps.c (_dbus_sleep_milliseconds): new function
2569 (_dbus_poll): new function
2571 * dbus/dbus-internals.h (_DBUS_STRUCT_OFFSET): new macro
2574 * bus/loop.c: initial code for the daemon main loop
2576 2003-01-04 Havoc Pennington <hp@pobox.com>
2578 * test/watch.c (error_handler): make it safe if the error handler
2579 is called multiple times (if we s/error handler/disconnect
2580 handler/ we should just guarantee it's called only once)
2582 * dbus/dbus-transport.c (_dbus_transport_disconnect): call the
2583 error handler on disconnect (it's quite possible we should
2584 just change the error handler to a "disconnect handler," I'm
2585 not sure we have any other meaningful errors)
2587 * configure.in: check for getpwnam_r
2589 * dbus/dbus-transport.c, dbus/dbus-transport-unix.c,
2590 dbus/dbus-auth.c: add credentials support, add EXTERNAL auth
2591 mechanism as in SASL spec, using socket credentials
2593 * dbus/dbus-sysdeps.c (_dbus_read_credentials_unix_socket): new function
2594 (_dbus_send_credentials_unix_socket): new function
2596 * dbus/dbus-sysdeps.c (_dbus_accept_unix_socket): rename just
2598 (_dbus_write): only check errno if <0 returned
2599 (_dbus_write_two): ditto
2601 2003-01-02 Anders Carlsson <andersca@codefactory.se>
2603 * dbus/dbus-marshal.c: (_dbus_marshal_utf8_string),
2604 (_dbus_marshal_byte_array), (_dbus_demarshal_utf8_string),
2605 (_dbus_marshal_test):
2606 * dbus/dbus-marshal.h:
2607 Add _dbus_marshal_byte_array and rename _dbus_marshal_string
2608 to _dbus_marshal_utf8_string. Also fix some tests.
2610 2002-12-28 Harri Porten <porten@kde.org>
2612 * configure.in: added check for C++ compiler and a very cheesy
2613 check for the Qt integration
2615 * Makefile.am (SUBDIRS): compile qt subdir if support is enabled
2617 * qt/Makefile.am: added
2619 * qt/.cvsignore: added
2621 * qt/dbus-qthread.cc, qt/dbus-qthread.cpp: renamed former to
2622 latter, added #ifdef QT_THREAD_SUPPORT guard.
2624 * dbus/Makefile.am: added missing headers for make dist
2626 2002-12-28 Kristian Rietveld <kris@gtk.org>
2628 * dbus/Makefile.am: fixup export-symbols-regex.
2630 2002-12-27 Anders Carlsson <andersca@codefactory.se>
2632 * acinclude.m4: Add this file and put the
2633 PKG_CHECK_MODULE macro in it.
2635 2002-12-27 Anders Carlsson <andersca@codefactory.se>
2637 * dbus/dbus-marshal.c: (_dbus_marshal_string),
2638 (_dbus_demarshal_double), (_dbus_demarshal_int32),
2639 (_dbus_demarshal_uint32), (_dbus_demarshal_string),
2640 (_dbus_marshal_test):
2641 Make the demarshalling routines align the pos argument.
2642 Add string marshalling tests and fix the obvious bugs
2645 2002-12-26 Havoc Pennington <hp@pobox.com>
2647 * dbus/dbus-auth.c: fixes fixes fixes
2649 * dbus/dbus-transport-unix.c: wire up support for
2650 encoding/decoding data on the wire
2652 * dbus/dbus-auth.c (_dbus_auth_encode_data)
2653 (_dbus_auth_decode_data): append to target string
2654 instead of nuking it.
2656 2002-12-26 Havoc Pennington <hp@pobox.com>
2658 * dbus/dbus-marshal.h (DBUS_COMPILER_BYTE_ORDER): #ifdef
2659 WORDS_BIGENDIAN then compiler byte order is DBUS_BIG_ENDIAN,
2662 * dbus/dbus-marshal.c: Add macros to do int swapping in-place and
2663 avoid swap_bytes() overhead (ignoring possible assembly stuff for
2664 now). Main point is because I wanted unpack_uint32 to implement
2666 (_dbus_verbose_bytes): new function
2668 * dbus/dbus-string.c (_dbus_string_validate_ascii): new function
2670 * dbus/dbus-message.c (_dbus_message_loader_get_is_corrupted): add
2671 mechanism to handle a corrupt message stream
2672 (_dbus_message_loader_new): fix preallocation to only prealloc,
2675 * dbus/dbus-string.c (_dbus_string_skip_blank): fix this function
2676 (_dbus_string_test): enhance tests for copy/move and fix the
2679 * dbus/dbus-transport-unix.c: Hold references in more places to
2680 avoid reentrancy problems
2682 * dbus/dbus-transport.c: ditto
2684 * dbus/dbus-connection.c (dbus_connection_dispatch_message): don't
2685 leak reference count in no-message case
2687 * test/watch.c (do_mainloop): handle adding/removing watches
2688 during iteration over the watches. Also, ref the connection/server
2689 stored on a watch, so we don't try to mangle a destroyed one.
2691 * dbus/dbus-transport-unix.c (do_authentication): perform
2694 * dbus/dbus-auth.c (get_state): add a state
2695 AUTHENTICATED_WITH_UNUSED_BYTES and return it if required
2696 (_dbus_auth_get_unused_bytes): append the unused bytes
2697 to the passed in string, rather than prepend
2699 * dbus/dbus-transport.c (_dbus_transport_init_base): create
2700 the auth conversation DBusAuth
2702 * dbus/dbus-transport-unix.c (_dbus_transport_new_for_fd)
2703 (_dbus_transport_new_for_domain_socket): when creating a
2704 transport, pass in whether it's a client-side or server-side
2705 transport so we know which DBusAuth to create
2707 2002-12-03 Havoc Pennington <hp@pobox.com>
2709 * dbus/dbus-transport-unix.c (unix_finalize): finalize base
2710 _after_ finalizing the derived members
2711 (unix_connection_set): unref watch if we fail to add it
2713 * dbus/dbus-connection.c (dbus_connection_unref): delete the
2714 transport first, so that the connection owned by the
2715 transport will be valid as the transport finalizes.
2717 * dbus/dbus-transport-unix.c (unix_finalize): free the write_watch
2718 if necessary, and remove watches from the connection.
2720 * dbus/dbus-watch.c (_dbus_watch_list_free): improve a comment
2722 2002-12-26 Anders Carlsson <andersca@codefactory.se>
2724 * dbus/dbus-marshal.c: (_dbus_marshal_string),
2725 (_dbus_demarshal_double), (_dbus_demarshal_int32),
2726 (_dbus_demarshal_uint32), (_dbus_demarshal_string),
2727 (_dbus_marshal_test):
2728 * dbus/dbus-marshal.h:
2729 Add string marshal functions and have the demarshal functions
2730 return the new position.
2732 2002-12-25 Havoc Pennington <hp@pobox.com>
2734 * doc/dbus-sasl-profile.txt: docs on the authentication protocol,
2735 it is a simple protocol that just maps directly to SASL.
2737 * dbus/dbus-auth.h, dbus/dbus-auth.c: authentication protocol
2738 initial implementation, not actually used yet.
2740 * dbus/dbus-string.c (_dbus_string_find): new function
2741 (_dbus_string_equal): new function
2742 (_dbus_string_base64_encode): new function
2743 (_dbus_string_base64_decode): new function
2745 2002-12-25 Anders Carlsson <andersca@codefactory.se>
2748 * dbus/dbus-marshal.c: (swap_bytes), (_dbus_marshal_double),
2749 (_dbus_marshal_int32), (_dbus_marshal_uint32),
2750 (_dbus_demarshal_double), (_dbus_demarshal_int32),
2751 (_dbus_demarshal_uint32), (_dbus_marshal_test):
2752 * dbus/dbus-marshal.h:
2753 * dbus/dbus-protocol.h:
2754 * dbus/dbus-test.c: (main):
2756 Add un-optimized marshalling/demarshalling routines.
2758 2002-12-25 Harri Porten <porten@kde.org>
2760 * qt/dbus-qt.h: adjusted ctor and getter to KDE/Qt conventions
2762 2002-12-24 Zack Rusin <zack@kde.org>
2764 * qt/dbus-qthread.cc: adding - integrates QMutex into Dbus
2765 * qt/dbus-qt.h: skeleton with two sample implemenatation of the
2768 2002-12-24 Havoc Pennington <hp@pobox.com>
2770 * glib/dbus-gthread.c: fix include
2772 * glib/dbus-glib.h: rename DBusMessageHandler for now.
2773 I think glib API needs to change, though, as you don't
2774 want to use DBusMessageFunction, you want to use the
2775 DBusMessageHandler object. Probably
2776 dbus_connection_open_with_g_main_loop()
2777 and dbus_connection_setup_g_main_loop() or something like that
2778 (but think of better names...) that just create a connection
2779 that has watch/timeout functions etc. already set up.
2781 * dbus/dbus-connection.c
2782 (dbus_connection_send_message_with_reply): new function just to
2783 show how the message handler helps us deal with replies.
2785 * dbus/dbus-list.c (_dbus_list_remove_last): new function
2787 * dbus/dbus-string.c (_dbus_string_test): free a string that
2790 * dbus/dbus-hash.c: use memory pools for the hash entries
2791 (rebuild_table): be more paranoid about overflow, and
2792 shrink table when we can
2793 (_dbus_hash_test): reduce number of sprintfs and write
2794 valid C89. Add tests for case where we grow and then
2795 shrink the hash table.
2797 * dbus/dbus-mempool.h, dbus/dbus-mempool.c: memory pools
2799 * dbus/dbus-connection.c (dbus_connection_register_handler)
2800 (dbus_connection_unregister_handler): new functions
2802 * dbus/dbus-message.c (dbus_message_get_name): new
2804 * dbus/dbus-list.c: fix docs typo
2806 * dbus/dbus-message-handler.h, dbus/dbus-message-handler.c:
2807 an object representing a handler for messages.
2809 2002-12-16 Anders Carlsson <andersca@codefactory.se>
2812 * glib/dbus-gthread.c: (dbus_gthread_init):
2813 Don't use the gdbus prefix for public functions.
2815 2002-12-16 Anders Carlsson <andersca@codefactory.se>
2819 Add GLib checks and fixup .pc files
2823 * glib/dbus-gmain.c: (gdbus_connection_prepare),
2824 (gdbus_connection_check), (gdbus_connection_dispatch),
2825 (gdbus_add_connection_watch), (gdbus_remove_connection_watch),
2826 (dbus_connection_gsource_new):
2827 * glib/dbus-gthread.c: (dbus_gmutex_new), (dbus_gmutex_free),
2828 (dbus_gmutex_lock), (dbus_gmutex_unlock), (dbus_gthread_init):
2829 * glib/test-dbus-glib.c: (message_handler), (main):
2832 2002-12-15 Harri Porten <porten@kde.org>
2834 * autogen.sh: check for libtoolize before attempting to use it
2836 * dbus/dbus-transport-unix.c: include <sys/time.h> for timeval
2839 * .cvsignore: ignore more stamp files
2841 * dbus/dbus-watch.c (_dbus_watch_list_new): fixed doc error
2843 * test/Makefile.am: added -I$(top_srcdir) to be able to compile
2844 without make install.
2846 2002-12-15 Havoc Pennington <hp@pobox.com>
2848 * dbus/dbus-threads.c: add thread stubs that a higher library
2849 layer can fill in. e.g. the GLib wrapper might fill them in with
2850 GThread stuff. We still need to use this thread API to
2851 thread-safe-ize the library.
2853 2002-12-12 Havoc Pennington <hp@pobox.com>
2855 * dbus/dbus-transport-unix.c, dbus/dbus-server-unix.c: use the
2856 below new interfaces and include fewer system headers.
2858 * dbus/dbus-sysdeps.c (_dbus_read): new function
2859 (_dbus_write): new function
2860 (_dbus_write_two): new function
2861 (_dbus_connect_unix_socket): new function
2862 (_dbus_listen_unix_socket): new function
2864 * dbus/dbus-message-internal.h: change interfaces to use
2867 2002-12-11 Havoc Pennington <hp@pobox.com>
2869 * dbus/dbus-types.h: add dbus_unichar
2871 * dbus/dbus-internals.c (_dbus_verbose): use _dbus_getenv
2873 * dbus/dbus-connection.c (dbus_connection_send_message): return
2876 * dbus/dbus-transport.c: include dbus-watch.h
2878 * dbus/dbus-connection.c: include dbus-message-internal.h
2880 * HACKING: add file with coding guidelines stuff.
2882 * dbus/dbus-string.h, dbus/dbus-string.c: Encapsulate all string
2883 handling here, for security purposes (as in vsftpd). Not actually
2884 using this class yet.
2886 * dbus/dbus-sysdeps.h, dbus/dbus-sysdeps.c: Encapsulate all
2887 system/libc usage here, as in vsftpd, for ease of auditing (and
2888 should also simplify portability). Haven't actually moved all the
2889 system/libc usage into here yet.
2891 2002-11-25 Havoc Pennington <hp@pobox.com>
2893 * dbus/dbus-internals.c (_dbus_verbose): fix to not
2894 always print the first verbose message.
2896 2002-11-24 Havoc Pennington <hp@pobox.com>
2898 * test/echo-client.c, test/echo-server.c: cheesy test
2901 * configure.in (AC_CHECK_FUNCS): check for writev
2903 * dbus/dbus-message.c (_dbus_message_get_network_data): new
2906 * dbus/dbus-list.c (_dbus_list_foreach): new function
2908 * dbus/dbus-internals.c (_dbus_verbose): new function
2910 * dbus/dbus-server.c, dbus/dbus-server.h: public object
2911 representing a server that listens for connections.
2913 * dbus/.cvsignore: create
2915 * dbus/dbus-errors.h, dbus/dbus-errors.c:
2916 public API for reporting errors
2918 * dbus/dbus-connection.h, dbus/dbus-connection.c:
2919 public object representing a connection that
2920 sends/receives messages. (Same object used for
2921 both client and server.)
2923 * dbus/dbus-transport.h, dbus/dbus-transport.c:
2924 Basic abstraction for different kinds of stream
2925 that we might read/write messages from.
2927 2002-11-23 Havoc Pennington <hp@pobox.com>
2929 * dbus/dbus-internals.h (_DBUS_INT_MAX): add _DBUS_INT_MIN
2932 * dbus/dbus-test.c (main): add list test, and include
2933 dbus-test.h as intended
2935 * dbus/dbus-hash.c (_dbus_hash_table_remove_string)
2936 (_dbus_hash_table_remove_int): return value indicates
2937 whether the entry existed to remove
2939 * dbus/dbus-list.c: add linked list utility class,
2942 * dbus/dbus-hash.c: add TODO item about shrinking the hash bucket
2945 2002-11-23 Havoc Pennington <hp@pobox.com>
2947 * Doxyfile.in (INCLUDE_FILE_PATTERNS): expand DBUS_BEGIN_DECLS/
2948 DBUS_END_DECLS to nothing, that should fix this once and for all
2950 * Doxyfile.in (JAVADOC_AUTOBRIEF): set to YES
2952 * dbus/dbus-message.c, dbus/dbus-hash.c:
2953 add some missing @brief
2955 2002-11-23 Havoc Pennington <hp@pobox.com>
2957 * dbus/dbus-message.h: put semicolons after DEBUG_BEGIN_DECLS
2958 to avoid confusing Doxygen
2960 * dbus/dbus-hash.c: @} not }@
2962 * dbus/dbus-message.c (struct DBusMessage): split out
2965 2002-11-23 Havoc Pennington <hp@pobox.com>
2967 * configure.in: pile on more warning flags if using gcc
2969 * Doxyfile.in (EXTRACT_STATIC): set to NO, so we don't have
2970 to document static functions
2972 * configure.in: add summary to end of configure so it
2973 looks nice and attractive
2975 * dbus/dbus-hash.c: finish implementation and write unit
2978 * configure.in: add --enable-tests to enable unit tests
2980 * dbus/dbus-test.c: test program to run unit tests
2981 for all files in dbus/*, initially runs a test for
2984 * dbus/dbus-internals.h: file to hold some internal utility stuff
2986 2002-11-22 Havoc Pennington <hp@redhat.com>
2988 * dbus/dbus-hash.c: copy in Tcl hash table, not yet
2989 "ported" away from Tcl
2991 * dbus/dbus-types.h: header for types such as dbus_bool_t
2993 2002-11-22 Havoc Pennington <hp@redhat.com>
2995 * dbus/dbus.h: fixups for doc warnings
2997 * Doxyfile.in (FILE_PATTERNS): we need to scan .h to pick up
2999 (QUIET): make it quiet so we can see warnings
3001 * dbus/dbus-memory.c: teach D-BUS to allocate and free memory
3003 2002-11-22 Havoc Pennington <hp@redhat.com>
3005 * Makefile.am: include "Doxyfile" target in all-local
3007 * configure.in: generate the Doxyfile
3009 * Doxyfile.in: move Doxyfile here, so we can use
3010 configure to generate a Doxyfile with the right
3013 2002-11-22 Havoc Pennington <hp@redhat.com>
3015 * dbus/dbus-message.c: move inline docs into .c file
3017 * Doxyfile (OUTPUT_DIRECTORY): move output to doc/api
3018 so all docs are under doc/
3019 (MAN_EXTENSION): generate man pages. Use extension
3020 ".3dbus" which matches ".3qt" on my system,
3021 I guess this is OK, I don't know really.
3022 (FILE_PATTERNS): look for .c files not .h, makes sense
3025 2002-11-22 Havoc Pennington <hp@pobox.com>
3027 * Makefile.am (SUBDIRS): rename subdir "server" to "bus"
3028 because any app can be a server, and any app can be a client,
3029 the bus is a special kind of server.
3031 Thu Nov 21 23:35:31 2002 Zack Rusin <zack@kde.org>
3033 * Doxyfile : adding. Still needs Makefile rules to be generated
3034 automatically (just run "doxygen" in the toplevel dir for now to
3037 * dbus/dbus-message.h : Adding sample docs (javadoc since
3038 resembles gtk-doc a little more)
3040 * dbus/dbus.h : Adding sample docs
3042 2002-11-21 Havoc Pennington <hp@redhat.com>
3044 * dbus/Makefile.am (INCLUDES): define DBUS_COMPILATION
3045 so we can allow ourselves to include files directly,
3046 instead of having to use dbus.h
3048 * dbus/dbus.h: fill in
3050 * dbus/dbus-message.h: sketch out a sample header file.
3051 Include griping if you include it directly instead of
3054 * dbus/dbus-macros.h: new file with macros for extern "C",
3055 TRUE/FALSE, NULL, etc.
3057 * doc/file-boilerplate.c: put include guards in here
3059 2002-11-21 Havoc Pennington <hp@redhat.com>
3061 * doc/file-boilerplate.c: include both AFL and GPL boilerplate.
3063 * COPYING: include the GPL as well, and license code
3064 under both AFL and GPL.
3066 2002-11-21 Havoc Pennington <hp@redhat.com>
3068 * acconfig.h: get rid of this
3070 * autogen.sh (run_configure): add --no-configure option
3072 * configure.in: remove AC_ARG_PROGRAM to make
3073 autoconf complain less. add AC_PREREQ.
3074 add AC_DEFINE third arg.
3076 2002-11-21 Anders Carlsson <andersca@codefactory.se>
3079 Fix references so we can distcheck.
3081 2002-11-21 Havoc Pennington <hp@redhat.com>
3083 * Initial module creation