1 2003-03-16 Havoc Pennington <hp@pobox.com>
3 * dbus/dbus-watch.c (_dbus_watch_new): handle failure to malloc
6 * dbus/dbus-server-debug-pipe.c (_dbus_transport_debug_pipe_new):
7 add some missing dbus_set_result
9 * bus/dispatch.c (bus_dispatch_add_connection): handle failure to
10 alloc the DBusMessageHandler
12 * dbus/dbus-transport.c (_dbus_transport_disconnect): don't ref
13 the transport here, since we call this from the finalizer; it
14 resulted in a double-finalize.
16 * dbus/dbus-transport.c (_dbus_transport_disconnect): fix a bug
17 where we tried to use transport->connection that was NULL,
18 happened when transport was disconnected early on due to OOM
20 * bus/*.c: adapt to handle OOM for watches/timeouts
22 * dbus/dbus-transport-unix.c: port to handle OOM during
25 * dbus/dbus-auth.c (_dbus_auth_get_unused_bytes): return a
26 reference to unused bytes instead of a copy
28 * dbus/dbus-server.c (dbus_server_handle_watch): return FALSE for
31 * dbus/dbus-connection.c (dbus_connection_handle_watch): return
34 * dbus/dbus-timeout.c (dbus_timeout_handle): return FALSE for out
37 2003-03-16 Anders Carlsson <andersca@codefactory.se>
39 * doc/dbus-specification.sgml:
40 Document reply message for ActivateService.
42 2003-03-16 Anders Carlsson <andersca@codefactory.se>
44 * bus/activation.c: (bus_pending_activation_entry_free),
45 (bus_pending_activation_free), (bus_activation_new),
46 (bus_activation_unref), (bus_activation_service_created),
47 (bus_activation_activate_service):
49 * bus/bus.c: (bus_context_new):
50 * bus/desktop-file.c: (new_section):
51 * bus/driver.c: (bus_driver_send_service_deleted),
52 (bus_driver_handle_activate_service):
53 * bus/services.c: (bus_registry_new), (bus_registry_ensure):
55 * dbus/dbus-connection.c:
56 (dbus_connection_send_with_reply_and_block):
57 * dbus/dbus-message.c: (dbus_message_append_args_valist):
58 * dbus/dbus-protocol.h:
59 Make activation work better. Now pending activations will be queued
60 and the daemon won't try to activate services that are already registered.
62 2003-03-16 Havoc Pennington <hp@pobox.com>
64 * dbus/dbus-bus.c (ensure_bus_data): handle failure to set
67 * dbus/dbus-memory.c (_dbus_initialize_malloc_debug): support
68 DBUS_MALLOC_BACKTRACES to print trace when failing an alloc
70 2003-03-16 Havoc Pennington <hp@pobox.com>
72 * dbus/dbus-string.c (_dbus_string_validate_utf8): oops, unbreak
73 this. always run the test suite before commit...
75 * bus/*: adapt to DBusConnection API changes
77 * glib/dbus-gmain.c: adapt to DBusConnection API changes,
78 requires renaming stuff to avoid dbus_connection_dispatch name
81 * dbus/dbus-transport.c (_dbus_transport_queue_messages): new
84 * dbus/dbus-message.c (_dbus_message_loader_queue_messages):
85 separate from _dbus_message_loader_return_buffer()
87 * dbus/dbus-connection.c (dbus_connection_get_n_messages): remove
88 this, because it's now always broken to use; the number of
89 messages in queue vs. the number still buffered by the message
90 loader is undefined/meaningless. Should use
91 dbus_connection_get_dispatch_state().
92 (dbus_connection_dispatch): rename from
93 dbus_connection_dispatch_message
95 2003-03-16 Havoc Pennington <hp@pobox.com>
97 * dbus/dbus-string.c (_dbus_string_validate_utf8): copy in a real
100 2003-03-16 Anders Carlsson <andersca@codefactory.se>
102 * dbus/dbus-connection.c:
103 (dbus_connection_send_with_reply_and_block):
104 Decrease connection->n_incoming when removing an entry
106 * dbus/dbus-dict.c: (dbus_dict_entry_free),
107 (dbus_dict_set_boolean_array), (dbus_dict_set_int32_array),
108 (dbus_dict_set_uint32_array), (dbus_dict_set_double_array),
109 (dbus_dict_set_byte_array), (dbus_dict_set_string_array),
110 (dbus_dict_get_boolean_array), (dbus_dict_get_double_array),
111 (dbus_dict_get_byte_array):
112 Handle NULL arrays and strings. Also add support for byte arrays.
114 * dbus/dbus-marshal.c: (_dbus_marshal_byte_array),
115 (_dbus_marshal_dict), (_dbus_demarshal_byte_array),
116 (_dbus_demarshal_int32_array), (_dbus_demarshal_uint32_array),
117 (_dbus_demarshal_double_array), (_dbus_demarshal_string_array),
118 (_dbus_demarshal_dict), (demarshal_and_validate_len),
119 (_dbus_marshal_validate_arg), (_dbus_marshal_test):
120 * dbus/dbus-marshal.h:
121 Add support for marshalling and demarshalling empty arrays and strings.
123 * dbus/dbus-message.c: (dbus_message_append_args_valist),
124 (dbus_message_append_string_array),
125 (dbus_message_iter_get_boolean),
126 (dbus_message_iter_get_boolean_array),
127 (dbus_message_iter_get_int32_array),
128 (dbus_message_iter_get_uint32_array),
129 (dbus_message_iter_get_double_array),
130 (dbus_message_iter_get_byte_array),
131 (dbus_message_iter_get_string_array), (dbus_message_iter_get_dict),
132 (check_message_handling):
133 Add support for getting empty arrays and dicts.
135 * dbus/dbus-string.c: (_dbus_string_validate_utf8):
136 Don't do any validation at all for now, that's better than just checking
139 * test/data/valid-messages/emptiness.message:
140 New test message with lots of empty arrays.
142 2003-03-16 Havoc Pennington <hp@pobox.com>
144 * dbus/dbus-connection.c
145 (_dbus_connection_queue_received_message_link): new function that
146 can't fail due to OOM
148 * dbus/dbus-message.c (_dbus_message_loader_pop_message_link):
149 new function pops a message together with a list link
152 * dbus/dbus-transport-unix.c (queue_messages): use new link-based
153 message queuing functions to avoid needing to alloc memory
155 2003-03-16 Havoc Pennington <hp@pobox.com>
157 Oops - test code was only testing failure of around 30 of the
158 mallocs in the test path, but it turns out there are 500+
159 mallocs. I believe this was due to misguided linking setup such
160 that there was one copy of dbus_malloc etc. in the daemon and one
161 in the shared lib, and only daemon mallocs were tested. In any
162 case, the test case now tests all 500+ mallocs, and doesn't pass
163 yet, though there are lots of fixes in this patch.
165 * dbus/dbus-connection.c (dbus_connection_dispatch_message): fix
166 this so that it doesn't need to allocate memory, since it
167 has no way of indicating failure due to OOM (and would be
170 * dbus/dbus-list.c (_dbus_list_pop_first_link): new function
172 * bus/Makefile.am: rearrange to create two self-contained
173 libraries, to avoid having libraries with overlapping symbols.
174 that was resulting in weirdness, e.g. I'm pretty sure there
175 were two copies of global static variables.
177 * dbus/dbus-internals.c: move the malloc debug stuff to
180 * dbus/dbus-list.c (free_link): free list mempool if it becomes
183 * dbus/dbus-memory.c (_dbus_disable_mem_pools): new function
185 * dbus/dbus-address.c (dbus_parse_address): free list nodes
188 * bus/dispatch.c (bus_dispatch_add_connection): free
189 message_handler_slot when no longer using it, so
190 memory leak checkers are happy for the test suite.
192 * dbus/dbus-server-debug-pipe.c (debug_finalize): free server name
194 * bus/bus.c (new_connection_callback): disconnect in here if
195 bus_connections_setup_connection fails.
197 * bus/connection.c (bus_connections_unref): fix to free the
199 (bus_connections_setup_connection): if this fails, don't
200 disconnect the connection, just be sure there are no side
203 * dbus/dbus-string.c (undo_alignment): unbreak this
205 * dbus/dbus-auth.c (_dbus_auth_unref): free some stuff we were
207 (_dbus_auth_new): fix the order in which we free strings
210 * bus/connection.c (bus_connection_disconnected): fix to
211 not send ServiceDeleted multiple times in case of memory
214 * dbus/dbus-bus.c (dbus_bus_get_base_service): new function to
215 get the base service name
216 (dbus_bus_register_client): don't return base service name,
217 instead store it on the DBusConnection and have an accessor
219 (dbus_bus_register_client): rename dbus_bus_register()
221 * bus/dispatch.c (check_hello_message): verify that other
222 connections on the bus also got the correct results, not
223 just the one sending hello
225 2003-03-15 Havoc Pennington <hp@pobox.com>
227 Make it pass the Hello handling test including all OOM codepaths.
228 Now to do other messages...
230 * bus/services.c (bus_service_remove_owner): fix crash when
231 removing owner from an empty list of owners
232 (bus_registry_ensure): don't leave service in the list of
233 a connection's owned services if we fail to put the service
236 * bus/connection.c (bus_connection_preallocate_oom_error): set
237 error flag on the OOM error.
239 * dbus/dbus-connection.c (_dbus_connection_new_for_transport):
240 handle _dbus_transport_set_connection failure
242 * dbus/dbus-transport-unix.c (_dbus_transport_new_for_fd): modify
243 to create watches up front and simply enable/disable them as
245 (unix_connection_set): this can now fail on OOM
247 * dbus/dbus-timeout.c, dbus/dbus-watch.c: add concept
248 of enabling/disabling a watch or timeout.
250 * bus/loop.c (bus_loop_iterate): don't touch disabled
253 * glib/dbus-gmain.c: adapt to enable/disable watches and timeouts
255 2003-03-15 Havoc Pennington <hp@pobox.com>
257 * bus/dispatch.c (bus_dispatch_test): OK, now finally actually
258 write useful test code, after all that futzing around ;-)
260 Test does not yet pass because we can't handle OOM in
261 _dbus_transport_messages_pending (basically,
262 dbus_connection_preallocate_send() does not prealloc the write
263 watch). To fix this, I think we need to add new stuff to
264 set_watch_functions, namely a SetEnabled function so we can alloc
265 the watch earlier, then enable it later.
267 * dbus/Makefile.am (libdbus_convenience_la_SOURCES): move
268 dbus-memory.c to the convenience lib
270 * bus/test.c: rename some static functions to keep them clearly
271 distinct from stuff in connection.c. Handle client disconnection.
273 2003-03-14 Havoc Pennington <hp@pobox.com>
275 * bus/dispatch.c (bus_dispatch_test): do test using debug-pipe
276 transport, tests more of the real codepath. Set up clients
277 with bus_setup_debug_client.
279 * bus/test.c (bus_setup_debug_client): function to set up debug
280 "clients" on the main loop
282 * dbus/dbus-transport.c (_dbus_transport_open): add debug-pipe
285 * dbus/dbus-server.c (dbus_server_listen): add debug-pipe
288 * dbus/dbus-server-debug.c: support a debug server based on pipes
290 * dbus/dbus-sysdeps.c (_dbus_full_duplex_pipe): new function
291 (_dbus_close): new function
293 * configure.in: check for socketpair
295 2003-03-14 Havoc Pennington <hp@redhat.com>
297 * dbus/dbus-memory.c: add a "detect buffer overwrites on free"
300 * dbus/dbus-transport-debug.c: rework this a good bit to be
301 less complicated. hopefully still works.
303 * dbus/dbus-server-debug.c (handle_new_client): remove timeout
306 * glib/dbus-gmain.c (timeout_handler): don't remove timeout
309 * dbus/dbus-message.c (dbus_message_copy): rename from
310 dbus_message_new_from_message, fix it up to copy
311 all the message fields, add test case
313 * bus/dispatch.c (bus_dispatch_test): add some more test code,
314 not quite passing yet
316 2003-03-14 Havoc Pennington <hp@pobox.com>
318 * bus/loop.c (bus_loop_iterate): add this so we can "run loop
319 until no work remains" in test code. (the large diff here
320 is just code movement, no actual changes)
322 * dbus/dbus-server-debug.c (DEFAULT_INTERVAL): change interval to
323 1, no point waiting around for test code.
324 (_dbus_server_debug_accept_transport): unref the timeout
325 after adding it (right?)
327 * dbus/dbus-transport-debug.c (DEFAULT_INTERVAL): ditto
329 2003-03-13 Havoc Pennington <hp@redhat.com>
331 * dbus/dbus-timeout.c (_dbus_timeout_list_set_functions): handle
334 * dbus/dbus-watch.c (_dbus_watch_list_set_functions): handle out
337 * dbus/dbus-connection.h: Make AddWatchFunction and
338 AddTimeoutFunction return a bool so they can fail on out-of-memory
340 * bus/bus.c (bus_context_new): set up timeout handlers
342 * bus/connection.c (bus_connections_setup_connection): set up
345 * glib/dbus-gmain.c: adapt to the fact that set_functions stuff
348 * bus/bus.c (bus_context_new): adapt to changes
350 * bus/connection.c: adapt to changes
352 * test/watch.c: adapt to DBusWatch changes
354 * bus/dispatch.c (bus_dispatch_test): started adding this but
357 2003-03-14 Anders Carlsson <andersca@codefactory.se>
359 * bus/dispatch.c (send_service_nonexistent_error): Fix typo.
361 2003-03-13 Havoc Pennington <hp@pobox.com>
363 * bus/test.c, bus/test.h, bus/Makefile.am, bus/test-main.c:
364 set up a test framework as for the library
366 2003-03-12 Havoc Pennington <hp@pobox.com>
368 Throughout: purge global variables, introduce BusActivation,
369 BusConnections, BusRegistry, etc. objects instead.
371 * bus/bus.h, bus/bus.c: introduce BusContext as a global
374 * test/Makefile.am (TEST_BINARIES): disable bus-test for now,
375 going to redo this a bit differently I think
377 2003-03-12 Havoc Pennington <hp@redhat.com>
379 Mega-patch that gets the message bus daemon initially handling
380 out-of-memory. Work still needed. Also lots of random
381 moving stuff to DBusError instead of ResultCode.
383 * dbus/dbus-list.c (_dbus_list_length_is_one): new function
385 * dbus/dbus-connection.c
386 (dbus_connection_send_with_reply_and_block): use DBusError
388 * dbus/dbus-bus.c: adapt to API changes, make it use DBusError not
391 * dbus/dbus-connection.c (dbus_connection_send): drop the result
392 code here, as the only failure possible is OOM.
394 * bus/connection.c (bus_connection_disconnect):
395 rename bus_connection_disconnected as it's a notification only
397 * bus/driver.c (bus_driver_handle_acquire_service): don't free
398 "name" on get_args failure, should be done by get_args;
399 don't disconnect client for bad args, just return an error.
400 (bus_driver_handle_service_exists): ditto
402 * bus/services.c (bus_services_list): NULL-terminate returned array
404 * bus/driver.c (bus_driver_send_service_lost)
405 (bus_driver_send_service_acquired): send messages from driver to a
406 specific client to the client's unique name, not to the broadcast
409 * dbus/dbus-message.c (decode_header_data): reject messages that
410 contain no name field
411 (_dbus_message_get_client_serial): rename to
412 dbus_message_get_serial and make public
413 (_dbus_message_set_serial): rename from set_client_serial
414 (_dbus_message_set_reply_serial): make public
415 (_dbus_message_get_reply_serial): make public
417 * bus/connection.c (bus_connection_foreach): allow stopping
418 iteration by returning FALSE from foreach function.
420 * dbus/dbus-connection.c (dbus_connection_send_preallocated)
421 (dbus_connection_free_preallocated_send)
422 (dbus_connection_preallocate_send): new API for sending a message
423 without possibility of malloc failure.
424 (dbus_connection_send_message): rename to just
425 dbus_connection_send (and same for whole function family)
427 * dbus/dbus-errors.c (dbus_error_free): make this reinit the error
429 * dbus/dbus-sysdeps.c (_dbus_exit): new function
431 * bus/activation.c: handle/return errors
433 * dbus/dbus-errors.h: add more DBUS_ERROR #define
435 * dbus/dbus-sysdeps.c (_dbus_directory_open) (_dbus_file_get_contents)
436 (_dbus_directory_get_next_file): use DBusError instead of DBusResultCode
437 (_dbus_result_from_errno): move to this file
439 2003-03-10 Anders Carlsson <andersca@codefactory.se>
441 * dbus/dbus-marshal.c:
442 (_dbus_marshal_set_string):
443 Take a length argument so we can marshal the correct string
446 (_dbus_marshal_dict), (_dbus_demarshal_dict),
447 (_dbus_marshal_get_arg_end_pos), (_dbus_marshal_validate_arg),
448 (_dbus_marshal_test):
449 * dbus/dbus-marshal.h:
450 Add support for marshalling and demarshalling dicts.
452 * dbus/dbus-message-builder.c: (_dbus_message_data_load):
453 Add support for TYPE DICT.
455 * dbus/dbus-message.c: (set_string_field):
456 Adjust header padding.
458 (dbus_message_append_args_valist), (dbus_message_append_dict),
459 (dbus_message_get_args_valist), (dbus_message_iter_get_arg_type),
460 (dbus_message_iter_get_dict), (_dbus_message_loader_return_buffer),
461 (check_message_handling), (check_have_valid_message):
462 * dbus/dbus-message.h:
463 Add functions for setting and getting dicts.
465 * dbus/dbus-protocol.h:
471 * doc/dbus-specification.sgml:
472 Add information about how dicts are marshalled.
474 * test/data/invalid-messages/dict-with-nil-value.message:
475 * test/data/invalid-messages/too-short-dict.message:
476 * test/data/valid-messages/dict-simple.message:
477 * test/data/valid-messages/dict.message:
478 Add sample messages containing dicts.
480 2003-03-08 Anders Carlsson <andersca@codefactory.se>
482 * dbus/dbus-dict.h: Add DBUS_END_DECLS.
484 2003-03-07 Anders Carlsson <andersca@codefactory.se>
487 * dbus/dbus-dict.c: (dbus_dict_entry_free), (dbus_dict_new),
488 (dbus_dict_get_keys), (insert_entry), (dbus_dict_set_boolean),
489 (dbus_dict_set_int32), (dbus_dict_set_uint32),
490 (dbus_dict_set_double), (dbus_dict_set_string),
491 (dbus_dict_set_boolean_array), (dbus_dict_set_int32_array),
492 (dbus_dict_set_uint32_array), (dbus_dict_set_double_array),
493 (dbus_dict_set_string_array), (_dbus_dict_test):
495 Fix according to comments from Havoc.
497 2003-03-06 Michael Meeks <michael@server.home>
499 * configure.in: if we don't have kde-config, disable have_qt.
501 2003-03-07 Anders Carlsson <andersca@codefactory.se>
506 * dbus/dbus-dict.c: (dbus_dict_entry_free), (dbus_dict_new),
507 (dbus_dict_ref), (dbus_dict_unref), (dbus_dict_contains),
508 (dbus_dict_remove), (dbus_dict_get_value_type),
509 (dbus_dict_get_keys), (dbus_dict_put_boolean),
510 (dbus_dict_put_int32), (dbus_dict_put_uint32),
511 (dbus_dict_put_double), (dbus_dict_put_string),
512 (dbus_dict_put_boolean_array), (dbus_dict_put_int32_array),
513 (dbus_dict_put_uint32_array), (dbus_dict_put_double_array),
514 (dbus_dict_put_string_array), (dbus_dict_get_boolean),
515 (dbus_dict_get_int32), (dbus_dict_get_uint32),
516 (dbus_dict_get_double), (dbus_dict_get_string),
517 (dbus_dict_get_boolean_array), (dbus_dict_get_int32_array),
518 (dbus_dict_get_uint32_array), (dbus_dict_get_double_array),
519 (dbus_dict_get_string_array), (_dbus_dict_test):
521 Add DBusDict implementation
523 * dbus/dbus-test.c: (dbus_internal_do_not_use_run_tests):
527 2003-03-04 Havoc Pennington <hp@pobox.com>
529 * test/data/auth/*: adapt to changes
531 * dbus/dbus-auth-script.c (_dbus_auth_script_run): add
532 USERID_BASE64 and change USERNAME_BASE64 to put in username not
535 * dbus/dbus-keyring.c (_dbus_keyring_validate_context): prevent
536 more stuff from being in a context name, to make the protocol
539 * dbus/dbus-errors.c (dbus_error_has_name): new function
540 (dbus_error_is_set): new function
542 * dbus/dbus-auth.c: replace DBUS_STUPID_TEST_MECH auth
543 with DBUS_COOKIE_SHA1, implement DBUS_COOKIE_SHA1
545 * dbus/dbus-connection.c (dbus_connection_flush): also read
546 messages during a flush operation
548 * dbus/Makefile.am: remove dbus-md5 since it isn't currently used.
550 2003-03-05 Anders Carlsson <andersca@codefactory.se>
552 * configure.in: Check for gethostbyname on Solaris.
554 * dbus/dbus-transport.c: (_dbus_transport_open):
555 Remove duplicate "tcp" entry.
557 * doc/dbus-specification.sgml:
560 2003-03-05 Anders Carlsson <andersca@codefactory.se>
562 * dbus/dbus-auth.c: (send_rejected), (process_test_subdir):
563 * dbus/dbus-keyring.c: (_dbus_keyring_new_homedir),
564 (_dbus_keyring_test):
565 * dbus/dbus-md5.c: (_dbus_md5_compute):
566 * dbus/dbus-sha.c: (_dbus_sha_compute):
569 2003-03-05 Anders Carlsson <andersca@codefactory.se>
571 * README: Add some things.
573 2003-03-04 Anders Carlsson <andersca@codefactory.se>
575 * dbus/dbus-message.c (dbus_message_append_args_valist): Add a break;
576 after case DBUS_TYPE_BOOELAN.
578 2003-03-02 Havoc Pennington <hp@pobox.com>
580 * test/break-loader.c (randomly_set_extreme_ints): add test that
581 sets really huge and small integers
583 * dbus/dbus-marshal.c (_dbus_marshal_validate_arg): add check
584 that length of boolean array fits in the string, and that
585 string has room for boolean value in single-bool case.
587 * dbus/dbus-message-builder.c (_dbus_message_data_load): add
588 optional value to "ALIGN" command which is what to fill the
591 * test/data/valid-messages/no-padding.message: add regression
592 test for the message padding problem
594 2003-03-02 Havoc Pennington <hp@pobox.com>
596 * dbus/dbus-message.c (decode_header_data): fix to always init
597 message_padding, from Benjamin Dauvergne
599 2003-03-02 Havoc Pennington <hp@pobox.com>
605 2003-03-01 Joe Shaw <joe@assbarn.com>
607 * configure.in: Check for "struct cmsgcred" and try to access its
608 members for BSD-like unices.
610 * dbus/dbus-sysdeps.c (read_credentials_byte): Fold this back into
611 _dbus_read_credentials_unix_socket().
612 (_dbus_read_credentials_unix_socket): Use recvmsg() instead of
613 read() for reading the credential byte off the unix socket. Use
614 struct cmsgcred on systems that support it.
616 2003-02-27 Alexander Larsson <alexl@redhat.com>
620 Make gthreads-2.0 dependency optional. Don't build thread test if
623 2003-02-27 Havoc Pennington <hp@pobox.com>
625 * dbus/dbus-connection.c
626 (dbus_connection_send_message_with_reply_and_block): fix doh!
627 doh! doh! bug that resulted in never removing a reply from the
628 queue, no wonder we called get_reply_serial so much ;-)
630 * dbus/dbus-message.c (struct DBusMessage): cache reply serial
631 and client serial instead of demarshaling them every time
633 2003-02-27 Havoc Pennington <hp@pobox.com>
635 * dbus/dbus-marshal.c (_dbus_demarshal_int32): rewrite to be much
636 more inlined, using dbus-string-private.h, speeds things up
639 * dbus/dbus-string.c (_dbus_string_free): apply align offset
640 when freeing the string
641 (_dbus_string_steal_data): fix for align offset
642 (undo_alignment): new function
644 2003-02-26 Havoc Pennington <hp@redhat.com>
646 All kinds of audit fixes from Owen, plus initial attempt to
647 handle unaligned memory returned from malloc.
649 * dbus/dbus-string.c (_dbus_string_init): clamp max length to
650 leave room for align_offset and nul byte
651 (fixup_alignment): function to track an align_offset and
652 ensure real->str is aligned
653 (DBUS_GENERIC_STRING_PREAMBLE): len must be less than allocated,
654 to allow a nul byte plus align offset
655 (_dbus_string_lock): fix overflow issue
656 (_dbus_string_init_const_len): add assertions on sanity of len,
657 assign allocated to be ALLOCATION_PADDING larger than len
658 (set_length): fixup the overflow handling
659 (_dbus_string_get_data_len): fix overflow in assertion
660 (open_gap): detect overflow in size of gap to be opened
661 (_dbus_string_lengthen): add overflow check
662 (_dbus_string_align_length): fix overflow with _DBUS_ALIGN_VALUE
663 (_dbus_string_append): add overflow check
664 (_dbus_string_append_unichar): overflow
665 (_dbus_string_delete): fix overflow in assertion
666 (_dbus_string_copy_len): overflow in assertion
667 (_dbus_string_replace_len): overflows in assertions
668 (_dbus_string_find): change to implement in terms of
670 (_dbus_string_find_to): assorted fixage
671 (_dbus_string_equal_c_str): assert c_str != NULL,
672 fix logic so the function works
673 (_dbus_string_ends_with_c_str): fix overflow thingy
674 (_dbus_string_base64_encode): overflow fix
675 (_dbus_string_validate_ascii): overflow
676 (_dbus_string_validate_nul): overflow
678 2003-02-26 Havoc Pennington <hp@redhat.com>
680 * dbus/dbus-marshal.c (_dbus_marshal_test): fix to work with DISABLE_ASSERTS
682 2003-02-26 Alexander Larsson <alexl@redhat.com>
685 Set DBUS_GLIB_THREADS_LIBS for apps using gthread-2.0
687 * dbus/dbus-connection.c:
688 * dbus/dbus-connection.h:
689 Fix _dbus_connection_acquire_io_path and _dbus_connection_acquire_dispatch.
690 Add dbus_connection_set_wakeup_main_function and use it when queueing
691 incoming and outgoing messages.
694 * dbus/dbus-dataslot.c:
695 Threadsafe usage of DBusDataSlotAllocator
697 * dbus/dbus-message.c: (dbus_message_get_args_iter):
700 * dbus/dbus-server-unix.c:
704 Implement the new wakeup functions for glib.
707 * glib/test-thread-client.c:
708 * glib/test-thread-server.c:
709 * glib/test-thread.h:
710 Initial cut at some thread test code. Not really done yet.
712 2003-02-26 Havoc Pennington <hp@pobox.com>
714 * dbus/dbus-connection.c
715 (dbus_connection_send_message_with_reply_and_block): fix crash
716 where we ref'd the outgoing message instead of the returned reply
718 * dbus/dbus-transport-unix.c (do_authentication): check read watch
719 at the end of this function, so if we didn't need to read for
720 authentication, we reinstall it for receiving messages
722 * dbus/dbus-message.c (dbus_message_new_reply): allow replies to
723 a NULL sender for peer-to-peer case
725 * dbus/dbus-transport-unix.c (check_read_watch): handle
726 !authenticated case correctly
728 * glib/dbus-gmain.c: add support for DBusServer
730 * dbus/dbus-server.c: add data slot support
732 * glib/dbus-gmain.c (dbus_connection_setup_with_g_main): check
733 return values and handle errors
735 * dbus/dbus-dataslot.c: factor out the data slot stuff from
738 * Doxyfile.in (INPUT): add glib subdir
740 * glib/dbus-gmain.c (dbus_connection_setup_with_g_main): rename
741 setup_with_g_main instead of hookup_with_g_main; write docs
743 2003-02-24 Anders Carlsson <andersca@codefactory.se>
745 * dbus/dbus-marshal.c: (_dbus_marshal_validate_arg):
746 * dbus/dbus-message-builder.c: (_dbus_message_data_load):
747 * dbus/dbus-message.c: (dbus_message_append_boolean),
748 (dbus_message_append_boolean_array),
749 (dbus_message_get_args_valist), (_dbus_message_test):
750 * dbus/dbus-message.h:
751 * doc/dbus-specification.sgml:
752 Various fixes as pointed out by Havoc.
754 * test/data/invalid-messages/bad-boolean-array.message:
755 * test/data/invalid-messages/bad-boolean.message:
756 Add invalid boolean value test cases.
758 2003-02-24 Anders Carlsson <andersca@codefactory.se>
760 * dbus/dbus-internals.c: (_dbus_type_to_string):
761 * dbus/dbus-marshal.c: (_dbus_marshal_get_arg_end_pos),
762 (_dbus_marshal_validate_arg):
763 * dbus/dbus-message-builder.c: (_dbus_message_data_load):
764 * dbus/dbus-message.c: (dbus_message_append_args_valist),
765 (dbus_message_append_boolean), (dbus_message_append_boolean_array),
766 (dbus_message_get_args_valist), (dbus_message_iter_get_boolean),
767 (dbus_message_iter_get_int32), (dbus_message_iter_get_uint32),
768 (dbus_message_iter_get_double),
769 (dbus_message_iter_get_boolean_array), (message_iter_test):
770 * dbus/dbus-message.h:
771 * dbus/dbus-protocol.h:
772 * doc/dbus-specification.sgml:
773 * test/data/valid-messages/lots-of-arguments.message:
774 Add support for boolean and boolean array types.
776 2003-02-23 Havoc Pennington <hp@pobox.com>
778 * dbus/dbus-keyring.c: finish most of this implementation and
781 * dbus/dbus-errors.c (dbus_set_error_const, dbus_set_error): make
782 these barf if the error isn't cleared to NULL
784 * dbus/dbus-sysdeps.c (_dbus_delete_file): set error on failure
785 (_dbus_create_directory): new function
787 * dbus/dbus-errors.c (dbus_set_error): fix warning
789 * dbus/dbus-string.c (_dbus_string_hex_encode): new function
790 (_dbus_string_hex_decode): new function
791 (test_hex_roundtrip): test code
793 * dbus/dbus-sha.c (_dbus_sha_compute): use dbus_string_hex_encode
795 * dbus/dbus-md5.c (_dbus_md5_compute): use dbus_string_hex_encode
797 * dbus/dbus-sysdeps.c (_dbus_string_save_to_file): make this use
798 the save-to-temp/rename trick to atomically write the new file
799 (_dbus_string_parse_uint): new function
801 2003-02-22 Havoc Pennington <hp@pobox.com>
803 * test/Makefile.am (dist-hook): fix dist for test/data/sha-1
805 2003-02-22 Havoc Pennington <hp@pobox.com>
807 * dbus/dbus-message.c (dbus_message_iter_get_string_array):
808 (dbus_message_iter_get_byte_array): Fix up doxygen warnings
810 * dbus/dbus-sha.c: add implementation of SHA-1 algorithm
812 * dbus/test/data/sha-1: add US government test suite for SHA-1
814 2003-02-21 Anders Carlsson <andersca@codefactory.se>
816 * dbus/dbus-marshal.c: (_dbus_demarshal_string_array):
817 Make string arrays NULL-terminated.
819 * dbus/dbus-memory.c: (dbus_free_string_array):
820 * dbus/dbus-memory.h:
821 New function for freeing NULL-terminated string arrays.
823 * dbus/dbus-message-builder.c: (append_quoted_string),
824 (_dbus_message_data_load):
825 Add support for array types.
827 * dbus/dbus-message.c: (check_message_handling):
828 Add more types as test cases.
830 * dbus/dbus-sysdeps.c: (_dbus_string_parse_int),
831 (_dbus_string_parse_double):
832 Add the start offset to the end offset.
834 * test/data/valid-messages/lots-of-arguments.message:
835 New test message with lots of arguments.
837 2003-02-21 Anders Carlsson <andersca@codefactory.se>
839 * dbus/dbus-message.c: (dbus_message_append_nil),
840 (dbus_message_append_int32), (dbus_message_append_uint32),
841 (dbus_message_append_double), (dbus_message_append_string),
842 (dbus_message_append_int32_array),
843 (dbus_message_append_uint32_array),
844 (dbus_message_append_double_array),
845 (dbus_message_append_byte_array),
846 (dbus_message_append_string_array):
847 Fix all out-of-memory handling in these functions.
849 2003-02-21 Anders Carlsson <andersca@codefactory.se>
851 * dbus/dbus-message.c: (dbus_message_append_nil):
854 2003-02-21 Anders Carlsson <andersca@codefactory.se>
856 * dbus/dbus-message.c: (dbus_message_append_args_valist),
857 (dbus_message_append_nil), (dbus_message_append_int32_array),
858 (dbus_message_append_uint32_array),
859 (dbus_message_append_double_array),
860 (dbus_message_append_byte_array),
861 (dbus_message_append_string_array), (dbus_message_get_args_valist),
862 (dbus_message_iter_get_int32_array),
863 (dbus_message_iter_get_uint32_array),
864 (dbus_message_iter_get_double_array),
865 (dbus_message_iter_get_byte_array),
866 (dbus_message_iter_get_string_array):
868 * dbus/dbus-message.h:
869 Add functions for appending and getting arrays.
871 2003-02-21 Anders Carlsson <andersca@codefactory.se>
873 * dbus/dbus-mempool.c (_dbus_mem_pool_new): Make the
874 element size at least 8 bytes, fixes mempool tests on
877 2003-02-20 Alexander Larsson <alexl@redhat.com>
879 * dbus/dbus-transport-unix.c (unix_do_iteration):
880 Unlock the connection mutex during a blocking select call.
881 Add todo about how we need a way to wake up the select.
883 * dbus/dbus-connection-internal.h:
884 * dbus/dbus-connection.c:
885 Add _dbus_connection_lock and _dbus_connection_unlock.
887 2003-02-19 Havoc Pennington <hp@pobox.com>
889 * Doxyfile.in (PREDEFINED): put DOXYGEN_SHOULD_SKIP_THIS in
890 Doxyfile.in, not Doxyfile
892 * dbus/dbus-keyring.c: do some hacking on this
894 * dbus/dbus-sysdeps.c (_dbus_delete_file): new
896 * dbus/dbus-errors.c (dbus_set_error_const): do not call
898 (dbus_set_error): remove dbus_error_init, check for message ==
899 NULL *before* we sprintf into it, and add @todo about including
900 system headers in this file
902 * dbus/dbus-sysdeps.c (_dbus_create_file_exclusively): new
904 * dbus/dbus-errors.h (DBUS_ERROR_FAILED): add
906 * dbus/dbus-sysdeps.c (get_user_info): break this function out to
907 get various bits of user information based on either username
909 (_dbus_homedir_from_username): new function
911 2003-02-19 Anders Carlsson <andersca@codefactory.se>
914 Add check for nonposix getpwnam_r
916 * dbus/dbus-mempool.c: (_dbus_mem_pool_new):
917 Align the pool element size to a sizeof (void *) boundary.
919 * dbus/dbus-sysdeps.c: (_dbus_setenv), (_dbus_connect_unix_socket),
920 (_dbus_listen_unix_socket), (_dbus_credentials_from_username):
921 General Solaris fixes.
923 * test/data/valid-messages/simplest-manual.message:
924 Explicitly state that we want little-endian packing.
926 2003-02-19 Mikael Hallendal <micke@codefactory.se>
928 * dbus/dbus-server.c (dbus_server_listen): Support tcp: addresses.
930 * dbus/dbus-transport-unix.c (_dbus_transport_new_for_tcp_socket):
931 Added to create a transport connecting using a tcp/ip socket.
933 * dbus/dbus-sysdeps.c (_dbus_connect_tcp_socket): Added to connect
934 to a tcp socket at given host and port.
935 (_dbus_listen_tcp_socket): added to listen on tcp socket for given
938 * dbus/dbus-server.c (dbus_server_listen): Support tcp: addresses.
940 * dbus/dbus-server-unix.c (_dbus_server_new_for_tcp_socket):
941 Added to create a server listening on a TCP/IP socket.
943 2003-02-19 Havoc Pennington <hp@pobox.com>
945 Throughout: mop up all the Doxygen warnings and undocumented
948 * dbus/dbus-sysdeps.c (do_exec): do not use execvp, we don't want
951 * dbus/dbus-threads.c: move global mutex initializers to
952 dbus-internals.h, multiple prototypes was confusing doxygen
953 besides being kind of ugly
955 * Doxyfile (PREDEFINED): have Doxygen define
956 DOXYGEN_SHOULD_SKIP_THIS so we can exclude things from
957 docs with #ifndef DOXYGEN_SHOULD_SKIP_THIS
958 (do not abuse the feature! it's for stuff like the autogenerated
959 macros in dbus-md5.c, not just for things you don't feel like
962 2003-02-18 Havoc Pennington <hp@pobox.com>
964 * dbus/dbus-string.c (_dbus_string_zero): new function
966 * dbus/dbus-md5.c: include MD5 implementation by L. Peter Deutsch,
967 wrap it in some dbus-friendly API
969 * dbus/dbus-types.h: add 16-bit types
971 2003-02-18 Joe Shaw <joe@assbarn.com>
973 * dbus/dbus-auth.c (handle_server_data_stupid_test_mech): Just get
974 credentials from our currently running process.
975 (get_word): Fix a buglet where we were copying the entire length
976 instead of relative to our position.
978 * dbus/dbus-hash.c (_dbus_hash_test): Don't try to allocate the
979 keys on the stack... it's 640k of data.
981 * dbus/dbus-sysdeps.c (_dbus_read_credentials_unix_socket): Always
982 read the credentials byte off the socket, even if we don't have
984 (_dbus_poll): Implement poll() using select() for systems which
987 * glib/test-dbus-glib.c (main): Print out an error if no
988 parameters are given.
990 * test/data/auth/fallback.auth-script: Added. Tests that a client
991 can fallback to a secondary auth mechanism if the first fails.
993 2003-02-18 Havoc Pennington <hp@pobox.com>
997 2003-02-17 Havoc Pennington <hp@pobox.com>
999 * doc/dbus-specification.sgml: lots of cosmetic
1000 cleanups/rearrangement, add assorted FIXME, change DBUS_ADDRESS
1001 env variable to DBUS_BUS_ADDRESS, s/client/application/,
1002 s/server/bus/ (except in authentication section). Add a section
1003 "Message Bus Message Routing"
1005 2003-02-17 Anders Carlsson <andersca@codefactory.se.>
1011 2003-02-17 Anders Carlsson <andersca@codefactory.se>
1013 * doc/dbus-specification.sgml:
1014 Specification updates.
1016 2003-02-17 Anders Carlsson <andersca@codefactory.se>
1018 * bus/activation.c: (bus_activation_init), (child_setup),
1019 (bus_activation_activate_service):
1021 * bus/main.c: (main):
1022 Set DBUS_ADDRESS environment variable.
1024 * dbus/dbus-errors.c: (dbus_set_error):
1025 Don't use va_copy since that's a C99 feature.
1027 * dbus/dbus-sysdeps.c: (_dbus_setenv), (do_exec),
1028 (_dbus_spawn_async):
1029 * dbus/dbus-sysdeps.h:
1030 Add child_setup_func to _dbus_spawn_async.
1032 * doc/dbus-specification.sgml:
1033 Update specification.
1035 * test/spawn-test.c: (setup_func), (main):
1038 2003-02-17 Alexander Larsson <alexl@redhat.com>
1040 * dbus/dbus-connection.c (_dbus_connection_handler_destroyed_locked):
1043 2003-02-17 Anders Carlsson <andersca@codefactory.se>
1047 * doc/dbus-test-plan.sgml:
1048 Add test plan document.
1053 2003-02-17 Anders Carlsson <andersca@codefactory.se>
1055 * dbus/dbus-message.c: (decode_header_data),
1056 (_dbus_message_loader_return_buffer):
1057 Set the header padding amount when loading a message.
1059 2003-02-16 Anders Carlsson <andersca@codefactory.se>
1061 * bus/dispatch.c: (send_one_message):
1062 Only send broadcast messages to registered connections.
1064 * dbus/dbus-message.c: (dbus_message_name_is):
1065 * dbus/dbus-message.h:
1066 New convenience function.
1068 * dbus/dbus-transport-debug.c: (do_reading):
1069 Only dispatch one message per run.
1072 * test/bus-test.c: (new_connection_callback), (die),
1073 (test_hello_client1_handler), (test_hello_client2_handler),
1074 (test_hello_replies), (main):
1076 * test/bus-test-loop.[ch]:
1079 2003-02-16 Havoc Pennington <hp@pobox.com>
1081 * dbus/dbus-connection.c (dbus_connection_dispatch_message): fix
1082 backward conditional
1084 2003-02-16 Alexander Larsson <alexl@redhat.com>
1086 * dbus/dbus-connection.c:
1087 Implement sent_message_with_reply. (with_reply_and block is still
1089 Made dispatch_message not lose message if OOM.
1091 * dbus/dbus-errors.h:
1092 Add NoReply error (for reply timeouts).
1094 2003-02-16 Alexander Larsson <alexl@redhat.com>
1096 * dbus/dbus-hash.c (_dbus_hash_table_unref):
1097 Actually free keys and values when destroying hashtable.
1099 2003-02-16 Anders Carlsson <andersca@codefactory.se>
1101 * dbus/dbus-auth.c: (client_try_next_mechanism):
1104 * dbus/dbus-threads.c: (dbus_condvar_wait_timeout):
1105 Return TRUE if there's no thread implementation around.
1107 * glib/dbus-gmain.c: (free_source),
1108 (dbus_connection_hookup_with_g_main):
1109 Make sure to remove the GSource when the connection is finalized.
1111 2003-02-16 Anders Carlsson <andersca@codefactory.se>
1113 * bus/dispatch.c: (bus_dispatch_message_handler):
1114 * dbus/dbus-errors.h:
1115 Return an error if someone tries to send a message to a service
1118 2003-02-16 Anders Carlsson <andersca@codefactory.se>
1120 * bus/activation.c: (load_directory), (bus_activation_init),
1121 (bus_activation_activate_service):
1124 (bus_driver_handle_activate_service), (bus_driver_handle_message):
1125 More work on the activation handling.
1127 * dbus/dbus-errors.h:
1128 Add some error messages
1130 * dbus/dbus-message.c: (dbus_message_new_error_reply):
1131 * dbus/dbus-message.h:
1132 New function that creates an error message.
1134 * dbus/dbus-protocol.h:
1135 Add ACTIVATE_SERVER message.
1137 * dbus/dbus-server-unix.c: (unix_handle_watch),
1138 (_dbus_server_new_for_domain_socket):
1139 Call _dbus_fd_set_close_on_exec.
1141 * dbus/dbus-sysdeps.c: (make_pipe), (do_exec),
1142 (_dbus_spawn_async), (_dbus_disable_sigpipe),
1143 (_dbus_fd_set_close_on_exec):
1144 * dbus/dbus-sysdeps.h:
1145 Add _dbus_fd_set_close_on exec function. Also add function that checks
1146 that all open fds are set to close-on-exec and warns otherwise.
1148 * dbus/dbus-transport-unix.c:
1149 (_dbus_transport_new_for_domain_socket):
1150 Call _dbus_fd_set_close_on_exec.
1152 2003-02-16 Havoc Pennington <hp@pobox.com>
1154 * dbus/dbus-connection.c (dbus_connection_set_change_sigpipe):
1155 allow people to avoid setting SIGPIPE to SIG_IGN
1156 (_dbus_connection_new_for_transport): disable SIGPIPE unless
1157 we've been asked not to
1159 2003-02-15 Anders Carlsson <andersca@codefactory.se>
1161 * dbus/dbus-list.c: (_dbus_list_append_link),
1162 (_dbus_list_prepend_link):
1163 * dbus/dbus-memory.c: (dbus_malloc), (dbus_malloc0),
1167 2003-02-15 Anders Carlsson <andersca@codefactory.se>
1170 * bus/activation.c: (bus_activation_entry_free),
1171 (add_desktop_file_entry), (load_directory), (bus_activation_init):
1173 * bus/main.c: (main):
1174 Add simple activation support, doesn't work yet though.
1176 2003-02-15 Zack Rusin <zack@kde.org>
1178 * qt/dbus-qthread.cpp: small casting fix
1180 2003-02-15 Anders Carlsson <andersca@codefactory.se>
1182 * dbus/dbus-errors.c: (dbus_set_error):
1183 * dbus/dbus-errors.h:
1184 Add a few errors and make dbus_set_error void.
1186 * dbus/dbus-sysdeps.c:
1187 (_dbus_errno_to_string), (close_and_invalidate), (make_pipe),
1188 (write_err_and_exit), (read_ints), (do_exec), (_dbus_spawn_async):
1189 * dbus/dbus-sysdeps.h:
1190 Add _dbus_spawn_async.
1192 * test/spawn-test.c: (main):
1193 Test for _dbus_spawn_async.
1195 2003-02-15 Anders Carlsson <andersca@codefactory.se>
1197 * dbus/dbus-internals.h:
1198 Fix build without tests.
1200 * dbus/dbus-list.c: (alloc_link):
1201 Fix a segfault when a malloc fails.
1203 * dbus/dbus-memory.c: (initialize_malloc_debug), (dbus_malloc),
1204 (dbus_malloc0), (dbus_realloc):
1205 Add support for malloc debugging.
1207 2003-02-15 Alexander Larsson <alexl@redhat.com>
1209 * dbus/dbus-threads.c:
1210 * dbus/dbus-threads.h:
1211 Add condvars. Remove static mutext from API.
1212 Implement static mutexes by initializing them from threads_init.
1214 * glib/dbus-gthread.c:
1215 * qt/dbus-qthread.cpp:
1216 Update with the thread api changes.
1221 Turn StaticMutex into normal mutex + init function.
1222 Export new functions _dbus_list_alloc_link, _dbus_list_free_link,
1223 _dbus_list_append_link, _dbus_list_prepend_link
1226 * dbus/dbus-sysdeps.c:
1227 * dbus/dbus-sysdeps.h:
1228 New type dbus_atomic_t, and new functions _dbus_atomic_inc,
1229 _dbus_atomic_dec. Only slow fallback implementation at the moment.
1231 * dbus/dbus-protocol.h:
1232 Add DBUS_MESSAGE_LOCAL_DISCONNECT define
1234 * dbus/dbus-message.c:
1235 Make ref/unref atomic.
1238 * dbus/dbus-connection-internal.h:
1239 * dbus/dbus-connection.c:
1240 * dbus/dbus-connection.h:
1242 Change _peek to _borrow,_return & _steal_borrowed.
1243 Change disconnect callback to event.
1244 Make dbus_connection_dispatch_messages reentrant.
1246 * dbus/dbus-transport.c:
1247 Don't ref the connection on calls to the transport
1250 * dbus/dbus-message-handler.c:
1253 * glib/dbus-gmain.c:
1254 Don't use peek_message anymore
1257 * test/debug-thread.c:
1258 * test/debug-thread.h:
1259 Simple thread implementation that asserts() on deadlocks in
1260 single-threaded code.
1263 (main) Call debug_threads_init.
1266 Use disconnect message instead of disconnect callback.
1270 Don't call dbus_connection_set_disconnect_function. Instead export
1271 bus_connection_disconnect.
1274 Call bus_connection_disconnect when we get a disconnected message.
1276 2003-02-15 Havoc Pennington <hp@pobox.com>
1278 * dbus/dbus-message.c (dbus_message_new): fool around with the
1281 2003-02-14 Havoc Pennington <hp@pobox.com>
1283 * dbus/dbus-mempool.c: fail if the debug functions so indicate
1285 * dbus/dbus-memory.c: fail if the debug functions indicate we
1288 * dbus/dbus-internals.c (_dbus_set_fail_alloc_counter)
1289 (_dbus_decrement_fail_alloc_counter): debug functions to
1290 simulate memory allocation failures
1292 2003-02-14 Havoc Pennington <hp@pobox.com>
1294 * dbus/dbus-errors.h (struct DBusError): add a word of padding
1297 2003-02-13 Anders Carlsson <andersca@codefactory.se>
1299 * bus/driver.c: (bus_driver_handle_hello):
1301 * bus/services.c: (bus_service_lookup):
1302 Reorder message sending so we get a more sane order.
1304 * test/bus-test.c: (message_handler):
1307 2003-02-13 Anders Carlsson <andersca@codefactory.se>
1309 * bus/driver.c: (bus_driver_send_service_deleted),
1310 (bus_driver_send_service_created), (bus_driver_send_service_lost),
1311 (bus_driver_send_service_acquired), (bus_driver_handle_hello),
1312 (bus_driver_send_welcome_message),
1313 (bus_driver_handle_list_services),
1314 (bus_driver_handle_acquire_service),
1315 (bus_driver_handle_service_exists):
1316 * dbus/dbus-bus.c: (dbus_bus_register_client),
1317 (dbus_bus_acquire_service), (dbus_bus_service_exists):
1318 * dbus/dbus-errors.c: (dbus_result_to_string):
1319 * dbus/dbus-errors.h:
1320 * dbus/dbus-message.c: (dbus_message_append_args),
1321 (dbus_message_append_args_valist), (dbus_message_get_args),
1322 (dbus_message_get_args_valist), (dbus_message_get_args_iter),
1323 (dbus_message_iter_get_arg_type), (dbus_message_iter_get_string),
1324 (dbus_message_iter_get_byte_array),
1325 (dbus_message_iter_get_string_array), (message_iter_test),
1326 (check_message_handling), (_dbus_message_test):
1327 * dbus/dbus-message.h:
1328 * test/bus-test.c: (main):
1329 Change fields to arguments in messages, so that they won't be
1330 confused with header fields.
1332 * glib/test-dbus-glib.c: (main):
1333 Remove append_fields from hello message.
1335 2003-02-13 Anders Carlsson <andersca@codefactory.se>
1337 * dbus/dbus-errors.c:
1338 * dbus/dbus-message.c:
1339 * dbus/dbus-string.c:
1340 Documentation fixes.
1342 2003-02-13 Anders Carlsson <andersca@codefactory.se>
1344 * glib/dbus-gmain.c: (timeout_handler), (add_timeout),
1346 Implement support for timeouts in dbus-glib.
1348 2003-02-13 Anders Carlsson <andersca@codefactory.se>
1350 * dbus/dbus-message-builder.c: (_dbus_message_data_load):
1351 * dbus/dbus-message.c: (process_test_subdir):
1352 * test/break-loader.c: (find_breaks_based_on):
1353 Plug some memory leaks.
1355 2003-02-13 Richard Hult <rhult@codefactory.se>
1357 * bus/main.c: Fix build.
1359 * dbus/dbus-errors.h:
1360 * dbus/dbus-errors.c: Fix copyright for Anders.
1362 2003-02-13 Anders Carlsson <andersca@codefactory.se>
1367 * bus/connection.c: (bus_connection_foreach):
1370 * bus/desktop-file.c: (grow_lines_in_section), (grow_sections),
1371 (unescape_string), (new_section), (parse_section_start),
1372 (parse_key_value), (report_error), (bus_desktop_file_load),
1373 (bus_desktop_file_get_string):
1374 * bus/desktop-file.h:
1375 Use DBusError for error reporting.
1377 * bus/dispatch.c: (send_one_message),
1378 (bus_dispatch_message_handler):
1379 * bus/driver.c: (bus_driver_send_service_deleted),
1380 (bus_driver_send_service_created), (bus_driver_send_service_lost),
1381 (bus_driver_send_service_acquired), (bus_driver_handle_hello),
1382 (bus_driver_send_welcome_message),
1383 (bus_driver_handle_list_services),
1384 (bus_driver_handle_acquire_service),
1385 (bus_driver_handle_service_exists):
1386 * bus/loop.c: (bus_loop_run):
1388 Use BUS_HANDLE_OOM instead of _DBUS_HANDLE_OOM.
1390 * bus/utils.c: (bus_wait_for_memory):
1392 New files with general utility functions.
1394 * dbus/dbus-internals.h:
1395 Remove _DBUS_HANDLE_OOM.
1397 2003-02-13 Anders Carlsson <andersca@codefactory.se>
1399 * dbus/dbus-errors.c: (dbus_result_to_string), (dbus_error_init),
1400 (dbus_error_free), (dbus_set_error_const), (dbus_set_error):
1401 * dbus/dbus-errors.h:
1402 Add DBusError structure.
1404 2003-02-13 Anders Carlsson <andersca@codefactory.se>
1406 * test/data/valid-messages/standard-acquire-service.message:
1407 * test/data/valid-messages/standard-hello.message:
1408 * test/data/valid-messages/standard-list-services.message:
1409 * test/data/valid-messages/standard-service-exists.message:
1410 Add some standard messages.
1412 2003-02-13 Anders Carlsson <andersca@codefactory.se>
1414 * bus/driver.c: (bus_driver_send_welcome_message),
1415 (bus_driver_handle_list_services),
1416 (bus_driver_handle_acquire_service),
1417 (bus_driver_handle_service_exists), (bus_driver_handle_message):
1418 Update for API changes in libdbus.
1420 * dbus/dbus-message.c: (dbus_message_new_reply):
1421 * dbus/dbus-message.h:
1422 Remove the name argument. The spec states that replies shouldn't
1425 2003-02-13 Anders Carlsson <andersca@codefactory.se>
1427 * bus/desktop-file.c: (parse_section_start), (parse_key_value),
1428 (report_error), (bus_desktop_file_load), (lookup_section),
1429 (lookup_line), (bus_desktop_file_get_raw),
1430 (bus_desktop_file_get_string):
1431 * bus/desktop-file.h:
1432 Some fixes, and new functions for getting a key value from a section.
1434 2003-02-13 Havoc Pennington <hp@pobox.com>
1436 * test/data/auth/fail-after-n-attempts.auth-script: new test
1438 * dbus/dbus-auth.c (send_rejected): shutdown_mech() when we
1441 2003-02-13 Havoc Pennington <hp@pobox.com>
1443 * dbus/dbus-auth.c (handle_server_data_external_mech): args to
1444 dbus_credentials_match were backward
1446 * dbus/dbus-auth-script.c (_dbus_auth_script_run): support
1447 NO_CREDENTIALS and ROOT_CREDENTIALS
1449 * dbus/dbus-auth.c (_dbus_auth_do_work): move get_state() routine
1450 into here. Never process more commands after we've reached an
1451 end state; store further data as unused bytes.
1453 * test/data/auth/*: add more auth tests
1455 * dbus/dbus-auth-script.c (_dbus_auth_script_run): support EXPECT
1456 command to match exact string and EXPECT_UNUSED to match unused
1459 * test/Makefile.am (dist-hook): fix to dist all the test stuff
1461 2003-02-12 Havoc Pennington <hp@pobox.com>
1463 * dbus/dbus-string.c (_dbus_string_pop_line): fix to also strip
1464 \r off of popped lines
1466 * dbus/dbus-auth.c (_dbus_auth_test): write code to run auth
1469 * dbus/dbus-auth-script.c (_dbus_auth_script_run): when doing a
1472 2003-02-12 Havoc Pennington <hp@pobox.com>
1474 * dbus/Makefile.am: remove break-loader from the build, since it
1477 * configure.in: add --enable-gcov to turn on coverage profiling
1478 flags and disable optimization
1480 2003-02-10 Havoc Pennington <hp@pobox.com>
1482 * dbus/dbus-auth-script.c, dbus/dbus-auth-script.h: sync
1483 initial cut at test framework for DBusAuth from laptop.
1484 Doesn't quite work yet but it compiles and I need to get
1485 it off the 266mhz laptop. ;-)
1487 * dbus/dbus-server-debug.c (_dbus_server_debug_accept_transport):
1488 fix a memleak in error case
1490 2003-02-12 Anders Carlsson <andersca@codefactory.se>
1493 * bus/desktop-file.c:
1494 * bus/desktop-file.h:
1495 Add a desktop file parser.
1497 2003-02-11 Zack Rusin <zack@kde.org>
1499 * qt/message.[h|cpp]: sample implementation
1500 of the KDE wrapper for DBusMessage
1502 2003-02-09 Zack Rusin <zack@kde.org>
1504 * test/bus-test.c: make_it_compile
1505 * doc/dbus-specification.sgml: minimal semantic fix
1507 2003-02-06 Anders Carlsson <andersca@codefactory.se>
1513 2003-02-06 Anders Carlsson <andersca@codefactory.se>
1516 * dbus/dbus-break-loader.c:
1518 * test/break-loader.c:
1519 Move dbus-break-loader to test/ and rename it to break-loader.
1521 2003-02-02 Havoc Pennington <hp@pobox.com>
1523 * dbus/dbus-keyring.c, dbus/dbus-keyring.h: template files
1524 for code to manage cookies in your home directory
1526 * dbus/dbus-sysdeps.c (_dbus_generate_random_bytes): new function
1528 * dbus/dbus-auth.c (get_state): impose a maximum number of tries
1529 to authenticate, then disconnect the client.
1531 2003-02-03 Alexander Larsson <alexl@redhat.com>
1533 * dbus/dbus-message.c (dbus_message_append_fields):
1536 2003-02-02 Anders Carlsson <andersca@codefactory.se>
1538 * doc/dbus-specification.sgml:
1539 Update address format section.
1541 2003-02-02 Anders Carlsson <andersca@codefactory.se>
1544 * test/bus-test.c: (get_time), (add_timeout), (remove_timeout),
1545 (message_handler), (new_connection_callback), (loop_quit),
1549 2003-02-02 Anders Carlsson <andersca@codefactory.se>
1551 * bus/driver.c: (bus_driver_handle_service_exists):
1552 Simplify the code a bit.
1554 * dbus/dbus-bus.c: (dbus_bus_service_exists):
1557 2003-02-02 Anders Carlsson <andersca@codefactory.se>
1560 Add libdbus-daemon.la and link to it.
1562 2003-02-01 James Willcox <jwillcox@gnome.org>
1564 * bus/driver.c: (bus_driver_handle_own_service):
1565 Actually include the service reply code in the message.
1567 2003-02-02 Anders Carlsson <andersca@codefactory.se>
1569 * bus/driver.c: (bus_driver_handle_service_exists):
1570 Don't unref the incoming message.
1572 2003-02-02 Anders Carlsson <andersca@codefactory.se>
1574 * dbus/dbus.h: Add dbus-address.h and dbus-bus.h
1576 2003-02-02 Anders Carlsson <andersca@codefactory.se>
1578 * dbus/dbus-server.c: (dbus_server_listen):
1579 * dbus/dbus-transport.c: (_dbus_transport_open):
1580 ifdef out the calls to the debug transport and server.
1582 2003-02-02 Alexander Larsson <alexl@redhat.com>
1584 * dbus/dbus-watch.c (dbus_watch_get_flags):
1585 Add note in the docs that ERROR or HANGUP won't be returned
1586 and are assumed always on.
1588 * glib/dbus-gmain.c (add_watch):
1589 Always add IO_ERR | IO_HUP
1591 * dbus/dbus-message.h:
1592 Add semicolon after dbus_message_iter_get_string_array().
1593 Makes qt code build again
1595 2003-02-01 Anders Carlsson <andersca@codefactory.se>
1597 * bus/driver.c: (create_unique_client_name),
1598 (bus_driver_handle_hello):
1599 Don't take a name, just use a numeric id to identify
1603 * dbus/dbus-bus.c: (dbus_bus_register_client),
1604 (dbus_bus_acquire_service), (dbus_bus_service_exists):
1606 Add new convenience functions for communicating with the bus.
1608 * dbus/dbus-message.h:
1610 * dbus/dbus-protocol.h:
1613 2003-02-01 Alexander Larsson <alexl@redhat.com>
1615 * dbus/dbus-message.c (dbus_message_append_fields):
1616 Add some more doc comments.
1618 2003-02-01 Havoc Pennington <hp@pobox.com>
1620 * dbus/dbus-break-loader.c (randomly_modify_length): change
1621 a 4-byte value in the message as if it were a length
1623 * dbus/dbus-sysdeps.c (_dbus_string_save_to_file): don't set
1624 execute bit on saved files
1626 2003-02-01 Havoc Pennington <hp@pobox.com>
1628 * dbus/dbus-break-loader.c (main): new program to find messages
1629 that break the loader.
1631 * dbus/dbus-sysdeps.c (_dbus_string_append_uint): new function
1632 * dbus/dbus-sysdeps.c (_dbus_string_save_to_file): new function
1634 * dbus/dbus-string.c (_dbus_string_set_byte): new
1636 2003-01-31 Havoc Pennington <hp@pobox.com>
1638 * dbus/dbus-message.c: refactor the test code to be more general,
1639 in preparation for writing a "randomly permute test cases to
1640 try to break the loader" program.
1642 2003-01-31 Havoc Pennington <hp@pobox.com>
1644 * doc/dbus-specification.sgml: work on the specification
1646 * dbus/dbus-message.c (_dbus_message_loader_return_buffer): check
1647 the protocol version of the message.
1649 * dbus/dbus-protocol.h: drop special _REPLY names, the spec
1650 no longer specifies that.
1651 (DBUS_SERVICE_REPLY_SERVICE_EXISTS): fix flags (1/2/4/8 not
1654 * dbus/dbus-marshal.c (_dbus_marshal_get_arg_end_pos): add missing
1655 "break" for DBUS_TYPE_NIL, remove @todo
1657 2003-01-31 Havoc Pennington <hp@pobox.com>
1659 * dbus/dbus-message.c (dbus_message_set_is_error_reply): rename
1660 just set_is_error/get_is_error as this is a commonly-used
1661 function, and write docs.
1663 2003-01-31 Anders Carlsson <andersca@codefactory.se>
1665 * dbus/dbus-address.c: (dbus_address_entry_free):
1666 Free key and value lists.
1668 * dbus/dbus-internals.c: (_dbus_type_to_string):
1669 Add the types we didn't have.
1671 * dbus/dbus-marshal.c: (_dbus_marshal_get_arg_end_pos),
1672 (_dbus_marshal_validate_arg):
1675 * dbus/dbus-message.c: (dbus_message_set_sender):
1676 Remove todo about being able to set sender to NULL.
1678 (dbus_message_set_is_error_reply),
1679 (dbus_message_get_is_error_reply):
1680 * dbus/dbus-message.h:
1683 * dbus/dbus-protocol.h:
1684 Add error reply flag.
1686 * test/data/valid-messages/opposite-endian.message:
1687 Add NIL type to test.
1689 2003-01-31 Havoc Pennington <hp@pobox.com>
1691 * doc/dbus-specification.sgml: fully specify the header. Add
1692 flags and major protocol version, and change header/body len to
1695 * dbus/dbus-message-builder.c (append_saved_length): append length
1698 * dbus/dbus-message.c (dbus_message_create_header): change header
1699 length and body length to unsigned. Add the new fields from the
1701 (_dbus_message_loader_return_buffer): unsigned header/body len
1703 2003-01-30 Havoc Pennington <hp@pobox.com>
1705 * dbus/dbus-auth.c: rework to use only REJECTED, no
1708 * doc/dbus-sasl-profile.txt: drop MECHANISMS and just
1709 use REJECTED, suggested by Mark McLoughlin
1711 2003-01-30 Havoc Pennington <hp@pobox.com>
1713 * dbus/dbus-server.c (dbus_server_listen): @todo about how we need
1714 a better way to report errors here. e.g. "unix address lacks
1715 path" or something. also "no such file" when the path doesn't
1718 * dbus/dbus-address.c (dbus_address_entries_free): add @todo about
1720 (dbus_parse_address): add @todo about documenting address format,
1721 and allowing , and ; to be escaped
1723 2003-01-30 Anders Carlsson <andersca@codefactory.se>
1726 Add dbus-address.[ch]
1728 * dbus/dbus-address.c: (dbus_address_entry_free),
1729 (dbus_address_entries_free), (create_entry),
1730 (dbus_address_entry_get_method), (dbus_address_entry_get_value),
1731 (dbus_parse_address), (_dbus_address_test):
1732 * dbus/dbus-address.h:
1733 New files for dealing with address parsing.
1735 * dbus/dbus-connection.c:
1736 Document timeout functions.
1738 * dbus/dbus-message.c:
1739 Document dbus_message_new_from_message.
1741 * dbus/dbus-server-debug.c:
1744 * dbus/dbus-server.c: (dbus_server_listen):
1745 Parse address and use correct server implementation.
1747 * dbus/dbus-string.c: (_dbus_string_find_to), (_dbus_string_test):
1748 * dbus/dbus-string.h:
1749 New function with test.
1751 * dbus/dbus-test.c: (dbus_internal_symbol_do_not_use_run_tests):
1755 * dbus/dbus-transport-debug.c:
1758 * dbus/dbus-transport.c: (_dbus_transport_open):
1759 Parse address and use correct transport implementation.
1761 2003-01-30 Havoc Pennington <hp@pobox.com>
1763 * dbus/dbus-message.c: use message->byte_order instead of
1764 DBUS_COMPILER_BYTE_ORDER throughout.
1765 (dbus_message_create_header): pad header to align the
1766 start of the body of the message to 8-byte boundary
1768 * dbus/dbus-marshal.h: make all the demarshalers take const
1769 DBusString arguments.
1771 * dbus/dbus-message.c (_dbus_message_loader_return_buffer):
1772 validate message args here, so we don't have to do slow validation
1773 later, and so we catch bad messages as they are incoming. Also add
1774 better checks on header_len and body_len. Also fill in
1777 * dbus/dbus-string.c (_dbus_string_validate_utf8): new (not
1778 implemented properly)
1779 (_dbus_string_validate_nul): new function to check all-nul
1781 * dbus/dbus-marshal.c (_dbus_marshal_get_field_end_pos): rename
1782 get_arg_end_pos and remove all validation
1783 (_dbus_marshal_validate_arg): actually do validation here.
1785 2003-01-29 Havoc Pennington <hp@pobox.com>
1787 * dbus/dbus-message.c (check_message_handling): fix assertion
1788 failure on set_client_serial
1790 2003-01-28 Havoc Pennington <hp@pobox.com>
1792 * dbus/dbus-server-debug.c: Add doc section comments
1794 * dbus/dbus-transport-debug.c: add doc section comments
1796 2003-01-28 Havoc Pennington <hp@redhat.com>
1798 * dbus/dbus-string.c (_dbus_string_base64_decode): append bytes in
1799 the reverse order from how I had it
1800 (_dbus_string_base64_encode): reverse encoding order. I was
1801 basically byteswapping everything during encoding.
1803 2003-01-28 Anders Carlsson <andersca@codefactory.se>
1805 * dbus/dbus-connection-internal.h:
1806 * dbus/dbus-connection.c: (_dbus_connection_add_timeout),
1807 (_dbus_connection_remove_timeout):
1808 Add functions for adding and removing timeouts.
1810 * dbus/dbus-message.c: (dbus_message_new_from_message):
1811 Add new function that takes a message and creates an exact
1812 copy of it, but with the refcount set to 1.
1813 (check_message_handling):
1816 * dbus/dbus-server-protected.h:
1817 * dbus/dbus-server.c: (_dbus_server_init_base),
1818 (_dbus_server_finalize_base), (_dbus_server_add_timeout),
1819 (dbus_server_set_timeout_functions):
1820 (_dbus_server_remove_timeout):
1821 New functions so that a server can add and remove timeouts.
1823 (dbus_server_listen):
1824 Add commented out call to dbus_server_debug_new.
1826 * dbus/dbus-timeout.c: (_dbus_timeout_new):
1827 Actually set the handler, doh.
1829 * dbus/dbus-transport.c: (_dbus_transport_open):
1830 Add commented out call to dbus_transport_debug_client_new.
1833 Add dbus-transport-debug.[ch] and dbus-server-debug.[ch]
1835 2003-01-28 Havoc Pennington <hp@pobox.com>
1837 * dbus/dbus-message.c (check_message_handling): function to check
1838 on the loaded message, iterates over it etc.
1840 2003-01-28 Havoc Pennington <hp@pobox.com>
1842 * test/Makefile.am (dist-hook): fix make distdir
1844 * dbus/Makefile.am (TESTS_ENVIRONMENT): fix make check
1846 2003-01-27 Havoc Pennington <hp@pobox.com>
1848 * dbus/dbus-mempool.c (time_for_size): replace printf with
1851 * dbus/dbus-message-builder.c (_dbus_message_data_load): allow
1852 empty lines; fix the SAVE_LENGTH stuff to be
1853 START_LENGTH/END_LENGTH so it actually works; couple other
1856 * test/Makefile.am (dist-hook): add dist-hook for .message files
1858 * dbus/dbus-string.c (DBUS_STRING_COPY_PREAMBLE): source of a copy
1859 can be constant or locked.
1860 (_dbus_string_free): allow freeing a const string as
1863 * dbus/dbus-sysdeps.c (_dbus_concat_dir_and_file): utility
1865 * dbus/dbus-test-main.c (main): take an argument which is the
1866 directory containing test data
1868 * dbus/dbus-message.c (_dbus_message_test): pass a test_data_dir
1869 argument to this and load all the messages in test/data/
1870 checking that they can be loaded or not loaded as appropriate.
1872 2003-01-27 Anders Carlsson <andersca@codefactory.se>
1874 * bus/dispatch.c: (bus_dispatch_message_handler):
1875 Dispatch messages sent to services.
1877 * bus/driver.c: (bus_driver_send_service_deleted),
1878 (bus_driver_send_service_created), (bus_driver_send_service_lost),
1879 (bus_driver_send_service_acquired):
1880 Add helper functions for sending service related messages.
1882 (bus_driver_send_welcome_message):
1883 Send HELLO_REPLY instead of WELCOME.
1885 (bus_driver_handle_list_services):
1886 Send LIST_SERVICES_REPLY instead of SERVICES.
1888 (bus_driver_handle_own_service),
1889 (bus_driver_handle_service_exists):
1890 New message handlers.
1892 (bus_driver_handle_message):
1893 Invoke new message handlers.
1895 (bus_driver_remove_connection):
1896 Don't remove any services here since that's done automatically
1897 by bus_service_remove_owner now.
1900 New function signatures.
1902 * bus/services.c: (bus_service_add_owner):
1903 Send ServiceAcquired message if we're the only primary owner.
1905 (bus_service_remove_owner):
1906 Send ServiceAcquired/ServiceLost messages.
1908 (bus_service_set_prohibit_replacement),
1909 (bus_service_get_prohibit_replacement):
1910 Functions for setting prohibit replacement.
1912 (bus_service_has_owner):
1913 New function that checks if a connection is in the owner queue of
1917 Add new function signatures.
1919 * dbus/dbus-list.c: (_dbus_list_test):
1920 Add tests for _dbus_list_remove_last and traversing the list backwards.
1923 Fix a typo in _dbus_list_get_prev_link, if we're at the first element we can't
1924 go any further, so return NULL then.
1926 * dbus/dbus-protocol.h:
1927 Add new messages, service flags and service replies.
1929 2003-01-26 Havoc Pennington <hp@pobox.com>
1931 * dbus/dbus-message-builder.c: implement, completely untested.
1933 * test/data/*: add data to be used in testing.
1934 ".message" files are our simple loadable text format.
1935 ".message-raw" will be binary dumps of messages.
1937 * dbus/dbus-string.c (_dbus_string_starts_with_c_str): new
1939 2003-01-26 Havoc Pennington <hp@pobox.com>
1941 * dbus/dbus-sysdeps.c (_dbus_file_get_contents): new function
1943 * dbus/dbus-errors.c (dbus_result_to_string): add
1946 * dbus/dbus-message-builder.c: new file, will contain code to load
1947 up messages from files. Not implemented yet.
1949 2003-01-26 Havoc Pennington <hp@pobox.com>
1951 * dbus/dbus-message.c (dbus_message_set_sender): support deleting
1952 the sender by setting to NULL
1954 2003-01-26 Havoc Pennington <hp@pobox.com>
1956 The unit tests pass, but otherwise untested. If it breaks, the
1957 tests should have been better. ;-)
1959 * bus/driver.c (bus_driver_handle_hello): return if we disconnect
1962 * dbus/dbus-message.c: redo everything so we maintain
1963 message->header as the only copy of the various fields.
1964 This avoids the possibility of out-of-memory in some cases,
1965 for example dbus_message_lock() can't run out of memory anymore,
1966 and avoids extra copying. Figured I may as well go ahead and do
1967 this since it was busted for dbus_message_lock to not return
1968 failure on OOM, and dbus_message_write_header was totally
1969 unchecked for OOM. Also fixed some random other bugs.
1971 * dbus/dbus-marshal.c (_dbus_marshal_get_field_end_pos): verify
1972 that strings are nul-terminated. Also, end_pos can be equal
1973 to string length just not greater than, I think.
1974 (_dbus_marshal_set_int32): new function
1975 (_dbus_marshal_set_uint32): new function
1976 (_dbus_marshal_set_string): new function
1978 * dbus/dbus-connection.c (_dbus_connection_new_for_transport): fix
1979 a warning, init timeout_list to NULL
1980 (dbus_connection_send_message): don't use uninitialized variable
1983 * dbus/dbus-string.c (_dbus_string_replace_len): new function
1985 2003-01-26 Anders Carlsson <andersca@codefactory.se>
1987 * bus/driver.c: (bus_driver_handle_hello),
1988 (bus_driver_send_welcome_message):
1991 2003-01-26 Anders Carlsson <andersca@codefactory.se>
1993 * dbus/dbus-auth.c: (process_auth), (_dbus_auth_unref):
1994 * dbus/dbus-connection.c: (_dbus_connection_new_for_transport),
1995 (dbus_connection_unref):
1996 * dbus/dbus-marshal.c: (_dbus_marshal_test):
1997 * dbus/dbus-message.c: (dbus_message_unref),
2000 (dbus_message_get_fields):
2001 Remove debugging printout.
2003 (_dbus_message_loader_return_buffer):
2004 Don't store the header string.
2006 (_dbus_message_test):
2009 2003-01-26 Richard Hult <rhult@codefactory.se>
2011 * glib/dbus-gmain.c (dbus_connection_dispatch): Traverse a copy of
2012 the file descriptor list, since it can change under us.
2014 2003-01-25 Anders Carlsson <andersca@codefactory.se>
2016 * glib/dbus-gmain.c: (dbus_connection_prepare),
2017 (dbus_connection_check), (dbus_connection_dispatch), (add_watch),
2018 (remove_watch), (dbus_connection_hookup_with_g_main):
2019 Rewrite the glib handling to use its own GSource instead of a
2020 GIOChannel so we can catch messages put in the queue while waiting
2023 2003-01-25 Anders Carlsson <andersca@codefactory.se>
2026 * bus/connection.c: (connection_disconnect_handler),
2027 (connection_watch_callback), (bus_connection_setup):
2028 * bus/dispatch.c: (send_one_message),
2029 (bus_dispatch_broadcast_message), (bus_dispatch_message_handler),
2030 (bus_dispatch_add_connection), (bus_dispatch_remove_connection):
2032 * bus/driver.c: (bus_driver_send_service_deleted),
2033 (bus_driver_send_service_created), (bus_driver_handle_hello),
2034 (bus_driver_send_welcome_message),
2035 (bus_driver_handle_list_services), (bus_driver_remove_connection),
2036 (bus_driver_handle_message):
2038 Refactor code, put the message dispatching in its own file. Use
2039 _DBUS_HANDLE_OOM. Also send ServiceDeleted messages when a client
2042 2003-01-25 Anders Carlsson <andersca@codefactory.se>
2044 * dbus/dbus-internals.h:
2045 Add _DBUS_HANDLE_OOM macro, it doesn't do anything currently.
2047 * dbus/dbus-message.c: (dbus_message_get_sender):
2048 * dbus/dbus-message.h:
2049 Implement dbus_message_get_sender.
2051 * dbus/dbus-protocol.h:
2052 Add message and service defines.
2054 2003-01-25 Anders Carlsson <andersca@codefactory.se>
2056 * dbus/dbus-connection.c: (dbus_connection_send_message):
2057 * dbus/dbus-message-internal.h:
2058 * dbus/dbus-message.c: (_dbus_message_get_client_serial),
2059 (dbus_message_write_header):
2060 Remove _dbus_messag_unlock and don't set the client serial on a
2061 message if one already exists.
2063 2003-01-24 Havoc Pennington <hp@pobox.com>
2065 * dbus/dbus-list.c (alloc_link): put a thread lock on the global
2068 * bus/driver.c (bus_driver_handle_list_services): fix a leak
2071 2003-01-25 Anders Carlsson <andersca@codefactory.se>
2073 * dbus/dbus-list.c: (alloc_link), (free_link):
2074 Use a memory pool for the links.
2076 2003-01-25 Anders Carlsson <andersca@codefactory.se>
2078 * bus/connection.c: (bus_connection_foreach):
2080 Add new bus_connection_foreach function.
2082 * bus/driver.c: (send_one_message), (bus_driver_broadcast_message):
2083 Add function that broadcasts a message to all clients.
2085 (bus_driver_send_service_created), (bus_driver_handle_hello),
2086 (bus_driver_send_welcome_message),
2087 (bus_driver_handle_list_services), (bus_driver_message_handler):
2088 Implement functions that take care of listing services, and notifying
2089 clients when new services are created.
2091 * bus/services.c: (bus_services_list):
2093 Add new function that returns an array of strings with the currently
2094 registered services.
2097 * glib/dbus-gmain.c:
2098 Update copyright year.
2100 2003-01-25 Anders Carlsson <andersca@codefactory.se>
2102 * dbus/dbus-connection.c: (dbus_connection_send_message):
2103 Unlock the message in case it was sent earlier.
2105 (dbus_connection_send_message_with_reply_and_block):
2106 Remove the reply message from the list.
2108 * dbus/dbus-marshal.c: (_dbus_demarshal_string_array):
2109 Set array_len and new_pos correctly.
2111 (_dbus_marshal_test):
2112 Remove debug output.
2114 * dbus/dbus-message-internal.h:
2115 * dbus/dbus-message.c: (_dbus_message_get_reply_serial):
2116 New function that returns the reply serial.
2118 (_dbus_message_unlock):
2119 New function that unlocks a message and resets its header.
2121 (dbus_message_append_string_array),
2122 (dbus_message_get_fields_valist),
2123 (dbus_message_iter_get_field_type),
2124 (dbus_message_iter_get_string_array),
2125 (dbus_message_get_fields),
2126 (dbus_message_append_fields_valist):
2127 Handle string arrays.
2129 (dbus_message_set_sender):
2130 Make this function public since the bus daemon needs it.
2132 (decode_header_data):
2133 Set the reply serial to -1 initially.
2135 * dbus/dbus-message.h:
2136 Add dbus_message_set_sender.
2138 2003-01-24 Havoc Pennington <hp@pobox.com>
2140 * doc/dbus-specification.sgml: add some stuff
2142 2003-01-22 Havoc Pennington <hp@pobox.com>
2144 * doc/dbus-specification.sgml: Start to document the protocol.
2146 2003-01-22 Havoc Pennington <hp@pobox.com>
2148 * dbus/dbus-connection.c
2149 (dbus_connection_send_message_with_reply_and_block): add some @todo
2151 * bus/driver.c (bus_driver_add_connection): add a FIXME about memleak
2153 2003-01-21 Havoc Pennington <hp@pobox.com>
2155 (patch untested because can't compile)
2157 * bus/driver.c (create_unique_client_name): make this function
2158 never recycle client names. Also, caller should initialize
2161 * dbus/dbus-sysdeps.c (_dbus_get_current_time): new function
2163 2003-01-21 Anders Carlsson <andersca@codefactory.se>
2165 * dbus/dbus-marshal.c: (_dbus_marshal_double),
2166 (_dbus_marshal_int32), (_dbus_marshal_uint32),
2167 (_dbus_marshal_int32_array), (_dbus_marshal_uint32_array),
2168 (_dbus_marshal_double_array), (_dbus_marshal_string_array),
2169 (_dbus_demarshal_int32_array), (_dbus_demarshal_uint32_array),
2170 (_dbus_demarshal_double_array), (_dbus_demarshal_string_array),
2171 (_dbus_marshal_get_field_end_pos), (_dbus_marshal_test):
2172 * dbus/dbus-marshal.h:
2173 * dbus/dbus-protocol.h:
2174 Add support for marshalling and demarshalling integer, double
2177 2003-01-21 Anders Carlsson <andersca@codefactory.se>
2182 * bus/connection.c: (connection_disconnect_handler):
2183 Remove the connection from the bus driver's list.
2185 (connection_watch_callback): Dispatch messages.
2187 (free_connection_data): Free connection name.
2189 (bus_connection_setup): Add connection to the bus driver's list.
2190 (bus_connection_remove_owned_service):
2191 (bus_connection_set_name), (bus_connection_get_name):
2192 Add functions for setting and getting the connection's name.
2195 Add function headers.
2197 * bus/driver.c: (create_unique_client_name),
2198 (bus_driver_handle_hello_message),
2199 (bus_driver_send_welcome_message), (bus_driver_message_handler),
2200 (bus_driver_add_connection), (bus_driver_remove_connection):
2203 * bus/services.c: (bus_service_free):
2205 New file that handles communication and registreation with the bus
2208 2003-01-21 Anders Carlsson <andersca@codefactory.se>
2210 * dbus/dbus-connection.c: (dbus_connection_send_message):
2211 Add a new client_serial parameter.
2213 (dbus_connection_send_message_with_reply):
2214 Remove a @todo since we've implemented the blocking function.
2216 (dbus_connection_send_message_with_reply_and_block):
2217 New function that sends a message and waits for a reply and
2218 then returns the reply.
2220 * dbus/dbus-connection.h:
2223 * dbus/dbus-errors.c: (dbus_result_to_string):
2224 * dbus/dbus-errors.h:
2225 Add new DBUS_RESULT.
2227 * dbus/dbus-message-internal.h:
2228 * dbus/dbus-message.c: (_dbus_message_get_reply_serial),
2229 (_dbus_message_set_sender), (dbus_message_write_header),
2230 (dbus_message_new_reply), (decode_header_data),
2231 (_dbus_message_loader_return_buffer), (_dbus_message_test):
2232 * dbus/dbus-message.h:
2233 Add new functions that set the reply serial and sender.
2234 Also marshal and demarshal them correctly and add test.
2236 * dbus/dbus-protocol.h:
2237 Add new DBUS_MESSAGE_TYPE_SENDER.
2240 * glib/dbus-gmain.c: (watch_callback), (free_callback_data),
2241 (add_watch), (remove_watch), (add_timeout), (remove_timeout),
2242 (dbus_connection_hookup_with_g_main):
2243 * glib/test-dbus-glib.c: (main):
2244 Rewrite to use GIOChannel and remove the GSource crack.
2246 * test/echo-client.c: (main):
2247 * test/watch.c: (check_messages):
2248 Update for changed APIs
2250 2003-01-19 Anders Carlsson <andersca@codefactory.se>
2252 * dbus/Makefile.am: Add dbus-timeout.[cħ]
2254 * dbus/dbus-connection.c: (_dbus_connection_new_for_transport):
2255 Create a DBusTimeoutList.
2256 (dbus_connection_set_timeout_functions): Add new function to
2257 set timeout callbacks
2259 * dbus/dbus-connection.h: Add public DBusTimeout API.
2261 * dbus/dbus-message.c: (dbus_message_get_service):
2262 * dbus/dbus-message.h: New function.
2264 * dbus/dbus-server.c: Fix small doc typo.
2266 * dbus/dbus-timeout.[ch]: New files for mainloop timeouts.
2268 2003-01-19 Anders Carlsson <andersca@codefactory.se>
2270 * dbus/dbus-string.c (_dbus_string_move_len): Don't delete all
2271 of the string, just as long as specified.
2273 2003-01-19 Havoc Pennington <hp@pobox.com>
2275 * dbus/dbus-connection.c (dbus_connection_get_is_authenticated):
2278 * dbus/dbus-server.c (dbus_server_set_max_connections)
2279 (dbus_server_get_max_connections, dbus_server_get_n_connections):
2280 keep track of current number of connections, and add API for
2281 setting a max (but haven't implemented enforcing the max yet)
2283 2003-01-18 Havoc Pennington <hp@pobox.com>
2285 * dbus/dbus-transport-unix.c (unix_do_iteration): only do the
2286 reading/writing if read_watch != NULL or write_watch != NULL.
2288 * dbus/dbus-message.c (_dbus_message_loader_return_buffer): fix
2289 the message loader code to actually load message->header and
2290 message->body into the newly-created message.
2292 * dbus/dbus-transport-unix.c (check_write_watch): fix a mem leak
2295 * dbus/dbus-connection.c (dbus_connection_set_max_message_size)
2296 (dbus_connection_get_max_message_size)
2297 (dbus_connection_set_max_live_messages_size)
2298 (dbus_connection_get_max_live_messages_size): implement some
2299 resource limitation functions
2301 * dbus/dbus-resources.c: new file implementing some of the
2302 resource limits stuff
2304 * dbus/dbus-message.c (dbus_message_iter_get_byte_array): add
2305 missing docs, add @todo to handle OOM etc.
2307 * dbus/dbus-marshal.c (_dbus_demarshal_byte_array): add missing
2310 2003-01-18 Havoc Pennington <hp@pobox.com>
2312 * dbus/dbus-connection.c (dbus_connection_unref): disconnect the
2313 connection if it hasn't been already.
2315 * dbus/dbus-connection.h: kill off the idea of an ErrorFunction,
2316 replace with DisconnectFunction.
2318 2003-01-18 Havoc Pennington <hp@pobox.com>
2320 Building --disable-verbose-mode --disable-asserts --disable-tests
2321 cuts the library from 112K to 45K or so
2323 * configure.in: check for varargs macro support,
2324 add --enable-verbose-mode, --enable-asserts.
2326 * dbus/dbus-internals.h (_dbus_assert): support
2328 (_dbus_verbose): support DBUS_ENABLE_VERBOSE_MODE
2330 2003-01-18 Havoc Pennington <hp@pobox.com>
2332 * dbus/dbus-test.c: include config.h so that tests actually run
2334 * dbus/dbus-string.c: add assertions that stuff is 8-byte aligned,
2335 so the failure mode when that assumption fails will be plenty
2338 2003-01-18 Havoc Pennington <hp@pobox.com>
2340 * configure.in: default --enable-tests to $USE_MAINTAINER_MODE
2342 * dbus/Makefile.am: fix it up so dubs-test-main.c is included in
2345 * test/Makefile.am: don't use special variable "TESTS" for echo-*
2346 since we don't want to use those in make check
2348 2003-01-15 Havoc Pennington <hp@redhat.com>
2354 2003-01-15 Havoc Pennington <hp@redhat.com>
2356 * test/Makefile.am: fix so that test source code ends up in the
2357 distribution on make distcheck
2359 2003-01-15 Havoc Pennington <hp@redhat.com>
2365 2003-01-15 Havoc Pennington <hp@redhat.com>
2367 * dbus/dbus-test.c (dbus_internal_symbol_do_not_use_run_tests):
2368 fix build when --disable-tests
2370 * Makefile.am (EXTRA_DIST): put HACKING in here
2372 * HACKING: document procedure for making a tarball release.
2374 2003-01-14 Anders Carlsson <andersca@codefactory.se>
2376 * bus/connection.c: (connection_error_handler),
2377 (bus_connection_setup):
2378 * bus/main.c: (main):
2379 Make sure that the DBusConnectionData struct is NULLed
2380 out to prevent a segfault.
2382 * dbus/dbus-errors.c: (dbus_result_to_string):
2383 * dbus/dbus-errors.h:
2384 * dbus/dbus-message.c: (dbus_message_get_fields),
2385 (dbus_message_get_fields_valist), (_dbus_message_test):
2386 * dbus/dbus-message.h:
2387 Make dbus_message_get_fields return a result code so we can
2388 track invalid fields as well as oom.
2390 2003-01-11 Havoc Pennington <hp@pobox.com>
2392 * configure.in: change --enable-test/--enable-ansi action-if-given
2393 to enable_foo=$enableval instead of enable_foo=yes
2395 2003-01-08 Havoc Pennington <hp@pobox.com>
2397 * dbus/dbus-string.c (_dbus_string_align_length): new function
2399 * dbus/dbus-test-main.c: move main() for test app here
2401 (dbus_internal_symbol_do_not_use_run_tests): we have to export a
2402 symbol to run tests, because dbus-test isn't in the main
2405 Code review nitpicks.
2407 * dbus/dbus-message.c (dbus_message_write_header): add newlines
2408 for people with narrow emacs ;-). Assert client_serial was filled
2409 in. Assert message->name != NULL.
2410 (dbus_message_append_fields): have "first_field_type" arg separate
2411 from va list, needed for C++ binding that also uses varargs IIRC
2412 and helps with type safety
2413 (dbus_message_new): add @todo about using DBusString to store
2414 service/name internally
2415 (dbus_message_new): don't leak ->service and ->name on OOM later
2417 (dbus_message_unref): free the service name
2418 (dbus_message_get_fields): same change to varargs
2419 i.e. first_field_type
2420 (_dbus_message_loader_return_buffer): assert that the message data
2421 is aligned (if not it's a bug in our code). Put in verbose griping
2422 about why we set corrupted = TRUE.
2423 (decode_header_data): add FIXME that char* is evil. Was going to
2424 add FIXME about evil locale-specific string.h strncmp, but just
2425 switched to wacky string-as-uint32 optimization. Move check for
2426 "no room for field name" above get_const_data_len() to avoid
2427 assertion failure in get_const_data_len if we have trailing 2
2428 bytes or the like. Check for service and name fields being
2429 provided twice. Don't leak service/name on error. Require field
2430 names to be aligned to 4 bytes.
2432 * dbus/dbus-marshal.c: move byte swap stuff to header
2433 (_dbus_pack_int32): uscore-prefix
2434 (_dbus_unpack_int32): uscore-prefix
2435 (_dbus_unpack_uint32): export
2436 (_dbus_demarshal_string): add @todo complaining about use of
2438 (_dbus_marshal_get_field_end_pos): add @todo about bad error
2439 handling allowing corrupt data to go unchecked
2441 2003-01-08 Havoc Pennington <hp@redhat.com>
2443 * dbus/dbus-transport-unix.c (unix_do_iteration): add read/write
2444 to the select() as needed for authentication. (should be using
2445 _dbus_poll() not select, but for another day)
2447 * dbus/dbus.h: include dbus/dbus-protocol.h
2449 2003-01-08 Anders Carlsson <andersca@codefactory.se>
2451 * dbus/Makefile.am (dbusinclude_HEADERS): Install
2454 2003-01-08 Anders Carlsson <andersca@codefactory.se>
2456 * dbus/dbus-internals.c: (_dbus_type_to_string):
2457 New function that returns a string describing a type.
2459 * dbus/dbus-marshal.c: (_dbus_demarshal_byte_array):
2460 * dbus/dbus-marshal.h:
2461 * dbus/dbus-message.c: (dbus_message_get_fields_valist),
2462 (dbus_message_iter_get_field_type), (dbus_message_iter_get_double),
2463 (dbus_message_iter_get_byte_array):
2464 * dbus/dbus-message.h:
2465 Add new convenience functions for appending and getting message fields.
2466 Also add demarshalling routines for byte arrays.
2468 2003-01-07 Anders Carlsson <andersca@codefactory.se>
2470 * dbus/dbus-connection-internal.h:
2471 * dbus/dbus-connection.c: (_dbus_connection_new_for_transport),
2472 (_dbus_connection_get_next_client_serial),
2473 (dbus_connection_send_message):
2474 * dbus/dbus-internals.h:
2475 * dbus/dbus-marshal.c: (unpack_uint32), (dbus_unpack_int32),
2476 (dbus_pack_int32), (_dbus_marshal_double), (_dbus_marshal_int32),
2477 (_dbus_marshal_uint32), (_dbus_demarshal_double),
2478 (_dbus_demarshal_int32), (_dbus_demarshal_uint32),
2479 (_dbus_demarshal_string), (_dbus_marshal_get_field_end_pos),
2480 (_dbus_verbose_bytes), (_dbus_marshal_test):
2481 * dbus/dbus-marshal.h:
2482 * dbus/dbus-message-internal.h:
2483 * dbus/dbus-message.c: (_dbus_message_set_client_serial),
2484 (dbus_message_write_header), (_dbus_message_lock),
2485 (dbus_message_new), (dbus_message_ref), (dbus_message_unref),
2486 (dbus_message_get_name), (dbus_message_append_int32),
2487 (dbus_message_append_uint32), (dbus_message_append_double),
2488 (dbus_message_append_string), (dbus_message_append_byte_array),
2489 (dbus_message_get_fields_iter), (dbus_message_iter_ref),
2490 (dbus_message_iter_unref), (dbus_message_iter_has_next),
2491 (dbus_message_iter_next), (dbus_message_iter_get_field_type),
2492 (dbus_message_iter_get_string), (dbus_message_iter_get_int32),
2493 (dbus_message_iter_get_uint32), (dbus_message_iter_get_double),
2494 (decode_header_data), (_dbus_message_loader_return_buffer),
2495 (message_iter_test), (_dbus_message_test):
2496 * dbus/dbus-message.h:
2497 * dbus/dbus-protocol.h:
2498 * dbus/dbus-test.c: (main):
2500 * glib/test-dbus-glib.c: (message_handler), (main):
2501 * test/echo-client.c: (main):
2502 * test/watch.c: (check_messages):
2503 Make messages sendable and receivable for real.
2505 2003-01-07 Anders Carlsson <andersca@codefactory.se>
2507 * dbus/dbus-marshal.c: (_dbus_marshal_double),
2508 (_dbus_marshal_string), (_dbus_marshal_byte_array):
2509 * dbus/dbus-message.c: (dbus_message_append_int32),
2510 (dbus_message_append_uint32), (dbus_message_append_double),
2511 (dbus_message_append_string), (dbus_message_append_byte_array):
2512 Handle OOM restoration.
2514 2003-01-07 Anders Carlsson <andersca@codefactory.se>
2516 * dbus/dbus-marshal.c: (_dbus_marshal_string),
2517 (_dbus_demarshal_string), (_dbus_marshal_test):
2518 * dbus/dbus-marshal.h:
2519 * dbus/dbus-message.c: (dbus_message_get_name),
2520 Document these functions.
2522 (dbus_message_append_int32), (dbus_message_append_uint32),
2523 (dbus_message_append_double), (dbus_message_append_string),
2524 (dbus_message_append_byte_array):
2525 * dbus/dbus-message.h:
2526 Add functions for adding message fields of different types.
2528 * dbus/dbus-protocol.h:
2529 Add the different types.
2531 2003-01-05 Havoc Pennington <hp@pobox.com>
2533 * bus/connection.c: implement routines for handling connections,
2534 first thing is keeping a list of owned services on each connection
2535 and setting up watches etc.
2537 * bus/services.c: implement a mapping from service names to lists
2540 * dbus/dbus-hash.c: add DBUS_HASH_POINTER
2542 * dbus/dbus-threads.c (dbus_static_mutex_lock): add functions
2543 to use static mutexes for global data
2545 * dbus/dbus-connection.c (dbus_connection_set_data): add new
2546 collection of functions to set/get application-specific data
2547 on the DBusConnection.
2549 2003-01-04 Havoc Pennington <hp@pobox.com>
2551 * dbus/dbus-sysdeps.c (_dbus_sleep_milliseconds): new function
2552 (_dbus_poll): new function
2554 * dbus/dbus-internals.h (_DBUS_STRUCT_OFFSET): new macro
2557 * bus/loop.c: initial code for the daemon main loop
2559 2003-01-04 Havoc Pennington <hp@pobox.com>
2561 * test/watch.c (error_handler): make it safe if the error handler
2562 is called multiple times (if we s/error handler/disconnect
2563 handler/ we should just guarantee it's called only once)
2565 * dbus/dbus-transport.c (_dbus_transport_disconnect): call the
2566 error handler on disconnect (it's quite possible we should
2567 just change the error handler to a "disconnect handler," I'm
2568 not sure we have any other meaningful errors)
2570 * configure.in: check for getpwnam_r
2572 * dbus/dbus-transport.c, dbus/dbus-transport-unix.c,
2573 dbus/dbus-auth.c: add credentials support, add EXTERNAL auth
2574 mechanism as in SASL spec, using socket credentials
2576 * dbus/dbus-sysdeps.c (_dbus_read_credentials_unix_socket): new function
2577 (_dbus_send_credentials_unix_socket): new function
2579 * dbus/dbus-sysdeps.c (_dbus_accept_unix_socket): rename just
2581 (_dbus_write): only check errno if <0 returned
2582 (_dbus_write_two): ditto
2584 2003-01-02 Anders Carlsson <andersca@codefactory.se>
2586 * dbus/dbus-marshal.c: (_dbus_marshal_utf8_string),
2587 (_dbus_marshal_byte_array), (_dbus_demarshal_utf8_string),
2588 (_dbus_marshal_test):
2589 * dbus/dbus-marshal.h:
2590 Add _dbus_marshal_byte_array and rename _dbus_marshal_string
2591 to _dbus_marshal_utf8_string. Also fix some tests.
2593 2002-12-28 Harri Porten <porten@kde.org>
2595 * configure.in: added check for C++ compiler and a very cheesy
2596 check for the Qt integration
2598 * Makefile.am (SUBDIRS): compile qt subdir if support is enabled
2600 * qt/Makefile.am: added
2602 * qt/.cvsignore: added
2604 * qt/dbus-qthread.cc, qt/dbus-qthread.cpp: renamed former to
2605 latter, added #ifdef QT_THREAD_SUPPORT guard.
2607 * dbus/Makefile.am: added missing headers for make dist
2609 2002-12-28 Kristian Rietveld <kris@gtk.org>
2611 * dbus/Makefile.am: fixup export-symbols-regex.
2613 2002-12-27 Anders Carlsson <andersca@codefactory.se>
2615 * acinclude.m4: Add this file and put the
2616 PKG_CHECK_MODULE macro in it.
2618 2002-12-27 Anders Carlsson <andersca@codefactory.se>
2620 * dbus/dbus-marshal.c: (_dbus_marshal_string),
2621 (_dbus_demarshal_double), (_dbus_demarshal_int32),
2622 (_dbus_demarshal_uint32), (_dbus_demarshal_string),
2623 (_dbus_marshal_test):
2624 Make the demarshalling routines align the pos argument.
2625 Add string marshalling tests and fix the obvious bugs
2628 2002-12-26 Havoc Pennington <hp@pobox.com>
2630 * dbus/dbus-auth.c: fixes fixes fixes
2632 * dbus/dbus-transport-unix.c: wire up support for
2633 encoding/decoding data on the wire
2635 * dbus/dbus-auth.c (_dbus_auth_encode_data)
2636 (_dbus_auth_decode_data): append to target string
2637 instead of nuking it.
2639 2002-12-26 Havoc Pennington <hp@pobox.com>
2641 * dbus/dbus-marshal.h (DBUS_COMPILER_BYTE_ORDER): #ifdef
2642 WORDS_BIGENDIAN then compiler byte order is DBUS_BIG_ENDIAN,
2645 * dbus/dbus-marshal.c: Add macros to do int swapping in-place and
2646 avoid swap_bytes() overhead (ignoring possible assembly stuff for
2647 now). Main point is because I wanted unpack_uint32 to implement
2649 (_dbus_verbose_bytes): new function
2651 * dbus/dbus-string.c (_dbus_string_validate_ascii): new function
2653 * dbus/dbus-message.c (_dbus_message_loader_get_is_corrupted): add
2654 mechanism to handle a corrupt message stream
2655 (_dbus_message_loader_new): fix preallocation to only prealloc,
2658 * dbus/dbus-string.c (_dbus_string_skip_blank): fix this function
2659 (_dbus_string_test): enhance tests for copy/move and fix the
2662 * dbus/dbus-transport-unix.c: Hold references in more places to
2663 avoid reentrancy problems
2665 * dbus/dbus-transport.c: ditto
2667 * dbus/dbus-connection.c (dbus_connection_dispatch_message): don't
2668 leak reference count in no-message case
2670 * test/watch.c (do_mainloop): handle adding/removing watches
2671 during iteration over the watches. Also, ref the connection/server
2672 stored on a watch, so we don't try to mangle a destroyed one.
2674 * dbus/dbus-transport-unix.c (do_authentication): perform
2677 * dbus/dbus-auth.c (get_state): add a state
2678 AUTHENTICATED_WITH_UNUSED_BYTES and return it if required
2679 (_dbus_auth_get_unused_bytes): append the unused bytes
2680 to the passed in string, rather than prepend
2682 * dbus/dbus-transport.c (_dbus_transport_init_base): create
2683 the auth conversation DBusAuth
2685 * dbus/dbus-transport-unix.c (_dbus_transport_new_for_fd)
2686 (_dbus_transport_new_for_domain_socket): when creating a
2687 transport, pass in whether it's a client-side or server-side
2688 transport so we know which DBusAuth to create
2690 2002-12-03 Havoc Pennington <hp@pobox.com>
2692 * dbus/dbus-transport-unix.c (unix_finalize): finalize base
2693 _after_ finalizing the derived members
2694 (unix_connection_set): unref watch if we fail to add it
2696 * dbus/dbus-connection.c (dbus_connection_unref): delete the
2697 transport first, so that the connection owned by the
2698 transport will be valid as the transport finalizes.
2700 * dbus/dbus-transport-unix.c (unix_finalize): free the write_watch
2701 if necessary, and remove watches from the connection.
2703 * dbus/dbus-watch.c (_dbus_watch_list_free): improve a comment
2705 2002-12-26 Anders Carlsson <andersca@codefactory.se>
2707 * dbus/dbus-marshal.c: (_dbus_marshal_string),
2708 (_dbus_demarshal_double), (_dbus_demarshal_int32),
2709 (_dbus_demarshal_uint32), (_dbus_demarshal_string),
2710 (_dbus_marshal_test):
2711 * dbus/dbus-marshal.h:
2712 Add string marshal functions and have the demarshal functions
2713 return the new position.
2715 2002-12-25 Havoc Pennington <hp@pobox.com>
2717 * doc/dbus-sasl-profile.txt: docs on the authentication protocol,
2718 it is a simple protocol that just maps directly to SASL.
2720 * dbus/dbus-auth.h, dbus/dbus-auth.c: authentication protocol
2721 initial implementation, not actually used yet.
2723 * dbus/dbus-string.c (_dbus_string_find): new function
2724 (_dbus_string_equal): new function
2725 (_dbus_string_base64_encode): new function
2726 (_dbus_string_base64_decode): new function
2728 2002-12-25 Anders Carlsson <andersca@codefactory.se>
2731 * dbus/dbus-marshal.c: (swap_bytes), (_dbus_marshal_double),
2732 (_dbus_marshal_int32), (_dbus_marshal_uint32),
2733 (_dbus_demarshal_double), (_dbus_demarshal_int32),
2734 (_dbus_demarshal_uint32), (_dbus_marshal_test):
2735 * dbus/dbus-marshal.h:
2736 * dbus/dbus-protocol.h:
2737 * dbus/dbus-test.c: (main):
2739 Add un-optimized marshalling/demarshalling routines.
2741 2002-12-25 Harri Porten <porten@kde.org>
2743 * qt/dbus-qt.h: adjusted ctor and getter to KDE/Qt conventions
2745 2002-12-24 Zack Rusin <zack@kde.org>
2747 * qt/dbus-qthread.cc: adding - integrates QMutex into Dbus
2748 * qt/dbus-qt.h: skeleton with two sample implemenatation of the
2751 2002-12-24 Havoc Pennington <hp@pobox.com>
2753 * glib/dbus-gthread.c: fix include
2755 * glib/dbus-glib.h: rename DBusMessageHandler for now.
2756 I think glib API needs to change, though, as you don't
2757 want to use DBusMessageFunction, you want to use the
2758 DBusMessageHandler object. Probably
2759 dbus_connection_open_with_g_main_loop()
2760 and dbus_connection_setup_g_main_loop() or something like that
2761 (but think of better names...) that just create a connection
2762 that has watch/timeout functions etc. already set up.
2764 * dbus/dbus-connection.c
2765 (dbus_connection_send_message_with_reply): new function just to
2766 show how the message handler helps us deal with replies.
2768 * dbus/dbus-list.c (_dbus_list_remove_last): new function
2770 * dbus/dbus-string.c (_dbus_string_test): free a string that
2773 * dbus/dbus-hash.c: use memory pools for the hash entries
2774 (rebuild_table): be more paranoid about overflow, and
2775 shrink table when we can
2776 (_dbus_hash_test): reduce number of sprintfs and write
2777 valid C89. Add tests for case where we grow and then
2778 shrink the hash table.
2780 * dbus/dbus-mempool.h, dbus/dbus-mempool.c: memory pools
2782 * dbus/dbus-connection.c (dbus_connection_register_handler)
2783 (dbus_connection_unregister_handler): new functions
2785 * dbus/dbus-message.c (dbus_message_get_name): new
2787 * dbus/dbus-list.c: fix docs typo
2789 * dbus/dbus-message-handler.h, dbus/dbus-message-handler.c:
2790 an object representing a handler for messages.
2792 2002-12-16 Anders Carlsson <andersca@codefactory.se>
2795 * glib/dbus-gthread.c: (dbus_gthread_init):
2796 Don't use the gdbus prefix for public functions.
2798 2002-12-16 Anders Carlsson <andersca@codefactory.se>
2802 Add GLib checks and fixup .pc files
2806 * glib/dbus-gmain.c: (gdbus_connection_prepare),
2807 (gdbus_connection_check), (gdbus_connection_dispatch),
2808 (gdbus_add_connection_watch), (gdbus_remove_connection_watch),
2809 (dbus_connection_gsource_new):
2810 * glib/dbus-gthread.c: (dbus_gmutex_new), (dbus_gmutex_free),
2811 (dbus_gmutex_lock), (dbus_gmutex_unlock), (dbus_gthread_init):
2812 * glib/test-dbus-glib.c: (message_handler), (main):
2815 2002-12-15 Harri Porten <porten@kde.org>
2817 * autogen.sh: check for libtoolize before attempting to use it
2819 * dbus/dbus-transport-unix.c: include <sys/time.h> for timeval
2822 * .cvsignore: ignore more stamp files
2824 * dbus/dbus-watch.c (_dbus_watch_list_new): fixed doc error
2826 * test/Makefile.am: added -I$(top_srcdir) to be able to compile
2827 without make install.
2829 2002-12-15 Havoc Pennington <hp@pobox.com>
2831 * dbus/dbus-threads.c: add thread stubs that a higher library
2832 layer can fill in. e.g. the GLib wrapper might fill them in with
2833 GThread stuff. We still need to use this thread API to
2834 thread-safe-ize the library.
2836 2002-12-12 Havoc Pennington <hp@pobox.com>
2838 * dbus/dbus-transport-unix.c, dbus/dbus-server-unix.c: use the
2839 below new interfaces and include fewer system headers.
2841 * dbus/dbus-sysdeps.c (_dbus_read): new function
2842 (_dbus_write): new function
2843 (_dbus_write_two): new function
2844 (_dbus_connect_unix_socket): new function
2845 (_dbus_listen_unix_socket): new function
2847 * dbus/dbus-message-internal.h: change interfaces to use
2850 2002-12-11 Havoc Pennington <hp@pobox.com>
2852 * dbus/dbus-types.h: add dbus_unichar
2854 * dbus/dbus-internals.c (_dbus_verbose): use _dbus_getenv
2856 * dbus/dbus-connection.c (dbus_connection_send_message): return
2859 * dbus/dbus-transport.c: include dbus-watch.h
2861 * dbus/dbus-connection.c: include dbus-message-internal.h
2863 * HACKING: add file with coding guidelines stuff.
2865 * dbus/dbus-string.h, dbus/dbus-string.c: Encapsulate all string
2866 handling here, for security purposes (as in vsftpd). Not actually
2867 using this class yet.
2869 * dbus/dbus-sysdeps.h, dbus/dbus-sysdeps.c: Encapsulate all
2870 system/libc usage here, as in vsftpd, for ease of auditing (and
2871 should also simplify portability). Haven't actually moved all the
2872 system/libc usage into here yet.
2874 2002-11-25 Havoc Pennington <hp@pobox.com>
2876 * dbus/dbus-internals.c (_dbus_verbose): fix to not
2877 always print the first verbose message.
2879 2002-11-24 Havoc Pennington <hp@pobox.com>
2881 * test/echo-client.c, test/echo-server.c: cheesy test
2884 * configure.in (AC_CHECK_FUNCS): check for writev
2886 * dbus/dbus-message.c (_dbus_message_get_network_data): new
2889 * dbus/dbus-list.c (_dbus_list_foreach): new function
2891 * dbus/dbus-internals.c (_dbus_verbose): new function
2893 * dbus/dbus-server.c, dbus/dbus-server.h: public object
2894 representing a server that listens for connections.
2896 * dbus/.cvsignore: create
2898 * dbus/dbus-errors.h, dbus/dbus-errors.c:
2899 public API for reporting errors
2901 * dbus/dbus-connection.h, dbus/dbus-connection.c:
2902 public object representing a connection that
2903 sends/receives messages. (Same object used for
2904 both client and server.)
2906 * dbus/dbus-transport.h, dbus/dbus-transport.c:
2907 Basic abstraction for different kinds of stream
2908 that we might read/write messages from.
2910 2002-11-23 Havoc Pennington <hp@pobox.com>
2912 * dbus/dbus-internals.h (_DBUS_INT_MAX): add _DBUS_INT_MIN
2915 * dbus/dbus-test.c (main): add list test, and include
2916 dbus-test.h as intended
2918 * dbus/dbus-hash.c (_dbus_hash_table_remove_string)
2919 (_dbus_hash_table_remove_int): return value indicates
2920 whether the entry existed to remove
2922 * dbus/dbus-list.c: add linked list utility class,
2925 * dbus/dbus-hash.c: add TODO item about shrinking the hash bucket
2928 2002-11-23 Havoc Pennington <hp@pobox.com>
2930 * Doxyfile.in (INCLUDE_FILE_PATTERNS): expand DBUS_BEGIN_DECLS/
2931 DBUS_END_DECLS to nothing, that should fix this once and for all
2933 * Doxyfile.in (JAVADOC_AUTOBRIEF): set to YES
2935 * dbus/dbus-message.c, dbus/dbus-hash.c:
2936 add some missing @brief
2938 2002-11-23 Havoc Pennington <hp@pobox.com>
2940 * dbus/dbus-message.h: put semicolons after DEBUG_BEGIN_DECLS
2941 to avoid confusing Doxygen
2943 * dbus/dbus-hash.c: @} not }@
2945 * dbus/dbus-message.c (struct DBusMessage): split out
2948 2002-11-23 Havoc Pennington <hp@pobox.com>
2950 * configure.in: pile on more warning flags if using gcc
2952 * Doxyfile.in (EXTRACT_STATIC): set to NO, so we don't have
2953 to document static functions
2955 * configure.in: add summary to end of configure so it
2956 looks nice and attractive
2958 * dbus/dbus-hash.c: finish implementation and write unit
2961 * configure.in: add --enable-tests to enable unit tests
2963 * dbus/dbus-test.c: test program to run unit tests
2964 for all files in dbus/*, initially runs a test for
2967 * dbus/dbus-internals.h: file to hold some internal utility stuff
2969 2002-11-22 Havoc Pennington <hp@redhat.com>
2971 * dbus/dbus-hash.c: copy in Tcl hash table, not yet
2972 "ported" away from Tcl
2974 * dbus/dbus-types.h: header for types such as dbus_bool_t
2976 2002-11-22 Havoc Pennington <hp@redhat.com>
2978 * dbus/dbus.h: fixups for doc warnings
2980 * Doxyfile.in (FILE_PATTERNS): we need to scan .h to pick up
2982 (QUIET): make it quiet so we can see warnings
2984 * dbus/dbus-memory.c: teach D-BUS to allocate and free memory
2986 2002-11-22 Havoc Pennington <hp@redhat.com>
2988 * Makefile.am: include "Doxyfile" target in all-local
2990 * configure.in: generate the Doxyfile
2992 * Doxyfile.in: move Doxyfile here, so we can use
2993 configure to generate a Doxyfile with the right
2996 2002-11-22 Havoc Pennington <hp@redhat.com>
2998 * dbus/dbus-message.c: move inline docs into .c file
3000 * Doxyfile (OUTPUT_DIRECTORY): move output to doc/api
3001 so all docs are under doc/
3002 (MAN_EXTENSION): generate man pages. Use extension
3003 ".3dbus" which matches ".3qt" on my system,
3004 I guess this is OK, I don't know really.
3005 (FILE_PATTERNS): look for .c files not .h, makes sense
3008 2002-11-22 Havoc Pennington <hp@pobox.com>
3010 * Makefile.am (SUBDIRS): rename subdir "server" to "bus"
3011 because any app can be a server, and any app can be a client,
3012 the bus is a special kind of server.
3014 Thu Nov 21 23:35:31 2002 Zack Rusin <zack@kde.org>
3016 * Doxyfile : adding. Still needs Makefile rules to be generated
3017 automatically (just run "doxygen" in the toplevel dir for now to
3020 * dbus/dbus-message.h : Adding sample docs (javadoc since
3021 resembles gtk-doc a little more)
3023 * dbus/dbus.h : Adding sample docs
3025 2002-11-21 Havoc Pennington <hp@redhat.com>
3027 * dbus/Makefile.am (INCLUDES): define DBUS_COMPILATION
3028 so we can allow ourselves to include files directly,
3029 instead of having to use dbus.h
3031 * dbus/dbus.h: fill in
3033 * dbus/dbus-message.h: sketch out a sample header file.
3034 Include griping if you include it directly instead of
3037 * dbus/dbus-macros.h: new file with macros for extern "C",
3038 TRUE/FALSE, NULL, etc.
3040 * doc/file-boilerplate.c: put include guards in here
3042 2002-11-21 Havoc Pennington <hp@redhat.com>
3044 * doc/file-boilerplate.c: include both AFL and GPL boilerplate.
3046 * COPYING: include the GPL as well, and license code
3047 under both AFL and GPL.
3049 2002-11-21 Havoc Pennington <hp@redhat.com>
3051 * acconfig.h: get rid of this
3053 * autogen.sh (run_configure): add --no-configure option
3055 * configure.in: remove AC_ARG_PROGRAM to make
3056 autoconf complain less. add AC_PREREQ.
3057 add AC_DEFINE third arg.
3059 2002-11-21 Anders Carlsson <andersca@codefactory.se>
3062 Fix references so we can distcheck.
3064 2002-11-21 Havoc Pennington <hp@redhat.com>
3066 * Initial module creation