1 2003-01-28 Havoc Pennington <hp@pobox.com>
3 * dbus/dbus-server-debug.c: Add doc section comments
5 * dbus/dbus-transport-debug.c: add doc section comments
7 2003-01-28 Havoc Pennington <hp@redhat.com>
9 * dbus/dbus-string.c (_dbus_string_base64_decode): append bytes in
10 the reverse order from how I had it
11 (_dbus_string_base64_encode): reverse encoding order. I was
12 basically byteswapping everything during encoding.
14 2003-01-28 Anders Carlsson <andersca@codefactory.se>
16 * dbus/dbus-connection-internal.h:
17 * dbus/dbus-connection.c: (_dbus_connection_add_timeout),
18 (_dbus_connection_remove_timeout):
19 Add functions for adding and removing timeouts.
21 * dbus/dbus-message.c: (dbus_message_new_from_message):
22 Add new function that takes a message and creates an exact
23 copy of it, but with the refcount set to 1.
24 (check_message_handling):
27 * dbus/dbus-server-protected.h:
28 * dbus/dbus-server.c: (_dbus_server_init_base),
29 (_dbus_server_finalize_base), (_dbus_server_add_timeout),
30 (dbus_server_set_timeout_functions):
31 (_dbus_server_remove_timeout):
32 New functions so that a server can add and remove timeouts.
35 Add commented out call to dbus_server_debug_new.
37 * dbus/dbus-timeout.c: (_dbus_timeout_new):
38 Actually set the handler, doh.
40 * dbus/dbus-transport.c: (_dbus_transport_open):
41 Add commented out call to dbus_transport_debug_client_new.
44 Add dbus-transport-debug.[ch] and dbus-server-debug.[ch]
46 2003-01-28 Havoc Pennington <hp@pobox.com>
48 * dbus/dbus-message.c (check_message_handling): function to check
49 on the loaded message, iterates over it etc.
51 2003-01-28 Havoc Pennington <hp@pobox.com>
53 * test/Makefile.am (dist-hook): fix make distdir
55 * dbus/Makefile.am (TESTS_ENVIRONMENT): fix make check
57 2003-01-27 Havoc Pennington <hp@pobox.com>
59 * dbus/dbus-mempool.c (time_for_size): replace printf with
62 * dbus/dbus-message-builder.c (_dbus_message_data_load): allow
63 empty lines; fix the SAVE_LENGTH stuff to be
64 START_LENGTH/END_LENGTH so it actually works; couple other
67 * test/Makefile.am (dist-hook): add dist-hook for .message files
69 * dbus/dbus-string.c (DBUS_STRING_COPY_PREAMBLE): source of a copy
70 can be constant or locked.
71 (_dbus_string_free): allow freeing a const string as
74 * dbus/dbus-sysdeps.c (_dbus_concat_dir_and_file): utility
76 * dbus/dbus-test-main.c (main): take an argument which is the
77 directory containing test data
79 * dbus/dbus-message.c (_dbus_message_test): pass a test_data_dir
80 argument to this and load all the messages in test/data/
81 checking that they can be loaded or not loaded as appropriate.
83 2003-01-27 Anders Carlsson <andersca@codefactory.se>
85 * bus/dispatch.c: (bus_dispatch_message_handler):
86 Dispatch messages sent to services.
88 * bus/driver.c: (bus_driver_send_service_deleted),
89 (bus_driver_send_service_created), (bus_driver_send_service_lost),
90 (bus_driver_send_service_acquired):
91 Add helper functions for sending service related messages.
93 (bus_driver_send_welcome_message):
94 Send HELLO_REPLY instead of WELCOME.
96 (bus_driver_handle_list_services):
97 Send LIST_SERVICES_REPLY instead of SERVICES.
99 (bus_driver_handle_own_service),
100 (bus_driver_handle_service_exists):
101 New message handlers.
103 (bus_driver_handle_message):
104 Invoke new message handlers.
106 (bus_driver_remove_connection):
107 Don't remove any services here since that's done automatically
108 by bus_service_remove_owner now.
111 New function signatures.
113 * bus/services.c: (bus_service_add_owner):
114 Send ServiceAcquired message if we're the only primary owner.
116 (bus_service_remove_owner):
117 Send ServiceAcquired/ServiceLost messages.
119 (bus_service_set_prohibit_replacement),
120 (bus_service_get_prohibit_replacement):
121 Functions for setting prohibit replacement.
123 (bus_service_has_owner):
124 New function that checks if a connection is in the owner queue of
128 Add new function signatures.
130 * dbus/dbus-list.c: (_dbus_list_test):
131 Add tests for _dbus_list_remove_last and traversing the list backwards.
134 Fix a typo in _dbus_list_get_prev_link, if we're at the first element we can't
135 go any further, so return NULL then.
137 * dbus/dbus-protocol.h:
138 Add new messages, service flags and service replies.
140 2003-01-26 Havoc Pennington <hp@pobox.com>
142 * dbus/dbus-message-builder.c: implement, completely untested.
144 * test/data/*: add data to be used in testing.
145 ".message" files are our simple loadable text format.
146 ".message-raw" will be binary dumps of messages.
148 * dbus/dbus-string.c (_dbus_string_starts_with_c_str): new
150 2003-01-26 Havoc Pennington <hp@pobox.com>
152 * dbus/dbus-sysdeps.c (_dbus_file_get_contents): new function
154 * dbus/dbus-errors.c (dbus_result_to_string): add
157 * dbus/dbus-message-builder.c: new file, will contain code to load
158 up messages from files. Not implemented yet.
160 2003-01-26 Havoc Pennington <hp@pobox.com>
162 * dbus/dbus-message.c (dbus_message_set_sender): support deleting
163 the sender by setting to NULL
165 2003-01-26 Havoc Pennington <hp@pobox.com>
167 The unit tests pass, but otherwise untested. If it breaks, the
168 tests should have been better. ;-)
170 * bus/driver.c (bus_driver_handle_hello): return if we disconnect
173 * dbus/dbus-message.c: redo everything so we maintain
174 message->header as the only copy of the various fields.
175 This avoids the possibility of out-of-memory in some cases,
176 for example dbus_message_lock() can't run out of memory anymore,
177 and avoids extra copying. Figured I may as well go ahead and do
178 this since it was busted for dbus_message_lock to not return
179 failure on OOM, and dbus_message_write_header was totally
180 unchecked for OOM. Also fixed some random other bugs.
182 * dbus/dbus-marshal.c (_dbus_marshal_get_field_end_pos): verify
183 that strings are nul-terminated. Also, end_pos can be equal
184 to string length just not greater than, I think.
185 (_dbus_marshal_set_int32): new function
186 (_dbus_marshal_set_uint32): new function
187 (_dbus_marshal_set_string): new function
189 * dbus/dbus-connection.c (_dbus_connection_new_for_transport): fix
190 a warning, init timeout_list to NULL
191 (dbus_connection_send_message): don't use uninitialized variable
194 * dbus/dbus-string.c (_dbus_string_replace_len): new function
196 2003-01-26 Anders Carlsson <andersca@codefactory.se>
198 * bus/driver.c: (bus_driver_handle_hello),
199 (bus_driver_send_welcome_message):
202 2003-01-26 Anders Carlsson <andersca@codefactory.se>
204 * dbus/dbus-auth.c: (process_auth), (_dbus_auth_unref):
205 * dbus/dbus-connection.c: (_dbus_connection_new_for_transport),
206 (dbus_connection_unref):
207 * dbus/dbus-marshal.c: (_dbus_marshal_test):
208 * dbus/dbus-message.c: (dbus_message_unref),
211 (dbus_message_get_fields):
212 Remove debugging printout.
214 (_dbus_message_loader_return_buffer):
215 Don't store the header string.
217 (_dbus_message_test):
220 2003-01-26 Richard Hult <rhult@codefactory.se>
222 * glib/dbus-gmain.c (dbus_connection_dispatch): Traverse a copy of
223 the file descriptor list, since it can change under us.
225 2003-01-25 Anders Carlsson <andersca@codefactory.se>
227 * glib/dbus-gmain.c: (dbus_connection_prepare),
228 (dbus_connection_check), (dbus_connection_dispatch), (add_watch),
229 (remove_watch), (dbus_connection_hookup_with_g_main):
230 Rewrite the glib handling to use its own GSource instead of a
231 GIOChannel so we can catch messages put in the queue while waiting
234 2003-01-25 Anders Carlsson <andersca@codefactory.se>
237 * bus/connection.c: (connection_disconnect_handler),
238 (connection_watch_callback), (bus_connection_setup):
239 * bus/dispatch.c: (send_one_message),
240 (bus_dispatch_broadcast_message), (bus_dispatch_message_handler),
241 (bus_dispatch_add_connection), (bus_dispatch_remove_connection):
243 * bus/driver.c: (bus_driver_send_service_deleted),
244 (bus_driver_send_service_created), (bus_driver_handle_hello),
245 (bus_driver_send_welcome_message),
246 (bus_driver_handle_list_services), (bus_driver_remove_connection),
247 (bus_driver_handle_message):
249 Refactor code, put the message dispatching in its own file. Use
250 _DBUS_HANDLE_OOM. Also send ServiceDeleted messages when a client
253 2003-01-25 Anders Carlsson <andersca@codefactory.se>
255 * dbus/dbus-internals.h:
256 Add _DBUS_HANDLE_OOM macro, it doesn't do anything currently.
258 * dbus/dbus-message.c: (dbus_message_get_sender):
259 * dbus/dbus-message.h:
260 Implement dbus_message_get_sender.
262 * dbus/dbus-protocol.h:
263 Add message and service defines.
265 2003-01-25 Anders Carlsson <andersca@codefactory.se>
267 * dbus/dbus-connection.c: (dbus_connection_send_message):
268 * dbus/dbus-message-internal.h:
269 * dbus/dbus-message.c: (_dbus_message_get_client_serial),
270 (dbus_message_write_header):
271 Remove _dbus_messag_unlock and don't set the client serial on a
272 message if one already exists.
274 2003-01-24 Havoc Pennington <hp@pobox.com>
276 * dbus/dbus-list.c (alloc_link): put a thread lock on the global
279 * bus/driver.c (bus_driver_handle_list_services): fix a leak
282 2003-01-25 Anders Carlsson <andersca@codefactory.se>
284 * dbus/dbus-list.c: (alloc_link), (free_link):
285 Use a memory pool for the links.
287 2003-01-25 Anders Carlsson <andersca@codefactory.se>
289 * bus/connection.c: (bus_connection_foreach):
291 Add new bus_connection_foreach function.
293 * bus/driver.c: (send_one_message), (bus_driver_broadcast_message):
294 Add function that broadcasts a message to all clients.
296 (bus_driver_send_service_created), (bus_driver_handle_hello),
297 (bus_driver_send_welcome_message),
298 (bus_driver_handle_list_services), (bus_driver_message_handler):
299 Implement functions that take care of listing services, and notifying
300 clients when new services are created.
302 * bus/services.c: (bus_services_list):
304 Add new function that returns an array of strings with the currently
309 Update copyright year.
311 2003-01-25 Anders Carlsson <andersca@codefactory.se>
313 * dbus/dbus-connection.c: (dbus_connection_send_message):
314 Unlock the message in case it was sent earlier.
316 (dbus_connection_send_message_with_reply_and_block):
317 Remove the reply message from the list.
319 * dbus/dbus-marshal.c: (_dbus_demarshal_string_array):
320 Set array_len and new_pos correctly.
322 (_dbus_marshal_test):
325 * dbus/dbus-message-internal.h:
326 * dbus/dbus-message.c: (_dbus_message_get_reply_serial):
327 New function that returns the reply serial.
329 (_dbus_message_unlock):
330 New function that unlocks a message and resets its header.
332 (dbus_message_append_string_array),
333 (dbus_message_get_fields_valist),
334 (dbus_message_iter_get_field_type),
335 (dbus_message_iter_get_string_array),
336 (dbus_message_get_fields),
337 (dbus_message_append_fields_valist):
338 Handle string arrays.
340 (dbus_message_set_sender):
341 Make this function public since the bus daemon needs it.
343 (decode_header_data):
344 Set the reply serial to -1 initially.
346 * dbus/dbus-message.h:
347 Add dbus_message_set_sender.
349 2003-01-24 Havoc Pennington <hp@pobox.com>
351 * doc/dbus-specification.sgml: add some stuff
353 2003-01-22 Havoc Pennington <hp@pobox.com>
355 * doc/dbus-specification.sgml: Start to document the protocol.
357 2003-01-22 Havoc Pennington <hp@pobox.com>
359 * dbus/dbus-connection.c
360 (dbus_connection_send_message_with_reply_and_block): add some @todo
362 * bus/driver.c (bus_driver_add_connection): add a FIXME about memleak
364 2003-01-21 Havoc Pennington <hp@pobox.com>
366 (patch untested because can't compile)
368 * bus/driver.c (create_unique_client_name): make this function
369 never recycle client names. Also, caller should initialize
372 * dbus/dbus-sysdeps.c (_dbus_get_current_time): new function
374 2003-01-21 Anders Carlsson <andersca@codefactory.se>
376 * dbus/dbus-marshal.c: (_dbus_marshal_double),
377 (_dbus_marshal_int32), (_dbus_marshal_uint32),
378 (_dbus_marshal_int32_array), (_dbus_marshal_uint32_array),
379 (_dbus_marshal_double_array), (_dbus_marshal_string_array),
380 (_dbus_demarshal_int32_array), (_dbus_demarshal_uint32_array),
381 (_dbus_demarshal_double_array), (_dbus_demarshal_string_array),
382 (_dbus_marshal_get_field_end_pos), (_dbus_marshal_test):
383 * dbus/dbus-marshal.h:
384 * dbus/dbus-protocol.h:
385 Add support for marshalling and demarshalling integer, double
388 2003-01-21 Anders Carlsson <andersca@codefactory.se>
393 * bus/connection.c: (connection_disconnect_handler):
394 Remove the connection from the bus driver's list.
396 (connection_watch_callback): Dispatch messages.
398 (free_connection_data): Free connection name.
400 (bus_connection_setup): Add connection to the bus driver's list.
401 (bus_connection_remove_owned_service):
402 (bus_connection_set_name), (bus_connection_get_name):
403 Add functions for setting and getting the connection's name.
406 Add function headers.
408 * bus/driver.c: (create_unique_client_name),
409 (bus_driver_handle_hello_message),
410 (bus_driver_send_welcome_message), (bus_driver_message_handler),
411 (bus_driver_add_connection), (bus_driver_remove_connection):
414 * bus/services.c: (bus_service_free):
416 New file that handles communication and registreation with the bus
419 2003-01-21 Anders Carlsson <andersca@codefactory.se>
421 * dbus/dbus-connection.c: (dbus_connection_send_message):
422 Add a new client_serial parameter.
424 (dbus_connection_send_message_with_reply):
425 Remove a @todo since we've implemented the blocking function.
427 (dbus_connection_send_message_with_reply_and_block):
428 New function that sends a message and waits for a reply and
429 then returns the reply.
431 * dbus/dbus-connection.h:
434 * dbus/dbus-errors.c: (dbus_result_to_string):
435 * dbus/dbus-errors.h:
438 * dbus/dbus-message-internal.h:
439 * dbus/dbus-message.c: (_dbus_message_get_reply_serial),
440 (_dbus_message_set_sender), (dbus_message_write_header),
441 (dbus_message_new_reply), (decode_header_data),
442 (_dbus_message_loader_return_buffer), (_dbus_message_test):
443 * dbus/dbus-message.h:
444 Add new functions that set the reply serial and sender.
445 Also marshal and demarshal them correctly and add test.
447 * dbus/dbus-protocol.h:
448 Add new DBUS_MESSAGE_TYPE_SENDER.
451 * glib/dbus-gmain.c: (watch_callback), (free_callback_data),
452 (add_watch), (remove_watch), (add_timeout), (remove_timeout),
453 (dbus_connection_hookup_with_g_main):
454 * glib/test-dbus-glib.c: (main):
455 Rewrite to use GIOChannel and remove the GSource crack.
457 * test/echo-client.c: (main):
458 * test/watch.c: (check_messages):
459 Update for changed APIs
461 2003-01-19 Anders Carlsson <andersca@codefactory.se>
463 * dbus/Makefile.am: Add dbus-timeout.[cħ]
465 * dbus/dbus-connection.c: (_dbus_connection_new_for_transport):
466 Create a DBusTimeoutList.
467 (dbus_connection_set_timeout_functions): Add new function to
468 set timeout callbacks
470 * dbus/dbus-connection.h: Add public DBusTimeout API.
472 * dbus/dbus-message.c: (dbus_message_get_service):
473 * dbus/dbus-message.h: New function.
475 * dbus/dbus-server.c: Fix small doc typo.
477 * dbus/dbus-timeout.[ch]: New files for mainloop timeouts.
479 2003-01-19 Anders Carlsson <andersca@codefactory.se>
481 * dbus/dbus-string.c (_dbus_string_move_len): Don't delete all
482 of the string, just as long as specified.
484 2003-01-19 Havoc Pennington <hp@pobox.com>
486 * dbus/dbus-connection.c (dbus_connection_get_is_authenticated):
489 * dbus/dbus-server.c (dbus_server_set_max_connections)
490 (dbus_server_get_max_connections, dbus_server_get_n_connections):
491 keep track of current number of connections, and add API for
492 setting a max (but haven't implemented enforcing the max yet)
494 2003-01-18 Havoc Pennington <hp@pobox.com>
496 * dbus/dbus-transport-unix.c (unix_do_iteration): only do the
497 reading/writing if read_watch != NULL or write_watch != NULL.
499 * dbus/dbus-message.c (_dbus_message_loader_return_buffer): fix
500 the message loader code to actually load message->header and
501 message->body into the newly-created message.
503 * dbus/dbus-transport-unix.c (check_write_watch): fix a mem leak
506 * dbus/dbus-connection.c (dbus_connection_set_max_message_size)
507 (dbus_connection_get_max_message_size)
508 (dbus_connection_set_max_live_messages_size)
509 (dbus_connection_get_max_live_messages_size): implement some
510 resource limitation functions
512 * dbus/dbus-resources.c: new file implementing some of the
513 resource limits stuff
515 * dbus/dbus-message.c (dbus_message_iter_get_byte_array): add
516 missing docs, add @todo to handle OOM etc.
518 * dbus/dbus-marshal.c (_dbus_demarshal_byte_array): add missing
521 2003-01-18 Havoc Pennington <hp@pobox.com>
523 * dbus/dbus-connection.c (dbus_connection_unref): disconnect the
524 connection if it hasn't been already.
526 * dbus/dbus-connection.h: kill off the idea of an ErrorFunction,
527 replace with DisconnectFunction.
529 2003-01-18 Havoc Pennington <hp@pobox.com>
531 Building --disable-verbose-mode --disable-asserts --disable-tests
532 cuts the library from 112K to 45K or so
534 * configure.in: check for varargs macro support,
535 add --enable-verbose-mode, --enable-asserts.
537 * dbus/dbus-internals.h (_dbus_assert): support
539 (_dbus_verbose): support DBUS_ENABLE_VERBOSE_MODE
541 2003-01-18 Havoc Pennington <hp@pobox.com>
543 * dbus/dbus-test.c: include config.h so that tests actually run
545 * dbus/dbus-string.c: add assertions that stuff is 8-byte aligned,
546 so the failure mode when that assumption fails will be plenty
549 2003-01-18 Havoc Pennington <hp@pobox.com>
551 * configure.in: default --enable-tests to $USE_MAINTAINER_MODE
553 * dbus/Makefile.am: fix it up so dubs-test-main.c is included in
556 * test/Makefile.am: don't use special variable "TESTS" for echo-*
557 since we don't want to use those in make check
559 2003-01-15 Havoc Pennington <hp@redhat.com>
565 2003-01-15 Havoc Pennington <hp@redhat.com>
567 * test/Makefile.am: fix so that test source code ends up in the
568 distribution on make distcheck
570 2003-01-15 Havoc Pennington <hp@redhat.com>
576 2003-01-15 Havoc Pennington <hp@redhat.com>
578 * dbus/dbus-test.c (dbus_internal_symbol_do_not_use_run_tests):
579 fix build when --disable-tests
581 * Makefile.am (EXTRA_DIST): put HACKING in here
583 * HACKING: document procedure for making a tarball release.
585 2003-01-14 Anders Carlsson <andersca@codefactory.se>
587 * bus/connection.c: (connection_error_handler),
588 (bus_connection_setup):
589 * bus/main.c: (main):
590 Make sure that the DBusConnectionData struct is NULLed
591 out to prevent a segfault.
593 * dbus/dbus-errors.c: (dbus_result_to_string):
594 * dbus/dbus-errors.h:
595 * dbus/dbus-message.c: (dbus_message_get_fields),
596 (dbus_message_get_fields_valist), (_dbus_message_test):
597 * dbus/dbus-message.h:
598 Make dbus_message_get_fields return a result code so we can
599 track invalid fields as well as oom.
601 2003-01-11 Havoc Pennington <hp@pobox.com>
603 * configure.in: change --enable-test/--enable-ansi action-if-given
604 to enable_foo=$enableval instead of enable_foo=yes
606 2003-01-08 Havoc Pennington <hp@pobox.com>
608 * dbus/dbus-string.c (_dbus_string_align_length): new function
610 * dbus/dbus-test-main.c: move main() for test app here
612 (dbus_internal_symbol_do_not_use_run_tests): we have to export a
613 symbol to run tests, because dbus-test isn't in the main
616 Code review nitpicks.
618 * dbus/dbus-message.c (dbus_message_write_header): add newlines
619 for people with narrow emacs ;-). Assert client_serial was filled
620 in. Assert message->name != NULL.
621 (dbus_message_append_fields): have "first_field_type" arg separate
622 from va list, needed for C++ binding that also uses varargs IIRC
623 and helps with type safety
624 (dbus_message_new): add @todo about using DBusString to store
625 service/name internally
626 (dbus_message_new): don't leak ->service and ->name on OOM later
628 (dbus_message_unref): free the service name
629 (dbus_message_get_fields): same change to varargs
630 i.e. first_field_type
631 (_dbus_message_loader_return_buffer): assert that the message data
632 is aligned (if not it's a bug in our code). Put in verbose griping
633 about why we set corrupted = TRUE.
634 (decode_header_data): add FIXME that char* is evil. Was going to
635 add FIXME about evil locale-specific string.h strncmp, but just
636 switched to wacky string-as-uint32 optimization. Move check for
637 "no room for field name" above get_const_data_len() to avoid
638 assertion failure in get_const_data_len if we have trailing 2
639 bytes or the like. Check for service and name fields being
640 provided twice. Don't leak service/name on error. Require field
641 names to be aligned to 4 bytes.
643 * dbus/dbus-marshal.c: move byte swap stuff to header
644 (_dbus_pack_int32): uscore-prefix
645 (_dbus_unpack_int32): uscore-prefix
646 (_dbus_unpack_uint32): export
647 (_dbus_demarshal_string): add @todo complaining about use of
649 (_dbus_marshal_get_field_end_pos): add @todo about bad error
650 handling allowing corrupt data to go unchecked
652 2003-01-08 Havoc Pennington <hp@redhat.com>
654 * dbus/dbus-transport-unix.c (unix_do_iteration): add read/write
655 to the select() as needed for authentication. (should be using
656 _dbus_poll() not select, but for another day)
658 * dbus/dbus.h: include dbus/dbus-protocol.h
660 2003-01-08 Anders Carlsson <andersca@codefactory.se>
662 * dbus/Makefile.am (dbusinclude_HEADERS): Install
665 2003-01-08 Anders Carlsson <andersca@codefactory.se>
667 * dbus/dbus-internals.c: (_dbus_type_to_string):
668 New function that returns a string describing a type.
670 * dbus/dbus-marshal.c: (_dbus_demarshal_byte_array):
671 * dbus/dbus-marshal.h:
672 * dbus/dbus-message.c: (dbus_message_get_fields_valist),
673 (dbus_message_iter_get_field_type), (dbus_message_iter_get_double),
674 (dbus_message_iter_get_byte_array):
675 * dbus/dbus-message.h:
676 Add new convenience functions for appending and getting message fields.
677 Also add demarshalling routines for byte arrays.
679 2003-01-07 Anders Carlsson <andersca@codefactory.se>
681 * dbus/dbus-connection-internal.h:
682 * dbus/dbus-connection.c: (_dbus_connection_new_for_transport),
683 (_dbus_connection_get_next_client_serial),
684 (dbus_connection_send_message):
685 * dbus/dbus-internals.h:
686 * dbus/dbus-marshal.c: (unpack_uint32), (dbus_unpack_int32),
687 (dbus_pack_int32), (_dbus_marshal_double), (_dbus_marshal_int32),
688 (_dbus_marshal_uint32), (_dbus_demarshal_double),
689 (_dbus_demarshal_int32), (_dbus_demarshal_uint32),
690 (_dbus_demarshal_string), (_dbus_marshal_get_field_end_pos),
691 (_dbus_verbose_bytes), (_dbus_marshal_test):
692 * dbus/dbus-marshal.h:
693 * dbus/dbus-message-internal.h:
694 * dbus/dbus-message.c: (_dbus_message_set_client_serial),
695 (dbus_message_write_header), (_dbus_message_lock),
696 (dbus_message_new), (dbus_message_ref), (dbus_message_unref),
697 (dbus_message_get_name), (dbus_message_append_int32),
698 (dbus_message_append_uint32), (dbus_message_append_double),
699 (dbus_message_append_string), (dbus_message_append_byte_array),
700 (dbus_message_get_fields_iter), (dbus_message_iter_ref),
701 (dbus_message_iter_unref), (dbus_message_iter_has_next),
702 (dbus_message_iter_next), (dbus_message_iter_get_field_type),
703 (dbus_message_iter_get_string), (dbus_message_iter_get_int32),
704 (dbus_message_iter_get_uint32), (dbus_message_iter_get_double),
705 (decode_header_data), (_dbus_message_loader_return_buffer),
706 (message_iter_test), (_dbus_message_test):
707 * dbus/dbus-message.h:
708 * dbus/dbus-protocol.h:
709 * dbus/dbus-test.c: (main):
711 * glib/test-dbus-glib.c: (message_handler), (main):
712 * test/echo-client.c: (main):
713 * test/watch.c: (check_messages):
714 Make messages sendable and receivable for real.
716 2003-01-07 Anders Carlsson <andersca@codefactory.se>
718 * dbus/dbus-marshal.c: (_dbus_marshal_double),
719 (_dbus_marshal_string), (_dbus_marshal_byte_array):
720 * dbus/dbus-message.c: (dbus_message_append_int32),
721 (dbus_message_append_uint32), (dbus_message_append_double),
722 (dbus_message_append_string), (dbus_message_append_byte_array):
723 Handle OOM restoration.
725 2003-01-07 Anders Carlsson <andersca@codefactory.se>
727 * dbus/dbus-marshal.c: (_dbus_marshal_string),
728 (_dbus_demarshal_string), (_dbus_marshal_test):
729 * dbus/dbus-marshal.h:
730 * dbus/dbus-message.c: (dbus_message_get_name),
731 Document these functions.
733 (dbus_message_append_int32), (dbus_message_append_uint32),
734 (dbus_message_append_double), (dbus_message_append_string),
735 (dbus_message_append_byte_array):
736 * dbus/dbus-message.h:
737 Add functions for adding message fields of different types.
739 * dbus/dbus-protocol.h:
740 Add the different types.
742 2003-01-05 Havoc Pennington <hp@pobox.com>
744 * bus/connection.c: implement routines for handling connections,
745 first thing is keeping a list of owned services on each connection
746 and setting up watches etc.
748 * bus/services.c: implement a mapping from service names to lists
751 * dbus/dbus-hash.c: add DBUS_HASH_POINTER
753 * dbus/dbus-threads.c (dbus_static_mutex_lock): add functions
754 to use static mutexes for global data
756 * dbus/dbus-connection.c (dbus_connection_set_data): add new
757 collection of functions to set/get application-specific data
758 on the DBusConnection.
760 2003-01-04 Havoc Pennington <hp@pobox.com>
762 * dbus/dbus-sysdeps.c (_dbus_sleep_milliseconds): new function
763 (_dbus_poll): new function
765 * dbus/dbus-internals.h (_DBUS_STRUCT_OFFSET): new macro
768 * bus/loop.c: initial code for the daemon main loop
770 2003-01-04 Havoc Pennington <hp@pobox.com>
772 * test/watch.c (error_handler): make it safe if the error handler
773 is called multiple times (if we s/error handler/disconnect
774 handler/ we should just guarantee it's called only once)
776 * dbus/dbus-transport.c (_dbus_transport_disconnect): call the
777 error handler on disconnect (it's quite possible we should
778 just change the error handler to a "disconnect handler," I'm
779 not sure we have any other meaningful errors)
781 * configure.in: check for getpwnam_r
783 * dbus/dbus-transport.c, dbus/dbus-transport-unix.c,
784 dbus/dbus-auth.c: add credentials support, add EXTERNAL auth
785 mechanism as in SASL spec, using socket credentials
787 * dbus/dbus-sysdeps.c (_dbus_read_credentials_unix_socket): new function
788 (_dbus_send_credentials_unix_socket): new function
790 * dbus/dbus-sysdeps.c (_dbus_accept_unix_socket): rename just
792 (_dbus_write): only check errno if <0 returned
793 (_dbus_write_two): ditto
795 2003-01-02 Anders Carlsson <andersca@codefactory.se>
797 * dbus/dbus-marshal.c: (_dbus_marshal_utf8_string),
798 (_dbus_marshal_byte_array), (_dbus_demarshal_utf8_string),
799 (_dbus_marshal_test):
800 * dbus/dbus-marshal.h:
801 Add _dbus_marshal_byte_array and rename _dbus_marshal_string
802 to _dbus_marshal_utf8_string. Also fix some tests.
804 2002-12-28 Harri Porten <porten@kde.org>
806 * configure.in: added check for C++ compiler and a very cheesy
807 check for the Qt integration
809 * Makefile.am (SUBDIRS): compile qt subdir if support is enabled
811 * qt/Makefile.am: added
813 * qt/.cvsignore: added
815 * qt/dbus-qthread.cc, qt/dbus-qthread.cpp: renamed former to
816 latter, added #ifdef QT_THREAD_SUPPORT guard.
818 * dbus/Makefile.am: added missing headers for make dist
820 2002-12-28 Kristian Rietveld <kris@gtk.org>
822 * dbus/Makefile.am: fixup export-symbols-regex.
824 2002-12-27 Anders Carlsson <andersca@codefactory.se>
826 * acinclude.m4: Add this file and put the
827 PKG_CHECK_MODULE macro in it.
829 2002-12-27 Anders Carlsson <andersca@codefactory.se>
831 * dbus/dbus-marshal.c: (_dbus_marshal_string),
832 (_dbus_demarshal_double), (_dbus_demarshal_int32),
833 (_dbus_demarshal_uint32), (_dbus_demarshal_string),
834 (_dbus_marshal_test):
835 Make the demarshalling routines align the pos argument.
836 Add string marshalling tests and fix the obvious bugs
839 2002-12-26 Havoc Pennington <hp@pobox.com>
841 * dbus/dbus-auth.c: fixes fixes fixes
843 * dbus/dbus-transport-unix.c: wire up support for
844 encoding/decoding data on the wire
846 * dbus/dbus-auth.c (_dbus_auth_encode_data)
847 (_dbus_auth_decode_data): append to target string
848 instead of nuking it.
850 2002-12-26 Havoc Pennington <hp@pobox.com>
852 * dbus/dbus-marshal.h (DBUS_COMPILER_BYTE_ORDER): #ifdef
853 WORDS_BIGENDIAN then compiler byte order is DBUS_BIG_ENDIAN,
856 * dbus/dbus-marshal.c: Add macros to do int swapping in-place and
857 avoid swap_bytes() overhead (ignoring possible assembly stuff for
858 now). Main point is because I wanted unpack_uint32 to implement
860 (_dbus_verbose_bytes): new function
862 * dbus/dbus-string.c (_dbus_string_validate_ascii): new function
864 * dbus/dbus-message.c (_dbus_message_loader_get_is_corrupted): add
865 mechanism to handle a corrupt message stream
866 (_dbus_message_loader_new): fix preallocation to only prealloc,
869 * dbus/dbus-string.c (_dbus_string_skip_blank): fix this function
870 (_dbus_string_test): enhance tests for copy/move and fix the
873 * dbus/dbus-transport-unix.c: Hold references in more places to
874 avoid reentrancy problems
876 * dbus/dbus-transport.c: ditto
878 * dbus/dbus-connection.c (dbus_connection_dispatch_message): don't
879 leak reference count in no-message case
881 * test/watch.c (do_mainloop): handle adding/removing watches
882 during iteration over the watches. Also, ref the connection/server
883 stored on a watch, so we don't try to mangle a destroyed one.
885 * dbus/dbus-transport-unix.c (do_authentication): perform
888 * dbus/dbus-auth.c (get_state): add a state
889 AUTHENTICATED_WITH_UNUSED_BYTES and return it if required
890 (_dbus_auth_get_unused_bytes): append the unused bytes
891 to the passed in string, rather than prepend
893 * dbus/dbus-transport.c (_dbus_transport_init_base): create
894 the auth conversation DBusAuth
896 * dbus/dbus-transport-unix.c (_dbus_transport_new_for_fd)
897 (_dbus_transport_new_for_domain_socket): when creating a
898 transport, pass in whether it's a client-side or server-side
899 transport so we know which DBusAuth to create
901 2002-12-03 Havoc Pennington <hp@pobox.com>
903 * dbus/dbus-transport-unix.c (unix_finalize): finalize base
904 _after_ finalizing the derived members
905 (unix_connection_set): unref watch if we fail to add it
907 * dbus/dbus-connection.c (dbus_connection_unref): delete the
908 transport first, so that the connection owned by the
909 transport will be valid as the transport finalizes.
911 * dbus/dbus-transport-unix.c (unix_finalize): free the write_watch
912 if necessary, and remove watches from the connection.
914 * dbus/dbus-watch.c (_dbus_watch_list_free): improve a comment
916 2002-12-26 Anders Carlsson <andersca@codefactory.se>
918 * dbus/dbus-marshal.c: (_dbus_marshal_string),
919 (_dbus_demarshal_double), (_dbus_demarshal_int32),
920 (_dbus_demarshal_uint32), (_dbus_demarshal_string),
921 (_dbus_marshal_test):
922 * dbus/dbus-marshal.h:
923 Add string marshal functions and have the demarshal functions
924 return the new position.
926 2002-12-25 Havoc Pennington <hp@pobox.com>
928 * doc/dbus-sasl-profile.txt: docs on the authentication protocol,
929 it is a simple protocol that just maps directly to SASL.
931 * dbus/dbus-auth.h, dbus/dbus-auth.c: authentication protocol
932 initial implementation, not actually used yet.
934 * dbus/dbus-string.c (_dbus_string_find): new function
935 (_dbus_string_equal): new function
936 (_dbus_string_base64_encode): new function
937 (_dbus_string_base64_decode): new function
939 2002-12-25 Anders Carlsson <andersca@codefactory.se>
942 * dbus/dbus-marshal.c: (swap_bytes), (_dbus_marshal_double),
943 (_dbus_marshal_int32), (_dbus_marshal_uint32),
944 (_dbus_demarshal_double), (_dbus_demarshal_int32),
945 (_dbus_demarshal_uint32), (_dbus_marshal_test):
946 * dbus/dbus-marshal.h:
947 * dbus/dbus-protocol.h:
948 * dbus/dbus-test.c: (main):
950 Add un-optimized marshalling/demarshalling routines.
952 2002-12-25 Harri Porten <porten@kde.org>
954 * qt/dbus-qt.h: adjusted ctor and getter to KDE/Qt conventions
956 2002-12-24 Zack Rusin <zack@kde.org>
958 * qt/dbus-qthread.cc: adding - integrates QMutex into Dbus
959 * qt/dbus-qt.h: skeleton with two sample implemenatation of the
962 2002-12-24 Havoc Pennington <hp@pobox.com>
964 * glib/dbus-gthread.c: fix include
966 * glib/dbus-glib.h: rename DBusMessageHandler for now.
967 I think glib API needs to change, though, as you don't
968 want to use DBusMessageFunction, you want to use the
969 DBusMessageHandler object. Probably
970 dbus_connection_open_with_g_main_loop()
971 and dbus_connection_setup_g_main_loop() or something like that
972 (but think of better names...) that just create a connection
973 that has watch/timeout functions etc. already set up.
975 * dbus/dbus-connection.c
976 (dbus_connection_send_message_with_reply): new function just to
977 show how the message handler helps us deal with replies.
979 * dbus/dbus-list.c (_dbus_list_remove_last): new function
981 * dbus/dbus-string.c (_dbus_string_test): free a string that
984 * dbus/dbus-hash.c: use memory pools for the hash entries
985 (rebuild_table): be more paranoid about overflow, and
986 shrink table when we can
987 (_dbus_hash_test): reduce number of sprintfs and write
988 valid C89. Add tests for case where we grow and then
989 shrink the hash table.
991 * dbus/dbus-mempool.h, dbus/dbus-mempool.c: memory pools
993 * dbus/dbus-connection.c (dbus_connection_register_handler)
994 (dbus_connection_unregister_handler): new functions
996 * dbus/dbus-message.c (dbus_message_get_name): new
998 * dbus/dbus-list.c: fix docs typo
1000 * dbus/dbus-message-handler.h, dbus/dbus-message-handler.c:
1001 an object representing a handler for messages.
1003 2002-12-16 Anders Carlsson <andersca@codefactory.se>
1006 * glib/dbus-gthread.c: (dbus_gthread_init):
1007 Don't use the gdbus prefix for public functions.
1009 2002-12-16 Anders Carlsson <andersca@codefactory.se>
1013 Add GLib checks and fixup .pc files
1017 * glib/dbus-gmain.c: (gdbus_connection_prepare),
1018 (gdbus_connection_check), (gdbus_connection_dispatch),
1019 (gdbus_add_connection_watch), (gdbus_remove_connection_watch),
1020 (dbus_connection_gsource_new):
1021 * glib/dbus-gthread.c: (dbus_gmutex_new), (dbus_gmutex_free),
1022 (dbus_gmutex_lock), (dbus_gmutex_unlock), (dbus_gthread_init):
1023 * glib/test-dbus-glib.c: (message_handler), (main):
1026 2002-12-15 Harri Porten <porten@kde.org>
1028 * autogen.sh: check for libtoolize before attempting to use it
1030 * dbus/dbus-transport-unix.c: include <sys/time.h> for timeval
1033 * .cvsignore: ignore more stamp files
1035 * dbus/dbus-watch.c (_dbus_watch_list_new): fixed doc error
1037 * test/Makefile.am: added -I$(top_srcdir) to be able to compile
1038 without make install.
1040 2002-12-15 Havoc Pennington <hp@pobox.com>
1042 * dbus/dbus-threads.c: add thread stubs that a higher library
1043 layer can fill in. e.g. the GLib wrapper might fill them in with
1044 GThread stuff. We still need to use this thread API to
1045 thread-safe-ize the library.
1047 2002-12-12 Havoc Pennington <hp@pobox.com>
1049 * dbus/dbus-transport-unix.c, dbus/dbus-server-unix.c: use the
1050 below new interfaces and include fewer system headers.
1052 * dbus/dbus-sysdeps.c (_dbus_read): new function
1053 (_dbus_write): new function
1054 (_dbus_write_two): new function
1055 (_dbus_connect_unix_socket): new function
1056 (_dbus_listen_unix_socket): new function
1058 * dbus/dbus-message-internal.h: change interfaces to use
1061 2002-12-11 Havoc Pennington <hp@pobox.com>
1063 * dbus/dbus-types.h: add dbus_unichar
1065 * dbus/dbus-internals.c (_dbus_verbose): use _dbus_getenv
1067 * dbus/dbus-connection.c (dbus_connection_send_message): return
1070 * dbus/dbus-transport.c: include dbus-watch.h
1072 * dbus/dbus-connection.c: include dbus-message-internal.h
1074 * HACKING: add file with coding guidelines stuff.
1076 * dbus/dbus-string.h, dbus/dbus-string.c: Encapsulate all string
1077 handling here, for security purposes (as in vsftpd). Not actually
1078 using this class yet.
1080 * dbus/dbus-sysdeps.h, dbus/dbus-sysdeps.c: Encapsulate all
1081 system/libc usage here, as in vsftpd, for ease of auditing (and
1082 should also simplify portability). Haven't actually moved all the
1083 system/libc usage into here yet.
1085 2002-11-25 Havoc Pennington <hp@pobox.com>
1087 * dbus/dbus-internals.c (_dbus_verbose): fix to not
1088 always print the first verbose message.
1090 2002-11-24 Havoc Pennington <hp@pobox.com>
1092 * test/echo-client.c, test/echo-server.c: cheesy test
1095 * configure.in (AC_CHECK_FUNCS): check for writev
1097 * dbus/dbus-message.c (_dbus_message_get_network_data): new
1100 * dbus/dbus-list.c (_dbus_list_foreach): new function
1102 * dbus/dbus-internals.c (_dbus_verbose): new function
1104 * dbus/dbus-server.c, dbus/dbus-server.h: public object
1105 representing a server that listens for connections.
1107 * dbus/.cvsignore: create
1109 * dbus/dbus-errors.h, dbus/dbus-errors.c:
1110 public API for reporting errors
1112 * dbus/dbus-connection.h, dbus/dbus-connection.c:
1113 public object representing a connection that
1114 sends/receives messages. (Same object used for
1115 both client and server.)
1117 * dbus/dbus-transport.h, dbus/dbus-transport.c:
1118 Basic abstraction for different kinds of stream
1119 that we might read/write messages from.
1121 2002-11-23 Havoc Pennington <hp@pobox.com>
1123 * dbus/dbus-internals.h (_DBUS_INT_MAX): add _DBUS_INT_MIN
1126 * dbus/dbus-test.c (main): add list test, and include
1127 dbus-test.h as intended
1129 * dbus/dbus-hash.c (_dbus_hash_table_remove_string)
1130 (_dbus_hash_table_remove_int): return value indicates
1131 whether the entry existed to remove
1133 * dbus/dbus-list.c: add linked list utility class,
1136 * dbus/dbus-hash.c: add TODO item about shrinking the hash bucket
1139 2002-11-23 Havoc Pennington <hp@pobox.com>
1141 * Doxyfile.in (INCLUDE_FILE_PATTERNS): expand DBUS_BEGIN_DECLS/
1142 DBUS_END_DECLS to nothing, that should fix this once and for all
1144 * Doxyfile.in (JAVADOC_AUTOBRIEF): set to YES
1146 * dbus/dbus-message.c, dbus/dbus-hash.c:
1147 add some missing @brief
1149 2002-11-23 Havoc Pennington <hp@pobox.com>
1151 * dbus/dbus-message.h: put semicolons after DEBUG_BEGIN_DECLS
1152 to avoid confusing Doxygen
1154 * dbus/dbus-hash.c: @} not }@
1156 * dbus/dbus-message.c (struct DBusMessage): split out
1159 2002-11-23 Havoc Pennington <hp@pobox.com>
1161 * configure.in: pile on more warning flags if using gcc
1163 * Doxyfile.in (EXTRACT_STATIC): set to NO, so we don't have
1164 to document static functions
1166 * configure.in: add summary to end of configure so it
1167 looks nice and attractive
1169 * dbus/dbus-hash.c: finish implementation and write unit
1172 * configure.in: add --enable-tests to enable unit tests
1174 * dbus/dbus-test.c: test program to run unit tests
1175 for all files in dbus/*, initially runs a test for
1178 * dbus/dbus-internals.h: file to hold some internal utility stuff
1180 2002-11-22 Havoc Pennington <hp@redhat.com>
1182 * dbus/dbus-hash.c: copy in Tcl hash table, not yet
1183 "ported" away from Tcl
1185 * dbus/dbus-types.h: header for types such as dbus_bool_t
1187 2002-11-22 Havoc Pennington <hp@redhat.com>
1189 * dbus/dbus.h: fixups for doc warnings
1191 * Doxyfile.in (FILE_PATTERNS): we need to scan .h to pick up
1193 (QUIET): make it quiet so we can see warnings
1195 * dbus/dbus-memory.c: teach D-BUS to allocate and free memory
1197 2002-11-22 Havoc Pennington <hp@redhat.com>
1199 * Makefile.am: include "Doxyfile" target in all-local
1201 * configure.in: generate the Doxyfile
1203 * Doxyfile.in: move Doxyfile here, so we can use
1204 configure to generate a Doxyfile with the right
1207 2002-11-22 Havoc Pennington <hp@redhat.com>
1209 * dbus/dbus-message.c: move inline docs into .c file
1211 * Doxyfile (OUTPUT_DIRECTORY): move output to doc/api
1212 so all docs are under doc/
1213 (MAN_EXTENSION): generate man pages. Use extension
1214 ".3dbus" which matches ".3qt" on my system,
1215 I guess this is OK, I don't know really.
1216 (FILE_PATTERNS): look for .c files not .h, makes sense
1219 2002-11-22 Havoc Pennington <hp@pobox.com>
1221 * Makefile.am (SUBDIRS): rename subdir "server" to "bus"
1222 because any app can be a server, and any app can be a client,
1223 the bus is a special kind of server.
1225 Thu Nov 21 23:35:31 2002 Zack Rusin <zack@kde.org>
1227 * Doxyfile : adding. Still needs Makefile rules to be generated
1228 automatically (just run "doxygen" in the toplevel dir for now to
1231 * dbus/dbus-message.h : Adding sample docs (javadoc since
1232 resembles gtk-doc a little more)
1234 * dbus/dbus.h : Adding sample docs
1236 2002-11-21 Havoc Pennington <hp@redhat.com>
1238 * dbus/Makefile.am (INCLUDES): define DBUS_COMPILATION
1239 so we can allow ourselves to include files directly,
1240 instead of having to use dbus.h
1242 * dbus/dbus.h: fill in
1244 * dbus/dbus-message.h: sketch out a sample header file.
1245 Include griping if you include it directly instead of
1248 * dbus/dbus-macros.h: new file with macros for extern "C",
1249 TRUE/FALSE, NULL, etc.
1251 * doc/file-boilerplate.c: put include guards in here
1253 2002-11-21 Havoc Pennington <hp@redhat.com>
1255 * doc/file-boilerplate.c: include both AFL and GPL boilerplate.
1257 * COPYING: include the GPL as well, and license code
1258 under both AFL and GPL.
1260 2002-11-21 Havoc Pennington <hp@redhat.com>
1262 * acconfig.h: get rid of this
1264 * autogen.sh (run_configure): add --no-configure option
1266 * configure.in: remove AC_ARG_PROGRAM to make
1267 autoconf complain less. add AC_PREREQ.
1268 add AC_DEFINE third arg.
1270 2002-11-21 Anders Carlsson <andersca@codefactory.se>
1273 Fix references so we can distcheck.
1275 2002-11-21 Havoc Pennington <hp@redhat.com>
1277 * Initial module creation