1 2003-03-17 Anders Carlsson <andersca@codefactory.se>
3 * bus/dispatch.c: (bus_dispatch):
4 Refetch the service name since it may have been reallocated
5 when dbus_message_set_sender was called.
7 * dbus/dbus-sysdeps.c: (_dbus_accept):
8 Add address and address length variables and use them to stop
9 valgrind from complaining.
11 2003-03-17 Havoc Pennington <hp@pobox.com>
13 All tests pass, no memleaks, no valgrind complaints.
15 * bus/test.c: refcount handler_slot
17 * bus/connection.c (bus_connections_new): refcount
20 * dbus/dbus-auth-script.c (_dbus_auth_script_run): delete unused
21 bytes so that auth scripts pass.
23 * bus/dispatch.c: init message_handler_slot so it gets allocated
26 * bus/dispatch.c (message_handler_slot_ref): fix memleak
28 * dbus/dbus-server-debug-pipe.c (_dbus_server_debug_pipe_new):
29 dealloc server_pipe_hash when no longer used for benefit of
32 * dbus/dbus-auth.c (process_command): memleak fix
34 * bus/dispatch.c (check_hello_message): memleak fix
36 2003-03-16 Havoc Pennington <hp@pobox.com>
38 * dbus/dbus-bus.c (ensure_bus_data): fix double-unref of the data slot
40 2003-03-17 Anders Carlsson <andersca@codefactory.se>
42 * bus/activation.c (bus_activation_activate_service): Append
43 the pending activation entry to the list of pending activations.
45 2003-03-16 Havoc Pennington <hp@pobox.com>
47 * bus/dispatch.c (bus_dispatch_test): remove double-unrefs of
50 * dbus/dbus-address.c (create_entry): fix OOM handling when
51 failing to alloc entry->method
53 2003-03-16 Havoc Pennington <hp@pobox.com>
55 * dbus/dbus-watch.c (_dbus_watch_new): handle failure to malloc
58 * dbus/dbus-server-debug-pipe.c (_dbus_transport_debug_pipe_new):
59 add some missing dbus_set_result
61 * bus/dispatch.c (bus_dispatch_add_connection): handle failure to
62 alloc the DBusMessageHandler
64 * dbus/dbus-transport.c (_dbus_transport_disconnect): don't ref
65 the transport here, since we call this from the finalizer; it
66 resulted in a double-finalize.
68 * dbus/dbus-transport.c (_dbus_transport_disconnect): fix a bug
69 where we tried to use transport->connection that was NULL,
70 happened when transport was disconnected early on due to OOM
72 * bus/*.c: adapt to handle OOM for watches/timeouts
74 * dbus/dbus-transport-unix.c: port to handle OOM during
77 * dbus/dbus-auth.c (_dbus_auth_get_unused_bytes): return a
78 reference to unused bytes instead of a copy
80 * dbus/dbus-server.c (dbus_server_handle_watch): return FALSE for
83 * dbus/dbus-connection.c (dbus_connection_handle_watch): return
86 * dbus/dbus-timeout.c (dbus_timeout_handle): return FALSE for out
89 2003-03-16 Anders Carlsson <andersca@codefactory.se>
91 * doc/dbus-specification.sgml:
92 Document reply message for ActivateService.
94 2003-03-16 Anders Carlsson <andersca@codefactory.se>
96 * bus/activation.c: (bus_pending_activation_entry_free),
97 (bus_pending_activation_free), (bus_activation_new),
98 (bus_activation_unref), (bus_activation_service_created),
99 (bus_activation_activate_service):
101 * bus/bus.c: (bus_context_new):
102 * bus/desktop-file.c: (new_section):
103 * bus/driver.c: (bus_driver_send_service_deleted),
104 (bus_driver_handle_activate_service):
105 * bus/services.c: (bus_registry_new), (bus_registry_ensure):
107 * dbus/dbus-connection.c:
108 (dbus_connection_send_with_reply_and_block):
109 * dbus/dbus-message.c: (dbus_message_append_args_valist):
110 * dbus/dbus-protocol.h:
111 Make activation work better. Now pending activations will be queued
112 and the daemon won't try to activate services that are already registered.
114 2003-03-16 Havoc Pennington <hp@pobox.com>
116 * dbus/dbus-bus.c (ensure_bus_data): handle failure to set
119 * dbus/dbus-memory.c (_dbus_initialize_malloc_debug): support
120 DBUS_MALLOC_BACKTRACES to print trace when failing an alloc
122 2003-03-16 Havoc Pennington <hp@pobox.com>
124 * dbus/dbus-string.c (_dbus_string_validate_utf8): oops, unbreak
125 this. always run the test suite before commit...
127 * bus/*: adapt to DBusConnection API changes
129 * glib/dbus-gmain.c: adapt to DBusConnection API changes,
130 requires renaming stuff to avoid dbus_connection_dispatch name
133 * dbus/dbus-transport.c (_dbus_transport_queue_messages): new
136 * dbus/dbus-message.c (_dbus_message_loader_queue_messages):
137 separate from _dbus_message_loader_return_buffer()
139 * dbus/dbus-connection.c (dbus_connection_get_n_messages): remove
140 this, because it's now always broken to use; the number of
141 messages in queue vs. the number still buffered by the message
142 loader is undefined/meaningless. Should use
143 dbus_connection_get_dispatch_state().
144 (dbus_connection_dispatch): rename from
145 dbus_connection_dispatch_message
147 2003-03-16 Havoc Pennington <hp@pobox.com>
149 * dbus/dbus-string.c (_dbus_string_validate_utf8): copy in a real
152 2003-03-16 Anders Carlsson <andersca@codefactory.se>
154 * dbus/dbus-connection.c:
155 (dbus_connection_send_with_reply_and_block):
156 Decrease connection->n_incoming when removing an entry
158 * dbus/dbus-dict.c: (dbus_dict_entry_free),
159 (dbus_dict_set_boolean_array), (dbus_dict_set_int32_array),
160 (dbus_dict_set_uint32_array), (dbus_dict_set_double_array),
161 (dbus_dict_set_byte_array), (dbus_dict_set_string_array),
162 (dbus_dict_get_boolean_array), (dbus_dict_get_double_array),
163 (dbus_dict_get_byte_array):
164 Handle NULL arrays and strings. Also add support for byte arrays.
166 * dbus/dbus-marshal.c: (_dbus_marshal_byte_array),
167 (_dbus_marshal_dict), (_dbus_demarshal_byte_array),
168 (_dbus_demarshal_int32_array), (_dbus_demarshal_uint32_array),
169 (_dbus_demarshal_double_array), (_dbus_demarshal_string_array),
170 (_dbus_demarshal_dict), (demarshal_and_validate_len),
171 (_dbus_marshal_validate_arg), (_dbus_marshal_test):
172 * dbus/dbus-marshal.h:
173 Add support for marshalling and demarshalling empty arrays and strings.
175 * dbus/dbus-message.c: (dbus_message_append_args_valist),
176 (dbus_message_append_string_array),
177 (dbus_message_iter_get_boolean),
178 (dbus_message_iter_get_boolean_array),
179 (dbus_message_iter_get_int32_array),
180 (dbus_message_iter_get_uint32_array),
181 (dbus_message_iter_get_double_array),
182 (dbus_message_iter_get_byte_array),
183 (dbus_message_iter_get_string_array), (dbus_message_iter_get_dict),
184 (check_message_handling):
185 Add support for getting empty arrays and dicts.
187 * dbus/dbus-string.c: (_dbus_string_validate_utf8):
188 Don't do any validation at all for now, that's better than just checking
191 * test/data/valid-messages/emptiness.message:
192 New test message with lots of empty arrays.
194 2003-03-16 Havoc Pennington <hp@pobox.com>
196 * dbus/dbus-connection.c
197 (_dbus_connection_queue_received_message_link): new function that
198 can't fail due to OOM
200 * dbus/dbus-message.c (_dbus_message_loader_pop_message_link):
201 new function pops a message together with a list link
204 * dbus/dbus-transport-unix.c (queue_messages): use new link-based
205 message queuing functions to avoid needing to alloc memory
207 2003-03-16 Havoc Pennington <hp@pobox.com>
209 Oops - test code was only testing failure of around 30 of the
210 mallocs in the test path, but it turns out there are 500+
211 mallocs. I believe this was due to misguided linking setup such
212 that there was one copy of dbus_malloc etc. in the daemon and one
213 in the shared lib, and only daemon mallocs were tested. In any
214 case, the test case now tests all 500+ mallocs, and doesn't pass
215 yet, though there are lots of fixes in this patch.
217 * dbus/dbus-connection.c (dbus_connection_dispatch_message): fix
218 this so that it doesn't need to allocate memory, since it
219 has no way of indicating failure due to OOM (and would be
222 * dbus/dbus-list.c (_dbus_list_pop_first_link): new function
224 * bus/Makefile.am: rearrange to create two self-contained
225 libraries, to avoid having libraries with overlapping symbols.
226 that was resulting in weirdness, e.g. I'm pretty sure there
227 were two copies of global static variables.
229 * dbus/dbus-internals.c: move the malloc debug stuff to
232 * dbus/dbus-list.c (free_link): free list mempool if it becomes
235 * dbus/dbus-memory.c (_dbus_disable_mem_pools): new function
237 * dbus/dbus-address.c (dbus_parse_address): free list nodes
240 * bus/dispatch.c (bus_dispatch_add_connection): free
241 message_handler_slot when no longer using it, so
242 memory leak checkers are happy for the test suite.
244 * dbus/dbus-server-debug-pipe.c (debug_finalize): free server name
246 * bus/bus.c (new_connection_callback): disconnect in here if
247 bus_connections_setup_connection fails.
249 * bus/connection.c (bus_connections_unref): fix to free the
251 (bus_connections_setup_connection): if this fails, don't
252 disconnect the connection, just be sure there are no side
255 * dbus/dbus-string.c (undo_alignment): unbreak this
257 * dbus/dbus-auth.c (_dbus_auth_unref): free some stuff we were
259 (_dbus_auth_new): fix the order in which we free strings
262 * bus/connection.c (bus_connection_disconnected): fix to
263 not send ServiceDeleted multiple times in case of memory
266 * dbus/dbus-bus.c (dbus_bus_get_base_service): new function to
267 get the base service name
268 (dbus_bus_register_client): don't return base service name,
269 instead store it on the DBusConnection and have an accessor
271 (dbus_bus_register_client): rename dbus_bus_register()
273 * bus/dispatch.c (check_hello_message): verify that other
274 connections on the bus also got the correct results, not
275 just the one sending hello
277 2003-03-15 Havoc Pennington <hp@pobox.com>
279 Make it pass the Hello handling test including all OOM codepaths.
280 Now to do other messages...
282 * bus/services.c (bus_service_remove_owner): fix crash when
283 removing owner from an empty list of owners
284 (bus_registry_ensure): don't leave service in the list of
285 a connection's owned services if we fail to put the service
288 * bus/connection.c (bus_connection_preallocate_oom_error): set
289 error flag on the OOM error.
291 * dbus/dbus-connection.c (_dbus_connection_new_for_transport):
292 handle _dbus_transport_set_connection failure
294 * dbus/dbus-transport-unix.c (_dbus_transport_new_for_fd): modify
295 to create watches up front and simply enable/disable them as
297 (unix_connection_set): this can now fail on OOM
299 * dbus/dbus-timeout.c, dbus/dbus-watch.c: add concept
300 of enabling/disabling a watch or timeout.
302 * bus/loop.c (bus_loop_iterate): don't touch disabled
305 * glib/dbus-gmain.c: adapt to enable/disable watches and timeouts
307 2003-03-15 Havoc Pennington <hp@pobox.com>
309 * bus/dispatch.c (bus_dispatch_test): OK, now finally actually
310 write useful test code, after all that futzing around ;-)
312 Test does not yet pass because we can't handle OOM in
313 _dbus_transport_messages_pending (basically,
314 dbus_connection_preallocate_send() does not prealloc the write
315 watch). To fix this, I think we need to add new stuff to
316 set_watch_functions, namely a SetEnabled function so we can alloc
317 the watch earlier, then enable it later.
319 * dbus/Makefile.am (libdbus_convenience_la_SOURCES): move
320 dbus-memory.c to the convenience lib
322 * bus/test.c: rename some static functions to keep them clearly
323 distinct from stuff in connection.c. Handle client disconnection.
325 2003-03-14 Havoc Pennington <hp@pobox.com>
327 * bus/dispatch.c (bus_dispatch_test): do test using debug-pipe
328 transport, tests more of the real codepath. Set up clients
329 with bus_setup_debug_client.
331 * bus/test.c (bus_setup_debug_client): function to set up debug
332 "clients" on the main loop
334 * dbus/dbus-transport.c (_dbus_transport_open): add debug-pipe
337 * dbus/dbus-server.c (dbus_server_listen): add debug-pipe
340 * dbus/dbus-server-debug.c: support a debug server based on pipes
342 * dbus/dbus-sysdeps.c (_dbus_full_duplex_pipe): new function
343 (_dbus_close): new function
345 * configure.in: check for socketpair
347 2003-03-14 Havoc Pennington <hp@redhat.com>
349 * dbus/dbus-memory.c: add a "detect buffer overwrites on free"
352 * dbus/dbus-transport-debug.c: rework this a good bit to be
353 less complicated. hopefully still works.
355 * dbus/dbus-server-debug.c (handle_new_client): remove timeout
358 * glib/dbus-gmain.c (timeout_handler): don't remove timeout
361 * dbus/dbus-message.c (dbus_message_copy): rename from
362 dbus_message_new_from_message, fix it up to copy
363 all the message fields, add test case
365 * bus/dispatch.c (bus_dispatch_test): add some more test code,
366 not quite passing yet
368 2003-03-14 Havoc Pennington <hp@pobox.com>
370 * bus/loop.c (bus_loop_iterate): add this so we can "run loop
371 until no work remains" in test code. (the large diff here
372 is just code movement, no actual changes)
374 * dbus/dbus-server-debug.c (DEFAULT_INTERVAL): change interval to
375 1, no point waiting around for test code.
376 (_dbus_server_debug_accept_transport): unref the timeout
377 after adding it (right?)
379 * dbus/dbus-transport-debug.c (DEFAULT_INTERVAL): ditto
381 2003-03-13 Havoc Pennington <hp@redhat.com>
383 * dbus/dbus-timeout.c (_dbus_timeout_list_set_functions): handle
386 * dbus/dbus-watch.c (_dbus_watch_list_set_functions): handle out
389 * dbus/dbus-connection.h: Make AddWatchFunction and
390 AddTimeoutFunction return a bool so they can fail on out-of-memory
392 * bus/bus.c (bus_context_new): set up timeout handlers
394 * bus/connection.c (bus_connections_setup_connection): set up
397 * glib/dbus-gmain.c: adapt to the fact that set_functions stuff
400 * bus/bus.c (bus_context_new): adapt to changes
402 * bus/connection.c: adapt to changes
404 * test/watch.c: adapt to DBusWatch changes
406 * bus/dispatch.c (bus_dispatch_test): started adding this but
409 2003-03-14 Anders Carlsson <andersca@codefactory.se>
411 * bus/dispatch.c (send_service_nonexistent_error): Fix typo.
413 2003-03-13 Havoc Pennington <hp@pobox.com>
415 * bus/test.c, bus/test.h, bus/Makefile.am, bus/test-main.c:
416 set up a test framework as for the library
418 2003-03-12 Havoc Pennington <hp@pobox.com>
420 Throughout: purge global variables, introduce BusActivation,
421 BusConnections, BusRegistry, etc. objects instead.
423 * bus/bus.h, bus/bus.c: introduce BusContext as a global
426 * test/Makefile.am (TEST_BINARIES): disable bus-test for now,
427 going to redo this a bit differently I think
429 2003-03-12 Havoc Pennington <hp@redhat.com>
431 Mega-patch that gets the message bus daemon initially handling
432 out-of-memory. Work still needed. Also lots of random
433 moving stuff to DBusError instead of ResultCode.
435 * dbus/dbus-list.c (_dbus_list_length_is_one): new function
437 * dbus/dbus-connection.c
438 (dbus_connection_send_with_reply_and_block): use DBusError
440 * dbus/dbus-bus.c: adapt to API changes, make it use DBusError not
443 * dbus/dbus-connection.c (dbus_connection_send): drop the result
444 code here, as the only failure possible is OOM.
446 * bus/connection.c (bus_connection_disconnect):
447 rename bus_connection_disconnected as it's a notification only
449 * bus/driver.c (bus_driver_handle_acquire_service): don't free
450 "name" on get_args failure, should be done by get_args;
451 don't disconnect client for bad args, just return an error.
452 (bus_driver_handle_service_exists): ditto
454 * bus/services.c (bus_services_list): NULL-terminate returned array
456 * bus/driver.c (bus_driver_send_service_lost)
457 (bus_driver_send_service_acquired): send messages from driver to a
458 specific client to the client's unique name, not to the broadcast
461 * dbus/dbus-message.c (decode_header_data): reject messages that
462 contain no name field
463 (_dbus_message_get_client_serial): rename to
464 dbus_message_get_serial and make public
465 (_dbus_message_set_serial): rename from set_client_serial
466 (_dbus_message_set_reply_serial): make public
467 (_dbus_message_get_reply_serial): make public
469 * bus/connection.c (bus_connection_foreach): allow stopping
470 iteration by returning FALSE from foreach function.
472 * dbus/dbus-connection.c (dbus_connection_send_preallocated)
473 (dbus_connection_free_preallocated_send)
474 (dbus_connection_preallocate_send): new API for sending a message
475 without possibility of malloc failure.
476 (dbus_connection_send_message): rename to just
477 dbus_connection_send (and same for whole function family)
479 * dbus/dbus-errors.c (dbus_error_free): make this reinit the error
481 * dbus/dbus-sysdeps.c (_dbus_exit): new function
483 * bus/activation.c: handle/return errors
485 * dbus/dbus-errors.h: add more DBUS_ERROR #define
487 * dbus/dbus-sysdeps.c (_dbus_directory_open) (_dbus_file_get_contents)
488 (_dbus_directory_get_next_file): use DBusError instead of DBusResultCode
489 (_dbus_result_from_errno): move to this file
491 2003-03-10 Anders Carlsson <andersca@codefactory.se>
493 * dbus/dbus-marshal.c:
494 (_dbus_marshal_set_string):
495 Take a length argument so we can marshal the correct string
498 (_dbus_marshal_dict), (_dbus_demarshal_dict),
499 (_dbus_marshal_get_arg_end_pos), (_dbus_marshal_validate_arg),
500 (_dbus_marshal_test):
501 * dbus/dbus-marshal.h:
502 Add support for marshalling and demarshalling dicts.
504 * dbus/dbus-message-builder.c: (_dbus_message_data_load):
505 Add support for TYPE DICT.
507 * dbus/dbus-message.c: (set_string_field):
508 Adjust header padding.
510 (dbus_message_append_args_valist), (dbus_message_append_dict),
511 (dbus_message_get_args_valist), (dbus_message_iter_get_arg_type),
512 (dbus_message_iter_get_dict), (_dbus_message_loader_return_buffer),
513 (check_message_handling), (check_have_valid_message):
514 * dbus/dbus-message.h:
515 Add functions for setting and getting dicts.
517 * dbus/dbus-protocol.h:
523 * doc/dbus-specification.sgml:
524 Add information about how dicts are marshalled.
526 * test/data/invalid-messages/dict-with-nil-value.message:
527 * test/data/invalid-messages/too-short-dict.message:
528 * test/data/valid-messages/dict-simple.message:
529 * test/data/valid-messages/dict.message:
530 Add sample messages containing dicts.
532 2003-03-08 Anders Carlsson <andersca@codefactory.se>
534 * dbus/dbus-dict.h: Add DBUS_END_DECLS.
536 2003-03-07 Anders Carlsson <andersca@codefactory.se>
539 * dbus/dbus-dict.c: (dbus_dict_entry_free), (dbus_dict_new),
540 (dbus_dict_get_keys), (insert_entry), (dbus_dict_set_boolean),
541 (dbus_dict_set_int32), (dbus_dict_set_uint32),
542 (dbus_dict_set_double), (dbus_dict_set_string),
543 (dbus_dict_set_boolean_array), (dbus_dict_set_int32_array),
544 (dbus_dict_set_uint32_array), (dbus_dict_set_double_array),
545 (dbus_dict_set_string_array), (_dbus_dict_test):
547 Fix according to comments from Havoc.
549 2003-03-06 Michael Meeks <michael@server.home>
551 * configure.in: if we don't have kde-config, disable have_qt.
553 2003-03-07 Anders Carlsson <andersca@codefactory.se>
558 * dbus/dbus-dict.c: (dbus_dict_entry_free), (dbus_dict_new),
559 (dbus_dict_ref), (dbus_dict_unref), (dbus_dict_contains),
560 (dbus_dict_remove), (dbus_dict_get_value_type),
561 (dbus_dict_get_keys), (dbus_dict_put_boolean),
562 (dbus_dict_put_int32), (dbus_dict_put_uint32),
563 (dbus_dict_put_double), (dbus_dict_put_string),
564 (dbus_dict_put_boolean_array), (dbus_dict_put_int32_array),
565 (dbus_dict_put_uint32_array), (dbus_dict_put_double_array),
566 (dbus_dict_put_string_array), (dbus_dict_get_boolean),
567 (dbus_dict_get_int32), (dbus_dict_get_uint32),
568 (dbus_dict_get_double), (dbus_dict_get_string),
569 (dbus_dict_get_boolean_array), (dbus_dict_get_int32_array),
570 (dbus_dict_get_uint32_array), (dbus_dict_get_double_array),
571 (dbus_dict_get_string_array), (_dbus_dict_test):
573 Add DBusDict implementation
575 * dbus/dbus-test.c: (dbus_internal_do_not_use_run_tests):
579 2003-03-04 Havoc Pennington <hp@pobox.com>
581 * test/data/auth/*: adapt to changes
583 * dbus/dbus-auth-script.c (_dbus_auth_script_run): add
584 USERID_BASE64 and change USERNAME_BASE64 to put in username not
587 * dbus/dbus-keyring.c (_dbus_keyring_validate_context): prevent
588 more stuff from being in a context name, to make the protocol
591 * dbus/dbus-errors.c (dbus_error_has_name): new function
592 (dbus_error_is_set): new function
594 * dbus/dbus-auth.c: replace DBUS_STUPID_TEST_MECH auth
595 with DBUS_COOKIE_SHA1, implement DBUS_COOKIE_SHA1
597 * dbus/dbus-connection.c (dbus_connection_flush): also read
598 messages during a flush operation
600 * dbus/Makefile.am: remove dbus-md5 since it isn't currently used.
602 2003-03-05 Anders Carlsson <andersca@codefactory.se>
604 * configure.in: Check for gethostbyname on Solaris.
606 * dbus/dbus-transport.c: (_dbus_transport_open):
607 Remove duplicate "tcp" entry.
609 * doc/dbus-specification.sgml:
612 2003-03-05 Anders Carlsson <andersca@codefactory.se>
614 * dbus/dbus-auth.c: (send_rejected), (process_test_subdir):
615 * dbus/dbus-keyring.c: (_dbus_keyring_new_homedir),
616 (_dbus_keyring_test):
617 * dbus/dbus-md5.c: (_dbus_md5_compute):
618 * dbus/dbus-sha.c: (_dbus_sha_compute):
621 2003-03-05 Anders Carlsson <andersca@codefactory.se>
623 * README: Add some things.
625 2003-03-04 Anders Carlsson <andersca@codefactory.se>
627 * dbus/dbus-message.c (dbus_message_append_args_valist): Add a break;
628 after case DBUS_TYPE_BOOELAN.
630 2003-03-02 Havoc Pennington <hp@pobox.com>
632 * test/break-loader.c (randomly_set_extreme_ints): add test that
633 sets really huge and small integers
635 * dbus/dbus-marshal.c (_dbus_marshal_validate_arg): add check
636 that length of boolean array fits in the string, and that
637 string has room for boolean value in single-bool case.
639 * dbus/dbus-message-builder.c (_dbus_message_data_load): add
640 optional value to "ALIGN" command which is what to fill the
643 * test/data/valid-messages/no-padding.message: add regression
644 test for the message padding problem
646 2003-03-02 Havoc Pennington <hp@pobox.com>
648 * dbus/dbus-message.c (decode_header_data): fix to always init
649 message_padding, from Benjamin Dauvergne
651 2003-03-02 Havoc Pennington <hp@pobox.com>
657 2003-03-01 Joe Shaw <joe@assbarn.com>
659 * configure.in: Check for "struct cmsgcred" and try to access its
660 members for BSD-like unices.
662 * dbus/dbus-sysdeps.c (read_credentials_byte): Fold this back into
663 _dbus_read_credentials_unix_socket().
664 (_dbus_read_credentials_unix_socket): Use recvmsg() instead of
665 read() for reading the credential byte off the unix socket. Use
666 struct cmsgcred on systems that support it.
668 2003-02-27 Alexander Larsson <alexl@redhat.com>
672 Make gthreads-2.0 dependency optional. Don't build thread test if
675 2003-02-27 Havoc Pennington <hp@pobox.com>
677 * dbus/dbus-connection.c
678 (dbus_connection_send_message_with_reply_and_block): fix doh!
679 doh! doh! bug that resulted in never removing a reply from the
680 queue, no wonder we called get_reply_serial so much ;-)
682 * dbus/dbus-message.c (struct DBusMessage): cache reply serial
683 and client serial instead of demarshaling them every time
685 2003-02-27 Havoc Pennington <hp@pobox.com>
687 * dbus/dbus-marshal.c (_dbus_demarshal_int32): rewrite to be much
688 more inlined, using dbus-string-private.h, speeds things up
691 * dbus/dbus-string.c (_dbus_string_free): apply align offset
692 when freeing the string
693 (_dbus_string_steal_data): fix for align offset
694 (undo_alignment): new function
696 2003-02-26 Havoc Pennington <hp@redhat.com>
698 All kinds of audit fixes from Owen, plus initial attempt to
699 handle unaligned memory returned from malloc.
701 * dbus/dbus-string.c (_dbus_string_init): clamp max length to
702 leave room for align_offset and nul byte
703 (fixup_alignment): function to track an align_offset and
704 ensure real->str is aligned
705 (DBUS_GENERIC_STRING_PREAMBLE): len must be less than allocated,
706 to allow a nul byte plus align offset
707 (_dbus_string_lock): fix overflow issue
708 (_dbus_string_init_const_len): add assertions on sanity of len,
709 assign allocated to be ALLOCATION_PADDING larger than len
710 (set_length): fixup the overflow handling
711 (_dbus_string_get_data_len): fix overflow in assertion
712 (open_gap): detect overflow in size of gap to be opened
713 (_dbus_string_lengthen): add overflow check
714 (_dbus_string_align_length): fix overflow with _DBUS_ALIGN_VALUE
715 (_dbus_string_append): add overflow check
716 (_dbus_string_append_unichar): overflow
717 (_dbus_string_delete): fix overflow in assertion
718 (_dbus_string_copy_len): overflow in assertion
719 (_dbus_string_replace_len): overflows in assertions
720 (_dbus_string_find): change to implement in terms of
722 (_dbus_string_find_to): assorted fixage
723 (_dbus_string_equal_c_str): assert c_str != NULL,
724 fix logic so the function works
725 (_dbus_string_ends_with_c_str): fix overflow thingy
726 (_dbus_string_base64_encode): overflow fix
727 (_dbus_string_validate_ascii): overflow
728 (_dbus_string_validate_nul): overflow
730 2003-02-26 Havoc Pennington <hp@redhat.com>
732 * dbus/dbus-marshal.c (_dbus_marshal_test): fix to work with DISABLE_ASSERTS
734 2003-02-26 Alexander Larsson <alexl@redhat.com>
737 Set DBUS_GLIB_THREADS_LIBS for apps using gthread-2.0
739 * dbus/dbus-connection.c:
740 * dbus/dbus-connection.h:
741 Fix _dbus_connection_acquire_io_path and _dbus_connection_acquire_dispatch.
742 Add dbus_connection_set_wakeup_main_function and use it when queueing
743 incoming and outgoing messages.
746 * dbus/dbus-dataslot.c:
747 Threadsafe usage of DBusDataSlotAllocator
749 * dbus/dbus-message.c: (dbus_message_get_args_iter):
752 * dbus/dbus-server-unix.c:
756 Implement the new wakeup functions for glib.
759 * glib/test-thread-client.c:
760 * glib/test-thread-server.c:
761 * glib/test-thread.h:
762 Initial cut at some thread test code. Not really done yet.
764 2003-02-26 Havoc Pennington <hp@pobox.com>
766 * dbus/dbus-connection.c
767 (dbus_connection_send_message_with_reply_and_block): fix crash
768 where we ref'd the outgoing message instead of the returned reply
770 * dbus/dbus-transport-unix.c (do_authentication): check read watch
771 at the end of this function, so if we didn't need to read for
772 authentication, we reinstall it for receiving messages
774 * dbus/dbus-message.c (dbus_message_new_reply): allow replies to
775 a NULL sender for peer-to-peer case
777 * dbus/dbus-transport-unix.c (check_read_watch): handle
778 !authenticated case correctly
780 * glib/dbus-gmain.c: add support for DBusServer
782 * dbus/dbus-server.c: add data slot support
784 * glib/dbus-gmain.c (dbus_connection_setup_with_g_main): check
785 return values and handle errors
787 * dbus/dbus-dataslot.c: factor out the data slot stuff from
790 * Doxyfile.in (INPUT): add glib subdir
792 * glib/dbus-gmain.c (dbus_connection_setup_with_g_main): rename
793 setup_with_g_main instead of hookup_with_g_main; write docs
795 2003-02-24 Anders Carlsson <andersca@codefactory.se>
797 * dbus/dbus-marshal.c: (_dbus_marshal_validate_arg):
798 * dbus/dbus-message-builder.c: (_dbus_message_data_load):
799 * dbus/dbus-message.c: (dbus_message_append_boolean),
800 (dbus_message_append_boolean_array),
801 (dbus_message_get_args_valist), (_dbus_message_test):
802 * dbus/dbus-message.h:
803 * doc/dbus-specification.sgml:
804 Various fixes as pointed out by Havoc.
806 * test/data/invalid-messages/bad-boolean-array.message:
807 * test/data/invalid-messages/bad-boolean.message:
808 Add invalid boolean value test cases.
810 2003-02-24 Anders Carlsson <andersca@codefactory.se>
812 * dbus/dbus-internals.c: (_dbus_type_to_string):
813 * dbus/dbus-marshal.c: (_dbus_marshal_get_arg_end_pos),
814 (_dbus_marshal_validate_arg):
815 * dbus/dbus-message-builder.c: (_dbus_message_data_load):
816 * dbus/dbus-message.c: (dbus_message_append_args_valist),
817 (dbus_message_append_boolean), (dbus_message_append_boolean_array),
818 (dbus_message_get_args_valist), (dbus_message_iter_get_boolean),
819 (dbus_message_iter_get_int32), (dbus_message_iter_get_uint32),
820 (dbus_message_iter_get_double),
821 (dbus_message_iter_get_boolean_array), (message_iter_test):
822 * dbus/dbus-message.h:
823 * dbus/dbus-protocol.h:
824 * doc/dbus-specification.sgml:
825 * test/data/valid-messages/lots-of-arguments.message:
826 Add support for boolean and boolean array types.
828 2003-02-23 Havoc Pennington <hp@pobox.com>
830 * dbus/dbus-keyring.c: finish most of this implementation and
833 * dbus/dbus-errors.c (dbus_set_error_const, dbus_set_error): make
834 these barf if the error isn't cleared to NULL
836 * dbus/dbus-sysdeps.c (_dbus_delete_file): set error on failure
837 (_dbus_create_directory): new function
839 * dbus/dbus-errors.c (dbus_set_error): fix warning
841 * dbus/dbus-string.c (_dbus_string_hex_encode): new function
842 (_dbus_string_hex_decode): new function
843 (test_hex_roundtrip): test code
845 * dbus/dbus-sha.c (_dbus_sha_compute): use dbus_string_hex_encode
847 * dbus/dbus-md5.c (_dbus_md5_compute): use dbus_string_hex_encode
849 * dbus/dbus-sysdeps.c (_dbus_string_save_to_file): make this use
850 the save-to-temp/rename trick to atomically write the new file
851 (_dbus_string_parse_uint): new function
853 2003-02-22 Havoc Pennington <hp@pobox.com>
855 * test/Makefile.am (dist-hook): fix dist for test/data/sha-1
857 2003-02-22 Havoc Pennington <hp@pobox.com>
859 * dbus/dbus-message.c (dbus_message_iter_get_string_array):
860 (dbus_message_iter_get_byte_array): Fix up doxygen warnings
862 * dbus/dbus-sha.c: add implementation of SHA-1 algorithm
864 * dbus/test/data/sha-1: add US government test suite for SHA-1
866 2003-02-21 Anders Carlsson <andersca@codefactory.se>
868 * dbus/dbus-marshal.c: (_dbus_demarshal_string_array):
869 Make string arrays NULL-terminated.
871 * dbus/dbus-memory.c: (dbus_free_string_array):
872 * dbus/dbus-memory.h:
873 New function for freeing NULL-terminated string arrays.
875 * dbus/dbus-message-builder.c: (append_quoted_string),
876 (_dbus_message_data_load):
877 Add support for array types.
879 * dbus/dbus-message.c: (check_message_handling):
880 Add more types as test cases.
882 * dbus/dbus-sysdeps.c: (_dbus_string_parse_int),
883 (_dbus_string_parse_double):
884 Add the start offset to the end offset.
886 * test/data/valid-messages/lots-of-arguments.message:
887 New test message with lots of arguments.
889 2003-02-21 Anders Carlsson <andersca@codefactory.se>
891 * dbus/dbus-message.c: (dbus_message_append_nil),
892 (dbus_message_append_int32), (dbus_message_append_uint32),
893 (dbus_message_append_double), (dbus_message_append_string),
894 (dbus_message_append_int32_array),
895 (dbus_message_append_uint32_array),
896 (dbus_message_append_double_array),
897 (dbus_message_append_byte_array),
898 (dbus_message_append_string_array):
899 Fix all out-of-memory handling in these functions.
901 2003-02-21 Anders Carlsson <andersca@codefactory.se>
903 * dbus/dbus-message.c: (dbus_message_append_nil):
906 2003-02-21 Anders Carlsson <andersca@codefactory.se>
908 * dbus/dbus-message.c: (dbus_message_append_args_valist),
909 (dbus_message_append_nil), (dbus_message_append_int32_array),
910 (dbus_message_append_uint32_array),
911 (dbus_message_append_double_array),
912 (dbus_message_append_byte_array),
913 (dbus_message_append_string_array), (dbus_message_get_args_valist),
914 (dbus_message_iter_get_int32_array),
915 (dbus_message_iter_get_uint32_array),
916 (dbus_message_iter_get_double_array),
917 (dbus_message_iter_get_byte_array),
918 (dbus_message_iter_get_string_array):
920 * dbus/dbus-message.h:
921 Add functions for appending and getting arrays.
923 2003-02-21 Anders Carlsson <andersca@codefactory.se>
925 * dbus/dbus-mempool.c (_dbus_mem_pool_new): Make the
926 element size at least 8 bytes, fixes mempool tests on
929 2003-02-20 Alexander Larsson <alexl@redhat.com>
931 * dbus/dbus-transport-unix.c (unix_do_iteration):
932 Unlock the connection mutex during a blocking select call.
933 Add todo about how we need a way to wake up the select.
935 * dbus/dbus-connection-internal.h:
936 * dbus/dbus-connection.c:
937 Add _dbus_connection_lock and _dbus_connection_unlock.
939 2003-02-19 Havoc Pennington <hp@pobox.com>
941 * Doxyfile.in (PREDEFINED): put DOXYGEN_SHOULD_SKIP_THIS in
942 Doxyfile.in, not Doxyfile
944 * dbus/dbus-keyring.c: do some hacking on this
946 * dbus/dbus-sysdeps.c (_dbus_delete_file): new
948 * dbus/dbus-errors.c (dbus_set_error_const): do not call
950 (dbus_set_error): remove dbus_error_init, check for message ==
951 NULL *before* we sprintf into it, and add @todo about including
952 system headers in this file
954 * dbus/dbus-sysdeps.c (_dbus_create_file_exclusively): new
956 * dbus/dbus-errors.h (DBUS_ERROR_FAILED): add
958 * dbus/dbus-sysdeps.c (get_user_info): break this function out to
959 get various bits of user information based on either username
961 (_dbus_homedir_from_username): new function
963 2003-02-19 Anders Carlsson <andersca@codefactory.se>
966 Add check for nonposix getpwnam_r
968 * dbus/dbus-mempool.c: (_dbus_mem_pool_new):
969 Align the pool element size to a sizeof (void *) boundary.
971 * dbus/dbus-sysdeps.c: (_dbus_setenv), (_dbus_connect_unix_socket),
972 (_dbus_listen_unix_socket), (_dbus_credentials_from_username):
973 General Solaris fixes.
975 * test/data/valid-messages/simplest-manual.message:
976 Explicitly state that we want little-endian packing.
978 2003-02-19 Mikael Hallendal <micke@codefactory.se>
980 * dbus/dbus-server.c (dbus_server_listen): Support tcp: addresses.
982 * dbus/dbus-transport-unix.c (_dbus_transport_new_for_tcp_socket):
983 Added to create a transport connecting using a tcp/ip socket.
985 * dbus/dbus-sysdeps.c (_dbus_connect_tcp_socket): Added to connect
986 to a tcp socket at given host and port.
987 (_dbus_listen_tcp_socket): added to listen on tcp socket for given
990 * dbus/dbus-server.c (dbus_server_listen): Support tcp: addresses.
992 * dbus/dbus-server-unix.c (_dbus_server_new_for_tcp_socket):
993 Added to create a server listening on a TCP/IP socket.
995 2003-02-19 Havoc Pennington <hp@pobox.com>
997 Throughout: mop up all the Doxygen warnings and undocumented
1000 * dbus/dbus-sysdeps.c (do_exec): do not use execvp, we don't want
1001 to search any paths.
1003 * dbus/dbus-threads.c: move global mutex initializers to
1004 dbus-internals.h, multiple prototypes was confusing doxygen
1005 besides being kind of ugly
1007 * Doxyfile (PREDEFINED): have Doxygen define
1008 DOXYGEN_SHOULD_SKIP_THIS so we can exclude things from
1009 docs with #ifndef DOXYGEN_SHOULD_SKIP_THIS
1010 (do not abuse the feature! it's for stuff like the autogenerated
1011 macros in dbus-md5.c, not just for things you don't feel like
1014 2003-02-18 Havoc Pennington <hp@pobox.com>
1016 * dbus/dbus-string.c (_dbus_string_zero): new function
1018 * dbus/dbus-md5.c: include MD5 implementation by L. Peter Deutsch,
1019 wrap it in some dbus-friendly API
1021 * dbus/dbus-types.h: add 16-bit types
1023 2003-02-18 Joe Shaw <joe@assbarn.com>
1025 * dbus/dbus-auth.c (handle_server_data_stupid_test_mech): Just get
1026 credentials from our currently running process.
1027 (get_word): Fix a buglet where we were copying the entire length
1028 instead of relative to our position.
1030 * dbus/dbus-hash.c (_dbus_hash_test): Don't try to allocate the
1031 keys on the stack... it's 640k of data.
1033 * dbus/dbus-sysdeps.c (_dbus_read_credentials_unix_socket): Always
1034 read the credentials byte off the socket, even if we don't have
1036 (_dbus_poll): Implement poll() using select() for systems which
1039 * glib/test-dbus-glib.c (main): Print out an error if no
1040 parameters are given.
1042 * test/data/auth/fallback.auth-script: Added. Tests that a client
1043 can fallback to a secondary auth mechanism if the first fails.
1045 2003-02-18 Havoc Pennington <hp@pobox.com>
1049 2003-02-17 Havoc Pennington <hp@pobox.com>
1051 * doc/dbus-specification.sgml: lots of cosmetic
1052 cleanups/rearrangement, add assorted FIXME, change DBUS_ADDRESS
1053 env variable to DBUS_BUS_ADDRESS, s/client/application/,
1054 s/server/bus/ (except in authentication section). Add a section
1055 "Message Bus Message Routing"
1057 2003-02-17 Anders Carlsson <andersca@codefactory.se.>
1063 2003-02-17 Anders Carlsson <andersca@codefactory.se>
1065 * doc/dbus-specification.sgml:
1066 Specification updates.
1068 2003-02-17 Anders Carlsson <andersca@codefactory.se>
1070 * bus/activation.c: (bus_activation_init), (child_setup),
1071 (bus_activation_activate_service):
1073 * bus/main.c: (main):
1074 Set DBUS_ADDRESS environment variable.
1076 * dbus/dbus-errors.c: (dbus_set_error):
1077 Don't use va_copy since that's a C99 feature.
1079 * dbus/dbus-sysdeps.c: (_dbus_setenv), (do_exec),
1080 (_dbus_spawn_async):
1081 * dbus/dbus-sysdeps.h:
1082 Add child_setup_func to _dbus_spawn_async.
1084 * doc/dbus-specification.sgml:
1085 Update specification.
1087 * test/spawn-test.c: (setup_func), (main):
1090 2003-02-17 Alexander Larsson <alexl@redhat.com>
1092 * dbus/dbus-connection.c (_dbus_connection_handler_destroyed_locked):
1095 2003-02-17 Anders Carlsson <andersca@codefactory.se>
1099 * doc/dbus-test-plan.sgml:
1100 Add test plan document.
1105 2003-02-17 Anders Carlsson <andersca@codefactory.se>
1107 * dbus/dbus-message.c: (decode_header_data),
1108 (_dbus_message_loader_return_buffer):
1109 Set the header padding amount when loading a message.
1111 2003-02-16 Anders Carlsson <andersca@codefactory.se>
1113 * bus/dispatch.c: (send_one_message):
1114 Only send broadcast messages to registered connections.
1116 * dbus/dbus-message.c: (dbus_message_name_is):
1117 * dbus/dbus-message.h:
1118 New convenience function.
1120 * dbus/dbus-transport-debug.c: (do_reading):
1121 Only dispatch one message per run.
1124 * test/bus-test.c: (new_connection_callback), (die),
1125 (test_hello_client1_handler), (test_hello_client2_handler),
1126 (test_hello_replies), (main):
1128 * test/bus-test-loop.[ch]:
1131 2003-02-16 Havoc Pennington <hp@pobox.com>
1133 * dbus/dbus-connection.c (dbus_connection_dispatch_message): fix
1134 backward conditional
1136 2003-02-16 Alexander Larsson <alexl@redhat.com>
1138 * dbus/dbus-connection.c:
1139 Implement sent_message_with_reply. (with_reply_and block is still
1141 Made dispatch_message not lose message if OOM.
1143 * dbus/dbus-errors.h:
1144 Add NoReply error (for reply timeouts).
1146 2003-02-16 Alexander Larsson <alexl@redhat.com>
1148 * dbus/dbus-hash.c (_dbus_hash_table_unref):
1149 Actually free keys and values when destroying hashtable.
1151 2003-02-16 Anders Carlsson <andersca@codefactory.se>
1153 * dbus/dbus-auth.c: (client_try_next_mechanism):
1156 * dbus/dbus-threads.c: (dbus_condvar_wait_timeout):
1157 Return TRUE if there's no thread implementation around.
1159 * glib/dbus-gmain.c: (free_source),
1160 (dbus_connection_hookup_with_g_main):
1161 Make sure to remove the GSource when the connection is finalized.
1163 2003-02-16 Anders Carlsson <andersca@codefactory.se>
1165 * bus/dispatch.c: (bus_dispatch_message_handler):
1166 * dbus/dbus-errors.h:
1167 Return an error if someone tries to send a message to a service
1170 2003-02-16 Anders Carlsson <andersca@codefactory.se>
1172 * bus/activation.c: (load_directory), (bus_activation_init),
1173 (bus_activation_activate_service):
1176 (bus_driver_handle_activate_service), (bus_driver_handle_message):
1177 More work on the activation handling.
1179 * dbus/dbus-errors.h:
1180 Add some error messages
1182 * dbus/dbus-message.c: (dbus_message_new_error_reply):
1183 * dbus/dbus-message.h:
1184 New function that creates an error message.
1186 * dbus/dbus-protocol.h:
1187 Add ACTIVATE_SERVER message.
1189 * dbus/dbus-server-unix.c: (unix_handle_watch),
1190 (_dbus_server_new_for_domain_socket):
1191 Call _dbus_fd_set_close_on_exec.
1193 * dbus/dbus-sysdeps.c: (make_pipe), (do_exec),
1194 (_dbus_spawn_async), (_dbus_disable_sigpipe),
1195 (_dbus_fd_set_close_on_exec):
1196 * dbus/dbus-sysdeps.h:
1197 Add _dbus_fd_set_close_on exec function. Also add function that checks
1198 that all open fds are set to close-on-exec and warns otherwise.
1200 * dbus/dbus-transport-unix.c:
1201 (_dbus_transport_new_for_domain_socket):
1202 Call _dbus_fd_set_close_on_exec.
1204 2003-02-16 Havoc Pennington <hp@pobox.com>
1206 * dbus/dbus-connection.c (dbus_connection_set_change_sigpipe):
1207 allow people to avoid setting SIGPIPE to SIG_IGN
1208 (_dbus_connection_new_for_transport): disable SIGPIPE unless
1209 we've been asked not to
1211 2003-02-15 Anders Carlsson <andersca@codefactory.se>
1213 * dbus/dbus-list.c: (_dbus_list_append_link),
1214 (_dbus_list_prepend_link):
1215 * dbus/dbus-memory.c: (dbus_malloc), (dbus_malloc0),
1219 2003-02-15 Anders Carlsson <andersca@codefactory.se>
1222 * bus/activation.c: (bus_activation_entry_free),
1223 (add_desktop_file_entry), (load_directory), (bus_activation_init):
1225 * bus/main.c: (main):
1226 Add simple activation support, doesn't work yet though.
1228 2003-02-15 Zack Rusin <zack@kde.org>
1230 * qt/dbus-qthread.cpp: small casting fix
1232 2003-02-15 Anders Carlsson <andersca@codefactory.se>
1234 * dbus/dbus-errors.c: (dbus_set_error):
1235 * dbus/dbus-errors.h:
1236 Add a few errors and make dbus_set_error void.
1238 * dbus/dbus-sysdeps.c:
1239 (_dbus_errno_to_string), (close_and_invalidate), (make_pipe),
1240 (write_err_and_exit), (read_ints), (do_exec), (_dbus_spawn_async):
1241 * dbus/dbus-sysdeps.h:
1242 Add _dbus_spawn_async.
1244 * test/spawn-test.c: (main):
1245 Test for _dbus_spawn_async.
1247 2003-02-15 Anders Carlsson <andersca@codefactory.se>
1249 * dbus/dbus-internals.h:
1250 Fix build without tests.
1252 * dbus/dbus-list.c: (alloc_link):
1253 Fix a segfault when a malloc fails.
1255 * dbus/dbus-memory.c: (initialize_malloc_debug), (dbus_malloc),
1256 (dbus_malloc0), (dbus_realloc):
1257 Add support for malloc debugging.
1259 2003-02-15 Alexander Larsson <alexl@redhat.com>
1261 * dbus/dbus-threads.c:
1262 * dbus/dbus-threads.h:
1263 Add condvars. Remove static mutext from API.
1264 Implement static mutexes by initializing them from threads_init.
1266 * glib/dbus-gthread.c:
1267 * qt/dbus-qthread.cpp:
1268 Update with the thread api changes.
1273 Turn StaticMutex into normal mutex + init function.
1274 Export new functions _dbus_list_alloc_link, _dbus_list_free_link,
1275 _dbus_list_append_link, _dbus_list_prepend_link
1278 * dbus/dbus-sysdeps.c:
1279 * dbus/dbus-sysdeps.h:
1280 New type dbus_atomic_t, and new functions _dbus_atomic_inc,
1281 _dbus_atomic_dec. Only slow fallback implementation at the moment.
1283 * dbus/dbus-protocol.h:
1284 Add DBUS_MESSAGE_LOCAL_DISCONNECT define
1286 * dbus/dbus-message.c:
1287 Make ref/unref atomic.
1290 * dbus/dbus-connection-internal.h:
1291 * dbus/dbus-connection.c:
1292 * dbus/dbus-connection.h:
1294 Change _peek to _borrow,_return & _steal_borrowed.
1295 Change disconnect callback to event.
1296 Make dbus_connection_dispatch_messages reentrant.
1298 * dbus/dbus-transport.c:
1299 Don't ref the connection on calls to the transport
1302 * dbus/dbus-message-handler.c:
1305 * glib/dbus-gmain.c:
1306 Don't use peek_message anymore
1309 * test/debug-thread.c:
1310 * test/debug-thread.h:
1311 Simple thread implementation that asserts() on deadlocks in
1312 single-threaded code.
1315 (main) Call debug_threads_init.
1318 Use disconnect message instead of disconnect callback.
1322 Don't call dbus_connection_set_disconnect_function. Instead export
1323 bus_connection_disconnect.
1326 Call bus_connection_disconnect when we get a disconnected message.
1328 2003-02-15 Havoc Pennington <hp@pobox.com>
1330 * dbus/dbus-message.c (dbus_message_new): fool around with the
1333 2003-02-14 Havoc Pennington <hp@pobox.com>
1335 * dbus/dbus-mempool.c: fail if the debug functions so indicate
1337 * dbus/dbus-memory.c: fail if the debug functions indicate we
1340 * dbus/dbus-internals.c (_dbus_set_fail_alloc_counter)
1341 (_dbus_decrement_fail_alloc_counter): debug functions to
1342 simulate memory allocation failures
1344 2003-02-14 Havoc Pennington <hp@pobox.com>
1346 * dbus/dbus-errors.h (struct DBusError): add a word of padding
1349 2003-02-13 Anders Carlsson <andersca@codefactory.se>
1351 * bus/driver.c: (bus_driver_handle_hello):
1353 * bus/services.c: (bus_service_lookup):
1354 Reorder message sending so we get a more sane order.
1356 * test/bus-test.c: (message_handler):
1359 2003-02-13 Anders Carlsson <andersca@codefactory.se>
1361 * bus/driver.c: (bus_driver_send_service_deleted),
1362 (bus_driver_send_service_created), (bus_driver_send_service_lost),
1363 (bus_driver_send_service_acquired), (bus_driver_handle_hello),
1364 (bus_driver_send_welcome_message),
1365 (bus_driver_handle_list_services),
1366 (bus_driver_handle_acquire_service),
1367 (bus_driver_handle_service_exists):
1368 * dbus/dbus-bus.c: (dbus_bus_register_client),
1369 (dbus_bus_acquire_service), (dbus_bus_service_exists):
1370 * dbus/dbus-errors.c: (dbus_result_to_string):
1371 * dbus/dbus-errors.h:
1372 * dbus/dbus-message.c: (dbus_message_append_args),
1373 (dbus_message_append_args_valist), (dbus_message_get_args),
1374 (dbus_message_get_args_valist), (dbus_message_get_args_iter),
1375 (dbus_message_iter_get_arg_type), (dbus_message_iter_get_string),
1376 (dbus_message_iter_get_byte_array),
1377 (dbus_message_iter_get_string_array), (message_iter_test),
1378 (check_message_handling), (_dbus_message_test):
1379 * dbus/dbus-message.h:
1380 * test/bus-test.c: (main):
1381 Change fields to arguments in messages, so that they won't be
1382 confused with header fields.
1384 * glib/test-dbus-glib.c: (main):
1385 Remove append_fields from hello message.
1387 2003-02-13 Anders Carlsson <andersca@codefactory.se>
1389 * dbus/dbus-errors.c:
1390 * dbus/dbus-message.c:
1391 * dbus/dbus-string.c:
1392 Documentation fixes.
1394 2003-02-13 Anders Carlsson <andersca@codefactory.se>
1396 * glib/dbus-gmain.c: (timeout_handler), (add_timeout),
1398 Implement support for timeouts in dbus-glib.
1400 2003-02-13 Anders Carlsson <andersca@codefactory.se>
1402 * dbus/dbus-message-builder.c: (_dbus_message_data_load):
1403 * dbus/dbus-message.c: (process_test_subdir):
1404 * test/break-loader.c: (find_breaks_based_on):
1405 Plug some memory leaks.
1407 2003-02-13 Richard Hult <rhult@codefactory.se>
1409 * bus/main.c: Fix build.
1411 * dbus/dbus-errors.h:
1412 * dbus/dbus-errors.c: Fix copyright for Anders.
1414 2003-02-13 Anders Carlsson <andersca@codefactory.se>
1419 * bus/connection.c: (bus_connection_foreach):
1422 * bus/desktop-file.c: (grow_lines_in_section), (grow_sections),
1423 (unescape_string), (new_section), (parse_section_start),
1424 (parse_key_value), (report_error), (bus_desktop_file_load),
1425 (bus_desktop_file_get_string):
1426 * bus/desktop-file.h:
1427 Use DBusError for error reporting.
1429 * bus/dispatch.c: (send_one_message),
1430 (bus_dispatch_message_handler):
1431 * bus/driver.c: (bus_driver_send_service_deleted),
1432 (bus_driver_send_service_created), (bus_driver_send_service_lost),
1433 (bus_driver_send_service_acquired), (bus_driver_handle_hello),
1434 (bus_driver_send_welcome_message),
1435 (bus_driver_handle_list_services),
1436 (bus_driver_handle_acquire_service),
1437 (bus_driver_handle_service_exists):
1438 * bus/loop.c: (bus_loop_run):
1440 Use BUS_HANDLE_OOM instead of _DBUS_HANDLE_OOM.
1442 * bus/utils.c: (bus_wait_for_memory):
1444 New files with general utility functions.
1446 * dbus/dbus-internals.h:
1447 Remove _DBUS_HANDLE_OOM.
1449 2003-02-13 Anders Carlsson <andersca@codefactory.se>
1451 * dbus/dbus-errors.c: (dbus_result_to_string), (dbus_error_init),
1452 (dbus_error_free), (dbus_set_error_const), (dbus_set_error):
1453 * dbus/dbus-errors.h:
1454 Add DBusError structure.
1456 2003-02-13 Anders Carlsson <andersca@codefactory.se>
1458 * test/data/valid-messages/standard-acquire-service.message:
1459 * test/data/valid-messages/standard-hello.message:
1460 * test/data/valid-messages/standard-list-services.message:
1461 * test/data/valid-messages/standard-service-exists.message:
1462 Add some standard messages.
1464 2003-02-13 Anders Carlsson <andersca@codefactory.se>
1466 * bus/driver.c: (bus_driver_send_welcome_message),
1467 (bus_driver_handle_list_services),
1468 (bus_driver_handle_acquire_service),
1469 (bus_driver_handle_service_exists), (bus_driver_handle_message):
1470 Update for API changes in libdbus.
1472 * dbus/dbus-message.c: (dbus_message_new_reply):
1473 * dbus/dbus-message.h:
1474 Remove the name argument. The spec states that replies shouldn't
1477 2003-02-13 Anders Carlsson <andersca@codefactory.se>
1479 * bus/desktop-file.c: (parse_section_start), (parse_key_value),
1480 (report_error), (bus_desktop_file_load), (lookup_section),
1481 (lookup_line), (bus_desktop_file_get_raw),
1482 (bus_desktop_file_get_string):
1483 * bus/desktop-file.h:
1484 Some fixes, and new functions for getting a key value from a section.
1486 2003-02-13 Havoc Pennington <hp@pobox.com>
1488 * test/data/auth/fail-after-n-attempts.auth-script: new test
1490 * dbus/dbus-auth.c (send_rejected): shutdown_mech() when we
1493 2003-02-13 Havoc Pennington <hp@pobox.com>
1495 * dbus/dbus-auth.c (handle_server_data_external_mech): args to
1496 dbus_credentials_match were backward
1498 * dbus/dbus-auth-script.c (_dbus_auth_script_run): support
1499 NO_CREDENTIALS and ROOT_CREDENTIALS
1501 * dbus/dbus-auth.c (_dbus_auth_do_work): move get_state() routine
1502 into here. Never process more commands after we've reached an
1503 end state; store further data as unused bytes.
1505 * test/data/auth/*: add more auth tests
1507 * dbus/dbus-auth-script.c (_dbus_auth_script_run): support EXPECT
1508 command to match exact string and EXPECT_UNUSED to match unused
1511 * test/Makefile.am (dist-hook): fix to dist all the test stuff
1513 2003-02-12 Havoc Pennington <hp@pobox.com>
1515 * dbus/dbus-string.c (_dbus_string_pop_line): fix to also strip
1516 \r off of popped lines
1518 * dbus/dbus-auth.c (_dbus_auth_test): write code to run auth
1521 * dbus/dbus-auth-script.c (_dbus_auth_script_run): when doing a
1524 2003-02-12 Havoc Pennington <hp@pobox.com>
1526 * dbus/Makefile.am: remove break-loader from the build, since it
1529 * configure.in: add --enable-gcov to turn on coverage profiling
1530 flags and disable optimization
1532 2003-02-10 Havoc Pennington <hp@pobox.com>
1534 * dbus/dbus-auth-script.c, dbus/dbus-auth-script.h: sync
1535 initial cut at test framework for DBusAuth from laptop.
1536 Doesn't quite work yet but it compiles and I need to get
1537 it off the 266mhz laptop. ;-)
1539 * dbus/dbus-server-debug.c (_dbus_server_debug_accept_transport):
1540 fix a memleak in error case
1542 2003-02-12 Anders Carlsson <andersca@codefactory.se>
1545 * bus/desktop-file.c:
1546 * bus/desktop-file.h:
1547 Add a desktop file parser.
1549 2003-02-11 Zack Rusin <zack@kde.org>
1551 * qt/message.[h|cpp]: sample implementation
1552 of the KDE wrapper for DBusMessage
1554 2003-02-09 Zack Rusin <zack@kde.org>
1556 * test/bus-test.c: make_it_compile
1557 * doc/dbus-specification.sgml: minimal semantic fix
1559 2003-02-06 Anders Carlsson <andersca@codefactory.se>
1565 2003-02-06 Anders Carlsson <andersca@codefactory.se>
1568 * dbus/dbus-break-loader.c:
1570 * test/break-loader.c:
1571 Move dbus-break-loader to test/ and rename it to break-loader.
1573 2003-02-02 Havoc Pennington <hp@pobox.com>
1575 * dbus/dbus-keyring.c, dbus/dbus-keyring.h: template files
1576 for code to manage cookies in your home directory
1578 * dbus/dbus-sysdeps.c (_dbus_generate_random_bytes): new function
1580 * dbus/dbus-auth.c (get_state): impose a maximum number of tries
1581 to authenticate, then disconnect the client.
1583 2003-02-03 Alexander Larsson <alexl@redhat.com>
1585 * dbus/dbus-message.c (dbus_message_append_fields):
1588 2003-02-02 Anders Carlsson <andersca@codefactory.se>
1590 * doc/dbus-specification.sgml:
1591 Update address format section.
1593 2003-02-02 Anders Carlsson <andersca@codefactory.se>
1596 * test/bus-test.c: (get_time), (add_timeout), (remove_timeout),
1597 (message_handler), (new_connection_callback), (loop_quit),
1601 2003-02-02 Anders Carlsson <andersca@codefactory.se>
1603 * bus/driver.c: (bus_driver_handle_service_exists):
1604 Simplify the code a bit.
1606 * dbus/dbus-bus.c: (dbus_bus_service_exists):
1609 2003-02-02 Anders Carlsson <andersca@codefactory.se>
1612 Add libdbus-daemon.la and link to it.
1614 2003-02-01 James Willcox <jwillcox@gnome.org>
1616 * bus/driver.c: (bus_driver_handle_own_service):
1617 Actually include the service reply code in the message.
1619 2003-02-02 Anders Carlsson <andersca@codefactory.se>
1621 * bus/driver.c: (bus_driver_handle_service_exists):
1622 Don't unref the incoming message.
1624 2003-02-02 Anders Carlsson <andersca@codefactory.se>
1626 * dbus/dbus.h: Add dbus-address.h and dbus-bus.h
1628 2003-02-02 Anders Carlsson <andersca@codefactory.se>
1630 * dbus/dbus-server.c: (dbus_server_listen):
1631 * dbus/dbus-transport.c: (_dbus_transport_open):
1632 ifdef out the calls to the debug transport and server.
1634 2003-02-02 Alexander Larsson <alexl@redhat.com>
1636 * dbus/dbus-watch.c (dbus_watch_get_flags):
1637 Add note in the docs that ERROR or HANGUP won't be returned
1638 and are assumed always on.
1640 * glib/dbus-gmain.c (add_watch):
1641 Always add IO_ERR | IO_HUP
1643 * dbus/dbus-message.h:
1644 Add semicolon after dbus_message_iter_get_string_array().
1645 Makes qt code build again
1647 2003-02-01 Anders Carlsson <andersca@codefactory.se>
1649 * bus/driver.c: (create_unique_client_name),
1650 (bus_driver_handle_hello):
1651 Don't take a name, just use a numeric id to identify
1655 * dbus/dbus-bus.c: (dbus_bus_register_client),
1656 (dbus_bus_acquire_service), (dbus_bus_service_exists):
1658 Add new convenience functions for communicating with the bus.
1660 * dbus/dbus-message.h:
1662 * dbus/dbus-protocol.h:
1665 2003-02-01 Alexander Larsson <alexl@redhat.com>
1667 * dbus/dbus-message.c (dbus_message_append_fields):
1668 Add some more doc comments.
1670 2003-02-01 Havoc Pennington <hp@pobox.com>
1672 * dbus/dbus-break-loader.c (randomly_modify_length): change
1673 a 4-byte value in the message as if it were a length
1675 * dbus/dbus-sysdeps.c (_dbus_string_save_to_file): don't set
1676 execute bit on saved files
1678 2003-02-01 Havoc Pennington <hp@pobox.com>
1680 * dbus/dbus-break-loader.c (main): new program to find messages
1681 that break the loader.
1683 * dbus/dbus-sysdeps.c (_dbus_string_append_uint): new function
1684 * dbus/dbus-sysdeps.c (_dbus_string_save_to_file): new function
1686 * dbus/dbus-string.c (_dbus_string_set_byte): new
1688 2003-01-31 Havoc Pennington <hp@pobox.com>
1690 * dbus/dbus-message.c: refactor the test code to be more general,
1691 in preparation for writing a "randomly permute test cases to
1692 try to break the loader" program.
1694 2003-01-31 Havoc Pennington <hp@pobox.com>
1696 * doc/dbus-specification.sgml: work on the specification
1698 * dbus/dbus-message.c (_dbus_message_loader_return_buffer): check
1699 the protocol version of the message.
1701 * dbus/dbus-protocol.h: drop special _REPLY names, the spec
1702 no longer specifies that.
1703 (DBUS_SERVICE_REPLY_SERVICE_EXISTS): fix flags (1/2/4/8 not
1706 * dbus/dbus-marshal.c (_dbus_marshal_get_arg_end_pos): add missing
1707 "break" for DBUS_TYPE_NIL, remove @todo
1709 2003-01-31 Havoc Pennington <hp@pobox.com>
1711 * dbus/dbus-message.c (dbus_message_set_is_error_reply): rename
1712 just set_is_error/get_is_error as this is a commonly-used
1713 function, and write docs.
1715 2003-01-31 Anders Carlsson <andersca@codefactory.se>
1717 * dbus/dbus-address.c: (dbus_address_entry_free):
1718 Free key and value lists.
1720 * dbus/dbus-internals.c: (_dbus_type_to_string):
1721 Add the types we didn't have.
1723 * dbus/dbus-marshal.c: (_dbus_marshal_get_arg_end_pos),
1724 (_dbus_marshal_validate_arg):
1727 * dbus/dbus-message.c: (dbus_message_set_sender):
1728 Remove todo about being able to set sender to NULL.
1730 (dbus_message_set_is_error_reply),
1731 (dbus_message_get_is_error_reply):
1732 * dbus/dbus-message.h:
1735 * dbus/dbus-protocol.h:
1736 Add error reply flag.
1738 * test/data/valid-messages/opposite-endian.message:
1739 Add NIL type to test.
1741 2003-01-31 Havoc Pennington <hp@pobox.com>
1743 * doc/dbus-specification.sgml: fully specify the header. Add
1744 flags and major protocol version, and change header/body len to
1747 * dbus/dbus-message-builder.c (append_saved_length): append length
1750 * dbus/dbus-message.c (dbus_message_create_header): change header
1751 length and body length to unsigned. Add the new fields from the
1753 (_dbus_message_loader_return_buffer): unsigned header/body len
1755 2003-01-30 Havoc Pennington <hp@pobox.com>
1757 * dbus/dbus-auth.c: rework to use only REJECTED, no
1760 * doc/dbus-sasl-profile.txt: drop MECHANISMS and just
1761 use REJECTED, suggested by Mark McLoughlin
1763 2003-01-30 Havoc Pennington <hp@pobox.com>
1765 * dbus/dbus-server.c (dbus_server_listen): @todo about how we need
1766 a better way to report errors here. e.g. "unix address lacks
1767 path" or something. also "no such file" when the path doesn't
1770 * dbus/dbus-address.c (dbus_address_entries_free): add @todo about
1772 (dbus_parse_address): add @todo about documenting address format,
1773 and allowing , and ; to be escaped
1775 2003-01-30 Anders Carlsson <andersca@codefactory.se>
1778 Add dbus-address.[ch]
1780 * dbus/dbus-address.c: (dbus_address_entry_free),
1781 (dbus_address_entries_free), (create_entry),
1782 (dbus_address_entry_get_method), (dbus_address_entry_get_value),
1783 (dbus_parse_address), (_dbus_address_test):
1784 * dbus/dbus-address.h:
1785 New files for dealing with address parsing.
1787 * dbus/dbus-connection.c:
1788 Document timeout functions.
1790 * dbus/dbus-message.c:
1791 Document dbus_message_new_from_message.
1793 * dbus/dbus-server-debug.c:
1796 * dbus/dbus-server.c: (dbus_server_listen):
1797 Parse address and use correct server implementation.
1799 * dbus/dbus-string.c: (_dbus_string_find_to), (_dbus_string_test):
1800 * dbus/dbus-string.h:
1801 New function with test.
1803 * dbus/dbus-test.c: (dbus_internal_symbol_do_not_use_run_tests):
1807 * dbus/dbus-transport-debug.c:
1810 * dbus/dbus-transport.c: (_dbus_transport_open):
1811 Parse address and use correct transport implementation.
1813 2003-01-30 Havoc Pennington <hp@pobox.com>
1815 * dbus/dbus-message.c: use message->byte_order instead of
1816 DBUS_COMPILER_BYTE_ORDER throughout.
1817 (dbus_message_create_header): pad header to align the
1818 start of the body of the message to 8-byte boundary
1820 * dbus/dbus-marshal.h: make all the demarshalers take const
1821 DBusString arguments.
1823 * dbus/dbus-message.c (_dbus_message_loader_return_buffer):
1824 validate message args here, so we don't have to do slow validation
1825 later, and so we catch bad messages as they are incoming. Also add
1826 better checks on header_len and body_len. Also fill in
1829 * dbus/dbus-string.c (_dbus_string_validate_utf8): new (not
1830 implemented properly)
1831 (_dbus_string_validate_nul): new function to check all-nul
1833 * dbus/dbus-marshal.c (_dbus_marshal_get_field_end_pos): rename
1834 get_arg_end_pos and remove all validation
1835 (_dbus_marshal_validate_arg): actually do validation here.
1837 2003-01-29 Havoc Pennington <hp@pobox.com>
1839 * dbus/dbus-message.c (check_message_handling): fix assertion
1840 failure on set_client_serial
1842 2003-01-28 Havoc Pennington <hp@pobox.com>
1844 * dbus/dbus-server-debug.c: Add doc section comments
1846 * dbus/dbus-transport-debug.c: add doc section comments
1848 2003-01-28 Havoc Pennington <hp@redhat.com>
1850 * dbus/dbus-string.c (_dbus_string_base64_decode): append bytes in
1851 the reverse order from how I had it
1852 (_dbus_string_base64_encode): reverse encoding order. I was
1853 basically byteswapping everything during encoding.
1855 2003-01-28 Anders Carlsson <andersca@codefactory.se>
1857 * dbus/dbus-connection-internal.h:
1858 * dbus/dbus-connection.c: (_dbus_connection_add_timeout),
1859 (_dbus_connection_remove_timeout):
1860 Add functions for adding and removing timeouts.
1862 * dbus/dbus-message.c: (dbus_message_new_from_message):
1863 Add new function that takes a message and creates an exact
1864 copy of it, but with the refcount set to 1.
1865 (check_message_handling):
1868 * dbus/dbus-server-protected.h:
1869 * dbus/dbus-server.c: (_dbus_server_init_base),
1870 (_dbus_server_finalize_base), (_dbus_server_add_timeout),
1871 (dbus_server_set_timeout_functions):
1872 (_dbus_server_remove_timeout):
1873 New functions so that a server can add and remove timeouts.
1875 (dbus_server_listen):
1876 Add commented out call to dbus_server_debug_new.
1878 * dbus/dbus-timeout.c: (_dbus_timeout_new):
1879 Actually set the handler, doh.
1881 * dbus/dbus-transport.c: (_dbus_transport_open):
1882 Add commented out call to dbus_transport_debug_client_new.
1885 Add dbus-transport-debug.[ch] and dbus-server-debug.[ch]
1887 2003-01-28 Havoc Pennington <hp@pobox.com>
1889 * dbus/dbus-message.c (check_message_handling): function to check
1890 on the loaded message, iterates over it etc.
1892 2003-01-28 Havoc Pennington <hp@pobox.com>
1894 * test/Makefile.am (dist-hook): fix make distdir
1896 * dbus/Makefile.am (TESTS_ENVIRONMENT): fix make check
1898 2003-01-27 Havoc Pennington <hp@pobox.com>
1900 * dbus/dbus-mempool.c (time_for_size): replace printf with
1903 * dbus/dbus-message-builder.c (_dbus_message_data_load): allow
1904 empty lines; fix the SAVE_LENGTH stuff to be
1905 START_LENGTH/END_LENGTH so it actually works; couple other
1908 * test/Makefile.am (dist-hook): add dist-hook for .message files
1910 * dbus/dbus-string.c (DBUS_STRING_COPY_PREAMBLE): source of a copy
1911 can be constant or locked.
1912 (_dbus_string_free): allow freeing a const string as
1915 * dbus/dbus-sysdeps.c (_dbus_concat_dir_and_file): utility
1917 * dbus/dbus-test-main.c (main): take an argument which is the
1918 directory containing test data
1920 * dbus/dbus-message.c (_dbus_message_test): pass a test_data_dir
1921 argument to this and load all the messages in test/data/
1922 checking that they can be loaded or not loaded as appropriate.
1924 2003-01-27 Anders Carlsson <andersca@codefactory.se>
1926 * bus/dispatch.c: (bus_dispatch_message_handler):
1927 Dispatch messages sent to services.
1929 * bus/driver.c: (bus_driver_send_service_deleted),
1930 (bus_driver_send_service_created), (bus_driver_send_service_lost),
1931 (bus_driver_send_service_acquired):
1932 Add helper functions for sending service related messages.
1934 (bus_driver_send_welcome_message):
1935 Send HELLO_REPLY instead of WELCOME.
1937 (bus_driver_handle_list_services):
1938 Send LIST_SERVICES_REPLY instead of SERVICES.
1940 (bus_driver_handle_own_service),
1941 (bus_driver_handle_service_exists):
1942 New message handlers.
1944 (bus_driver_handle_message):
1945 Invoke new message handlers.
1947 (bus_driver_remove_connection):
1948 Don't remove any services here since that's done automatically
1949 by bus_service_remove_owner now.
1952 New function signatures.
1954 * bus/services.c: (bus_service_add_owner):
1955 Send ServiceAcquired message if we're the only primary owner.
1957 (bus_service_remove_owner):
1958 Send ServiceAcquired/ServiceLost messages.
1960 (bus_service_set_prohibit_replacement),
1961 (bus_service_get_prohibit_replacement):
1962 Functions for setting prohibit replacement.
1964 (bus_service_has_owner):
1965 New function that checks if a connection is in the owner queue of
1969 Add new function signatures.
1971 * dbus/dbus-list.c: (_dbus_list_test):
1972 Add tests for _dbus_list_remove_last and traversing the list backwards.
1975 Fix a typo in _dbus_list_get_prev_link, if we're at the first element we can't
1976 go any further, so return NULL then.
1978 * dbus/dbus-protocol.h:
1979 Add new messages, service flags and service replies.
1981 2003-01-26 Havoc Pennington <hp@pobox.com>
1983 * dbus/dbus-message-builder.c: implement, completely untested.
1985 * test/data/*: add data to be used in testing.
1986 ".message" files are our simple loadable text format.
1987 ".message-raw" will be binary dumps of messages.
1989 * dbus/dbus-string.c (_dbus_string_starts_with_c_str): new
1991 2003-01-26 Havoc Pennington <hp@pobox.com>
1993 * dbus/dbus-sysdeps.c (_dbus_file_get_contents): new function
1995 * dbus/dbus-errors.c (dbus_result_to_string): add
1998 * dbus/dbus-message-builder.c: new file, will contain code to load
1999 up messages from files. Not implemented yet.
2001 2003-01-26 Havoc Pennington <hp@pobox.com>
2003 * dbus/dbus-message.c (dbus_message_set_sender): support deleting
2004 the sender by setting to NULL
2006 2003-01-26 Havoc Pennington <hp@pobox.com>
2008 The unit tests pass, but otherwise untested. If it breaks, the
2009 tests should have been better. ;-)
2011 * bus/driver.c (bus_driver_handle_hello): return if we disconnect
2014 * dbus/dbus-message.c: redo everything so we maintain
2015 message->header as the only copy of the various fields.
2016 This avoids the possibility of out-of-memory in some cases,
2017 for example dbus_message_lock() can't run out of memory anymore,
2018 and avoids extra copying. Figured I may as well go ahead and do
2019 this since it was busted for dbus_message_lock to not return
2020 failure on OOM, and dbus_message_write_header was totally
2021 unchecked for OOM. Also fixed some random other bugs.
2023 * dbus/dbus-marshal.c (_dbus_marshal_get_field_end_pos): verify
2024 that strings are nul-terminated. Also, end_pos can be equal
2025 to string length just not greater than, I think.
2026 (_dbus_marshal_set_int32): new function
2027 (_dbus_marshal_set_uint32): new function
2028 (_dbus_marshal_set_string): new function
2030 * dbus/dbus-connection.c (_dbus_connection_new_for_transport): fix
2031 a warning, init timeout_list to NULL
2032 (dbus_connection_send_message): don't use uninitialized variable
2035 * dbus/dbus-string.c (_dbus_string_replace_len): new function
2037 2003-01-26 Anders Carlsson <andersca@codefactory.se>
2039 * bus/driver.c: (bus_driver_handle_hello),
2040 (bus_driver_send_welcome_message):
2043 2003-01-26 Anders Carlsson <andersca@codefactory.se>
2045 * dbus/dbus-auth.c: (process_auth), (_dbus_auth_unref):
2046 * dbus/dbus-connection.c: (_dbus_connection_new_for_transport),
2047 (dbus_connection_unref):
2048 * dbus/dbus-marshal.c: (_dbus_marshal_test):
2049 * dbus/dbus-message.c: (dbus_message_unref),
2052 (dbus_message_get_fields):
2053 Remove debugging printout.
2055 (_dbus_message_loader_return_buffer):
2056 Don't store the header string.
2058 (_dbus_message_test):
2061 2003-01-26 Richard Hult <rhult@codefactory.se>
2063 * glib/dbus-gmain.c (dbus_connection_dispatch): Traverse a copy of
2064 the file descriptor list, since it can change under us.
2066 2003-01-25 Anders Carlsson <andersca@codefactory.se>
2068 * glib/dbus-gmain.c: (dbus_connection_prepare),
2069 (dbus_connection_check), (dbus_connection_dispatch), (add_watch),
2070 (remove_watch), (dbus_connection_hookup_with_g_main):
2071 Rewrite the glib handling to use its own GSource instead of a
2072 GIOChannel so we can catch messages put in the queue while waiting
2075 2003-01-25 Anders Carlsson <andersca@codefactory.se>
2078 * bus/connection.c: (connection_disconnect_handler),
2079 (connection_watch_callback), (bus_connection_setup):
2080 * bus/dispatch.c: (send_one_message),
2081 (bus_dispatch_broadcast_message), (bus_dispatch_message_handler),
2082 (bus_dispatch_add_connection), (bus_dispatch_remove_connection):
2084 * bus/driver.c: (bus_driver_send_service_deleted),
2085 (bus_driver_send_service_created), (bus_driver_handle_hello),
2086 (bus_driver_send_welcome_message),
2087 (bus_driver_handle_list_services), (bus_driver_remove_connection),
2088 (bus_driver_handle_message):
2090 Refactor code, put the message dispatching in its own file. Use
2091 _DBUS_HANDLE_OOM. Also send ServiceDeleted messages when a client
2094 2003-01-25 Anders Carlsson <andersca@codefactory.se>
2096 * dbus/dbus-internals.h:
2097 Add _DBUS_HANDLE_OOM macro, it doesn't do anything currently.
2099 * dbus/dbus-message.c: (dbus_message_get_sender):
2100 * dbus/dbus-message.h:
2101 Implement dbus_message_get_sender.
2103 * dbus/dbus-protocol.h:
2104 Add message and service defines.
2106 2003-01-25 Anders Carlsson <andersca@codefactory.se>
2108 * dbus/dbus-connection.c: (dbus_connection_send_message):
2109 * dbus/dbus-message-internal.h:
2110 * dbus/dbus-message.c: (_dbus_message_get_client_serial),
2111 (dbus_message_write_header):
2112 Remove _dbus_messag_unlock and don't set the client serial on a
2113 message if one already exists.
2115 2003-01-24 Havoc Pennington <hp@pobox.com>
2117 * dbus/dbus-list.c (alloc_link): put a thread lock on the global
2120 * bus/driver.c (bus_driver_handle_list_services): fix a leak
2123 2003-01-25 Anders Carlsson <andersca@codefactory.se>
2125 * dbus/dbus-list.c: (alloc_link), (free_link):
2126 Use a memory pool for the links.
2128 2003-01-25 Anders Carlsson <andersca@codefactory.se>
2130 * bus/connection.c: (bus_connection_foreach):
2132 Add new bus_connection_foreach function.
2134 * bus/driver.c: (send_one_message), (bus_driver_broadcast_message):
2135 Add function that broadcasts a message to all clients.
2137 (bus_driver_send_service_created), (bus_driver_handle_hello),
2138 (bus_driver_send_welcome_message),
2139 (bus_driver_handle_list_services), (bus_driver_message_handler):
2140 Implement functions that take care of listing services, and notifying
2141 clients when new services are created.
2143 * bus/services.c: (bus_services_list):
2145 Add new function that returns an array of strings with the currently
2146 registered services.
2149 * glib/dbus-gmain.c:
2150 Update copyright year.
2152 2003-01-25 Anders Carlsson <andersca@codefactory.se>
2154 * dbus/dbus-connection.c: (dbus_connection_send_message):
2155 Unlock the message in case it was sent earlier.
2157 (dbus_connection_send_message_with_reply_and_block):
2158 Remove the reply message from the list.
2160 * dbus/dbus-marshal.c: (_dbus_demarshal_string_array):
2161 Set array_len and new_pos correctly.
2163 (_dbus_marshal_test):
2164 Remove debug output.
2166 * dbus/dbus-message-internal.h:
2167 * dbus/dbus-message.c: (_dbus_message_get_reply_serial):
2168 New function that returns the reply serial.
2170 (_dbus_message_unlock):
2171 New function that unlocks a message and resets its header.
2173 (dbus_message_append_string_array),
2174 (dbus_message_get_fields_valist),
2175 (dbus_message_iter_get_field_type),
2176 (dbus_message_iter_get_string_array),
2177 (dbus_message_get_fields),
2178 (dbus_message_append_fields_valist):
2179 Handle string arrays.
2181 (dbus_message_set_sender):
2182 Make this function public since the bus daemon needs it.
2184 (decode_header_data):
2185 Set the reply serial to -1 initially.
2187 * dbus/dbus-message.h:
2188 Add dbus_message_set_sender.
2190 2003-01-24 Havoc Pennington <hp@pobox.com>
2192 * doc/dbus-specification.sgml: add some stuff
2194 2003-01-22 Havoc Pennington <hp@pobox.com>
2196 * doc/dbus-specification.sgml: Start to document the protocol.
2198 2003-01-22 Havoc Pennington <hp@pobox.com>
2200 * dbus/dbus-connection.c
2201 (dbus_connection_send_message_with_reply_and_block): add some @todo
2203 * bus/driver.c (bus_driver_add_connection): add a FIXME about memleak
2205 2003-01-21 Havoc Pennington <hp@pobox.com>
2207 (patch untested because can't compile)
2209 * bus/driver.c (create_unique_client_name): make this function
2210 never recycle client names. Also, caller should initialize
2213 * dbus/dbus-sysdeps.c (_dbus_get_current_time): new function
2215 2003-01-21 Anders Carlsson <andersca@codefactory.se>
2217 * dbus/dbus-marshal.c: (_dbus_marshal_double),
2218 (_dbus_marshal_int32), (_dbus_marshal_uint32),
2219 (_dbus_marshal_int32_array), (_dbus_marshal_uint32_array),
2220 (_dbus_marshal_double_array), (_dbus_marshal_string_array),
2221 (_dbus_demarshal_int32_array), (_dbus_demarshal_uint32_array),
2222 (_dbus_demarshal_double_array), (_dbus_demarshal_string_array),
2223 (_dbus_marshal_get_field_end_pos), (_dbus_marshal_test):
2224 * dbus/dbus-marshal.h:
2225 * dbus/dbus-protocol.h:
2226 Add support for marshalling and demarshalling integer, double
2229 2003-01-21 Anders Carlsson <andersca@codefactory.se>
2234 * bus/connection.c: (connection_disconnect_handler):
2235 Remove the connection from the bus driver's list.
2237 (connection_watch_callback): Dispatch messages.
2239 (free_connection_data): Free connection name.
2241 (bus_connection_setup): Add connection to the bus driver's list.
2242 (bus_connection_remove_owned_service):
2243 (bus_connection_set_name), (bus_connection_get_name):
2244 Add functions for setting and getting the connection's name.
2247 Add function headers.
2249 * bus/driver.c: (create_unique_client_name),
2250 (bus_driver_handle_hello_message),
2251 (bus_driver_send_welcome_message), (bus_driver_message_handler),
2252 (bus_driver_add_connection), (bus_driver_remove_connection):
2255 * bus/services.c: (bus_service_free):
2257 New file that handles communication and registreation with the bus
2260 2003-01-21 Anders Carlsson <andersca@codefactory.se>
2262 * dbus/dbus-connection.c: (dbus_connection_send_message):
2263 Add a new client_serial parameter.
2265 (dbus_connection_send_message_with_reply):
2266 Remove a @todo since we've implemented the blocking function.
2268 (dbus_connection_send_message_with_reply_and_block):
2269 New function that sends a message and waits for a reply and
2270 then returns the reply.
2272 * dbus/dbus-connection.h:
2275 * dbus/dbus-errors.c: (dbus_result_to_string):
2276 * dbus/dbus-errors.h:
2277 Add new DBUS_RESULT.
2279 * dbus/dbus-message-internal.h:
2280 * dbus/dbus-message.c: (_dbus_message_get_reply_serial),
2281 (_dbus_message_set_sender), (dbus_message_write_header),
2282 (dbus_message_new_reply), (decode_header_data),
2283 (_dbus_message_loader_return_buffer), (_dbus_message_test):
2284 * dbus/dbus-message.h:
2285 Add new functions that set the reply serial and sender.
2286 Also marshal and demarshal them correctly and add test.
2288 * dbus/dbus-protocol.h:
2289 Add new DBUS_MESSAGE_TYPE_SENDER.
2292 * glib/dbus-gmain.c: (watch_callback), (free_callback_data),
2293 (add_watch), (remove_watch), (add_timeout), (remove_timeout),
2294 (dbus_connection_hookup_with_g_main):
2295 * glib/test-dbus-glib.c: (main):
2296 Rewrite to use GIOChannel and remove the GSource crack.
2298 * test/echo-client.c: (main):
2299 * test/watch.c: (check_messages):
2300 Update for changed APIs
2302 2003-01-19 Anders Carlsson <andersca@codefactory.se>
2304 * dbus/Makefile.am: Add dbus-timeout.[cħ]
2306 * dbus/dbus-connection.c: (_dbus_connection_new_for_transport):
2307 Create a DBusTimeoutList.
2308 (dbus_connection_set_timeout_functions): Add new function to
2309 set timeout callbacks
2311 * dbus/dbus-connection.h: Add public DBusTimeout API.
2313 * dbus/dbus-message.c: (dbus_message_get_service):
2314 * dbus/dbus-message.h: New function.
2316 * dbus/dbus-server.c: Fix small doc typo.
2318 * dbus/dbus-timeout.[ch]: New files for mainloop timeouts.
2320 2003-01-19 Anders Carlsson <andersca@codefactory.se>
2322 * dbus/dbus-string.c (_dbus_string_move_len): Don't delete all
2323 of the string, just as long as specified.
2325 2003-01-19 Havoc Pennington <hp@pobox.com>
2327 * dbus/dbus-connection.c (dbus_connection_get_is_authenticated):
2330 * dbus/dbus-server.c (dbus_server_set_max_connections)
2331 (dbus_server_get_max_connections, dbus_server_get_n_connections):
2332 keep track of current number of connections, and add API for
2333 setting a max (but haven't implemented enforcing the max yet)
2335 2003-01-18 Havoc Pennington <hp@pobox.com>
2337 * dbus/dbus-transport-unix.c (unix_do_iteration): only do the
2338 reading/writing if read_watch != NULL or write_watch != NULL.
2340 * dbus/dbus-message.c (_dbus_message_loader_return_buffer): fix
2341 the message loader code to actually load message->header and
2342 message->body into the newly-created message.
2344 * dbus/dbus-transport-unix.c (check_write_watch): fix a mem leak
2347 * dbus/dbus-connection.c (dbus_connection_set_max_message_size)
2348 (dbus_connection_get_max_message_size)
2349 (dbus_connection_set_max_live_messages_size)
2350 (dbus_connection_get_max_live_messages_size): implement some
2351 resource limitation functions
2353 * dbus/dbus-resources.c: new file implementing some of the
2354 resource limits stuff
2356 * dbus/dbus-message.c (dbus_message_iter_get_byte_array): add
2357 missing docs, add @todo to handle OOM etc.
2359 * dbus/dbus-marshal.c (_dbus_demarshal_byte_array): add missing
2362 2003-01-18 Havoc Pennington <hp@pobox.com>
2364 * dbus/dbus-connection.c (dbus_connection_unref): disconnect the
2365 connection if it hasn't been already.
2367 * dbus/dbus-connection.h: kill off the idea of an ErrorFunction,
2368 replace with DisconnectFunction.
2370 2003-01-18 Havoc Pennington <hp@pobox.com>
2372 Building --disable-verbose-mode --disable-asserts --disable-tests
2373 cuts the library from 112K to 45K or so
2375 * configure.in: check for varargs macro support,
2376 add --enable-verbose-mode, --enable-asserts.
2378 * dbus/dbus-internals.h (_dbus_assert): support
2380 (_dbus_verbose): support DBUS_ENABLE_VERBOSE_MODE
2382 2003-01-18 Havoc Pennington <hp@pobox.com>
2384 * dbus/dbus-test.c: include config.h so that tests actually run
2386 * dbus/dbus-string.c: add assertions that stuff is 8-byte aligned,
2387 so the failure mode when that assumption fails will be plenty
2390 2003-01-18 Havoc Pennington <hp@pobox.com>
2392 * configure.in: default --enable-tests to $USE_MAINTAINER_MODE
2394 * dbus/Makefile.am: fix it up so dubs-test-main.c is included in
2397 * test/Makefile.am: don't use special variable "TESTS" for echo-*
2398 since we don't want to use those in make check
2400 2003-01-15 Havoc Pennington <hp@redhat.com>
2406 2003-01-15 Havoc Pennington <hp@redhat.com>
2408 * test/Makefile.am: fix so that test source code ends up in the
2409 distribution on make distcheck
2411 2003-01-15 Havoc Pennington <hp@redhat.com>
2417 2003-01-15 Havoc Pennington <hp@redhat.com>
2419 * dbus/dbus-test.c (dbus_internal_symbol_do_not_use_run_tests):
2420 fix build when --disable-tests
2422 * Makefile.am (EXTRA_DIST): put HACKING in here
2424 * HACKING: document procedure for making a tarball release.
2426 2003-01-14 Anders Carlsson <andersca@codefactory.se>
2428 * bus/connection.c: (connection_error_handler),
2429 (bus_connection_setup):
2430 * bus/main.c: (main):
2431 Make sure that the DBusConnectionData struct is NULLed
2432 out to prevent a segfault.
2434 * dbus/dbus-errors.c: (dbus_result_to_string):
2435 * dbus/dbus-errors.h:
2436 * dbus/dbus-message.c: (dbus_message_get_fields),
2437 (dbus_message_get_fields_valist), (_dbus_message_test):
2438 * dbus/dbus-message.h:
2439 Make dbus_message_get_fields return a result code so we can
2440 track invalid fields as well as oom.
2442 2003-01-11 Havoc Pennington <hp@pobox.com>
2444 * configure.in: change --enable-test/--enable-ansi action-if-given
2445 to enable_foo=$enableval instead of enable_foo=yes
2447 2003-01-08 Havoc Pennington <hp@pobox.com>
2449 * dbus/dbus-string.c (_dbus_string_align_length): new function
2451 * dbus/dbus-test-main.c: move main() for test app here
2453 (dbus_internal_symbol_do_not_use_run_tests): we have to export a
2454 symbol to run tests, because dbus-test isn't in the main
2457 Code review nitpicks.
2459 * dbus/dbus-message.c (dbus_message_write_header): add newlines
2460 for people with narrow emacs ;-). Assert client_serial was filled
2461 in. Assert message->name != NULL.
2462 (dbus_message_append_fields): have "first_field_type" arg separate
2463 from va list, needed for C++ binding that also uses varargs IIRC
2464 and helps with type safety
2465 (dbus_message_new): add @todo about using DBusString to store
2466 service/name internally
2467 (dbus_message_new): don't leak ->service and ->name on OOM later
2469 (dbus_message_unref): free the service name
2470 (dbus_message_get_fields): same change to varargs
2471 i.e. first_field_type
2472 (_dbus_message_loader_return_buffer): assert that the message data
2473 is aligned (if not it's a bug in our code). Put in verbose griping
2474 about why we set corrupted = TRUE.
2475 (decode_header_data): add FIXME that char* is evil. Was going to
2476 add FIXME about evil locale-specific string.h strncmp, but just
2477 switched to wacky string-as-uint32 optimization. Move check for
2478 "no room for field name" above get_const_data_len() to avoid
2479 assertion failure in get_const_data_len if we have trailing 2
2480 bytes or the like. Check for service and name fields being
2481 provided twice. Don't leak service/name on error. Require field
2482 names to be aligned to 4 bytes.
2484 * dbus/dbus-marshal.c: move byte swap stuff to header
2485 (_dbus_pack_int32): uscore-prefix
2486 (_dbus_unpack_int32): uscore-prefix
2487 (_dbus_unpack_uint32): export
2488 (_dbus_demarshal_string): add @todo complaining about use of
2490 (_dbus_marshal_get_field_end_pos): add @todo about bad error
2491 handling allowing corrupt data to go unchecked
2493 2003-01-08 Havoc Pennington <hp@redhat.com>
2495 * dbus/dbus-transport-unix.c (unix_do_iteration): add read/write
2496 to the select() as needed for authentication. (should be using
2497 _dbus_poll() not select, but for another day)
2499 * dbus/dbus.h: include dbus/dbus-protocol.h
2501 2003-01-08 Anders Carlsson <andersca@codefactory.se>
2503 * dbus/Makefile.am (dbusinclude_HEADERS): Install
2506 2003-01-08 Anders Carlsson <andersca@codefactory.se>
2508 * dbus/dbus-internals.c: (_dbus_type_to_string):
2509 New function that returns a string describing a type.
2511 * dbus/dbus-marshal.c: (_dbus_demarshal_byte_array):
2512 * dbus/dbus-marshal.h:
2513 * dbus/dbus-message.c: (dbus_message_get_fields_valist),
2514 (dbus_message_iter_get_field_type), (dbus_message_iter_get_double),
2515 (dbus_message_iter_get_byte_array):
2516 * dbus/dbus-message.h:
2517 Add new convenience functions for appending and getting message fields.
2518 Also add demarshalling routines for byte arrays.
2520 2003-01-07 Anders Carlsson <andersca@codefactory.se>
2522 * dbus/dbus-connection-internal.h:
2523 * dbus/dbus-connection.c: (_dbus_connection_new_for_transport),
2524 (_dbus_connection_get_next_client_serial),
2525 (dbus_connection_send_message):
2526 * dbus/dbus-internals.h:
2527 * dbus/dbus-marshal.c: (unpack_uint32), (dbus_unpack_int32),
2528 (dbus_pack_int32), (_dbus_marshal_double), (_dbus_marshal_int32),
2529 (_dbus_marshal_uint32), (_dbus_demarshal_double),
2530 (_dbus_demarshal_int32), (_dbus_demarshal_uint32),
2531 (_dbus_demarshal_string), (_dbus_marshal_get_field_end_pos),
2532 (_dbus_verbose_bytes), (_dbus_marshal_test):
2533 * dbus/dbus-marshal.h:
2534 * dbus/dbus-message-internal.h:
2535 * dbus/dbus-message.c: (_dbus_message_set_client_serial),
2536 (dbus_message_write_header), (_dbus_message_lock),
2537 (dbus_message_new), (dbus_message_ref), (dbus_message_unref),
2538 (dbus_message_get_name), (dbus_message_append_int32),
2539 (dbus_message_append_uint32), (dbus_message_append_double),
2540 (dbus_message_append_string), (dbus_message_append_byte_array),
2541 (dbus_message_get_fields_iter), (dbus_message_iter_ref),
2542 (dbus_message_iter_unref), (dbus_message_iter_has_next),
2543 (dbus_message_iter_next), (dbus_message_iter_get_field_type),
2544 (dbus_message_iter_get_string), (dbus_message_iter_get_int32),
2545 (dbus_message_iter_get_uint32), (dbus_message_iter_get_double),
2546 (decode_header_data), (_dbus_message_loader_return_buffer),
2547 (message_iter_test), (_dbus_message_test):
2548 * dbus/dbus-message.h:
2549 * dbus/dbus-protocol.h:
2550 * dbus/dbus-test.c: (main):
2552 * glib/test-dbus-glib.c: (message_handler), (main):
2553 * test/echo-client.c: (main):
2554 * test/watch.c: (check_messages):
2555 Make messages sendable and receivable for real.
2557 2003-01-07 Anders Carlsson <andersca@codefactory.se>
2559 * dbus/dbus-marshal.c: (_dbus_marshal_double),
2560 (_dbus_marshal_string), (_dbus_marshal_byte_array):
2561 * dbus/dbus-message.c: (dbus_message_append_int32),
2562 (dbus_message_append_uint32), (dbus_message_append_double),
2563 (dbus_message_append_string), (dbus_message_append_byte_array):
2564 Handle OOM restoration.
2566 2003-01-07 Anders Carlsson <andersca@codefactory.se>
2568 * dbus/dbus-marshal.c: (_dbus_marshal_string),
2569 (_dbus_demarshal_string), (_dbus_marshal_test):
2570 * dbus/dbus-marshal.h:
2571 * dbus/dbus-message.c: (dbus_message_get_name),
2572 Document these functions.
2574 (dbus_message_append_int32), (dbus_message_append_uint32),
2575 (dbus_message_append_double), (dbus_message_append_string),
2576 (dbus_message_append_byte_array):
2577 * dbus/dbus-message.h:
2578 Add functions for adding message fields of different types.
2580 * dbus/dbus-protocol.h:
2581 Add the different types.
2583 2003-01-05 Havoc Pennington <hp@pobox.com>
2585 * bus/connection.c: implement routines for handling connections,
2586 first thing is keeping a list of owned services on each connection
2587 and setting up watches etc.
2589 * bus/services.c: implement a mapping from service names to lists
2592 * dbus/dbus-hash.c: add DBUS_HASH_POINTER
2594 * dbus/dbus-threads.c (dbus_static_mutex_lock): add functions
2595 to use static mutexes for global data
2597 * dbus/dbus-connection.c (dbus_connection_set_data): add new
2598 collection of functions to set/get application-specific data
2599 on the DBusConnection.
2601 2003-01-04 Havoc Pennington <hp@pobox.com>
2603 * dbus/dbus-sysdeps.c (_dbus_sleep_milliseconds): new function
2604 (_dbus_poll): new function
2606 * dbus/dbus-internals.h (_DBUS_STRUCT_OFFSET): new macro
2609 * bus/loop.c: initial code for the daemon main loop
2611 2003-01-04 Havoc Pennington <hp@pobox.com>
2613 * test/watch.c (error_handler): make it safe if the error handler
2614 is called multiple times (if we s/error handler/disconnect
2615 handler/ we should just guarantee it's called only once)
2617 * dbus/dbus-transport.c (_dbus_transport_disconnect): call the
2618 error handler on disconnect (it's quite possible we should
2619 just change the error handler to a "disconnect handler," I'm
2620 not sure we have any other meaningful errors)
2622 * configure.in: check for getpwnam_r
2624 * dbus/dbus-transport.c, dbus/dbus-transport-unix.c,
2625 dbus/dbus-auth.c: add credentials support, add EXTERNAL auth
2626 mechanism as in SASL spec, using socket credentials
2628 * dbus/dbus-sysdeps.c (_dbus_read_credentials_unix_socket): new function
2629 (_dbus_send_credentials_unix_socket): new function
2631 * dbus/dbus-sysdeps.c (_dbus_accept_unix_socket): rename just
2633 (_dbus_write): only check errno if <0 returned
2634 (_dbus_write_two): ditto
2636 2003-01-02 Anders Carlsson <andersca@codefactory.se>
2638 * dbus/dbus-marshal.c: (_dbus_marshal_utf8_string),
2639 (_dbus_marshal_byte_array), (_dbus_demarshal_utf8_string),
2640 (_dbus_marshal_test):
2641 * dbus/dbus-marshal.h:
2642 Add _dbus_marshal_byte_array and rename _dbus_marshal_string
2643 to _dbus_marshal_utf8_string. Also fix some tests.
2645 2002-12-28 Harri Porten <porten@kde.org>
2647 * configure.in: added check for C++ compiler and a very cheesy
2648 check for the Qt integration
2650 * Makefile.am (SUBDIRS): compile qt subdir if support is enabled
2652 * qt/Makefile.am: added
2654 * qt/.cvsignore: added
2656 * qt/dbus-qthread.cc, qt/dbus-qthread.cpp: renamed former to
2657 latter, added #ifdef QT_THREAD_SUPPORT guard.
2659 * dbus/Makefile.am: added missing headers for make dist
2661 2002-12-28 Kristian Rietveld <kris@gtk.org>
2663 * dbus/Makefile.am: fixup export-symbols-regex.
2665 2002-12-27 Anders Carlsson <andersca@codefactory.se>
2667 * acinclude.m4: Add this file and put the
2668 PKG_CHECK_MODULE macro in it.
2670 2002-12-27 Anders Carlsson <andersca@codefactory.se>
2672 * dbus/dbus-marshal.c: (_dbus_marshal_string),
2673 (_dbus_demarshal_double), (_dbus_demarshal_int32),
2674 (_dbus_demarshal_uint32), (_dbus_demarshal_string),
2675 (_dbus_marshal_test):
2676 Make the demarshalling routines align the pos argument.
2677 Add string marshalling tests and fix the obvious bugs
2680 2002-12-26 Havoc Pennington <hp@pobox.com>
2682 * dbus/dbus-auth.c: fixes fixes fixes
2684 * dbus/dbus-transport-unix.c: wire up support for
2685 encoding/decoding data on the wire
2687 * dbus/dbus-auth.c (_dbus_auth_encode_data)
2688 (_dbus_auth_decode_data): append to target string
2689 instead of nuking it.
2691 2002-12-26 Havoc Pennington <hp@pobox.com>
2693 * dbus/dbus-marshal.h (DBUS_COMPILER_BYTE_ORDER): #ifdef
2694 WORDS_BIGENDIAN then compiler byte order is DBUS_BIG_ENDIAN,
2697 * dbus/dbus-marshal.c: Add macros to do int swapping in-place and
2698 avoid swap_bytes() overhead (ignoring possible assembly stuff for
2699 now). Main point is because I wanted unpack_uint32 to implement
2701 (_dbus_verbose_bytes): new function
2703 * dbus/dbus-string.c (_dbus_string_validate_ascii): new function
2705 * dbus/dbus-message.c (_dbus_message_loader_get_is_corrupted): add
2706 mechanism to handle a corrupt message stream
2707 (_dbus_message_loader_new): fix preallocation to only prealloc,
2710 * dbus/dbus-string.c (_dbus_string_skip_blank): fix this function
2711 (_dbus_string_test): enhance tests for copy/move and fix the
2714 * dbus/dbus-transport-unix.c: Hold references in more places to
2715 avoid reentrancy problems
2717 * dbus/dbus-transport.c: ditto
2719 * dbus/dbus-connection.c (dbus_connection_dispatch_message): don't
2720 leak reference count in no-message case
2722 * test/watch.c (do_mainloop): handle adding/removing watches
2723 during iteration over the watches. Also, ref the connection/server
2724 stored on a watch, so we don't try to mangle a destroyed one.
2726 * dbus/dbus-transport-unix.c (do_authentication): perform
2729 * dbus/dbus-auth.c (get_state): add a state
2730 AUTHENTICATED_WITH_UNUSED_BYTES and return it if required
2731 (_dbus_auth_get_unused_bytes): append the unused bytes
2732 to the passed in string, rather than prepend
2734 * dbus/dbus-transport.c (_dbus_transport_init_base): create
2735 the auth conversation DBusAuth
2737 * dbus/dbus-transport-unix.c (_dbus_transport_new_for_fd)
2738 (_dbus_transport_new_for_domain_socket): when creating a
2739 transport, pass in whether it's a client-side or server-side
2740 transport so we know which DBusAuth to create
2742 2002-12-03 Havoc Pennington <hp@pobox.com>
2744 * dbus/dbus-transport-unix.c (unix_finalize): finalize base
2745 _after_ finalizing the derived members
2746 (unix_connection_set): unref watch if we fail to add it
2748 * dbus/dbus-connection.c (dbus_connection_unref): delete the
2749 transport first, so that the connection owned by the
2750 transport will be valid as the transport finalizes.
2752 * dbus/dbus-transport-unix.c (unix_finalize): free the write_watch
2753 if necessary, and remove watches from the connection.
2755 * dbus/dbus-watch.c (_dbus_watch_list_free): improve a comment
2757 2002-12-26 Anders Carlsson <andersca@codefactory.se>
2759 * dbus/dbus-marshal.c: (_dbus_marshal_string),
2760 (_dbus_demarshal_double), (_dbus_demarshal_int32),
2761 (_dbus_demarshal_uint32), (_dbus_demarshal_string),
2762 (_dbus_marshal_test):
2763 * dbus/dbus-marshal.h:
2764 Add string marshal functions and have the demarshal functions
2765 return the new position.
2767 2002-12-25 Havoc Pennington <hp@pobox.com>
2769 * doc/dbus-sasl-profile.txt: docs on the authentication protocol,
2770 it is a simple protocol that just maps directly to SASL.
2772 * dbus/dbus-auth.h, dbus/dbus-auth.c: authentication protocol
2773 initial implementation, not actually used yet.
2775 * dbus/dbus-string.c (_dbus_string_find): new function
2776 (_dbus_string_equal): new function
2777 (_dbus_string_base64_encode): new function
2778 (_dbus_string_base64_decode): new function
2780 2002-12-25 Anders Carlsson <andersca@codefactory.se>
2783 * dbus/dbus-marshal.c: (swap_bytes), (_dbus_marshal_double),
2784 (_dbus_marshal_int32), (_dbus_marshal_uint32),
2785 (_dbus_demarshal_double), (_dbus_demarshal_int32),
2786 (_dbus_demarshal_uint32), (_dbus_marshal_test):
2787 * dbus/dbus-marshal.h:
2788 * dbus/dbus-protocol.h:
2789 * dbus/dbus-test.c: (main):
2791 Add un-optimized marshalling/demarshalling routines.
2793 2002-12-25 Harri Porten <porten@kde.org>
2795 * qt/dbus-qt.h: adjusted ctor and getter to KDE/Qt conventions
2797 2002-12-24 Zack Rusin <zack@kde.org>
2799 * qt/dbus-qthread.cc: adding - integrates QMutex into Dbus
2800 * qt/dbus-qt.h: skeleton with two sample implemenatation of the
2803 2002-12-24 Havoc Pennington <hp@pobox.com>
2805 * glib/dbus-gthread.c: fix include
2807 * glib/dbus-glib.h: rename DBusMessageHandler for now.
2808 I think glib API needs to change, though, as you don't
2809 want to use DBusMessageFunction, you want to use the
2810 DBusMessageHandler object. Probably
2811 dbus_connection_open_with_g_main_loop()
2812 and dbus_connection_setup_g_main_loop() or something like that
2813 (but think of better names...) that just create a connection
2814 that has watch/timeout functions etc. already set up.
2816 * dbus/dbus-connection.c
2817 (dbus_connection_send_message_with_reply): new function just to
2818 show how the message handler helps us deal with replies.
2820 * dbus/dbus-list.c (_dbus_list_remove_last): new function
2822 * dbus/dbus-string.c (_dbus_string_test): free a string that
2825 * dbus/dbus-hash.c: use memory pools for the hash entries
2826 (rebuild_table): be more paranoid about overflow, and
2827 shrink table when we can
2828 (_dbus_hash_test): reduce number of sprintfs and write
2829 valid C89. Add tests for case where we grow and then
2830 shrink the hash table.
2832 * dbus/dbus-mempool.h, dbus/dbus-mempool.c: memory pools
2834 * dbus/dbus-connection.c (dbus_connection_register_handler)
2835 (dbus_connection_unregister_handler): new functions
2837 * dbus/dbus-message.c (dbus_message_get_name): new
2839 * dbus/dbus-list.c: fix docs typo
2841 * dbus/dbus-message-handler.h, dbus/dbus-message-handler.c:
2842 an object representing a handler for messages.
2844 2002-12-16 Anders Carlsson <andersca@codefactory.se>
2847 * glib/dbus-gthread.c: (dbus_gthread_init):
2848 Don't use the gdbus prefix for public functions.
2850 2002-12-16 Anders Carlsson <andersca@codefactory.se>
2854 Add GLib checks and fixup .pc files
2858 * glib/dbus-gmain.c: (gdbus_connection_prepare),
2859 (gdbus_connection_check), (gdbus_connection_dispatch),
2860 (gdbus_add_connection_watch), (gdbus_remove_connection_watch),
2861 (dbus_connection_gsource_new):
2862 * glib/dbus-gthread.c: (dbus_gmutex_new), (dbus_gmutex_free),
2863 (dbus_gmutex_lock), (dbus_gmutex_unlock), (dbus_gthread_init):
2864 * glib/test-dbus-glib.c: (message_handler), (main):
2867 2002-12-15 Harri Porten <porten@kde.org>
2869 * autogen.sh: check for libtoolize before attempting to use it
2871 * dbus/dbus-transport-unix.c: include <sys/time.h> for timeval
2874 * .cvsignore: ignore more stamp files
2876 * dbus/dbus-watch.c (_dbus_watch_list_new): fixed doc error
2878 * test/Makefile.am: added -I$(top_srcdir) to be able to compile
2879 without make install.
2881 2002-12-15 Havoc Pennington <hp@pobox.com>
2883 * dbus/dbus-threads.c: add thread stubs that a higher library
2884 layer can fill in. e.g. the GLib wrapper might fill them in with
2885 GThread stuff. We still need to use this thread API to
2886 thread-safe-ize the library.
2888 2002-12-12 Havoc Pennington <hp@pobox.com>
2890 * dbus/dbus-transport-unix.c, dbus/dbus-server-unix.c: use the
2891 below new interfaces and include fewer system headers.
2893 * dbus/dbus-sysdeps.c (_dbus_read): new function
2894 (_dbus_write): new function
2895 (_dbus_write_two): new function
2896 (_dbus_connect_unix_socket): new function
2897 (_dbus_listen_unix_socket): new function
2899 * dbus/dbus-message-internal.h: change interfaces to use
2902 2002-12-11 Havoc Pennington <hp@pobox.com>
2904 * dbus/dbus-types.h: add dbus_unichar
2906 * dbus/dbus-internals.c (_dbus_verbose): use _dbus_getenv
2908 * dbus/dbus-connection.c (dbus_connection_send_message): return
2911 * dbus/dbus-transport.c: include dbus-watch.h
2913 * dbus/dbus-connection.c: include dbus-message-internal.h
2915 * HACKING: add file with coding guidelines stuff.
2917 * dbus/dbus-string.h, dbus/dbus-string.c: Encapsulate all string
2918 handling here, for security purposes (as in vsftpd). Not actually
2919 using this class yet.
2921 * dbus/dbus-sysdeps.h, dbus/dbus-sysdeps.c: Encapsulate all
2922 system/libc usage here, as in vsftpd, for ease of auditing (and
2923 should also simplify portability). Haven't actually moved all the
2924 system/libc usage into here yet.
2926 2002-11-25 Havoc Pennington <hp@pobox.com>
2928 * dbus/dbus-internals.c (_dbus_verbose): fix to not
2929 always print the first verbose message.
2931 2002-11-24 Havoc Pennington <hp@pobox.com>
2933 * test/echo-client.c, test/echo-server.c: cheesy test
2936 * configure.in (AC_CHECK_FUNCS): check for writev
2938 * dbus/dbus-message.c (_dbus_message_get_network_data): new
2941 * dbus/dbus-list.c (_dbus_list_foreach): new function
2943 * dbus/dbus-internals.c (_dbus_verbose): new function
2945 * dbus/dbus-server.c, dbus/dbus-server.h: public object
2946 representing a server that listens for connections.
2948 * dbus/.cvsignore: create
2950 * dbus/dbus-errors.h, dbus/dbus-errors.c:
2951 public API for reporting errors
2953 * dbus/dbus-connection.h, dbus/dbus-connection.c:
2954 public object representing a connection that
2955 sends/receives messages. (Same object used for
2956 both client and server.)
2958 * dbus/dbus-transport.h, dbus/dbus-transport.c:
2959 Basic abstraction for different kinds of stream
2960 that we might read/write messages from.
2962 2002-11-23 Havoc Pennington <hp@pobox.com>
2964 * dbus/dbus-internals.h (_DBUS_INT_MAX): add _DBUS_INT_MIN
2967 * dbus/dbus-test.c (main): add list test, and include
2968 dbus-test.h as intended
2970 * dbus/dbus-hash.c (_dbus_hash_table_remove_string)
2971 (_dbus_hash_table_remove_int): return value indicates
2972 whether the entry existed to remove
2974 * dbus/dbus-list.c: add linked list utility class,
2977 * dbus/dbus-hash.c: add TODO item about shrinking the hash bucket
2980 2002-11-23 Havoc Pennington <hp@pobox.com>
2982 * Doxyfile.in (INCLUDE_FILE_PATTERNS): expand DBUS_BEGIN_DECLS/
2983 DBUS_END_DECLS to nothing, that should fix this once and for all
2985 * Doxyfile.in (JAVADOC_AUTOBRIEF): set to YES
2987 * dbus/dbus-message.c, dbus/dbus-hash.c:
2988 add some missing @brief
2990 2002-11-23 Havoc Pennington <hp@pobox.com>
2992 * dbus/dbus-message.h: put semicolons after DEBUG_BEGIN_DECLS
2993 to avoid confusing Doxygen
2995 * dbus/dbus-hash.c: @} not }@
2997 * dbus/dbus-message.c (struct DBusMessage): split out
3000 2002-11-23 Havoc Pennington <hp@pobox.com>
3002 * configure.in: pile on more warning flags if using gcc
3004 * Doxyfile.in (EXTRACT_STATIC): set to NO, so we don't have
3005 to document static functions
3007 * configure.in: add summary to end of configure so it
3008 looks nice and attractive
3010 * dbus/dbus-hash.c: finish implementation and write unit
3013 * configure.in: add --enable-tests to enable unit tests
3015 * dbus/dbus-test.c: test program to run unit tests
3016 for all files in dbus/*, initially runs a test for
3019 * dbus/dbus-internals.h: file to hold some internal utility stuff
3021 2002-11-22 Havoc Pennington <hp@redhat.com>
3023 * dbus/dbus-hash.c: copy in Tcl hash table, not yet
3024 "ported" away from Tcl
3026 * dbus/dbus-types.h: header for types such as dbus_bool_t
3028 2002-11-22 Havoc Pennington <hp@redhat.com>
3030 * dbus/dbus.h: fixups for doc warnings
3032 * Doxyfile.in (FILE_PATTERNS): we need to scan .h to pick up
3034 (QUIET): make it quiet so we can see warnings
3036 * dbus/dbus-memory.c: teach D-BUS to allocate and free memory
3038 2002-11-22 Havoc Pennington <hp@redhat.com>
3040 * Makefile.am: include "Doxyfile" target in all-local
3042 * configure.in: generate the Doxyfile
3044 * Doxyfile.in: move Doxyfile here, so we can use
3045 configure to generate a Doxyfile with the right
3048 2002-11-22 Havoc Pennington <hp@redhat.com>
3050 * dbus/dbus-message.c: move inline docs into .c file
3052 * Doxyfile (OUTPUT_DIRECTORY): move output to doc/api
3053 so all docs are under doc/
3054 (MAN_EXTENSION): generate man pages. Use extension
3055 ".3dbus" which matches ".3qt" on my system,
3056 I guess this is OK, I don't know really.
3057 (FILE_PATTERNS): look for .c files not .h, makes sense
3060 2002-11-22 Havoc Pennington <hp@pobox.com>
3062 * Makefile.am (SUBDIRS): rename subdir "server" to "bus"
3063 because any app can be a server, and any app can be a client,
3064 the bus is a special kind of server.
3066 Thu Nov 21 23:35:31 2002 Zack Rusin <zack@kde.org>
3068 * Doxyfile : adding. Still needs Makefile rules to be generated
3069 automatically (just run "doxygen" in the toplevel dir for now to
3072 * dbus/dbus-message.h : Adding sample docs (javadoc since
3073 resembles gtk-doc a little more)
3075 * dbus/dbus.h : Adding sample docs
3077 2002-11-21 Havoc Pennington <hp@redhat.com>
3079 * dbus/Makefile.am (INCLUDES): define DBUS_COMPILATION
3080 so we can allow ourselves to include files directly,
3081 instead of having to use dbus.h
3083 * dbus/dbus.h: fill in
3085 * dbus/dbus-message.h: sketch out a sample header file.
3086 Include griping if you include it directly instead of
3089 * dbus/dbus-macros.h: new file with macros for extern "C",
3090 TRUE/FALSE, NULL, etc.
3092 * doc/file-boilerplate.c: put include guards in here
3094 2002-11-21 Havoc Pennington <hp@redhat.com>
3096 * doc/file-boilerplate.c: include both AFL and GPL boilerplate.
3098 * COPYING: include the GPL as well, and license code
3099 under both AFL and GPL.
3101 2002-11-21 Havoc Pennington <hp@redhat.com>
3103 * acconfig.h: get rid of this
3105 * autogen.sh (run_configure): add --no-configure option
3107 * configure.in: remove AC_ARG_PROGRAM to make
3108 autoconf complain less. add AC_PREREQ.
3109 add AC_DEFINE third arg.
3111 2002-11-21 Anders Carlsson <andersca@codefactory.se>
3114 Fix references so we can distcheck.
3116 2002-11-21 Havoc Pennington <hp@redhat.com>
3118 * Initial module creation