1 2003-01-28 Havoc Pennington <hp@pobox.com>
3 * dbus/dbus-message.c (check_message_handling): function to check
4 on the loaded message, iterates over it etc.
6 2003-01-28 Havoc Pennington <hp@pobox.com>
8 * test/Makefile.am (dist-hook): fix make distdir
10 * dbus/Makefile.am (TESTS_ENVIRONMENT): fix make check
12 2003-01-27 Havoc Pennington <hp@pobox.com>
14 * dbus/dbus-mempool.c (time_for_size): replace printf with
17 * dbus/dbus-message-builder.c (_dbus_message_data_load): allow
18 empty lines; fix the SAVE_LENGTH stuff to be
19 START_LENGTH/END_LENGTH so it actually works; couple other
22 * test/Makefile.am (dist-hook): add dist-hook for .message files
24 * dbus/dbus-string.c (DBUS_STRING_COPY_PREAMBLE): source of a copy
25 can be constant or locked.
26 (_dbus_string_free): allow freeing a const string as
29 * dbus/dbus-sysdeps.c (_dbus_concat_dir_and_file): utility
31 * dbus/dbus-test-main.c (main): take an argument which is the
32 directory containing test data
34 * dbus/dbus-message.c (_dbus_message_test): pass a test_data_dir
35 argument to this and load all the messages in test/data/
36 checking that they can be loaded or not loaded as appropriate.
38 2003-01-27 Anders Carlsson <andersca@codefactory.se>
40 * bus/dispatch.c: (bus_dispatch_message_handler):
41 Dispatch messages sent to services.
43 * bus/driver.c: (bus_driver_send_service_deleted),
44 (bus_driver_send_service_created), (bus_driver_send_service_lost),
45 (bus_driver_send_service_acquired):
46 Add helper functions for sending service related messages.
48 (bus_driver_send_welcome_message):
49 Send HELLO_REPLY instead of WELCOME.
51 (bus_driver_handle_list_services):
52 Send LIST_SERVICES_REPLY instead of SERVICES.
54 (bus_driver_handle_own_service),
55 (bus_driver_handle_service_exists):
58 (bus_driver_handle_message):
59 Invoke new message handlers.
61 (bus_driver_remove_connection):
62 Don't remove any services here since that's done automatically
63 by bus_service_remove_owner now.
66 New function signatures.
68 * bus/services.c: (bus_service_add_owner):
69 Send ServiceAcquired message if we're the only primary owner.
71 (bus_service_remove_owner):
72 Send ServiceAcquired/ServiceLost messages.
74 (bus_service_set_prohibit_replacement),
75 (bus_service_get_prohibit_replacement):
76 Functions for setting prohibit replacement.
78 (bus_service_has_owner):
79 New function that checks if a connection is in the owner queue of
83 Add new function signatures.
85 * dbus/dbus-list.c: (_dbus_list_test):
86 Add tests for _dbus_list_remove_last and traversing the list backwards.
89 Fix a typo in _dbus_list_get_prev_link, if we're at the first element we can't
90 go any further, so return NULL then.
92 * dbus/dbus-protocol.h:
93 Add new messages, service flags and service replies.
95 2003-01-26 Havoc Pennington <hp@pobox.com>
97 * dbus/dbus-message-builder.c: implement, completely untested.
99 * test/data/*: add data to be used in testing.
100 ".message" files are our simple loadable text format.
101 ".message-raw" will be binary dumps of messages.
103 * dbus/dbus-string.c (_dbus_string_starts_with_c_str): new
105 2003-01-26 Havoc Pennington <hp@pobox.com>
107 * dbus/dbus-sysdeps.c (_dbus_file_get_contents): new function
109 * dbus/dbus-errors.c (dbus_result_to_string): add
112 * dbus/dbus-message-builder.c: new file, will contain code to load
113 up messages from files. Not implemented yet.
115 2003-01-26 Havoc Pennington <hp@pobox.com>
117 * dbus/dbus-message.c (dbus_message_set_sender): support deleting
118 the sender by setting to NULL
120 2003-01-26 Havoc Pennington <hp@pobox.com>
122 The unit tests pass, but otherwise untested. If it breaks, the
123 tests should have been better. ;-)
125 * bus/driver.c (bus_driver_handle_hello): return if we disconnect
128 * dbus/dbus-message.c: redo everything so we maintain
129 message->header as the only copy of the various fields.
130 This avoids the possibility of out-of-memory in some cases,
131 for example dbus_message_lock() can't run out of memory anymore,
132 and avoids extra copying. Figured I may as well go ahead and do
133 this since it was busted for dbus_message_lock to not return
134 failure on OOM, and dbus_message_write_header was totally
135 unchecked for OOM. Also fixed some random other bugs.
137 * dbus/dbus-marshal.c (_dbus_marshal_get_field_end_pos): verify
138 that strings are nul-terminated. Also, end_pos can be equal
139 to string length just not greater than, I think.
140 (_dbus_marshal_set_int32): new function
141 (_dbus_marshal_set_uint32): new function
142 (_dbus_marshal_set_string): new function
144 * dbus/dbus-connection.c (_dbus_connection_new_for_transport): fix
145 a warning, init timeout_list to NULL
146 (dbus_connection_send_message): don't use uninitialized variable
149 * dbus/dbus-string.c (_dbus_string_replace_len): new function
151 2003-01-26 Anders Carlsson <andersca@codefactory.se>
153 * bus/driver.c: (bus_driver_handle_hello),
154 (bus_driver_send_welcome_message):
157 2003-01-26 Anders Carlsson <andersca@codefactory.se>
159 * dbus/dbus-auth.c: (process_auth), (_dbus_auth_unref):
160 * dbus/dbus-connection.c: (_dbus_connection_new_for_transport),
161 (dbus_connection_unref):
162 * dbus/dbus-marshal.c: (_dbus_marshal_test):
163 * dbus/dbus-message.c: (dbus_message_unref),
166 (dbus_message_get_fields):
167 Remove debugging printout.
169 (_dbus_message_loader_return_buffer):
170 Don't store the header string.
172 (_dbus_message_test):
175 2003-01-26 Richard Hult <rhult@codefactory.se>
177 * glib/dbus-gmain.c (dbus_connection_dispatch): Traverse a copy of
178 the file descriptor list, since it can change under us.
180 2003-01-25 Anders Carlsson <andersca@codefactory.se>
182 * glib/dbus-gmain.c: (dbus_connection_prepare),
183 (dbus_connection_check), (dbus_connection_dispatch), (add_watch),
184 (remove_watch), (dbus_connection_hookup_with_g_main):
185 Rewrite the glib handling to use its own GSource instead of a
186 GIOChannel so we can catch messages put in the queue while waiting
189 2003-01-25 Anders Carlsson <andersca@codefactory.se>
192 * bus/connection.c: (connection_disconnect_handler),
193 (connection_watch_callback), (bus_connection_setup):
194 * bus/dispatch.c: (send_one_message),
195 (bus_dispatch_broadcast_message), (bus_dispatch_message_handler),
196 (bus_dispatch_add_connection), (bus_dispatch_remove_connection):
198 * bus/driver.c: (bus_driver_send_service_deleted),
199 (bus_driver_send_service_created), (bus_driver_handle_hello),
200 (bus_driver_send_welcome_message),
201 (bus_driver_handle_list_services), (bus_driver_remove_connection),
202 (bus_driver_handle_message):
204 Refactor code, put the message dispatching in its own file. Use
205 _DBUS_HANDLE_OOM. Also send ServiceDeleted messages when a client
208 2003-01-25 Anders Carlsson <andersca@codefactory.se>
210 * dbus/dbus-internals.h:
211 Add _DBUS_HANDLE_OOM macro, it doesn't do anything currently.
213 * dbus/dbus-message.c: (dbus_message_get_sender):
214 * dbus/dbus-message.h:
215 Implement dbus_message_get_sender.
217 * dbus/dbus-protocol.h:
218 Add message and service defines.
220 2003-01-25 Anders Carlsson <andersca@codefactory.se>
222 * dbus/dbus-connection.c: (dbus_connection_send_message):
223 * dbus/dbus-message-internal.h:
224 * dbus/dbus-message.c: (_dbus_message_get_client_serial),
225 (dbus_message_write_header):
226 Remove _dbus_messag_unlock and don't set the client serial on a
227 message if one already exists.
229 2003-01-24 Havoc Pennington <hp@pobox.com>
231 * dbus/dbus-list.c (alloc_link): put a thread lock on the global
234 * bus/driver.c (bus_driver_handle_list_services): fix a leak
237 2003-01-25 Anders Carlsson <andersca@codefactory.se>
239 * dbus/dbus-list.c: (alloc_link), (free_link):
240 Use a memory pool for the links.
242 2003-01-25 Anders Carlsson <andersca@codefactory.se>
244 * bus/connection.c: (bus_connection_foreach):
246 Add new bus_connection_foreach function.
248 * bus/driver.c: (send_one_message), (bus_driver_broadcast_message):
249 Add function that broadcasts a message to all clients.
251 (bus_driver_send_service_created), (bus_driver_handle_hello),
252 (bus_driver_send_welcome_message),
253 (bus_driver_handle_list_services), (bus_driver_message_handler):
254 Implement functions that take care of listing services, and notifying
255 clients when new services are created.
257 * bus/services.c: (bus_services_list):
259 Add new function that returns an array of strings with the currently
264 Update copyright year.
266 2003-01-25 Anders Carlsson <andersca@codefactory.se>
268 * dbus/dbus-connection.c: (dbus_connection_send_message):
269 Unlock the message in case it was sent earlier.
271 (dbus_connection_send_message_with_reply_and_block):
272 Remove the reply message from the list.
274 * dbus/dbus-marshal.c: (_dbus_demarshal_string_array):
275 Set array_len and new_pos correctly.
277 (_dbus_marshal_test):
280 * dbus/dbus-message-internal.h:
281 * dbus/dbus-message.c: (_dbus_message_get_reply_serial):
282 New function that returns the reply serial.
284 (_dbus_message_unlock):
285 New function that unlocks a message and resets its header.
287 (dbus_message_append_string_array),
288 (dbus_message_get_fields_valist),
289 (dbus_message_iter_get_field_type),
290 (dbus_message_iter_get_string_array),
291 (dbus_message_get_fields),
292 (dbus_message_append_fields_valist):
293 Handle string arrays.
295 (dbus_message_set_sender):
296 Make this function public since the bus daemon needs it.
298 (decode_header_data):
299 Set the reply serial to -1 initially.
301 * dbus/dbus-message.h:
302 Add dbus_message_set_sender.
304 2003-01-24 Havoc Pennington <hp@pobox.com>
306 * doc/dbus-specification.sgml: add some stuff
308 2003-01-22 Havoc Pennington <hp@pobox.com>
310 * doc/dbus-specification.sgml: Start to document the protocol.
312 2003-01-22 Havoc Pennington <hp@pobox.com>
314 * dbus/dbus-connection.c
315 (dbus_connection_send_message_with_reply_and_block): add some @todo
317 * bus/driver.c (bus_driver_add_connection): add a FIXME about memleak
319 2003-01-21 Havoc Pennington <hp@pobox.com>
321 (patch untested because can't compile)
323 * bus/driver.c (create_unique_client_name): make this function
324 never recycle client names. Also, caller should initialize
327 * dbus/dbus-sysdeps.c (_dbus_get_current_time): new function
329 2003-01-21 Anders Carlsson <andersca@codefactory.se>
331 * dbus/dbus-marshal.c: (_dbus_marshal_double),
332 (_dbus_marshal_int32), (_dbus_marshal_uint32),
333 (_dbus_marshal_int32_array), (_dbus_marshal_uint32_array),
334 (_dbus_marshal_double_array), (_dbus_marshal_string_array),
335 (_dbus_demarshal_int32_array), (_dbus_demarshal_uint32_array),
336 (_dbus_demarshal_double_array), (_dbus_demarshal_string_array),
337 (_dbus_marshal_get_field_end_pos), (_dbus_marshal_test):
338 * dbus/dbus-marshal.h:
339 * dbus/dbus-protocol.h:
340 Add support for marshalling and demarshalling integer, double
343 2003-01-21 Anders Carlsson <andersca@codefactory.se>
348 * bus/connection.c: (connection_disconnect_handler):
349 Remove the connection from the bus driver's list.
351 (connection_watch_callback): Dispatch messages.
353 (free_connection_data): Free connection name.
355 (bus_connection_setup): Add connection to the bus driver's list.
356 (bus_connection_remove_owned_service):
357 (bus_connection_set_name), (bus_connection_get_name):
358 Add functions for setting and getting the connection's name.
361 Add function headers.
363 * bus/driver.c: (create_unique_client_name),
364 (bus_driver_handle_hello_message),
365 (bus_driver_send_welcome_message), (bus_driver_message_handler),
366 (bus_driver_add_connection), (bus_driver_remove_connection):
369 * bus/services.c: (bus_service_free):
371 New file that handles communication and registreation with the bus
374 2003-01-21 Anders Carlsson <andersca@codefactory.se>
376 * dbus/dbus-connection.c: (dbus_connection_send_message):
377 Add a new client_serial parameter.
379 (dbus_connection_send_message_with_reply):
380 Remove a @todo since we've implemented the blocking function.
382 (dbus_connection_send_message_with_reply_and_block):
383 New function that sends a message and waits for a reply and
384 then returns the reply.
386 * dbus/dbus-connection.h:
389 * dbus/dbus-errors.c: (dbus_result_to_string):
390 * dbus/dbus-errors.h:
393 * dbus/dbus-message-internal.h:
394 * dbus/dbus-message.c: (_dbus_message_get_reply_serial),
395 (_dbus_message_set_sender), (dbus_message_write_header),
396 (dbus_message_new_reply), (decode_header_data),
397 (_dbus_message_loader_return_buffer), (_dbus_message_test):
398 * dbus/dbus-message.h:
399 Add new functions that set the reply serial and sender.
400 Also marshal and demarshal them correctly and add test.
402 * dbus/dbus-protocol.h:
403 Add new DBUS_MESSAGE_TYPE_SENDER.
406 * glib/dbus-gmain.c: (watch_callback), (free_callback_data),
407 (add_watch), (remove_watch), (add_timeout), (remove_timeout),
408 (dbus_connection_hookup_with_g_main):
409 * glib/test-dbus-glib.c: (main):
410 Rewrite to use GIOChannel and remove the GSource crack.
412 * test/echo-client.c: (main):
413 * test/watch.c: (check_messages):
414 Update for changed APIs
416 2003-01-19 Anders Carlsson <andersca@codefactory.se>
418 * dbus/Makefile.am: Add dbus-timeout.[cħ]
420 * dbus/dbus-connection.c: (_dbus_connection_new_for_transport):
421 Create a DBusTimeoutList.
422 (dbus_connection_set_timeout_functions): Add new function to
423 set timeout callbacks
425 * dbus/dbus-connection.h: Add public DBusTimeout API.
427 * dbus/dbus-message.c: (dbus_message_get_service):
428 * dbus/dbus-message.h: New function.
430 * dbus/dbus-server.c: Fix small doc typo.
432 * dbus/dbus-timeout.[ch]: New files for mainloop timeouts.
434 2003-01-19 Anders Carlsson <andersca@codefactory.se>
436 * dbus/dbus-string.c (_dbus_string_move_len): Don't delete all
437 of the string, just as long as specified.
439 2003-01-19 Havoc Pennington <hp@pobox.com>
441 * dbus/dbus-connection.c (dbus_connection_get_is_authenticated):
444 * dbus/dbus-server.c (dbus_server_set_max_connections)
445 (dbus_server_get_max_connections, dbus_server_get_n_connections):
446 keep track of current number of connections, and add API for
447 setting a max (but haven't implemented enforcing the max yet)
449 2003-01-18 Havoc Pennington <hp@pobox.com>
451 * dbus/dbus-transport-unix.c (unix_do_iteration): only do the
452 reading/writing if read_watch != NULL or write_watch != NULL.
454 * dbus/dbus-message.c (_dbus_message_loader_return_buffer): fix
455 the message loader code to actually load message->header and
456 message->body into the newly-created message.
458 * dbus/dbus-transport-unix.c (check_write_watch): fix a mem leak
461 * dbus/dbus-connection.c (dbus_connection_set_max_message_size)
462 (dbus_connection_get_max_message_size)
463 (dbus_connection_set_max_live_messages_size)
464 (dbus_connection_get_max_live_messages_size): implement some
465 resource limitation functions
467 * dbus/dbus-resources.c: new file implementing some of the
468 resource limits stuff
470 * dbus/dbus-message.c (dbus_message_iter_get_byte_array): add
471 missing docs, add @todo to handle OOM etc.
473 * dbus/dbus-marshal.c (_dbus_demarshal_byte_array): add missing
476 2003-01-18 Havoc Pennington <hp@pobox.com>
478 * dbus/dbus-connection.c (dbus_connection_unref): disconnect the
479 connection if it hasn't been already.
481 * dbus/dbus-connection.h: kill off the idea of an ErrorFunction,
482 replace with DisconnectFunction.
484 2003-01-18 Havoc Pennington <hp@pobox.com>
486 Building --disable-verbose-mode --disable-asserts --disable-tests
487 cuts the library from 112K to 45K or so
489 * configure.in: check for varargs macro support,
490 add --enable-verbose-mode, --enable-asserts.
492 * dbus/dbus-internals.h (_dbus_assert): support
494 (_dbus_verbose): support DBUS_ENABLE_VERBOSE_MODE
496 2003-01-18 Havoc Pennington <hp@pobox.com>
498 * dbus/dbus-test.c: include config.h so that tests actually run
500 * dbus/dbus-string.c: add assertions that stuff is 8-byte aligned,
501 so the failure mode when that assumption fails will be plenty
504 2003-01-18 Havoc Pennington <hp@pobox.com>
506 * configure.in: default --enable-tests to $USE_MAINTAINER_MODE
508 * dbus/Makefile.am: fix it up so dubs-test-main.c is included in
511 * test/Makefile.am: don't use special variable "TESTS" for echo-*
512 since we don't want to use those in make check
514 2003-01-15 Havoc Pennington <hp@redhat.com>
520 2003-01-15 Havoc Pennington <hp@redhat.com>
522 * test/Makefile.am: fix so that test source code ends up in the
523 distribution on make distcheck
525 2003-01-15 Havoc Pennington <hp@redhat.com>
531 2003-01-15 Havoc Pennington <hp@redhat.com>
533 * dbus/dbus-test.c (dbus_internal_symbol_do_not_use_run_tests):
534 fix build when --disable-tests
536 * Makefile.am (EXTRA_DIST): put HACKING in here
538 * HACKING: document procedure for making a tarball release.
540 2003-01-14 Anders Carlsson <andersca@codefactory.se>
542 * bus/connection.c: (connection_error_handler),
543 (bus_connection_setup):
544 * bus/main.c: (main):
545 Make sure that the DBusConnectionData struct is NULLed
546 out to prevent a segfault.
548 * dbus/dbus-errors.c: (dbus_result_to_string):
549 * dbus/dbus-errors.h:
550 * dbus/dbus-message.c: (dbus_message_get_fields),
551 (dbus_message_get_fields_valist), (_dbus_message_test):
552 * dbus/dbus-message.h:
553 Make dbus_message_get_fields return a result code so we can
554 track invalid fields as well as oom.
556 2003-01-11 Havoc Pennington <hp@pobox.com>
558 * configure.in: change --enable-test/--enable-ansi action-if-given
559 to enable_foo=$enableval instead of enable_foo=yes
561 2003-01-08 Havoc Pennington <hp@pobox.com>
563 * dbus/dbus-string.c (_dbus_string_align_length): new function
565 * dbus/dbus-test-main.c: move main() for test app here
567 (dbus_internal_symbol_do_not_use_run_tests): we have to export a
568 symbol to run tests, because dbus-test isn't in the main
571 Code review nitpicks.
573 * dbus/dbus-message.c (dbus_message_write_header): add newlines
574 for people with narrow emacs ;-). Assert client_serial was filled
575 in. Assert message->name != NULL.
576 (dbus_message_append_fields): have "first_field_type" arg separate
577 from va list, needed for C++ binding that also uses varargs IIRC
578 and helps with type safety
579 (dbus_message_new): add @todo about using DBusString to store
580 service/name internally
581 (dbus_message_new): don't leak ->service and ->name on OOM later
583 (dbus_message_unref): free the service name
584 (dbus_message_get_fields): same change to varargs
585 i.e. first_field_type
586 (_dbus_message_loader_return_buffer): assert that the message data
587 is aligned (if not it's a bug in our code). Put in verbose griping
588 about why we set corrupted = TRUE.
589 (decode_header_data): add FIXME that char* is evil. Was going to
590 add FIXME about evil locale-specific string.h strncmp, but just
591 switched to wacky string-as-uint32 optimization. Move check for
592 "no room for field name" above get_const_data_len() to avoid
593 assertion failure in get_const_data_len if we have trailing 2
594 bytes or the like. Check for service and name fields being
595 provided twice. Don't leak service/name on error. Require field
596 names to be aligned to 4 bytes.
598 * dbus/dbus-marshal.c: move byte swap stuff to header
599 (_dbus_pack_int32): uscore-prefix
600 (_dbus_unpack_int32): uscore-prefix
601 (_dbus_unpack_uint32): export
602 (_dbus_demarshal_string): add @todo complaining about use of
604 (_dbus_marshal_get_field_end_pos): add @todo about bad error
605 handling allowing corrupt data to go unchecked
607 2003-01-08 Havoc Pennington <hp@redhat.com>
609 * dbus/dbus-transport-unix.c (unix_do_iteration): add read/write
610 to the select() as needed for authentication. (should be using
611 _dbus_poll() not select, but for another day)
613 * dbus/dbus.h: include dbus/dbus-protocol.h
615 2003-01-08 Anders Carlsson <andersca@codefactory.se>
617 * dbus/Makefile.am (dbusinclude_HEADERS): Install
620 2003-01-08 Anders Carlsson <andersca@codefactory.se>
622 * dbus/dbus-internals.c: (_dbus_type_to_string):
623 New function that returns a string describing a type.
625 * dbus/dbus-marshal.c: (_dbus_demarshal_byte_array):
626 * dbus/dbus-marshal.h:
627 * dbus/dbus-message.c: (dbus_message_get_fields_valist),
628 (dbus_message_iter_get_field_type), (dbus_message_iter_get_double),
629 (dbus_message_iter_get_byte_array):
630 * dbus/dbus-message.h:
631 Add new convenience functions for appending and getting message fields.
632 Also add demarshalling routines for byte arrays.
634 2003-01-07 Anders Carlsson <andersca@codefactory.se>
636 * dbus/dbus-connection-internal.h:
637 * dbus/dbus-connection.c: (_dbus_connection_new_for_transport),
638 (_dbus_connection_get_next_client_serial),
639 (dbus_connection_send_message):
640 * dbus/dbus-internals.h:
641 * dbus/dbus-marshal.c: (unpack_uint32), (dbus_unpack_int32),
642 (dbus_pack_int32), (_dbus_marshal_double), (_dbus_marshal_int32),
643 (_dbus_marshal_uint32), (_dbus_demarshal_double),
644 (_dbus_demarshal_int32), (_dbus_demarshal_uint32),
645 (_dbus_demarshal_string), (_dbus_marshal_get_field_end_pos),
646 (_dbus_verbose_bytes), (_dbus_marshal_test):
647 * dbus/dbus-marshal.h:
648 * dbus/dbus-message-internal.h:
649 * dbus/dbus-message.c: (_dbus_message_set_client_serial),
650 (dbus_message_write_header), (_dbus_message_lock),
651 (dbus_message_new), (dbus_message_ref), (dbus_message_unref),
652 (dbus_message_get_name), (dbus_message_append_int32),
653 (dbus_message_append_uint32), (dbus_message_append_double),
654 (dbus_message_append_string), (dbus_message_append_byte_array),
655 (dbus_message_get_fields_iter), (dbus_message_iter_ref),
656 (dbus_message_iter_unref), (dbus_message_iter_has_next),
657 (dbus_message_iter_next), (dbus_message_iter_get_field_type),
658 (dbus_message_iter_get_string), (dbus_message_iter_get_int32),
659 (dbus_message_iter_get_uint32), (dbus_message_iter_get_double),
660 (decode_header_data), (_dbus_message_loader_return_buffer),
661 (message_iter_test), (_dbus_message_test):
662 * dbus/dbus-message.h:
663 * dbus/dbus-protocol.h:
664 * dbus/dbus-test.c: (main):
666 * glib/test-dbus-glib.c: (message_handler), (main):
667 * test/echo-client.c: (main):
668 * test/watch.c: (check_messages):
669 Make messages sendable and receivable for real.
671 2003-01-07 Anders Carlsson <andersca@codefactory.se>
673 * dbus/dbus-marshal.c: (_dbus_marshal_double),
674 (_dbus_marshal_string), (_dbus_marshal_byte_array):
675 * dbus/dbus-message.c: (dbus_message_append_int32),
676 (dbus_message_append_uint32), (dbus_message_append_double),
677 (dbus_message_append_string), (dbus_message_append_byte_array):
678 Handle OOM restoration.
680 2003-01-07 Anders Carlsson <andersca@codefactory.se>
682 * dbus/dbus-marshal.c: (_dbus_marshal_string),
683 (_dbus_demarshal_string), (_dbus_marshal_test):
684 * dbus/dbus-marshal.h:
685 * dbus/dbus-message.c: (dbus_message_get_name),
686 Document these functions.
688 (dbus_message_append_int32), (dbus_message_append_uint32),
689 (dbus_message_append_double), (dbus_message_append_string),
690 (dbus_message_append_byte_array):
691 * dbus/dbus-message.h:
692 Add functions for adding message fields of different types.
694 * dbus/dbus-protocol.h:
695 Add the different types.
697 2003-01-05 Havoc Pennington <hp@pobox.com>
699 * bus/connection.c: implement routines for handling connections,
700 first thing is keeping a list of owned services on each connection
701 and setting up watches etc.
703 * bus/services.c: implement a mapping from service names to lists
706 * dbus/dbus-hash.c: add DBUS_HASH_POINTER
708 * dbus/dbus-threads.c (dbus_static_mutex_lock): add functions
709 to use static mutexes for global data
711 * dbus/dbus-connection.c (dbus_connection_set_data): add new
712 collection of functions to set/get application-specific data
713 on the DBusConnection.
715 2003-01-04 Havoc Pennington <hp@pobox.com>
717 * dbus/dbus-sysdeps.c (_dbus_sleep_milliseconds): new function
718 (_dbus_poll): new function
720 * dbus/dbus-internals.h (_DBUS_STRUCT_OFFSET): new macro
723 * bus/loop.c: initial code for the daemon main loop
725 2003-01-04 Havoc Pennington <hp@pobox.com>
727 * test/watch.c (error_handler): make it safe if the error handler
728 is called multiple times (if we s/error handler/disconnect
729 handler/ we should just guarantee it's called only once)
731 * dbus/dbus-transport.c (_dbus_transport_disconnect): call the
732 error handler on disconnect (it's quite possible we should
733 just change the error handler to a "disconnect handler," I'm
734 not sure we have any other meaningful errors)
736 * configure.in: check for getpwnam_r
738 * dbus/dbus-transport.c, dbus/dbus-transport-unix.c,
739 dbus/dbus-auth.c: add credentials support, add EXTERNAL auth
740 mechanism as in SASL spec, using socket credentials
742 * dbus/dbus-sysdeps.c (_dbus_read_credentials_unix_socket): new function
743 (_dbus_send_credentials_unix_socket): new function
745 * dbus/dbus-sysdeps.c (_dbus_accept_unix_socket): rename just
747 (_dbus_write): only check errno if <0 returned
748 (_dbus_write_two): ditto
750 2003-01-02 Anders Carlsson <andersca@codefactory.se>
752 * dbus/dbus-marshal.c: (_dbus_marshal_utf8_string),
753 (_dbus_marshal_byte_array), (_dbus_demarshal_utf8_string),
754 (_dbus_marshal_test):
755 * dbus/dbus-marshal.h:
756 Add _dbus_marshal_byte_array and rename _dbus_marshal_string
757 to _dbus_marshal_utf8_string. Also fix some tests.
759 2002-12-28 Harri Porten <porten@kde.org>
761 * configure.in: added check for C++ compiler and a very cheesy
762 check for the Qt integration
764 * Makefile.am (SUBDIRS): compile qt subdir if support is enabled
766 * qt/Makefile.am: added
768 * qt/.cvsignore: added
770 * qt/dbus-qthread.cc, qt/dbus-qthread.cpp: renamed former to
771 latter, added #ifdef QT_THREAD_SUPPORT guard.
773 * dbus/Makefile.am: added missing headers for make dist
775 2002-12-28 Kristian Rietveld <kris@gtk.org>
777 * dbus/Makefile.am: fixup export-symbols-regex.
779 2002-12-27 Anders Carlsson <andersca@codefactory.se>
781 * acinclude.m4: Add this file and put the
782 PKG_CHECK_MODULE macro in it.
784 2002-12-27 Anders Carlsson <andersca@codefactory.se>
786 * dbus/dbus-marshal.c: (_dbus_marshal_string),
787 (_dbus_demarshal_double), (_dbus_demarshal_int32),
788 (_dbus_demarshal_uint32), (_dbus_demarshal_string),
789 (_dbus_marshal_test):
790 Make the demarshalling routines align the pos argument.
791 Add string marshalling tests and fix the obvious bugs
794 2002-12-26 Havoc Pennington <hp@pobox.com>
796 * dbus/dbus-auth.c: fixes fixes fixes
798 * dbus/dbus-transport-unix.c: wire up support for
799 encoding/decoding data on the wire
801 * dbus/dbus-auth.c (_dbus_auth_encode_data)
802 (_dbus_auth_decode_data): append to target string
803 instead of nuking it.
805 2002-12-26 Havoc Pennington <hp@pobox.com>
807 * dbus/dbus-marshal.h (DBUS_COMPILER_BYTE_ORDER): #ifdef
808 WORDS_BIGENDIAN then compiler byte order is DBUS_BIG_ENDIAN,
811 * dbus/dbus-marshal.c: Add macros to do int swapping in-place and
812 avoid swap_bytes() overhead (ignoring possible assembly stuff for
813 now). Main point is because I wanted unpack_uint32 to implement
815 (_dbus_verbose_bytes): new function
817 * dbus/dbus-string.c (_dbus_string_validate_ascii): new function
819 * dbus/dbus-message.c (_dbus_message_loader_get_is_corrupted): add
820 mechanism to handle a corrupt message stream
821 (_dbus_message_loader_new): fix preallocation to only prealloc,
824 * dbus/dbus-string.c (_dbus_string_skip_blank): fix this function
825 (_dbus_string_test): enhance tests for copy/move and fix the
828 * dbus/dbus-transport-unix.c: Hold references in more places to
829 avoid reentrancy problems
831 * dbus/dbus-transport.c: ditto
833 * dbus/dbus-connection.c (dbus_connection_dispatch_message): don't
834 leak reference count in no-message case
836 * test/watch.c (do_mainloop): handle adding/removing watches
837 during iteration over the watches. Also, ref the connection/server
838 stored on a watch, so we don't try to mangle a destroyed one.
840 * dbus/dbus-transport-unix.c (do_authentication): perform
843 * dbus/dbus-auth.c (get_state): add a state
844 AUTHENTICATED_WITH_UNUSED_BYTES and return it if required
845 (_dbus_auth_get_unused_bytes): append the unused bytes
846 to the passed in string, rather than prepend
848 * dbus/dbus-transport.c (_dbus_transport_init_base): create
849 the auth conversation DBusAuth
851 * dbus/dbus-transport-unix.c (_dbus_transport_new_for_fd)
852 (_dbus_transport_new_for_domain_socket): when creating a
853 transport, pass in whether it's a client-side or server-side
854 transport so we know which DBusAuth to create
856 2002-12-03 Havoc Pennington <hp@pobox.com>
858 * dbus/dbus-transport-unix.c (unix_finalize): finalize base
859 _after_ finalizing the derived members
860 (unix_connection_set): unref watch if we fail to add it
862 * dbus/dbus-connection.c (dbus_connection_unref): delete the
863 transport first, so that the connection owned by the
864 transport will be valid as the transport finalizes.
866 * dbus/dbus-transport-unix.c (unix_finalize): free the write_watch
867 if necessary, and remove watches from the connection.
869 * dbus/dbus-watch.c (_dbus_watch_list_free): improve a comment
871 2002-12-26 Anders Carlsson <andersca@codefactory.se>
873 * dbus/dbus-marshal.c: (_dbus_marshal_string),
874 (_dbus_demarshal_double), (_dbus_demarshal_int32),
875 (_dbus_demarshal_uint32), (_dbus_demarshal_string),
876 (_dbus_marshal_test):
877 * dbus/dbus-marshal.h:
878 Add string marshal functions and have the demarshal functions
879 return the new position.
881 2002-12-25 Havoc Pennington <hp@pobox.com>
883 * doc/dbus-sasl-profile.txt: docs on the authentication protocol,
884 it is a simple protocol that just maps directly to SASL.
886 * dbus/dbus-auth.h, dbus/dbus-auth.c: authentication protocol
887 initial implementation, not actually used yet.
889 * dbus/dbus-string.c (_dbus_string_find): new function
890 (_dbus_string_equal): new function
891 (_dbus_string_base64_encode): new function
892 (_dbus_string_base64_decode): new function
894 2002-12-25 Anders Carlsson <andersca@codefactory.se>
897 * dbus/dbus-marshal.c: (swap_bytes), (_dbus_marshal_double),
898 (_dbus_marshal_int32), (_dbus_marshal_uint32),
899 (_dbus_demarshal_double), (_dbus_demarshal_int32),
900 (_dbus_demarshal_uint32), (_dbus_marshal_test):
901 * dbus/dbus-marshal.h:
902 * dbus/dbus-protocol.h:
903 * dbus/dbus-test.c: (main):
905 Add un-optimized marshalling/demarshalling routines.
907 2002-12-25 Harri Porten <porten@kde.org>
909 * qt/dbus-qt.h: adjusted ctor and getter to KDE/Qt conventions
911 2002-12-24 Zack Rusin <zack@kde.org>
913 * qt/dbus-qthread.cc: adding - integrates QMutex into Dbus
914 * qt/dbus-qt.h: skeleton with two sample implemenatation of the
917 2002-12-24 Havoc Pennington <hp@pobox.com>
919 * glib/dbus-gthread.c: fix include
921 * glib/dbus-glib.h: rename DBusMessageHandler for now.
922 I think glib API needs to change, though, as you don't
923 want to use DBusMessageFunction, you want to use the
924 DBusMessageHandler object. Probably
925 dbus_connection_open_with_g_main_loop()
926 and dbus_connection_setup_g_main_loop() or something like that
927 (but think of better names...) that just create a connection
928 that has watch/timeout functions etc. already set up.
930 * dbus/dbus-connection.c
931 (dbus_connection_send_message_with_reply): new function just to
932 show how the message handler helps us deal with replies.
934 * dbus/dbus-list.c (_dbus_list_remove_last): new function
936 * dbus/dbus-string.c (_dbus_string_test): free a string that
939 * dbus/dbus-hash.c: use memory pools for the hash entries
940 (rebuild_table): be more paranoid about overflow, and
941 shrink table when we can
942 (_dbus_hash_test): reduce number of sprintfs and write
943 valid C89. Add tests for case where we grow and then
944 shrink the hash table.
946 * dbus/dbus-mempool.h, dbus/dbus-mempool.c: memory pools
948 * dbus/dbus-connection.c (dbus_connection_register_handler)
949 (dbus_connection_unregister_handler): new functions
951 * dbus/dbus-message.c (dbus_message_get_name): new
953 * dbus/dbus-list.c: fix docs typo
955 * dbus/dbus-message-handler.h, dbus/dbus-message-handler.c:
956 an object representing a handler for messages.
958 2002-12-16 Anders Carlsson <andersca@codefactory.se>
961 * glib/dbus-gthread.c: (dbus_gthread_init):
962 Don't use the gdbus prefix for public functions.
964 2002-12-16 Anders Carlsson <andersca@codefactory.se>
968 Add GLib checks and fixup .pc files
972 * glib/dbus-gmain.c: (gdbus_connection_prepare),
973 (gdbus_connection_check), (gdbus_connection_dispatch),
974 (gdbus_add_connection_watch), (gdbus_remove_connection_watch),
975 (dbus_connection_gsource_new):
976 * glib/dbus-gthread.c: (dbus_gmutex_new), (dbus_gmutex_free),
977 (dbus_gmutex_lock), (dbus_gmutex_unlock), (dbus_gthread_init):
978 * glib/test-dbus-glib.c: (message_handler), (main):
981 2002-12-15 Harri Porten <porten@kde.org>
983 * autogen.sh: check for libtoolize before attempting to use it
985 * dbus/dbus-transport-unix.c: include <sys/time.h> for timeval
988 * .cvsignore: ignore more stamp files
990 * dbus/dbus-watch.c (_dbus_watch_list_new): fixed doc error
992 * test/Makefile.am: added -I$(top_srcdir) to be able to compile
993 without make install.
995 2002-12-15 Havoc Pennington <hp@pobox.com>
997 * dbus/dbus-threads.c: add thread stubs that a higher library
998 layer can fill in. e.g. the GLib wrapper might fill them in with
999 GThread stuff. We still need to use this thread API to
1000 thread-safe-ize the library.
1002 2002-12-12 Havoc Pennington <hp@pobox.com>
1004 * dbus/dbus-transport-unix.c, dbus/dbus-server-unix.c: use the
1005 below new interfaces and include fewer system headers.
1007 * dbus/dbus-sysdeps.c (_dbus_read): new function
1008 (_dbus_write): new function
1009 (_dbus_write_two): new function
1010 (_dbus_connect_unix_socket): new function
1011 (_dbus_listen_unix_socket): new function
1013 * dbus/dbus-message-internal.h: change interfaces to use
1016 2002-12-11 Havoc Pennington <hp@pobox.com>
1018 * dbus/dbus-types.h: add dbus_unichar
1020 * dbus/dbus-internals.c (_dbus_verbose): use _dbus_getenv
1022 * dbus/dbus-connection.c (dbus_connection_send_message): return
1025 * dbus/dbus-transport.c: include dbus-watch.h
1027 * dbus/dbus-connection.c: include dbus-message-internal.h
1029 * HACKING: add file with coding guidelines stuff.
1031 * dbus/dbus-string.h, dbus/dbus-string.c: Encapsulate all string
1032 handling here, for security purposes (as in vsftpd). Not actually
1033 using this class yet.
1035 * dbus/dbus-sysdeps.h, dbus/dbus-sysdeps.c: Encapsulate all
1036 system/libc usage here, as in vsftpd, for ease of auditing (and
1037 should also simplify portability). Haven't actually moved all the
1038 system/libc usage into here yet.
1040 2002-11-25 Havoc Pennington <hp@pobox.com>
1042 * dbus/dbus-internals.c (_dbus_verbose): fix to not
1043 always print the first verbose message.
1045 2002-11-24 Havoc Pennington <hp@pobox.com>
1047 * test/echo-client.c, test/echo-server.c: cheesy test
1050 * configure.in (AC_CHECK_FUNCS): check for writev
1052 * dbus/dbus-message.c (_dbus_message_get_network_data): new
1055 * dbus/dbus-list.c (_dbus_list_foreach): new function
1057 * dbus/dbus-internals.c (_dbus_verbose): new function
1059 * dbus/dbus-server.c, dbus/dbus-server.h: public object
1060 representing a server that listens for connections.
1062 * dbus/.cvsignore: create
1064 * dbus/dbus-errors.h, dbus/dbus-errors.c:
1065 public API for reporting errors
1067 * dbus/dbus-connection.h, dbus/dbus-connection.c:
1068 public object representing a connection that
1069 sends/receives messages. (Same object used for
1070 both client and server.)
1072 * dbus/dbus-transport.h, dbus/dbus-transport.c:
1073 Basic abstraction for different kinds of stream
1074 that we might read/write messages from.
1076 2002-11-23 Havoc Pennington <hp@pobox.com>
1078 * dbus/dbus-internals.h (_DBUS_INT_MAX): add _DBUS_INT_MIN
1081 * dbus/dbus-test.c (main): add list test, and include
1082 dbus-test.h as intended
1084 * dbus/dbus-hash.c (_dbus_hash_table_remove_string)
1085 (_dbus_hash_table_remove_int): return value indicates
1086 whether the entry existed to remove
1088 * dbus/dbus-list.c: add linked list utility class,
1091 * dbus/dbus-hash.c: add TODO item about shrinking the hash bucket
1094 2002-11-23 Havoc Pennington <hp@pobox.com>
1096 * Doxyfile.in (INCLUDE_FILE_PATTERNS): expand DBUS_BEGIN_DECLS/
1097 DBUS_END_DECLS to nothing, that should fix this once and for all
1099 * Doxyfile.in (JAVADOC_AUTOBRIEF): set to YES
1101 * dbus/dbus-message.c, dbus/dbus-hash.c:
1102 add some missing @brief
1104 2002-11-23 Havoc Pennington <hp@pobox.com>
1106 * dbus/dbus-message.h: put semicolons after DEBUG_BEGIN_DECLS
1107 to avoid confusing Doxygen
1109 * dbus/dbus-hash.c: @} not }@
1111 * dbus/dbus-message.c (struct DBusMessage): split out
1114 2002-11-23 Havoc Pennington <hp@pobox.com>
1116 * configure.in: pile on more warning flags if using gcc
1118 * Doxyfile.in (EXTRACT_STATIC): set to NO, so we don't have
1119 to document static functions
1121 * configure.in: add summary to end of configure so it
1122 looks nice and attractive
1124 * dbus/dbus-hash.c: finish implementation and write unit
1127 * configure.in: add --enable-tests to enable unit tests
1129 * dbus/dbus-test.c: test program to run unit tests
1130 for all files in dbus/*, initially runs a test for
1133 * dbus/dbus-internals.h: file to hold some internal utility stuff
1135 2002-11-22 Havoc Pennington <hp@redhat.com>
1137 * dbus/dbus-hash.c: copy in Tcl hash table, not yet
1138 "ported" away from Tcl
1140 * dbus/dbus-types.h: header for types such as dbus_bool_t
1142 2002-11-22 Havoc Pennington <hp@redhat.com>
1144 * dbus/dbus.h: fixups for doc warnings
1146 * Doxyfile.in (FILE_PATTERNS): we need to scan .h to pick up
1148 (QUIET): make it quiet so we can see warnings
1150 * dbus/dbus-memory.c: teach D-BUS to allocate and free memory
1152 2002-11-22 Havoc Pennington <hp@redhat.com>
1154 * Makefile.am: include "Doxyfile" target in all-local
1156 * configure.in: generate the Doxyfile
1158 * Doxyfile.in: move Doxyfile here, so we can use
1159 configure to generate a Doxyfile with the right
1162 2002-11-22 Havoc Pennington <hp@redhat.com>
1164 * dbus/dbus-message.c: move inline docs into .c file
1166 * Doxyfile (OUTPUT_DIRECTORY): move output to doc/api
1167 so all docs are under doc/
1168 (MAN_EXTENSION): generate man pages. Use extension
1169 ".3dbus" which matches ".3qt" on my system,
1170 I guess this is OK, I don't know really.
1171 (FILE_PATTERNS): look for .c files not .h, makes sense
1174 2002-11-22 Havoc Pennington <hp@pobox.com>
1176 * Makefile.am (SUBDIRS): rename subdir "server" to "bus"
1177 because any app can be a server, and any app can be a client,
1178 the bus is a special kind of server.
1180 Thu Nov 21 23:35:31 2002 Zack Rusin <zack@kde.org>
1182 * Doxyfile : adding. Still needs Makefile rules to be generated
1183 automatically (just run "doxygen" in the toplevel dir for now to
1186 * dbus/dbus-message.h : Adding sample docs (javadoc since
1187 resembles gtk-doc a little more)
1189 * dbus/dbus.h : Adding sample docs
1191 2002-11-21 Havoc Pennington <hp@redhat.com>
1193 * dbus/Makefile.am (INCLUDES): define DBUS_COMPILATION
1194 so we can allow ourselves to include files directly,
1195 instead of having to use dbus.h
1197 * dbus/dbus.h: fill in
1199 * dbus/dbus-message.h: sketch out a sample header file.
1200 Include griping if you include it directly instead of
1203 * dbus/dbus-macros.h: new file with macros for extern "C",
1204 TRUE/FALSE, NULL, etc.
1206 * doc/file-boilerplate.c: put include guards in here
1208 2002-11-21 Havoc Pennington <hp@redhat.com>
1210 * doc/file-boilerplate.c: include both AFL and GPL boilerplate.
1212 * COPYING: include the GPL as well, and license code
1213 under both AFL and GPL.
1215 2002-11-21 Havoc Pennington <hp@redhat.com>
1217 * acconfig.h: get rid of this
1219 * autogen.sh (run_configure): add --no-configure option
1221 * configure.in: remove AC_ARG_PROGRAM to make
1222 autoconf complain less. add AC_PREREQ.
1223 add AC_DEFINE third arg.
1225 2002-11-21 Anders Carlsson <andersca@codefactory.se>
1228 Fix references so we can distcheck.
1230 2002-11-21 Havoc Pennington <hp@redhat.com>
1232 * Initial module creation