1 2003-01-28 Havoc Pennington <hp@redhat.com>
3 * dbus/dbus-string.c (_dbus_string_base64_decode): append bytes in
4 the reverse order from how I had it
5 (_dbus_string_base64_encode): reverse encoding order. I was
6 basically byteswapping everything during encoding.
8 2003-01-28 Anders Carlsson <andersca@codefactory.se>
10 * dbus/dbus-connection-internal.h:
11 * dbus/dbus-connection.c: (_dbus_connection_add_timeout),
12 (_dbus_connection_remove_timeout):
13 Add functions for adding and removing timeouts.
15 * dbus/dbus-message.c: (dbus_message_new_from_message):
16 Add new function that takes a message and creates an exact
17 copy of it, but with the refcount set to 1.
18 (check_message_handling):
21 * dbus/dbus-server-protected.h:
22 * dbus/dbus-server.c: (_dbus_server_init_base),
23 (_dbus_server_finalize_base), (_dbus_server_add_timeout),
24 (dbus_server_set_timeout_functions):
25 (_dbus_server_remove_timeout):
26 New functions so that a server can add and remove timeouts.
29 Add commented out call to dbus_server_debug_new.
31 * dbus/dbus-timeout.c: (_dbus_timeout_new):
32 Actually set the handler, doh.
34 * dbus/dbus-transport.c: (_dbus_transport_open):
35 Add commented out call to dbus_transport_debug_client_new.
38 Add dbus-transport-debug.[ch] and dbus-server-debug.[ch]
40 2003-01-28 Havoc Pennington <hp@pobox.com>
42 * dbus/dbus-message.c (check_message_handling): function to check
43 on the loaded message, iterates over it etc.
45 2003-01-28 Havoc Pennington <hp@pobox.com>
47 * test/Makefile.am (dist-hook): fix make distdir
49 * dbus/Makefile.am (TESTS_ENVIRONMENT): fix make check
51 2003-01-27 Havoc Pennington <hp@pobox.com>
53 * dbus/dbus-mempool.c (time_for_size): replace printf with
56 * dbus/dbus-message-builder.c (_dbus_message_data_load): allow
57 empty lines; fix the SAVE_LENGTH stuff to be
58 START_LENGTH/END_LENGTH so it actually works; couple other
61 * test/Makefile.am (dist-hook): add dist-hook for .message files
63 * dbus/dbus-string.c (DBUS_STRING_COPY_PREAMBLE): source of a copy
64 can be constant or locked.
65 (_dbus_string_free): allow freeing a const string as
68 * dbus/dbus-sysdeps.c (_dbus_concat_dir_and_file): utility
70 * dbus/dbus-test-main.c (main): take an argument which is the
71 directory containing test data
73 * dbus/dbus-message.c (_dbus_message_test): pass a test_data_dir
74 argument to this and load all the messages in test/data/
75 checking that they can be loaded or not loaded as appropriate.
77 2003-01-27 Anders Carlsson <andersca@codefactory.se>
79 * bus/dispatch.c: (bus_dispatch_message_handler):
80 Dispatch messages sent to services.
82 * bus/driver.c: (bus_driver_send_service_deleted),
83 (bus_driver_send_service_created), (bus_driver_send_service_lost),
84 (bus_driver_send_service_acquired):
85 Add helper functions for sending service related messages.
87 (bus_driver_send_welcome_message):
88 Send HELLO_REPLY instead of WELCOME.
90 (bus_driver_handle_list_services):
91 Send LIST_SERVICES_REPLY instead of SERVICES.
93 (bus_driver_handle_own_service),
94 (bus_driver_handle_service_exists):
97 (bus_driver_handle_message):
98 Invoke new message handlers.
100 (bus_driver_remove_connection):
101 Don't remove any services here since that's done automatically
102 by bus_service_remove_owner now.
105 New function signatures.
107 * bus/services.c: (bus_service_add_owner):
108 Send ServiceAcquired message if we're the only primary owner.
110 (bus_service_remove_owner):
111 Send ServiceAcquired/ServiceLost messages.
113 (bus_service_set_prohibit_replacement),
114 (bus_service_get_prohibit_replacement):
115 Functions for setting prohibit replacement.
117 (bus_service_has_owner):
118 New function that checks if a connection is in the owner queue of
122 Add new function signatures.
124 * dbus/dbus-list.c: (_dbus_list_test):
125 Add tests for _dbus_list_remove_last and traversing the list backwards.
128 Fix a typo in _dbus_list_get_prev_link, if we're at the first element we can't
129 go any further, so return NULL then.
131 * dbus/dbus-protocol.h:
132 Add new messages, service flags and service replies.
134 2003-01-26 Havoc Pennington <hp@pobox.com>
136 * dbus/dbus-message-builder.c: implement, completely untested.
138 * test/data/*: add data to be used in testing.
139 ".message" files are our simple loadable text format.
140 ".message-raw" will be binary dumps of messages.
142 * dbus/dbus-string.c (_dbus_string_starts_with_c_str): new
144 2003-01-26 Havoc Pennington <hp@pobox.com>
146 * dbus/dbus-sysdeps.c (_dbus_file_get_contents): new function
148 * dbus/dbus-errors.c (dbus_result_to_string): add
151 * dbus/dbus-message-builder.c: new file, will contain code to load
152 up messages from files. Not implemented yet.
154 2003-01-26 Havoc Pennington <hp@pobox.com>
156 * dbus/dbus-message.c (dbus_message_set_sender): support deleting
157 the sender by setting to NULL
159 2003-01-26 Havoc Pennington <hp@pobox.com>
161 The unit tests pass, but otherwise untested. If it breaks, the
162 tests should have been better. ;-)
164 * bus/driver.c (bus_driver_handle_hello): return if we disconnect
167 * dbus/dbus-message.c: redo everything so we maintain
168 message->header as the only copy of the various fields.
169 This avoids the possibility of out-of-memory in some cases,
170 for example dbus_message_lock() can't run out of memory anymore,
171 and avoids extra copying. Figured I may as well go ahead and do
172 this since it was busted for dbus_message_lock to not return
173 failure on OOM, and dbus_message_write_header was totally
174 unchecked for OOM. Also fixed some random other bugs.
176 * dbus/dbus-marshal.c (_dbus_marshal_get_field_end_pos): verify
177 that strings are nul-terminated. Also, end_pos can be equal
178 to string length just not greater than, I think.
179 (_dbus_marshal_set_int32): new function
180 (_dbus_marshal_set_uint32): new function
181 (_dbus_marshal_set_string): new function
183 * dbus/dbus-connection.c (_dbus_connection_new_for_transport): fix
184 a warning, init timeout_list to NULL
185 (dbus_connection_send_message): don't use uninitialized variable
188 * dbus/dbus-string.c (_dbus_string_replace_len): new function
190 2003-01-26 Anders Carlsson <andersca@codefactory.se>
192 * bus/driver.c: (bus_driver_handle_hello),
193 (bus_driver_send_welcome_message):
196 2003-01-26 Anders Carlsson <andersca@codefactory.se>
198 * dbus/dbus-auth.c: (process_auth), (_dbus_auth_unref):
199 * dbus/dbus-connection.c: (_dbus_connection_new_for_transport),
200 (dbus_connection_unref):
201 * dbus/dbus-marshal.c: (_dbus_marshal_test):
202 * dbus/dbus-message.c: (dbus_message_unref),
205 (dbus_message_get_fields):
206 Remove debugging printout.
208 (_dbus_message_loader_return_buffer):
209 Don't store the header string.
211 (_dbus_message_test):
214 2003-01-26 Richard Hult <rhult@codefactory.se>
216 * glib/dbus-gmain.c (dbus_connection_dispatch): Traverse a copy of
217 the file descriptor list, since it can change under us.
219 2003-01-25 Anders Carlsson <andersca@codefactory.se>
221 * glib/dbus-gmain.c: (dbus_connection_prepare),
222 (dbus_connection_check), (dbus_connection_dispatch), (add_watch),
223 (remove_watch), (dbus_connection_hookup_with_g_main):
224 Rewrite the glib handling to use its own GSource instead of a
225 GIOChannel so we can catch messages put in the queue while waiting
228 2003-01-25 Anders Carlsson <andersca@codefactory.se>
231 * bus/connection.c: (connection_disconnect_handler),
232 (connection_watch_callback), (bus_connection_setup):
233 * bus/dispatch.c: (send_one_message),
234 (bus_dispatch_broadcast_message), (bus_dispatch_message_handler),
235 (bus_dispatch_add_connection), (bus_dispatch_remove_connection):
237 * bus/driver.c: (bus_driver_send_service_deleted),
238 (bus_driver_send_service_created), (bus_driver_handle_hello),
239 (bus_driver_send_welcome_message),
240 (bus_driver_handle_list_services), (bus_driver_remove_connection),
241 (bus_driver_handle_message):
243 Refactor code, put the message dispatching in its own file. Use
244 _DBUS_HANDLE_OOM. Also send ServiceDeleted messages when a client
247 2003-01-25 Anders Carlsson <andersca@codefactory.se>
249 * dbus/dbus-internals.h:
250 Add _DBUS_HANDLE_OOM macro, it doesn't do anything currently.
252 * dbus/dbus-message.c: (dbus_message_get_sender):
253 * dbus/dbus-message.h:
254 Implement dbus_message_get_sender.
256 * dbus/dbus-protocol.h:
257 Add message and service defines.
259 2003-01-25 Anders Carlsson <andersca@codefactory.se>
261 * dbus/dbus-connection.c: (dbus_connection_send_message):
262 * dbus/dbus-message-internal.h:
263 * dbus/dbus-message.c: (_dbus_message_get_client_serial),
264 (dbus_message_write_header):
265 Remove _dbus_messag_unlock and don't set the client serial on a
266 message if one already exists.
268 2003-01-24 Havoc Pennington <hp@pobox.com>
270 * dbus/dbus-list.c (alloc_link): put a thread lock on the global
273 * bus/driver.c (bus_driver_handle_list_services): fix a leak
276 2003-01-25 Anders Carlsson <andersca@codefactory.se>
278 * dbus/dbus-list.c: (alloc_link), (free_link):
279 Use a memory pool for the links.
281 2003-01-25 Anders Carlsson <andersca@codefactory.se>
283 * bus/connection.c: (bus_connection_foreach):
285 Add new bus_connection_foreach function.
287 * bus/driver.c: (send_one_message), (bus_driver_broadcast_message):
288 Add function that broadcasts a message to all clients.
290 (bus_driver_send_service_created), (bus_driver_handle_hello),
291 (bus_driver_send_welcome_message),
292 (bus_driver_handle_list_services), (bus_driver_message_handler):
293 Implement functions that take care of listing services, and notifying
294 clients when new services are created.
296 * bus/services.c: (bus_services_list):
298 Add new function that returns an array of strings with the currently
303 Update copyright year.
305 2003-01-25 Anders Carlsson <andersca@codefactory.se>
307 * dbus/dbus-connection.c: (dbus_connection_send_message):
308 Unlock the message in case it was sent earlier.
310 (dbus_connection_send_message_with_reply_and_block):
311 Remove the reply message from the list.
313 * dbus/dbus-marshal.c: (_dbus_demarshal_string_array):
314 Set array_len and new_pos correctly.
316 (_dbus_marshal_test):
319 * dbus/dbus-message-internal.h:
320 * dbus/dbus-message.c: (_dbus_message_get_reply_serial):
321 New function that returns the reply serial.
323 (_dbus_message_unlock):
324 New function that unlocks a message and resets its header.
326 (dbus_message_append_string_array),
327 (dbus_message_get_fields_valist),
328 (dbus_message_iter_get_field_type),
329 (dbus_message_iter_get_string_array),
330 (dbus_message_get_fields),
331 (dbus_message_append_fields_valist):
332 Handle string arrays.
334 (dbus_message_set_sender):
335 Make this function public since the bus daemon needs it.
337 (decode_header_data):
338 Set the reply serial to -1 initially.
340 * dbus/dbus-message.h:
341 Add dbus_message_set_sender.
343 2003-01-24 Havoc Pennington <hp@pobox.com>
345 * doc/dbus-specification.sgml: add some stuff
347 2003-01-22 Havoc Pennington <hp@pobox.com>
349 * doc/dbus-specification.sgml: Start to document the protocol.
351 2003-01-22 Havoc Pennington <hp@pobox.com>
353 * dbus/dbus-connection.c
354 (dbus_connection_send_message_with_reply_and_block): add some @todo
356 * bus/driver.c (bus_driver_add_connection): add a FIXME about memleak
358 2003-01-21 Havoc Pennington <hp@pobox.com>
360 (patch untested because can't compile)
362 * bus/driver.c (create_unique_client_name): make this function
363 never recycle client names. Also, caller should initialize
366 * dbus/dbus-sysdeps.c (_dbus_get_current_time): new function
368 2003-01-21 Anders Carlsson <andersca@codefactory.se>
370 * dbus/dbus-marshal.c: (_dbus_marshal_double),
371 (_dbus_marshal_int32), (_dbus_marshal_uint32),
372 (_dbus_marshal_int32_array), (_dbus_marshal_uint32_array),
373 (_dbus_marshal_double_array), (_dbus_marshal_string_array),
374 (_dbus_demarshal_int32_array), (_dbus_demarshal_uint32_array),
375 (_dbus_demarshal_double_array), (_dbus_demarshal_string_array),
376 (_dbus_marshal_get_field_end_pos), (_dbus_marshal_test):
377 * dbus/dbus-marshal.h:
378 * dbus/dbus-protocol.h:
379 Add support for marshalling and demarshalling integer, double
382 2003-01-21 Anders Carlsson <andersca@codefactory.se>
387 * bus/connection.c: (connection_disconnect_handler):
388 Remove the connection from the bus driver's list.
390 (connection_watch_callback): Dispatch messages.
392 (free_connection_data): Free connection name.
394 (bus_connection_setup): Add connection to the bus driver's list.
395 (bus_connection_remove_owned_service):
396 (bus_connection_set_name), (bus_connection_get_name):
397 Add functions for setting and getting the connection's name.
400 Add function headers.
402 * bus/driver.c: (create_unique_client_name),
403 (bus_driver_handle_hello_message),
404 (bus_driver_send_welcome_message), (bus_driver_message_handler),
405 (bus_driver_add_connection), (bus_driver_remove_connection):
408 * bus/services.c: (bus_service_free):
410 New file that handles communication and registreation with the bus
413 2003-01-21 Anders Carlsson <andersca@codefactory.se>
415 * dbus/dbus-connection.c: (dbus_connection_send_message):
416 Add a new client_serial parameter.
418 (dbus_connection_send_message_with_reply):
419 Remove a @todo since we've implemented the blocking function.
421 (dbus_connection_send_message_with_reply_and_block):
422 New function that sends a message and waits for a reply and
423 then returns the reply.
425 * dbus/dbus-connection.h:
428 * dbus/dbus-errors.c: (dbus_result_to_string):
429 * dbus/dbus-errors.h:
432 * dbus/dbus-message-internal.h:
433 * dbus/dbus-message.c: (_dbus_message_get_reply_serial),
434 (_dbus_message_set_sender), (dbus_message_write_header),
435 (dbus_message_new_reply), (decode_header_data),
436 (_dbus_message_loader_return_buffer), (_dbus_message_test):
437 * dbus/dbus-message.h:
438 Add new functions that set the reply serial and sender.
439 Also marshal and demarshal them correctly and add test.
441 * dbus/dbus-protocol.h:
442 Add new DBUS_MESSAGE_TYPE_SENDER.
445 * glib/dbus-gmain.c: (watch_callback), (free_callback_data),
446 (add_watch), (remove_watch), (add_timeout), (remove_timeout),
447 (dbus_connection_hookup_with_g_main):
448 * glib/test-dbus-glib.c: (main):
449 Rewrite to use GIOChannel and remove the GSource crack.
451 * test/echo-client.c: (main):
452 * test/watch.c: (check_messages):
453 Update for changed APIs
455 2003-01-19 Anders Carlsson <andersca@codefactory.se>
457 * dbus/Makefile.am: Add dbus-timeout.[cħ]
459 * dbus/dbus-connection.c: (_dbus_connection_new_for_transport):
460 Create a DBusTimeoutList.
461 (dbus_connection_set_timeout_functions): Add new function to
462 set timeout callbacks
464 * dbus/dbus-connection.h: Add public DBusTimeout API.
466 * dbus/dbus-message.c: (dbus_message_get_service):
467 * dbus/dbus-message.h: New function.
469 * dbus/dbus-server.c: Fix small doc typo.
471 * dbus/dbus-timeout.[ch]: New files for mainloop timeouts.
473 2003-01-19 Anders Carlsson <andersca@codefactory.se>
475 * dbus/dbus-string.c (_dbus_string_move_len): Don't delete all
476 of the string, just as long as specified.
478 2003-01-19 Havoc Pennington <hp@pobox.com>
480 * dbus/dbus-connection.c (dbus_connection_get_is_authenticated):
483 * dbus/dbus-server.c (dbus_server_set_max_connections)
484 (dbus_server_get_max_connections, dbus_server_get_n_connections):
485 keep track of current number of connections, and add API for
486 setting a max (but haven't implemented enforcing the max yet)
488 2003-01-18 Havoc Pennington <hp@pobox.com>
490 * dbus/dbus-transport-unix.c (unix_do_iteration): only do the
491 reading/writing if read_watch != NULL or write_watch != NULL.
493 * dbus/dbus-message.c (_dbus_message_loader_return_buffer): fix
494 the message loader code to actually load message->header and
495 message->body into the newly-created message.
497 * dbus/dbus-transport-unix.c (check_write_watch): fix a mem leak
500 * dbus/dbus-connection.c (dbus_connection_set_max_message_size)
501 (dbus_connection_get_max_message_size)
502 (dbus_connection_set_max_live_messages_size)
503 (dbus_connection_get_max_live_messages_size): implement some
504 resource limitation functions
506 * dbus/dbus-resources.c: new file implementing some of the
507 resource limits stuff
509 * dbus/dbus-message.c (dbus_message_iter_get_byte_array): add
510 missing docs, add @todo to handle OOM etc.
512 * dbus/dbus-marshal.c (_dbus_demarshal_byte_array): add missing
515 2003-01-18 Havoc Pennington <hp@pobox.com>
517 * dbus/dbus-connection.c (dbus_connection_unref): disconnect the
518 connection if it hasn't been already.
520 * dbus/dbus-connection.h: kill off the idea of an ErrorFunction,
521 replace with DisconnectFunction.
523 2003-01-18 Havoc Pennington <hp@pobox.com>
525 Building --disable-verbose-mode --disable-asserts --disable-tests
526 cuts the library from 112K to 45K or so
528 * configure.in: check for varargs macro support,
529 add --enable-verbose-mode, --enable-asserts.
531 * dbus/dbus-internals.h (_dbus_assert): support
533 (_dbus_verbose): support DBUS_ENABLE_VERBOSE_MODE
535 2003-01-18 Havoc Pennington <hp@pobox.com>
537 * dbus/dbus-test.c: include config.h so that tests actually run
539 * dbus/dbus-string.c: add assertions that stuff is 8-byte aligned,
540 so the failure mode when that assumption fails will be plenty
543 2003-01-18 Havoc Pennington <hp@pobox.com>
545 * configure.in: default --enable-tests to $USE_MAINTAINER_MODE
547 * dbus/Makefile.am: fix it up so dubs-test-main.c is included in
550 * test/Makefile.am: don't use special variable "TESTS" for echo-*
551 since we don't want to use those in make check
553 2003-01-15 Havoc Pennington <hp@redhat.com>
559 2003-01-15 Havoc Pennington <hp@redhat.com>
561 * test/Makefile.am: fix so that test source code ends up in the
562 distribution on make distcheck
564 2003-01-15 Havoc Pennington <hp@redhat.com>
570 2003-01-15 Havoc Pennington <hp@redhat.com>
572 * dbus/dbus-test.c (dbus_internal_symbol_do_not_use_run_tests):
573 fix build when --disable-tests
575 * Makefile.am (EXTRA_DIST): put HACKING in here
577 * HACKING: document procedure for making a tarball release.
579 2003-01-14 Anders Carlsson <andersca@codefactory.se>
581 * bus/connection.c: (connection_error_handler),
582 (bus_connection_setup):
583 * bus/main.c: (main):
584 Make sure that the DBusConnectionData struct is NULLed
585 out to prevent a segfault.
587 * dbus/dbus-errors.c: (dbus_result_to_string):
588 * dbus/dbus-errors.h:
589 * dbus/dbus-message.c: (dbus_message_get_fields),
590 (dbus_message_get_fields_valist), (_dbus_message_test):
591 * dbus/dbus-message.h:
592 Make dbus_message_get_fields return a result code so we can
593 track invalid fields as well as oom.
595 2003-01-11 Havoc Pennington <hp@pobox.com>
597 * configure.in: change --enable-test/--enable-ansi action-if-given
598 to enable_foo=$enableval instead of enable_foo=yes
600 2003-01-08 Havoc Pennington <hp@pobox.com>
602 * dbus/dbus-string.c (_dbus_string_align_length): new function
604 * dbus/dbus-test-main.c: move main() for test app here
606 (dbus_internal_symbol_do_not_use_run_tests): we have to export a
607 symbol to run tests, because dbus-test isn't in the main
610 Code review nitpicks.
612 * dbus/dbus-message.c (dbus_message_write_header): add newlines
613 for people with narrow emacs ;-). Assert client_serial was filled
614 in. Assert message->name != NULL.
615 (dbus_message_append_fields): have "first_field_type" arg separate
616 from va list, needed for C++ binding that also uses varargs IIRC
617 and helps with type safety
618 (dbus_message_new): add @todo about using DBusString to store
619 service/name internally
620 (dbus_message_new): don't leak ->service and ->name on OOM later
622 (dbus_message_unref): free the service name
623 (dbus_message_get_fields): same change to varargs
624 i.e. first_field_type
625 (_dbus_message_loader_return_buffer): assert that the message data
626 is aligned (if not it's a bug in our code). Put in verbose griping
627 about why we set corrupted = TRUE.
628 (decode_header_data): add FIXME that char* is evil. Was going to
629 add FIXME about evil locale-specific string.h strncmp, but just
630 switched to wacky string-as-uint32 optimization. Move check for
631 "no room for field name" above get_const_data_len() to avoid
632 assertion failure in get_const_data_len if we have trailing 2
633 bytes or the like. Check for service and name fields being
634 provided twice. Don't leak service/name on error. Require field
635 names to be aligned to 4 bytes.
637 * dbus/dbus-marshal.c: move byte swap stuff to header
638 (_dbus_pack_int32): uscore-prefix
639 (_dbus_unpack_int32): uscore-prefix
640 (_dbus_unpack_uint32): export
641 (_dbus_demarshal_string): add @todo complaining about use of
643 (_dbus_marshal_get_field_end_pos): add @todo about bad error
644 handling allowing corrupt data to go unchecked
646 2003-01-08 Havoc Pennington <hp@redhat.com>
648 * dbus/dbus-transport-unix.c (unix_do_iteration): add read/write
649 to the select() as needed for authentication. (should be using
650 _dbus_poll() not select, but for another day)
652 * dbus/dbus.h: include dbus/dbus-protocol.h
654 2003-01-08 Anders Carlsson <andersca@codefactory.se>
656 * dbus/Makefile.am (dbusinclude_HEADERS): Install
659 2003-01-08 Anders Carlsson <andersca@codefactory.se>
661 * dbus/dbus-internals.c: (_dbus_type_to_string):
662 New function that returns a string describing a type.
664 * dbus/dbus-marshal.c: (_dbus_demarshal_byte_array):
665 * dbus/dbus-marshal.h:
666 * dbus/dbus-message.c: (dbus_message_get_fields_valist),
667 (dbus_message_iter_get_field_type), (dbus_message_iter_get_double),
668 (dbus_message_iter_get_byte_array):
669 * dbus/dbus-message.h:
670 Add new convenience functions for appending and getting message fields.
671 Also add demarshalling routines for byte arrays.
673 2003-01-07 Anders Carlsson <andersca@codefactory.se>
675 * dbus/dbus-connection-internal.h:
676 * dbus/dbus-connection.c: (_dbus_connection_new_for_transport),
677 (_dbus_connection_get_next_client_serial),
678 (dbus_connection_send_message):
679 * dbus/dbus-internals.h:
680 * dbus/dbus-marshal.c: (unpack_uint32), (dbus_unpack_int32),
681 (dbus_pack_int32), (_dbus_marshal_double), (_dbus_marshal_int32),
682 (_dbus_marshal_uint32), (_dbus_demarshal_double),
683 (_dbus_demarshal_int32), (_dbus_demarshal_uint32),
684 (_dbus_demarshal_string), (_dbus_marshal_get_field_end_pos),
685 (_dbus_verbose_bytes), (_dbus_marshal_test):
686 * dbus/dbus-marshal.h:
687 * dbus/dbus-message-internal.h:
688 * dbus/dbus-message.c: (_dbus_message_set_client_serial),
689 (dbus_message_write_header), (_dbus_message_lock),
690 (dbus_message_new), (dbus_message_ref), (dbus_message_unref),
691 (dbus_message_get_name), (dbus_message_append_int32),
692 (dbus_message_append_uint32), (dbus_message_append_double),
693 (dbus_message_append_string), (dbus_message_append_byte_array),
694 (dbus_message_get_fields_iter), (dbus_message_iter_ref),
695 (dbus_message_iter_unref), (dbus_message_iter_has_next),
696 (dbus_message_iter_next), (dbus_message_iter_get_field_type),
697 (dbus_message_iter_get_string), (dbus_message_iter_get_int32),
698 (dbus_message_iter_get_uint32), (dbus_message_iter_get_double),
699 (decode_header_data), (_dbus_message_loader_return_buffer),
700 (message_iter_test), (_dbus_message_test):
701 * dbus/dbus-message.h:
702 * dbus/dbus-protocol.h:
703 * dbus/dbus-test.c: (main):
705 * glib/test-dbus-glib.c: (message_handler), (main):
706 * test/echo-client.c: (main):
707 * test/watch.c: (check_messages):
708 Make messages sendable and receivable for real.
710 2003-01-07 Anders Carlsson <andersca@codefactory.se>
712 * dbus/dbus-marshal.c: (_dbus_marshal_double),
713 (_dbus_marshal_string), (_dbus_marshal_byte_array):
714 * dbus/dbus-message.c: (dbus_message_append_int32),
715 (dbus_message_append_uint32), (dbus_message_append_double),
716 (dbus_message_append_string), (dbus_message_append_byte_array):
717 Handle OOM restoration.
719 2003-01-07 Anders Carlsson <andersca@codefactory.se>
721 * dbus/dbus-marshal.c: (_dbus_marshal_string),
722 (_dbus_demarshal_string), (_dbus_marshal_test):
723 * dbus/dbus-marshal.h:
724 * dbus/dbus-message.c: (dbus_message_get_name),
725 Document these functions.
727 (dbus_message_append_int32), (dbus_message_append_uint32),
728 (dbus_message_append_double), (dbus_message_append_string),
729 (dbus_message_append_byte_array):
730 * dbus/dbus-message.h:
731 Add functions for adding message fields of different types.
733 * dbus/dbus-protocol.h:
734 Add the different types.
736 2003-01-05 Havoc Pennington <hp@pobox.com>
738 * bus/connection.c: implement routines for handling connections,
739 first thing is keeping a list of owned services on each connection
740 and setting up watches etc.
742 * bus/services.c: implement a mapping from service names to lists
745 * dbus/dbus-hash.c: add DBUS_HASH_POINTER
747 * dbus/dbus-threads.c (dbus_static_mutex_lock): add functions
748 to use static mutexes for global data
750 * dbus/dbus-connection.c (dbus_connection_set_data): add new
751 collection of functions to set/get application-specific data
752 on the DBusConnection.
754 2003-01-04 Havoc Pennington <hp@pobox.com>
756 * dbus/dbus-sysdeps.c (_dbus_sleep_milliseconds): new function
757 (_dbus_poll): new function
759 * dbus/dbus-internals.h (_DBUS_STRUCT_OFFSET): new macro
762 * bus/loop.c: initial code for the daemon main loop
764 2003-01-04 Havoc Pennington <hp@pobox.com>
766 * test/watch.c (error_handler): make it safe if the error handler
767 is called multiple times (if we s/error handler/disconnect
768 handler/ we should just guarantee it's called only once)
770 * dbus/dbus-transport.c (_dbus_transport_disconnect): call the
771 error handler on disconnect (it's quite possible we should
772 just change the error handler to a "disconnect handler," I'm
773 not sure we have any other meaningful errors)
775 * configure.in: check for getpwnam_r
777 * dbus/dbus-transport.c, dbus/dbus-transport-unix.c,
778 dbus/dbus-auth.c: add credentials support, add EXTERNAL auth
779 mechanism as in SASL spec, using socket credentials
781 * dbus/dbus-sysdeps.c (_dbus_read_credentials_unix_socket): new function
782 (_dbus_send_credentials_unix_socket): new function
784 * dbus/dbus-sysdeps.c (_dbus_accept_unix_socket): rename just
786 (_dbus_write): only check errno if <0 returned
787 (_dbus_write_two): ditto
789 2003-01-02 Anders Carlsson <andersca@codefactory.se>
791 * dbus/dbus-marshal.c: (_dbus_marshal_utf8_string),
792 (_dbus_marshal_byte_array), (_dbus_demarshal_utf8_string),
793 (_dbus_marshal_test):
794 * dbus/dbus-marshal.h:
795 Add _dbus_marshal_byte_array and rename _dbus_marshal_string
796 to _dbus_marshal_utf8_string. Also fix some tests.
798 2002-12-28 Harri Porten <porten@kde.org>
800 * configure.in: added check for C++ compiler and a very cheesy
801 check for the Qt integration
803 * Makefile.am (SUBDIRS): compile qt subdir if support is enabled
805 * qt/Makefile.am: added
807 * qt/.cvsignore: added
809 * qt/dbus-qthread.cc, qt/dbus-qthread.cpp: renamed former to
810 latter, added #ifdef QT_THREAD_SUPPORT guard.
812 * dbus/Makefile.am: added missing headers for make dist
814 2002-12-28 Kristian Rietveld <kris@gtk.org>
816 * dbus/Makefile.am: fixup export-symbols-regex.
818 2002-12-27 Anders Carlsson <andersca@codefactory.se>
820 * acinclude.m4: Add this file and put the
821 PKG_CHECK_MODULE macro in it.
823 2002-12-27 Anders Carlsson <andersca@codefactory.se>
825 * dbus/dbus-marshal.c: (_dbus_marshal_string),
826 (_dbus_demarshal_double), (_dbus_demarshal_int32),
827 (_dbus_demarshal_uint32), (_dbus_demarshal_string),
828 (_dbus_marshal_test):
829 Make the demarshalling routines align the pos argument.
830 Add string marshalling tests and fix the obvious bugs
833 2002-12-26 Havoc Pennington <hp@pobox.com>
835 * dbus/dbus-auth.c: fixes fixes fixes
837 * dbus/dbus-transport-unix.c: wire up support for
838 encoding/decoding data on the wire
840 * dbus/dbus-auth.c (_dbus_auth_encode_data)
841 (_dbus_auth_decode_data): append to target string
842 instead of nuking it.
844 2002-12-26 Havoc Pennington <hp@pobox.com>
846 * dbus/dbus-marshal.h (DBUS_COMPILER_BYTE_ORDER): #ifdef
847 WORDS_BIGENDIAN then compiler byte order is DBUS_BIG_ENDIAN,
850 * dbus/dbus-marshal.c: Add macros to do int swapping in-place and
851 avoid swap_bytes() overhead (ignoring possible assembly stuff for
852 now). Main point is because I wanted unpack_uint32 to implement
854 (_dbus_verbose_bytes): new function
856 * dbus/dbus-string.c (_dbus_string_validate_ascii): new function
858 * dbus/dbus-message.c (_dbus_message_loader_get_is_corrupted): add
859 mechanism to handle a corrupt message stream
860 (_dbus_message_loader_new): fix preallocation to only prealloc,
863 * dbus/dbus-string.c (_dbus_string_skip_blank): fix this function
864 (_dbus_string_test): enhance tests for copy/move and fix the
867 * dbus/dbus-transport-unix.c: Hold references in more places to
868 avoid reentrancy problems
870 * dbus/dbus-transport.c: ditto
872 * dbus/dbus-connection.c (dbus_connection_dispatch_message): don't
873 leak reference count in no-message case
875 * test/watch.c (do_mainloop): handle adding/removing watches
876 during iteration over the watches. Also, ref the connection/server
877 stored on a watch, so we don't try to mangle a destroyed one.
879 * dbus/dbus-transport-unix.c (do_authentication): perform
882 * dbus/dbus-auth.c (get_state): add a state
883 AUTHENTICATED_WITH_UNUSED_BYTES and return it if required
884 (_dbus_auth_get_unused_bytes): append the unused bytes
885 to the passed in string, rather than prepend
887 * dbus/dbus-transport.c (_dbus_transport_init_base): create
888 the auth conversation DBusAuth
890 * dbus/dbus-transport-unix.c (_dbus_transport_new_for_fd)
891 (_dbus_transport_new_for_domain_socket): when creating a
892 transport, pass in whether it's a client-side or server-side
893 transport so we know which DBusAuth to create
895 2002-12-03 Havoc Pennington <hp@pobox.com>
897 * dbus/dbus-transport-unix.c (unix_finalize): finalize base
898 _after_ finalizing the derived members
899 (unix_connection_set): unref watch if we fail to add it
901 * dbus/dbus-connection.c (dbus_connection_unref): delete the
902 transport first, so that the connection owned by the
903 transport will be valid as the transport finalizes.
905 * dbus/dbus-transport-unix.c (unix_finalize): free the write_watch
906 if necessary, and remove watches from the connection.
908 * dbus/dbus-watch.c (_dbus_watch_list_free): improve a comment
910 2002-12-26 Anders Carlsson <andersca@codefactory.se>
912 * dbus/dbus-marshal.c: (_dbus_marshal_string),
913 (_dbus_demarshal_double), (_dbus_demarshal_int32),
914 (_dbus_demarshal_uint32), (_dbus_demarshal_string),
915 (_dbus_marshal_test):
916 * dbus/dbus-marshal.h:
917 Add string marshal functions and have the demarshal functions
918 return the new position.
920 2002-12-25 Havoc Pennington <hp@pobox.com>
922 * doc/dbus-sasl-profile.txt: docs on the authentication protocol,
923 it is a simple protocol that just maps directly to SASL.
925 * dbus/dbus-auth.h, dbus/dbus-auth.c: authentication protocol
926 initial implementation, not actually used yet.
928 * dbus/dbus-string.c (_dbus_string_find): new function
929 (_dbus_string_equal): new function
930 (_dbus_string_base64_encode): new function
931 (_dbus_string_base64_decode): new function
933 2002-12-25 Anders Carlsson <andersca@codefactory.se>
936 * dbus/dbus-marshal.c: (swap_bytes), (_dbus_marshal_double),
937 (_dbus_marshal_int32), (_dbus_marshal_uint32),
938 (_dbus_demarshal_double), (_dbus_demarshal_int32),
939 (_dbus_demarshal_uint32), (_dbus_marshal_test):
940 * dbus/dbus-marshal.h:
941 * dbus/dbus-protocol.h:
942 * dbus/dbus-test.c: (main):
944 Add un-optimized marshalling/demarshalling routines.
946 2002-12-25 Harri Porten <porten@kde.org>
948 * qt/dbus-qt.h: adjusted ctor and getter to KDE/Qt conventions
950 2002-12-24 Zack Rusin <zack@kde.org>
952 * qt/dbus-qthread.cc: adding - integrates QMutex into Dbus
953 * qt/dbus-qt.h: skeleton with two sample implemenatation of the
956 2002-12-24 Havoc Pennington <hp@pobox.com>
958 * glib/dbus-gthread.c: fix include
960 * glib/dbus-glib.h: rename DBusMessageHandler for now.
961 I think glib API needs to change, though, as you don't
962 want to use DBusMessageFunction, you want to use the
963 DBusMessageHandler object. Probably
964 dbus_connection_open_with_g_main_loop()
965 and dbus_connection_setup_g_main_loop() or something like that
966 (but think of better names...) that just create a connection
967 that has watch/timeout functions etc. already set up.
969 * dbus/dbus-connection.c
970 (dbus_connection_send_message_with_reply): new function just to
971 show how the message handler helps us deal with replies.
973 * dbus/dbus-list.c (_dbus_list_remove_last): new function
975 * dbus/dbus-string.c (_dbus_string_test): free a string that
978 * dbus/dbus-hash.c: use memory pools for the hash entries
979 (rebuild_table): be more paranoid about overflow, and
980 shrink table when we can
981 (_dbus_hash_test): reduce number of sprintfs and write
982 valid C89. Add tests for case where we grow and then
983 shrink the hash table.
985 * dbus/dbus-mempool.h, dbus/dbus-mempool.c: memory pools
987 * dbus/dbus-connection.c (dbus_connection_register_handler)
988 (dbus_connection_unregister_handler): new functions
990 * dbus/dbus-message.c (dbus_message_get_name): new
992 * dbus/dbus-list.c: fix docs typo
994 * dbus/dbus-message-handler.h, dbus/dbus-message-handler.c:
995 an object representing a handler for messages.
997 2002-12-16 Anders Carlsson <andersca@codefactory.se>
1000 * glib/dbus-gthread.c: (dbus_gthread_init):
1001 Don't use the gdbus prefix for public functions.
1003 2002-12-16 Anders Carlsson <andersca@codefactory.se>
1007 Add GLib checks and fixup .pc files
1011 * glib/dbus-gmain.c: (gdbus_connection_prepare),
1012 (gdbus_connection_check), (gdbus_connection_dispatch),
1013 (gdbus_add_connection_watch), (gdbus_remove_connection_watch),
1014 (dbus_connection_gsource_new):
1015 * glib/dbus-gthread.c: (dbus_gmutex_new), (dbus_gmutex_free),
1016 (dbus_gmutex_lock), (dbus_gmutex_unlock), (dbus_gthread_init):
1017 * glib/test-dbus-glib.c: (message_handler), (main):
1020 2002-12-15 Harri Porten <porten@kde.org>
1022 * autogen.sh: check for libtoolize before attempting to use it
1024 * dbus/dbus-transport-unix.c: include <sys/time.h> for timeval
1027 * .cvsignore: ignore more stamp files
1029 * dbus/dbus-watch.c (_dbus_watch_list_new): fixed doc error
1031 * test/Makefile.am: added -I$(top_srcdir) to be able to compile
1032 without make install.
1034 2002-12-15 Havoc Pennington <hp@pobox.com>
1036 * dbus/dbus-threads.c: add thread stubs that a higher library
1037 layer can fill in. e.g. the GLib wrapper might fill them in with
1038 GThread stuff. We still need to use this thread API to
1039 thread-safe-ize the library.
1041 2002-12-12 Havoc Pennington <hp@pobox.com>
1043 * dbus/dbus-transport-unix.c, dbus/dbus-server-unix.c: use the
1044 below new interfaces and include fewer system headers.
1046 * dbus/dbus-sysdeps.c (_dbus_read): new function
1047 (_dbus_write): new function
1048 (_dbus_write_two): new function
1049 (_dbus_connect_unix_socket): new function
1050 (_dbus_listen_unix_socket): new function
1052 * dbus/dbus-message-internal.h: change interfaces to use
1055 2002-12-11 Havoc Pennington <hp@pobox.com>
1057 * dbus/dbus-types.h: add dbus_unichar
1059 * dbus/dbus-internals.c (_dbus_verbose): use _dbus_getenv
1061 * dbus/dbus-connection.c (dbus_connection_send_message): return
1064 * dbus/dbus-transport.c: include dbus-watch.h
1066 * dbus/dbus-connection.c: include dbus-message-internal.h
1068 * HACKING: add file with coding guidelines stuff.
1070 * dbus/dbus-string.h, dbus/dbus-string.c: Encapsulate all string
1071 handling here, for security purposes (as in vsftpd). Not actually
1072 using this class yet.
1074 * dbus/dbus-sysdeps.h, dbus/dbus-sysdeps.c: Encapsulate all
1075 system/libc usage here, as in vsftpd, for ease of auditing (and
1076 should also simplify portability). Haven't actually moved all the
1077 system/libc usage into here yet.
1079 2002-11-25 Havoc Pennington <hp@pobox.com>
1081 * dbus/dbus-internals.c (_dbus_verbose): fix to not
1082 always print the first verbose message.
1084 2002-11-24 Havoc Pennington <hp@pobox.com>
1086 * test/echo-client.c, test/echo-server.c: cheesy test
1089 * configure.in (AC_CHECK_FUNCS): check for writev
1091 * dbus/dbus-message.c (_dbus_message_get_network_data): new
1094 * dbus/dbus-list.c (_dbus_list_foreach): new function
1096 * dbus/dbus-internals.c (_dbus_verbose): new function
1098 * dbus/dbus-server.c, dbus/dbus-server.h: public object
1099 representing a server that listens for connections.
1101 * dbus/.cvsignore: create
1103 * dbus/dbus-errors.h, dbus/dbus-errors.c:
1104 public API for reporting errors
1106 * dbus/dbus-connection.h, dbus/dbus-connection.c:
1107 public object representing a connection that
1108 sends/receives messages. (Same object used for
1109 both client and server.)
1111 * dbus/dbus-transport.h, dbus/dbus-transport.c:
1112 Basic abstraction for different kinds of stream
1113 that we might read/write messages from.
1115 2002-11-23 Havoc Pennington <hp@pobox.com>
1117 * dbus/dbus-internals.h (_DBUS_INT_MAX): add _DBUS_INT_MIN
1120 * dbus/dbus-test.c (main): add list test, and include
1121 dbus-test.h as intended
1123 * dbus/dbus-hash.c (_dbus_hash_table_remove_string)
1124 (_dbus_hash_table_remove_int): return value indicates
1125 whether the entry existed to remove
1127 * dbus/dbus-list.c: add linked list utility class,
1130 * dbus/dbus-hash.c: add TODO item about shrinking the hash bucket
1133 2002-11-23 Havoc Pennington <hp@pobox.com>
1135 * Doxyfile.in (INCLUDE_FILE_PATTERNS): expand DBUS_BEGIN_DECLS/
1136 DBUS_END_DECLS to nothing, that should fix this once and for all
1138 * Doxyfile.in (JAVADOC_AUTOBRIEF): set to YES
1140 * dbus/dbus-message.c, dbus/dbus-hash.c:
1141 add some missing @brief
1143 2002-11-23 Havoc Pennington <hp@pobox.com>
1145 * dbus/dbus-message.h: put semicolons after DEBUG_BEGIN_DECLS
1146 to avoid confusing Doxygen
1148 * dbus/dbus-hash.c: @} not }@
1150 * dbus/dbus-message.c (struct DBusMessage): split out
1153 2002-11-23 Havoc Pennington <hp@pobox.com>
1155 * configure.in: pile on more warning flags if using gcc
1157 * Doxyfile.in (EXTRACT_STATIC): set to NO, so we don't have
1158 to document static functions
1160 * configure.in: add summary to end of configure so it
1161 looks nice and attractive
1163 * dbus/dbus-hash.c: finish implementation and write unit
1166 * configure.in: add --enable-tests to enable unit tests
1168 * dbus/dbus-test.c: test program to run unit tests
1169 for all files in dbus/*, initially runs a test for
1172 * dbus/dbus-internals.h: file to hold some internal utility stuff
1174 2002-11-22 Havoc Pennington <hp@redhat.com>
1176 * dbus/dbus-hash.c: copy in Tcl hash table, not yet
1177 "ported" away from Tcl
1179 * dbus/dbus-types.h: header for types such as dbus_bool_t
1181 2002-11-22 Havoc Pennington <hp@redhat.com>
1183 * dbus/dbus.h: fixups for doc warnings
1185 * Doxyfile.in (FILE_PATTERNS): we need to scan .h to pick up
1187 (QUIET): make it quiet so we can see warnings
1189 * dbus/dbus-memory.c: teach D-BUS to allocate and free memory
1191 2002-11-22 Havoc Pennington <hp@redhat.com>
1193 * Makefile.am: include "Doxyfile" target in all-local
1195 * configure.in: generate the Doxyfile
1197 * Doxyfile.in: move Doxyfile here, so we can use
1198 configure to generate a Doxyfile with the right
1201 2002-11-22 Havoc Pennington <hp@redhat.com>
1203 * dbus/dbus-message.c: move inline docs into .c file
1205 * Doxyfile (OUTPUT_DIRECTORY): move output to doc/api
1206 so all docs are under doc/
1207 (MAN_EXTENSION): generate man pages. Use extension
1208 ".3dbus" which matches ".3qt" on my system,
1209 I guess this is OK, I don't know really.
1210 (FILE_PATTERNS): look for .c files not .h, makes sense
1213 2002-11-22 Havoc Pennington <hp@pobox.com>
1215 * Makefile.am (SUBDIRS): rename subdir "server" to "bus"
1216 because any app can be a server, and any app can be a client,
1217 the bus is a special kind of server.
1219 Thu Nov 21 23:35:31 2002 Zack Rusin <zack@kde.org>
1221 * Doxyfile : adding. Still needs Makefile rules to be generated
1222 automatically (just run "doxygen" in the toplevel dir for now to
1225 * dbus/dbus-message.h : Adding sample docs (javadoc since
1226 resembles gtk-doc a little more)
1228 * dbus/dbus.h : Adding sample docs
1230 2002-11-21 Havoc Pennington <hp@redhat.com>
1232 * dbus/Makefile.am (INCLUDES): define DBUS_COMPILATION
1233 so we can allow ourselves to include files directly,
1234 instead of having to use dbus.h
1236 * dbus/dbus.h: fill in
1238 * dbus/dbus-message.h: sketch out a sample header file.
1239 Include griping if you include it directly instead of
1242 * dbus/dbus-macros.h: new file with macros for extern "C",
1243 TRUE/FALSE, NULL, etc.
1245 * doc/file-boilerplate.c: put include guards in here
1247 2002-11-21 Havoc Pennington <hp@redhat.com>
1249 * doc/file-boilerplate.c: include both AFL and GPL boilerplate.
1251 * COPYING: include the GPL as well, and license code
1252 under both AFL and GPL.
1254 2002-11-21 Havoc Pennington <hp@redhat.com>
1256 * acconfig.h: get rid of this
1258 * autogen.sh (run_configure): add --no-configure option
1260 * configure.in: remove AC_ARG_PROGRAM to make
1261 autoconf complain less. add AC_PREREQ.
1262 add AC_DEFINE third arg.
1264 2002-11-21 Anders Carlsson <andersca@codefactory.se>
1267 Fix references so we can distcheck.
1269 2002-11-21 Havoc Pennington <hp@redhat.com>
1271 * Initial module creation