1 2003-01-29 Havoc Pennington <hp@pobox.com>
3 * dbus/dbus-message.c (check_message_handling): fix assertion
4 failure on set_client_serial
6 2003-01-28 Havoc Pennington <hp@pobox.com>
8 * dbus/dbus-server-debug.c: Add doc section comments
10 * dbus/dbus-transport-debug.c: add doc section comments
12 2003-01-28 Havoc Pennington <hp@redhat.com>
14 * dbus/dbus-string.c (_dbus_string_base64_decode): append bytes in
15 the reverse order from how I had it
16 (_dbus_string_base64_encode): reverse encoding order. I was
17 basically byteswapping everything during encoding.
19 2003-01-28 Anders Carlsson <andersca@codefactory.se>
21 * dbus/dbus-connection-internal.h:
22 * dbus/dbus-connection.c: (_dbus_connection_add_timeout),
23 (_dbus_connection_remove_timeout):
24 Add functions for adding and removing timeouts.
26 * dbus/dbus-message.c: (dbus_message_new_from_message):
27 Add new function that takes a message and creates an exact
28 copy of it, but with the refcount set to 1.
29 (check_message_handling):
32 * dbus/dbus-server-protected.h:
33 * dbus/dbus-server.c: (_dbus_server_init_base),
34 (_dbus_server_finalize_base), (_dbus_server_add_timeout),
35 (dbus_server_set_timeout_functions):
36 (_dbus_server_remove_timeout):
37 New functions so that a server can add and remove timeouts.
40 Add commented out call to dbus_server_debug_new.
42 * dbus/dbus-timeout.c: (_dbus_timeout_new):
43 Actually set the handler, doh.
45 * dbus/dbus-transport.c: (_dbus_transport_open):
46 Add commented out call to dbus_transport_debug_client_new.
49 Add dbus-transport-debug.[ch] and dbus-server-debug.[ch]
51 2003-01-28 Havoc Pennington <hp@pobox.com>
53 * dbus/dbus-message.c (check_message_handling): function to check
54 on the loaded message, iterates over it etc.
56 2003-01-28 Havoc Pennington <hp@pobox.com>
58 * test/Makefile.am (dist-hook): fix make distdir
60 * dbus/Makefile.am (TESTS_ENVIRONMENT): fix make check
62 2003-01-27 Havoc Pennington <hp@pobox.com>
64 * dbus/dbus-mempool.c (time_for_size): replace printf with
67 * dbus/dbus-message-builder.c (_dbus_message_data_load): allow
68 empty lines; fix the SAVE_LENGTH stuff to be
69 START_LENGTH/END_LENGTH so it actually works; couple other
72 * test/Makefile.am (dist-hook): add dist-hook for .message files
74 * dbus/dbus-string.c (DBUS_STRING_COPY_PREAMBLE): source of a copy
75 can be constant or locked.
76 (_dbus_string_free): allow freeing a const string as
79 * dbus/dbus-sysdeps.c (_dbus_concat_dir_and_file): utility
81 * dbus/dbus-test-main.c (main): take an argument which is the
82 directory containing test data
84 * dbus/dbus-message.c (_dbus_message_test): pass a test_data_dir
85 argument to this and load all the messages in test/data/
86 checking that they can be loaded or not loaded as appropriate.
88 2003-01-27 Anders Carlsson <andersca@codefactory.se>
90 * bus/dispatch.c: (bus_dispatch_message_handler):
91 Dispatch messages sent to services.
93 * bus/driver.c: (bus_driver_send_service_deleted),
94 (bus_driver_send_service_created), (bus_driver_send_service_lost),
95 (bus_driver_send_service_acquired):
96 Add helper functions for sending service related messages.
98 (bus_driver_send_welcome_message):
99 Send HELLO_REPLY instead of WELCOME.
101 (bus_driver_handle_list_services):
102 Send LIST_SERVICES_REPLY instead of SERVICES.
104 (bus_driver_handle_own_service),
105 (bus_driver_handle_service_exists):
106 New message handlers.
108 (bus_driver_handle_message):
109 Invoke new message handlers.
111 (bus_driver_remove_connection):
112 Don't remove any services here since that's done automatically
113 by bus_service_remove_owner now.
116 New function signatures.
118 * bus/services.c: (bus_service_add_owner):
119 Send ServiceAcquired message if we're the only primary owner.
121 (bus_service_remove_owner):
122 Send ServiceAcquired/ServiceLost messages.
124 (bus_service_set_prohibit_replacement),
125 (bus_service_get_prohibit_replacement):
126 Functions for setting prohibit replacement.
128 (bus_service_has_owner):
129 New function that checks if a connection is in the owner queue of
133 Add new function signatures.
135 * dbus/dbus-list.c: (_dbus_list_test):
136 Add tests for _dbus_list_remove_last and traversing the list backwards.
139 Fix a typo in _dbus_list_get_prev_link, if we're at the first element we can't
140 go any further, so return NULL then.
142 * dbus/dbus-protocol.h:
143 Add new messages, service flags and service replies.
145 2003-01-26 Havoc Pennington <hp@pobox.com>
147 * dbus/dbus-message-builder.c: implement, completely untested.
149 * test/data/*: add data to be used in testing.
150 ".message" files are our simple loadable text format.
151 ".message-raw" will be binary dumps of messages.
153 * dbus/dbus-string.c (_dbus_string_starts_with_c_str): new
155 2003-01-26 Havoc Pennington <hp@pobox.com>
157 * dbus/dbus-sysdeps.c (_dbus_file_get_contents): new function
159 * dbus/dbus-errors.c (dbus_result_to_string): add
162 * dbus/dbus-message-builder.c: new file, will contain code to load
163 up messages from files. Not implemented yet.
165 2003-01-26 Havoc Pennington <hp@pobox.com>
167 * dbus/dbus-message.c (dbus_message_set_sender): support deleting
168 the sender by setting to NULL
170 2003-01-26 Havoc Pennington <hp@pobox.com>
172 The unit tests pass, but otherwise untested. If it breaks, the
173 tests should have been better. ;-)
175 * bus/driver.c (bus_driver_handle_hello): return if we disconnect
178 * dbus/dbus-message.c: redo everything so we maintain
179 message->header as the only copy of the various fields.
180 This avoids the possibility of out-of-memory in some cases,
181 for example dbus_message_lock() can't run out of memory anymore,
182 and avoids extra copying. Figured I may as well go ahead and do
183 this since it was busted for dbus_message_lock to not return
184 failure on OOM, and dbus_message_write_header was totally
185 unchecked for OOM. Also fixed some random other bugs.
187 * dbus/dbus-marshal.c (_dbus_marshal_get_field_end_pos): verify
188 that strings are nul-terminated. Also, end_pos can be equal
189 to string length just not greater than, I think.
190 (_dbus_marshal_set_int32): new function
191 (_dbus_marshal_set_uint32): new function
192 (_dbus_marshal_set_string): new function
194 * dbus/dbus-connection.c (_dbus_connection_new_for_transport): fix
195 a warning, init timeout_list to NULL
196 (dbus_connection_send_message): don't use uninitialized variable
199 * dbus/dbus-string.c (_dbus_string_replace_len): new function
201 2003-01-26 Anders Carlsson <andersca@codefactory.se>
203 * bus/driver.c: (bus_driver_handle_hello),
204 (bus_driver_send_welcome_message):
207 2003-01-26 Anders Carlsson <andersca@codefactory.se>
209 * dbus/dbus-auth.c: (process_auth), (_dbus_auth_unref):
210 * dbus/dbus-connection.c: (_dbus_connection_new_for_transport),
211 (dbus_connection_unref):
212 * dbus/dbus-marshal.c: (_dbus_marshal_test):
213 * dbus/dbus-message.c: (dbus_message_unref),
216 (dbus_message_get_fields):
217 Remove debugging printout.
219 (_dbus_message_loader_return_buffer):
220 Don't store the header string.
222 (_dbus_message_test):
225 2003-01-26 Richard Hult <rhult@codefactory.se>
227 * glib/dbus-gmain.c (dbus_connection_dispatch): Traverse a copy of
228 the file descriptor list, since it can change under us.
230 2003-01-25 Anders Carlsson <andersca@codefactory.se>
232 * glib/dbus-gmain.c: (dbus_connection_prepare),
233 (dbus_connection_check), (dbus_connection_dispatch), (add_watch),
234 (remove_watch), (dbus_connection_hookup_with_g_main):
235 Rewrite the glib handling to use its own GSource instead of a
236 GIOChannel so we can catch messages put in the queue while waiting
239 2003-01-25 Anders Carlsson <andersca@codefactory.se>
242 * bus/connection.c: (connection_disconnect_handler),
243 (connection_watch_callback), (bus_connection_setup):
244 * bus/dispatch.c: (send_one_message),
245 (bus_dispatch_broadcast_message), (bus_dispatch_message_handler),
246 (bus_dispatch_add_connection), (bus_dispatch_remove_connection):
248 * bus/driver.c: (bus_driver_send_service_deleted),
249 (bus_driver_send_service_created), (bus_driver_handle_hello),
250 (bus_driver_send_welcome_message),
251 (bus_driver_handle_list_services), (bus_driver_remove_connection),
252 (bus_driver_handle_message):
254 Refactor code, put the message dispatching in its own file. Use
255 _DBUS_HANDLE_OOM. Also send ServiceDeleted messages when a client
258 2003-01-25 Anders Carlsson <andersca@codefactory.se>
260 * dbus/dbus-internals.h:
261 Add _DBUS_HANDLE_OOM macro, it doesn't do anything currently.
263 * dbus/dbus-message.c: (dbus_message_get_sender):
264 * dbus/dbus-message.h:
265 Implement dbus_message_get_sender.
267 * dbus/dbus-protocol.h:
268 Add message and service defines.
270 2003-01-25 Anders Carlsson <andersca@codefactory.se>
272 * dbus/dbus-connection.c: (dbus_connection_send_message):
273 * dbus/dbus-message-internal.h:
274 * dbus/dbus-message.c: (_dbus_message_get_client_serial),
275 (dbus_message_write_header):
276 Remove _dbus_messag_unlock and don't set the client serial on a
277 message if one already exists.
279 2003-01-24 Havoc Pennington <hp@pobox.com>
281 * dbus/dbus-list.c (alloc_link): put a thread lock on the global
284 * bus/driver.c (bus_driver_handle_list_services): fix a leak
287 2003-01-25 Anders Carlsson <andersca@codefactory.se>
289 * dbus/dbus-list.c: (alloc_link), (free_link):
290 Use a memory pool for the links.
292 2003-01-25 Anders Carlsson <andersca@codefactory.se>
294 * bus/connection.c: (bus_connection_foreach):
296 Add new bus_connection_foreach function.
298 * bus/driver.c: (send_one_message), (bus_driver_broadcast_message):
299 Add function that broadcasts a message to all clients.
301 (bus_driver_send_service_created), (bus_driver_handle_hello),
302 (bus_driver_send_welcome_message),
303 (bus_driver_handle_list_services), (bus_driver_message_handler):
304 Implement functions that take care of listing services, and notifying
305 clients when new services are created.
307 * bus/services.c: (bus_services_list):
309 Add new function that returns an array of strings with the currently
314 Update copyright year.
316 2003-01-25 Anders Carlsson <andersca@codefactory.se>
318 * dbus/dbus-connection.c: (dbus_connection_send_message):
319 Unlock the message in case it was sent earlier.
321 (dbus_connection_send_message_with_reply_and_block):
322 Remove the reply message from the list.
324 * dbus/dbus-marshal.c: (_dbus_demarshal_string_array):
325 Set array_len and new_pos correctly.
327 (_dbus_marshal_test):
330 * dbus/dbus-message-internal.h:
331 * dbus/dbus-message.c: (_dbus_message_get_reply_serial):
332 New function that returns the reply serial.
334 (_dbus_message_unlock):
335 New function that unlocks a message and resets its header.
337 (dbus_message_append_string_array),
338 (dbus_message_get_fields_valist),
339 (dbus_message_iter_get_field_type),
340 (dbus_message_iter_get_string_array),
341 (dbus_message_get_fields),
342 (dbus_message_append_fields_valist):
343 Handle string arrays.
345 (dbus_message_set_sender):
346 Make this function public since the bus daemon needs it.
348 (decode_header_data):
349 Set the reply serial to -1 initially.
351 * dbus/dbus-message.h:
352 Add dbus_message_set_sender.
354 2003-01-24 Havoc Pennington <hp@pobox.com>
356 * doc/dbus-specification.sgml: add some stuff
358 2003-01-22 Havoc Pennington <hp@pobox.com>
360 * doc/dbus-specification.sgml: Start to document the protocol.
362 2003-01-22 Havoc Pennington <hp@pobox.com>
364 * dbus/dbus-connection.c
365 (dbus_connection_send_message_with_reply_and_block): add some @todo
367 * bus/driver.c (bus_driver_add_connection): add a FIXME about memleak
369 2003-01-21 Havoc Pennington <hp@pobox.com>
371 (patch untested because can't compile)
373 * bus/driver.c (create_unique_client_name): make this function
374 never recycle client names. Also, caller should initialize
377 * dbus/dbus-sysdeps.c (_dbus_get_current_time): new function
379 2003-01-21 Anders Carlsson <andersca@codefactory.se>
381 * dbus/dbus-marshal.c: (_dbus_marshal_double),
382 (_dbus_marshal_int32), (_dbus_marshal_uint32),
383 (_dbus_marshal_int32_array), (_dbus_marshal_uint32_array),
384 (_dbus_marshal_double_array), (_dbus_marshal_string_array),
385 (_dbus_demarshal_int32_array), (_dbus_demarshal_uint32_array),
386 (_dbus_demarshal_double_array), (_dbus_demarshal_string_array),
387 (_dbus_marshal_get_field_end_pos), (_dbus_marshal_test):
388 * dbus/dbus-marshal.h:
389 * dbus/dbus-protocol.h:
390 Add support for marshalling and demarshalling integer, double
393 2003-01-21 Anders Carlsson <andersca@codefactory.se>
398 * bus/connection.c: (connection_disconnect_handler):
399 Remove the connection from the bus driver's list.
401 (connection_watch_callback): Dispatch messages.
403 (free_connection_data): Free connection name.
405 (bus_connection_setup): Add connection to the bus driver's list.
406 (bus_connection_remove_owned_service):
407 (bus_connection_set_name), (bus_connection_get_name):
408 Add functions for setting and getting the connection's name.
411 Add function headers.
413 * bus/driver.c: (create_unique_client_name),
414 (bus_driver_handle_hello_message),
415 (bus_driver_send_welcome_message), (bus_driver_message_handler),
416 (bus_driver_add_connection), (bus_driver_remove_connection):
419 * bus/services.c: (bus_service_free):
421 New file that handles communication and registreation with the bus
424 2003-01-21 Anders Carlsson <andersca@codefactory.se>
426 * dbus/dbus-connection.c: (dbus_connection_send_message):
427 Add a new client_serial parameter.
429 (dbus_connection_send_message_with_reply):
430 Remove a @todo since we've implemented the blocking function.
432 (dbus_connection_send_message_with_reply_and_block):
433 New function that sends a message and waits for a reply and
434 then returns the reply.
436 * dbus/dbus-connection.h:
439 * dbus/dbus-errors.c: (dbus_result_to_string):
440 * dbus/dbus-errors.h:
443 * dbus/dbus-message-internal.h:
444 * dbus/dbus-message.c: (_dbus_message_get_reply_serial),
445 (_dbus_message_set_sender), (dbus_message_write_header),
446 (dbus_message_new_reply), (decode_header_data),
447 (_dbus_message_loader_return_buffer), (_dbus_message_test):
448 * dbus/dbus-message.h:
449 Add new functions that set the reply serial and sender.
450 Also marshal and demarshal them correctly and add test.
452 * dbus/dbus-protocol.h:
453 Add new DBUS_MESSAGE_TYPE_SENDER.
456 * glib/dbus-gmain.c: (watch_callback), (free_callback_data),
457 (add_watch), (remove_watch), (add_timeout), (remove_timeout),
458 (dbus_connection_hookup_with_g_main):
459 * glib/test-dbus-glib.c: (main):
460 Rewrite to use GIOChannel and remove the GSource crack.
462 * test/echo-client.c: (main):
463 * test/watch.c: (check_messages):
464 Update for changed APIs
466 2003-01-19 Anders Carlsson <andersca@codefactory.se>
468 * dbus/Makefile.am: Add dbus-timeout.[cħ]
470 * dbus/dbus-connection.c: (_dbus_connection_new_for_transport):
471 Create a DBusTimeoutList.
472 (dbus_connection_set_timeout_functions): Add new function to
473 set timeout callbacks
475 * dbus/dbus-connection.h: Add public DBusTimeout API.
477 * dbus/dbus-message.c: (dbus_message_get_service):
478 * dbus/dbus-message.h: New function.
480 * dbus/dbus-server.c: Fix small doc typo.
482 * dbus/dbus-timeout.[ch]: New files for mainloop timeouts.
484 2003-01-19 Anders Carlsson <andersca@codefactory.se>
486 * dbus/dbus-string.c (_dbus_string_move_len): Don't delete all
487 of the string, just as long as specified.
489 2003-01-19 Havoc Pennington <hp@pobox.com>
491 * dbus/dbus-connection.c (dbus_connection_get_is_authenticated):
494 * dbus/dbus-server.c (dbus_server_set_max_connections)
495 (dbus_server_get_max_connections, dbus_server_get_n_connections):
496 keep track of current number of connections, and add API for
497 setting a max (but haven't implemented enforcing the max yet)
499 2003-01-18 Havoc Pennington <hp@pobox.com>
501 * dbus/dbus-transport-unix.c (unix_do_iteration): only do the
502 reading/writing if read_watch != NULL or write_watch != NULL.
504 * dbus/dbus-message.c (_dbus_message_loader_return_buffer): fix
505 the message loader code to actually load message->header and
506 message->body into the newly-created message.
508 * dbus/dbus-transport-unix.c (check_write_watch): fix a mem leak
511 * dbus/dbus-connection.c (dbus_connection_set_max_message_size)
512 (dbus_connection_get_max_message_size)
513 (dbus_connection_set_max_live_messages_size)
514 (dbus_connection_get_max_live_messages_size): implement some
515 resource limitation functions
517 * dbus/dbus-resources.c: new file implementing some of the
518 resource limits stuff
520 * dbus/dbus-message.c (dbus_message_iter_get_byte_array): add
521 missing docs, add @todo to handle OOM etc.
523 * dbus/dbus-marshal.c (_dbus_demarshal_byte_array): add missing
526 2003-01-18 Havoc Pennington <hp@pobox.com>
528 * dbus/dbus-connection.c (dbus_connection_unref): disconnect the
529 connection if it hasn't been already.
531 * dbus/dbus-connection.h: kill off the idea of an ErrorFunction,
532 replace with DisconnectFunction.
534 2003-01-18 Havoc Pennington <hp@pobox.com>
536 Building --disable-verbose-mode --disable-asserts --disable-tests
537 cuts the library from 112K to 45K or so
539 * configure.in: check for varargs macro support,
540 add --enable-verbose-mode, --enable-asserts.
542 * dbus/dbus-internals.h (_dbus_assert): support
544 (_dbus_verbose): support DBUS_ENABLE_VERBOSE_MODE
546 2003-01-18 Havoc Pennington <hp@pobox.com>
548 * dbus/dbus-test.c: include config.h so that tests actually run
550 * dbus/dbus-string.c: add assertions that stuff is 8-byte aligned,
551 so the failure mode when that assumption fails will be plenty
554 2003-01-18 Havoc Pennington <hp@pobox.com>
556 * configure.in: default --enable-tests to $USE_MAINTAINER_MODE
558 * dbus/Makefile.am: fix it up so dubs-test-main.c is included in
561 * test/Makefile.am: don't use special variable "TESTS" for echo-*
562 since we don't want to use those in make check
564 2003-01-15 Havoc Pennington <hp@redhat.com>
570 2003-01-15 Havoc Pennington <hp@redhat.com>
572 * test/Makefile.am: fix so that test source code ends up in the
573 distribution on make distcheck
575 2003-01-15 Havoc Pennington <hp@redhat.com>
581 2003-01-15 Havoc Pennington <hp@redhat.com>
583 * dbus/dbus-test.c (dbus_internal_symbol_do_not_use_run_tests):
584 fix build when --disable-tests
586 * Makefile.am (EXTRA_DIST): put HACKING in here
588 * HACKING: document procedure for making a tarball release.
590 2003-01-14 Anders Carlsson <andersca@codefactory.se>
592 * bus/connection.c: (connection_error_handler),
593 (bus_connection_setup):
594 * bus/main.c: (main):
595 Make sure that the DBusConnectionData struct is NULLed
596 out to prevent a segfault.
598 * dbus/dbus-errors.c: (dbus_result_to_string):
599 * dbus/dbus-errors.h:
600 * dbus/dbus-message.c: (dbus_message_get_fields),
601 (dbus_message_get_fields_valist), (_dbus_message_test):
602 * dbus/dbus-message.h:
603 Make dbus_message_get_fields return a result code so we can
604 track invalid fields as well as oom.
606 2003-01-11 Havoc Pennington <hp@pobox.com>
608 * configure.in: change --enable-test/--enable-ansi action-if-given
609 to enable_foo=$enableval instead of enable_foo=yes
611 2003-01-08 Havoc Pennington <hp@pobox.com>
613 * dbus/dbus-string.c (_dbus_string_align_length): new function
615 * dbus/dbus-test-main.c: move main() for test app here
617 (dbus_internal_symbol_do_not_use_run_tests): we have to export a
618 symbol to run tests, because dbus-test isn't in the main
621 Code review nitpicks.
623 * dbus/dbus-message.c (dbus_message_write_header): add newlines
624 for people with narrow emacs ;-). Assert client_serial was filled
625 in. Assert message->name != NULL.
626 (dbus_message_append_fields): have "first_field_type" arg separate
627 from va list, needed for C++ binding that also uses varargs IIRC
628 and helps with type safety
629 (dbus_message_new): add @todo about using DBusString to store
630 service/name internally
631 (dbus_message_new): don't leak ->service and ->name on OOM later
633 (dbus_message_unref): free the service name
634 (dbus_message_get_fields): same change to varargs
635 i.e. first_field_type
636 (_dbus_message_loader_return_buffer): assert that the message data
637 is aligned (if not it's a bug in our code). Put in verbose griping
638 about why we set corrupted = TRUE.
639 (decode_header_data): add FIXME that char* is evil. Was going to
640 add FIXME about evil locale-specific string.h strncmp, but just
641 switched to wacky string-as-uint32 optimization. Move check for
642 "no room for field name" above get_const_data_len() to avoid
643 assertion failure in get_const_data_len if we have trailing 2
644 bytes or the like. Check for service and name fields being
645 provided twice. Don't leak service/name on error. Require field
646 names to be aligned to 4 bytes.
648 * dbus/dbus-marshal.c: move byte swap stuff to header
649 (_dbus_pack_int32): uscore-prefix
650 (_dbus_unpack_int32): uscore-prefix
651 (_dbus_unpack_uint32): export
652 (_dbus_demarshal_string): add @todo complaining about use of
654 (_dbus_marshal_get_field_end_pos): add @todo about bad error
655 handling allowing corrupt data to go unchecked
657 2003-01-08 Havoc Pennington <hp@redhat.com>
659 * dbus/dbus-transport-unix.c (unix_do_iteration): add read/write
660 to the select() as needed for authentication. (should be using
661 _dbus_poll() not select, but for another day)
663 * dbus/dbus.h: include dbus/dbus-protocol.h
665 2003-01-08 Anders Carlsson <andersca@codefactory.se>
667 * dbus/Makefile.am (dbusinclude_HEADERS): Install
670 2003-01-08 Anders Carlsson <andersca@codefactory.se>
672 * dbus/dbus-internals.c: (_dbus_type_to_string):
673 New function that returns a string describing a type.
675 * dbus/dbus-marshal.c: (_dbus_demarshal_byte_array):
676 * dbus/dbus-marshal.h:
677 * dbus/dbus-message.c: (dbus_message_get_fields_valist),
678 (dbus_message_iter_get_field_type), (dbus_message_iter_get_double),
679 (dbus_message_iter_get_byte_array):
680 * dbus/dbus-message.h:
681 Add new convenience functions for appending and getting message fields.
682 Also add demarshalling routines for byte arrays.
684 2003-01-07 Anders Carlsson <andersca@codefactory.se>
686 * dbus/dbus-connection-internal.h:
687 * dbus/dbus-connection.c: (_dbus_connection_new_for_transport),
688 (_dbus_connection_get_next_client_serial),
689 (dbus_connection_send_message):
690 * dbus/dbus-internals.h:
691 * dbus/dbus-marshal.c: (unpack_uint32), (dbus_unpack_int32),
692 (dbus_pack_int32), (_dbus_marshal_double), (_dbus_marshal_int32),
693 (_dbus_marshal_uint32), (_dbus_demarshal_double),
694 (_dbus_demarshal_int32), (_dbus_demarshal_uint32),
695 (_dbus_demarshal_string), (_dbus_marshal_get_field_end_pos),
696 (_dbus_verbose_bytes), (_dbus_marshal_test):
697 * dbus/dbus-marshal.h:
698 * dbus/dbus-message-internal.h:
699 * dbus/dbus-message.c: (_dbus_message_set_client_serial),
700 (dbus_message_write_header), (_dbus_message_lock),
701 (dbus_message_new), (dbus_message_ref), (dbus_message_unref),
702 (dbus_message_get_name), (dbus_message_append_int32),
703 (dbus_message_append_uint32), (dbus_message_append_double),
704 (dbus_message_append_string), (dbus_message_append_byte_array),
705 (dbus_message_get_fields_iter), (dbus_message_iter_ref),
706 (dbus_message_iter_unref), (dbus_message_iter_has_next),
707 (dbus_message_iter_next), (dbus_message_iter_get_field_type),
708 (dbus_message_iter_get_string), (dbus_message_iter_get_int32),
709 (dbus_message_iter_get_uint32), (dbus_message_iter_get_double),
710 (decode_header_data), (_dbus_message_loader_return_buffer),
711 (message_iter_test), (_dbus_message_test):
712 * dbus/dbus-message.h:
713 * dbus/dbus-protocol.h:
714 * dbus/dbus-test.c: (main):
716 * glib/test-dbus-glib.c: (message_handler), (main):
717 * test/echo-client.c: (main):
718 * test/watch.c: (check_messages):
719 Make messages sendable and receivable for real.
721 2003-01-07 Anders Carlsson <andersca@codefactory.se>
723 * dbus/dbus-marshal.c: (_dbus_marshal_double),
724 (_dbus_marshal_string), (_dbus_marshal_byte_array):
725 * dbus/dbus-message.c: (dbus_message_append_int32),
726 (dbus_message_append_uint32), (dbus_message_append_double),
727 (dbus_message_append_string), (dbus_message_append_byte_array):
728 Handle OOM restoration.
730 2003-01-07 Anders Carlsson <andersca@codefactory.se>
732 * dbus/dbus-marshal.c: (_dbus_marshal_string),
733 (_dbus_demarshal_string), (_dbus_marshal_test):
734 * dbus/dbus-marshal.h:
735 * dbus/dbus-message.c: (dbus_message_get_name),
736 Document these functions.
738 (dbus_message_append_int32), (dbus_message_append_uint32),
739 (dbus_message_append_double), (dbus_message_append_string),
740 (dbus_message_append_byte_array):
741 * dbus/dbus-message.h:
742 Add functions for adding message fields of different types.
744 * dbus/dbus-protocol.h:
745 Add the different types.
747 2003-01-05 Havoc Pennington <hp@pobox.com>
749 * bus/connection.c: implement routines for handling connections,
750 first thing is keeping a list of owned services on each connection
751 and setting up watches etc.
753 * bus/services.c: implement a mapping from service names to lists
756 * dbus/dbus-hash.c: add DBUS_HASH_POINTER
758 * dbus/dbus-threads.c (dbus_static_mutex_lock): add functions
759 to use static mutexes for global data
761 * dbus/dbus-connection.c (dbus_connection_set_data): add new
762 collection of functions to set/get application-specific data
763 on the DBusConnection.
765 2003-01-04 Havoc Pennington <hp@pobox.com>
767 * dbus/dbus-sysdeps.c (_dbus_sleep_milliseconds): new function
768 (_dbus_poll): new function
770 * dbus/dbus-internals.h (_DBUS_STRUCT_OFFSET): new macro
773 * bus/loop.c: initial code for the daemon main loop
775 2003-01-04 Havoc Pennington <hp@pobox.com>
777 * test/watch.c (error_handler): make it safe if the error handler
778 is called multiple times (if we s/error handler/disconnect
779 handler/ we should just guarantee it's called only once)
781 * dbus/dbus-transport.c (_dbus_transport_disconnect): call the
782 error handler on disconnect (it's quite possible we should
783 just change the error handler to a "disconnect handler," I'm
784 not sure we have any other meaningful errors)
786 * configure.in: check for getpwnam_r
788 * dbus/dbus-transport.c, dbus/dbus-transport-unix.c,
789 dbus/dbus-auth.c: add credentials support, add EXTERNAL auth
790 mechanism as in SASL spec, using socket credentials
792 * dbus/dbus-sysdeps.c (_dbus_read_credentials_unix_socket): new function
793 (_dbus_send_credentials_unix_socket): new function
795 * dbus/dbus-sysdeps.c (_dbus_accept_unix_socket): rename just
797 (_dbus_write): only check errno if <0 returned
798 (_dbus_write_two): ditto
800 2003-01-02 Anders Carlsson <andersca@codefactory.se>
802 * dbus/dbus-marshal.c: (_dbus_marshal_utf8_string),
803 (_dbus_marshal_byte_array), (_dbus_demarshal_utf8_string),
804 (_dbus_marshal_test):
805 * dbus/dbus-marshal.h:
806 Add _dbus_marshal_byte_array and rename _dbus_marshal_string
807 to _dbus_marshal_utf8_string. Also fix some tests.
809 2002-12-28 Harri Porten <porten@kde.org>
811 * configure.in: added check for C++ compiler and a very cheesy
812 check for the Qt integration
814 * Makefile.am (SUBDIRS): compile qt subdir if support is enabled
816 * qt/Makefile.am: added
818 * qt/.cvsignore: added
820 * qt/dbus-qthread.cc, qt/dbus-qthread.cpp: renamed former to
821 latter, added #ifdef QT_THREAD_SUPPORT guard.
823 * dbus/Makefile.am: added missing headers for make dist
825 2002-12-28 Kristian Rietveld <kris@gtk.org>
827 * dbus/Makefile.am: fixup export-symbols-regex.
829 2002-12-27 Anders Carlsson <andersca@codefactory.se>
831 * acinclude.m4: Add this file and put the
832 PKG_CHECK_MODULE macro in it.
834 2002-12-27 Anders Carlsson <andersca@codefactory.se>
836 * dbus/dbus-marshal.c: (_dbus_marshal_string),
837 (_dbus_demarshal_double), (_dbus_demarshal_int32),
838 (_dbus_demarshal_uint32), (_dbus_demarshal_string),
839 (_dbus_marshal_test):
840 Make the demarshalling routines align the pos argument.
841 Add string marshalling tests and fix the obvious bugs
844 2002-12-26 Havoc Pennington <hp@pobox.com>
846 * dbus/dbus-auth.c: fixes fixes fixes
848 * dbus/dbus-transport-unix.c: wire up support for
849 encoding/decoding data on the wire
851 * dbus/dbus-auth.c (_dbus_auth_encode_data)
852 (_dbus_auth_decode_data): append to target string
853 instead of nuking it.
855 2002-12-26 Havoc Pennington <hp@pobox.com>
857 * dbus/dbus-marshal.h (DBUS_COMPILER_BYTE_ORDER): #ifdef
858 WORDS_BIGENDIAN then compiler byte order is DBUS_BIG_ENDIAN,
861 * dbus/dbus-marshal.c: Add macros to do int swapping in-place and
862 avoid swap_bytes() overhead (ignoring possible assembly stuff for
863 now). Main point is because I wanted unpack_uint32 to implement
865 (_dbus_verbose_bytes): new function
867 * dbus/dbus-string.c (_dbus_string_validate_ascii): new function
869 * dbus/dbus-message.c (_dbus_message_loader_get_is_corrupted): add
870 mechanism to handle a corrupt message stream
871 (_dbus_message_loader_new): fix preallocation to only prealloc,
874 * dbus/dbus-string.c (_dbus_string_skip_blank): fix this function
875 (_dbus_string_test): enhance tests for copy/move and fix the
878 * dbus/dbus-transport-unix.c: Hold references in more places to
879 avoid reentrancy problems
881 * dbus/dbus-transport.c: ditto
883 * dbus/dbus-connection.c (dbus_connection_dispatch_message): don't
884 leak reference count in no-message case
886 * test/watch.c (do_mainloop): handle adding/removing watches
887 during iteration over the watches. Also, ref the connection/server
888 stored on a watch, so we don't try to mangle a destroyed one.
890 * dbus/dbus-transport-unix.c (do_authentication): perform
893 * dbus/dbus-auth.c (get_state): add a state
894 AUTHENTICATED_WITH_UNUSED_BYTES and return it if required
895 (_dbus_auth_get_unused_bytes): append the unused bytes
896 to the passed in string, rather than prepend
898 * dbus/dbus-transport.c (_dbus_transport_init_base): create
899 the auth conversation DBusAuth
901 * dbus/dbus-transport-unix.c (_dbus_transport_new_for_fd)
902 (_dbus_transport_new_for_domain_socket): when creating a
903 transport, pass in whether it's a client-side or server-side
904 transport so we know which DBusAuth to create
906 2002-12-03 Havoc Pennington <hp@pobox.com>
908 * dbus/dbus-transport-unix.c (unix_finalize): finalize base
909 _after_ finalizing the derived members
910 (unix_connection_set): unref watch if we fail to add it
912 * dbus/dbus-connection.c (dbus_connection_unref): delete the
913 transport first, so that the connection owned by the
914 transport will be valid as the transport finalizes.
916 * dbus/dbus-transport-unix.c (unix_finalize): free the write_watch
917 if necessary, and remove watches from the connection.
919 * dbus/dbus-watch.c (_dbus_watch_list_free): improve a comment
921 2002-12-26 Anders Carlsson <andersca@codefactory.se>
923 * dbus/dbus-marshal.c: (_dbus_marshal_string),
924 (_dbus_demarshal_double), (_dbus_demarshal_int32),
925 (_dbus_demarshal_uint32), (_dbus_demarshal_string),
926 (_dbus_marshal_test):
927 * dbus/dbus-marshal.h:
928 Add string marshal functions and have the demarshal functions
929 return the new position.
931 2002-12-25 Havoc Pennington <hp@pobox.com>
933 * doc/dbus-sasl-profile.txt: docs on the authentication protocol,
934 it is a simple protocol that just maps directly to SASL.
936 * dbus/dbus-auth.h, dbus/dbus-auth.c: authentication protocol
937 initial implementation, not actually used yet.
939 * dbus/dbus-string.c (_dbus_string_find): new function
940 (_dbus_string_equal): new function
941 (_dbus_string_base64_encode): new function
942 (_dbus_string_base64_decode): new function
944 2002-12-25 Anders Carlsson <andersca@codefactory.se>
947 * dbus/dbus-marshal.c: (swap_bytes), (_dbus_marshal_double),
948 (_dbus_marshal_int32), (_dbus_marshal_uint32),
949 (_dbus_demarshal_double), (_dbus_demarshal_int32),
950 (_dbus_demarshal_uint32), (_dbus_marshal_test):
951 * dbus/dbus-marshal.h:
952 * dbus/dbus-protocol.h:
953 * dbus/dbus-test.c: (main):
955 Add un-optimized marshalling/demarshalling routines.
957 2002-12-25 Harri Porten <porten@kde.org>
959 * qt/dbus-qt.h: adjusted ctor and getter to KDE/Qt conventions
961 2002-12-24 Zack Rusin <zack@kde.org>
963 * qt/dbus-qthread.cc: adding - integrates QMutex into Dbus
964 * qt/dbus-qt.h: skeleton with two sample implemenatation of the
967 2002-12-24 Havoc Pennington <hp@pobox.com>
969 * glib/dbus-gthread.c: fix include
971 * glib/dbus-glib.h: rename DBusMessageHandler for now.
972 I think glib API needs to change, though, as you don't
973 want to use DBusMessageFunction, you want to use the
974 DBusMessageHandler object. Probably
975 dbus_connection_open_with_g_main_loop()
976 and dbus_connection_setup_g_main_loop() or something like that
977 (but think of better names...) that just create a connection
978 that has watch/timeout functions etc. already set up.
980 * dbus/dbus-connection.c
981 (dbus_connection_send_message_with_reply): new function just to
982 show how the message handler helps us deal with replies.
984 * dbus/dbus-list.c (_dbus_list_remove_last): new function
986 * dbus/dbus-string.c (_dbus_string_test): free a string that
989 * dbus/dbus-hash.c: use memory pools for the hash entries
990 (rebuild_table): be more paranoid about overflow, and
991 shrink table when we can
992 (_dbus_hash_test): reduce number of sprintfs and write
993 valid C89. Add tests for case where we grow and then
994 shrink the hash table.
996 * dbus/dbus-mempool.h, dbus/dbus-mempool.c: memory pools
998 * dbus/dbus-connection.c (dbus_connection_register_handler)
999 (dbus_connection_unregister_handler): new functions
1001 * dbus/dbus-message.c (dbus_message_get_name): new
1003 * dbus/dbus-list.c: fix docs typo
1005 * dbus/dbus-message-handler.h, dbus/dbus-message-handler.c:
1006 an object representing a handler for messages.
1008 2002-12-16 Anders Carlsson <andersca@codefactory.se>
1011 * glib/dbus-gthread.c: (dbus_gthread_init):
1012 Don't use the gdbus prefix for public functions.
1014 2002-12-16 Anders Carlsson <andersca@codefactory.se>
1018 Add GLib checks and fixup .pc files
1022 * glib/dbus-gmain.c: (gdbus_connection_prepare),
1023 (gdbus_connection_check), (gdbus_connection_dispatch),
1024 (gdbus_add_connection_watch), (gdbus_remove_connection_watch),
1025 (dbus_connection_gsource_new):
1026 * glib/dbus-gthread.c: (dbus_gmutex_new), (dbus_gmutex_free),
1027 (dbus_gmutex_lock), (dbus_gmutex_unlock), (dbus_gthread_init):
1028 * glib/test-dbus-glib.c: (message_handler), (main):
1031 2002-12-15 Harri Porten <porten@kde.org>
1033 * autogen.sh: check for libtoolize before attempting to use it
1035 * dbus/dbus-transport-unix.c: include <sys/time.h> for timeval
1038 * .cvsignore: ignore more stamp files
1040 * dbus/dbus-watch.c (_dbus_watch_list_new): fixed doc error
1042 * test/Makefile.am: added -I$(top_srcdir) to be able to compile
1043 without make install.
1045 2002-12-15 Havoc Pennington <hp@pobox.com>
1047 * dbus/dbus-threads.c: add thread stubs that a higher library
1048 layer can fill in. e.g. the GLib wrapper might fill them in with
1049 GThread stuff. We still need to use this thread API to
1050 thread-safe-ize the library.
1052 2002-12-12 Havoc Pennington <hp@pobox.com>
1054 * dbus/dbus-transport-unix.c, dbus/dbus-server-unix.c: use the
1055 below new interfaces and include fewer system headers.
1057 * dbus/dbus-sysdeps.c (_dbus_read): new function
1058 (_dbus_write): new function
1059 (_dbus_write_two): new function
1060 (_dbus_connect_unix_socket): new function
1061 (_dbus_listen_unix_socket): new function
1063 * dbus/dbus-message-internal.h: change interfaces to use
1066 2002-12-11 Havoc Pennington <hp@pobox.com>
1068 * dbus/dbus-types.h: add dbus_unichar
1070 * dbus/dbus-internals.c (_dbus_verbose): use _dbus_getenv
1072 * dbus/dbus-connection.c (dbus_connection_send_message): return
1075 * dbus/dbus-transport.c: include dbus-watch.h
1077 * dbus/dbus-connection.c: include dbus-message-internal.h
1079 * HACKING: add file with coding guidelines stuff.
1081 * dbus/dbus-string.h, dbus/dbus-string.c: Encapsulate all string
1082 handling here, for security purposes (as in vsftpd). Not actually
1083 using this class yet.
1085 * dbus/dbus-sysdeps.h, dbus/dbus-sysdeps.c: Encapsulate all
1086 system/libc usage here, as in vsftpd, for ease of auditing (and
1087 should also simplify portability). Haven't actually moved all the
1088 system/libc usage into here yet.
1090 2002-11-25 Havoc Pennington <hp@pobox.com>
1092 * dbus/dbus-internals.c (_dbus_verbose): fix to not
1093 always print the first verbose message.
1095 2002-11-24 Havoc Pennington <hp@pobox.com>
1097 * test/echo-client.c, test/echo-server.c: cheesy test
1100 * configure.in (AC_CHECK_FUNCS): check for writev
1102 * dbus/dbus-message.c (_dbus_message_get_network_data): new
1105 * dbus/dbus-list.c (_dbus_list_foreach): new function
1107 * dbus/dbus-internals.c (_dbus_verbose): new function
1109 * dbus/dbus-server.c, dbus/dbus-server.h: public object
1110 representing a server that listens for connections.
1112 * dbus/.cvsignore: create
1114 * dbus/dbus-errors.h, dbus/dbus-errors.c:
1115 public API for reporting errors
1117 * dbus/dbus-connection.h, dbus/dbus-connection.c:
1118 public object representing a connection that
1119 sends/receives messages. (Same object used for
1120 both client and server.)
1122 * dbus/dbus-transport.h, dbus/dbus-transport.c:
1123 Basic abstraction for different kinds of stream
1124 that we might read/write messages from.
1126 2002-11-23 Havoc Pennington <hp@pobox.com>
1128 * dbus/dbus-internals.h (_DBUS_INT_MAX): add _DBUS_INT_MIN
1131 * dbus/dbus-test.c (main): add list test, and include
1132 dbus-test.h as intended
1134 * dbus/dbus-hash.c (_dbus_hash_table_remove_string)
1135 (_dbus_hash_table_remove_int): return value indicates
1136 whether the entry existed to remove
1138 * dbus/dbus-list.c: add linked list utility class,
1141 * dbus/dbus-hash.c: add TODO item about shrinking the hash bucket
1144 2002-11-23 Havoc Pennington <hp@pobox.com>
1146 * Doxyfile.in (INCLUDE_FILE_PATTERNS): expand DBUS_BEGIN_DECLS/
1147 DBUS_END_DECLS to nothing, that should fix this once and for all
1149 * Doxyfile.in (JAVADOC_AUTOBRIEF): set to YES
1151 * dbus/dbus-message.c, dbus/dbus-hash.c:
1152 add some missing @brief
1154 2002-11-23 Havoc Pennington <hp@pobox.com>
1156 * dbus/dbus-message.h: put semicolons after DEBUG_BEGIN_DECLS
1157 to avoid confusing Doxygen
1159 * dbus/dbus-hash.c: @} not }@
1161 * dbus/dbus-message.c (struct DBusMessage): split out
1164 2002-11-23 Havoc Pennington <hp@pobox.com>
1166 * configure.in: pile on more warning flags if using gcc
1168 * Doxyfile.in (EXTRACT_STATIC): set to NO, so we don't have
1169 to document static functions
1171 * configure.in: add summary to end of configure so it
1172 looks nice and attractive
1174 * dbus/dbus-hash.c: finish implementation and write unit
1177 * configure.in: add --enable-tests to enable unit tests
1179 * dbus/dbus-test.c: test program to run unit tests
1180 for all files in dbus/*, initially runs a test for
1183 * dbus/dbus-internals.h: file to hold some internal utility stuff
1185 2002-11-22 Havoc Pennington <hp@redhat.com>
1187 * dbus/dbus-hash.c: copy in Tcl hash table, not yet
1188 "ported" away from Tcl
1190 * dbus/dbus-types.h: header for types such as dbus_bool_t
1192 2002-11-22 Havoc Pennington <hp@redhat.com>
1194 * dbus/dbus.h: fixups for doc warnings
1196 * Doxyfile.in (FILE_PATTERNS): we need to scan .h to pick up
1198 (QUIET): make it quiet so we can see warnings
1200 * dbus/dbus-memory.c: teach D-BUS to allocate and free memory
1202 2002-11-22 Havoc Pennington <hp@redhat.com>
1204 * Makefile.am: include "Doxyfile" target in all-local
1206 * configure.in: generate the Doxyfile
1208 * Doxyfile.in: move Doxyfile here, so we can use
1209 configure to generate a Doxyfile with the right
1212 2002-11-22 Havoc Pennington <hp@redhat.com>
1214 * dbus/dbus-message.c: move inline docs into .c file
1216 * Doxyfile (OUTPUT_DIRECTORY): move output to doc/api
1217 so all docs are under doc/
1218 (MAN_EXTENSION): generate man pages. Use extension
1219 ".3dbus" which matches ".3qt" on my system,
1220 I guess this is OK, I don't know really.
1221 (FILE_PATTERNS): look for .c files not .h, makes sense
1224 2002-11-22 Havoc Pennington <hp@pobox.com>
1226 * Makefile.am (SUBDIRS): rename subdir "server" to "bus"
1227 because any app can be a server, and any app can be a client,
1228 the bus is a special kind of server.
1230 Thu Nov 21 23:35:31 2002 Zack Rusin <zack@kde.org>
1232 * Doxyfile : adding. Still needs Makefile rules to be generated
1233 automatically (just run "doxygen" in the toplevel dir for now to
1236 * dbus/dbus-message.h : Adding sample docs (javadoc since
1237 resembles gtk-doc a little more)
1239 * dbus/dbus.h : Adding sample docs
1241 2002-11-21 Havoc Pennington <hp@redhat.com>
1243 * dbus/Makefile.am (INCLUDES): define DBUS_COMPILATION
1244 so we can allow ourselves to include files directly,
1245 instead of having to use dbus.h
1247 * dbus/dbus.h: fill in
1249 * dbus/dbus-message.h: sketch out a sample header file.
1250 Include griping if you include it directly instead of
1253 * dbus/dbus-macros.h: new file with macros for extern "C",
1254 TRUE/FALSE, NULL, etc.
1256 * doc/file-boilerplate.c: put include guards in here
1258 2002-11-21 Havoc Pennington <hp@redhat.com>
1260 * doc/file-boilerplate.c: include both AFL and GPL boilerplate.
1262 * COPYING: include the GPL as well, and license code
1263 under both AFL and GPL.
1265 2002-11-21 Havoc Pennington <hp@redhat.com>
1267 * acconfig.h: get rid of this
1269 * autogen.sh (run_configure): add --no-configure option
1271 * configure.in: remove AC_ARG_PROGRAM to make
1272 autoconf complain less. add AC_PREREQ.
1273 add AC_DEFINE third arg.
1275 2002-11-21 Anders Carlsson <andersca@codefactory.se>
1278 Fix references so we can distcheck.
1280 2002-11-21 Havoc Pennington <hp@redhat.com>
1282 * Initial module creation