1 2003-01-27 Anders Carlsson <andersca@codefactory.se>
3 * bus/dispatch.c: (bus_dispatch_message_handler):
4 Dispatch messages sent to services.
6 * bus/driver.c: (bus_driver_send_service_deleted),
7 (bus_driver_send_service_created), (bus_driver_send_service_lost),
8 (bus_driver_send_service_acquired):
9 Add helper functions for sending service related messages.
11 (bus_driver_send_welcome_message):
12 Send HELLO_REPLY instead of WELCOME.
14 (bus_driver_handle_list_services):
15 Send LIST_SERVICES_REPLY instead of SERVICES.
17 (bus_driver_handle_own_service),
18 (bus_driver_handle_service_exists):
21 (bus_driver_handle_message):
22 Invoke new message handlers.
24 (bus_driver_remove_connection):
25 Don't remove any services here since that's done automatically
26 by bus_service_remove_owner now.
29 New function signatures.
31 * bus/services.c: (bus_service_add_owner):
32 Send ServiceAcquired message if we're the only primary owner.
34 (bus_service_remove_owner):
35 Send ServiceAcquired/ServiceLost messages.
37 (bus_service_set_prohibit_replacement),
38 (bus_service_get_prohibit_replacement):
39 Functions for setting prohibit replacement.
41 (bus_service_has_owner):
42 New function that checks if a connection is in the owner queue of
46 Add new function signatures.
48 * dbus/dbus-list.c: (_dbus_list_test):
49 Add tests for _dbus_list_remove_last and traversing the list backwards.
52 Fix a typo in _dbus_list_get_prev_link, if we're at the first element we can't
53 go any further, so return NULL then.
55 * dbus/dbus-protocol.h:
56 Add new messages, service flags and service replies.
58 2003-01-26 Havoc Pennington <hp@pobox.com>
60 * dbus/dbus-message-builder.c: implement, completely untested.
62 * test/data/*: add data to be used in testing.
63 ".message" files are our simple loadable text format.
64 ".message-raw" will be binary dumps of messages.
66 * dbus/dbus-string.c (_dbus_string_starts_with_c_str): new
68 2003-01-26 Havoc Pennington <hp@pobox.com>
70 * dbus/dbus-sysdeps.c (_dbus_file_get_contents): new function
72 * dbus/dbus-errors.c (dbus_result_to_string): add
75 * dbus/dbus-message-builder.c: new file, will contain code to load
76 up messages from files. Not implemented yet.
78 2003-01-26 Havoc Pennington <hp@pobox.com>
80 * dbus/dbus-message.c (dbus_message_set_sender): support deleting
81 the sender by setting to NULL
83 2003-01-26 Havoc Pennington <hp@pobox.com>
85 The unit tests pass, but otherwise untested. If it breaks, the
86 tests should have been better. ;-)
88 * bus/driver.c (bus_driver_handle_hello): return if we disconnect
91 * dbus/dbus-message.c: redo everything so we maintain
92 message->header as the only copy of the various fields.
93 This avoids the possibility of out-of-memory in some cases,
94 for example dbus_message_lock() can't run out of memory anymore,
95 and avoids extra copying. Figured I may as well go ahead and do
96 this since it was busted for dbus_message_lock to not return
97 failure on OOM, and dbus_message_write_header was totally
98 unchecked for OOM. Also fixed some random other bugs.
100 * dbus/dbus-marshal.c (_dbus_marshal_get_field_end_pos): verify
101 that strings are nul-terminated. Also, end_pos can be equal
102 to string length just not greater than, I think.
103 (_dbus_marshal_set_int32): new function
104 (_dbus_marshal_set_uint32): new function
105 (_dbus_marshal_set_string): new function
107 * dbus/dbus-connection.c (_dbus_connection_new_for_transport): fix
108 a warning, init timeout_list to NULL
109 (dbus_connection_send_message): don't use uninitialized variable
112 * dbus/dbus-string.c (_dbus_string_replace_len): new function
114 2003-01-26 Anders Carlsson <andersca@codefactory.se>
116 * bus/driver.c: (bus_driver_handle_hello),
117 (bus_driver_send_welcome_message):
120 2003-01-26 Anders Carlsson <andersca@codefactory.se>
122 * dbus/dbus-auth.c: (process_auth), (_dbus_auth_unref):
123 * dbus/dbus-connection.c: (_dbus_connection_new_for_transport),
124 (dbus_connection_unref):
125 * dbus/dbus-marshal.c: (_dbus_marshal_test):
126 * dbus/dbus-message.c: (dbus_message_unref),
129 (dbus_message_get_fields):
130 Remove debugging printout.
132 (_dbus_message_loader_return_buffer):
133 Don't store the header string.
135 (_dbus_message_test):
138 2003-01-26 Richard Hult <rhult@codefactory.se>
140 * glib/dbus-gmain.c (dbus_connection_dispatch): Traverse a copy of
141 the file descriptor list, since it can change under us.
143 2003-01-25 Anders Carlsson <andersca@codefactory.se>
145 * glib/dbus-gmain.c: (dbus_connection_prepare),
146 (dbus_connection_check), (dbus_connection_dispatch), (add_watch),
147 (remove_watch), (dbus_connection_hookup_with_g_main):
148 Rewrite the glib handling to use its own GSource instead of a
149 GIOChannel so we can catch messages put in the queue while waiting
152 2003-01-25 Anders Carlsson <andersca@codefactory.se>
155 * bus/connection.c: (connection_disconnect_handler),
156 (connection_watch_callback), (bus_connection_setup):
157 * bus/dispatch.c: (send_one_message),
158 (bus_dispatch_broadcast_message), (bus_dispatch_message_handler),
159 (bus_dispatch_add_connection), (bus_dispatch_remove_connection):
161 * bus/driver.c: (bus_driver_send_service_deleted),
162 (bus_driver_send_service_created), (bus_driver_handle_hello),
163 (bus_driver_send_welcome_message),
164 (bus_driver_handle_list_services), (bus_driver_remove_connection),
165 (bus_driver_handle_message):
167 Refactor code, put the message dispatching in its own file. Use
168 _DBUS_HANDLE_OOM. Also send ServiceDeleted messages when a client
171 2003-01-25 Anders Carlsson <andersca@codefactory.se>
173 * dbus/dbus-internals.h:
174 Add _DBUS_HANDLE_OOM macro, it doesn't do anything currently.
176 * dbus/dbus-message.c: (dbus_message_get_sender):
177 * dbus/dbus-message.h:
178 Implement dbus_message_get_sender.
180 * dbus/dbus-protocol.h:
181 Add message and service defines.
183 2003-01-25 Anders Carlsson <andersca@codefactory.se>
185 * dbus/dbus-connection.c: (dbus_connection_send_message):
186 * dbus/dbus-message-internal.h:
187 * dbus/dbus-message.c: (_dbus_message_get_client_serial),
188 (dbus_message_write_header):
189 Remove _dbus_messag_unlock and don't set the client serial on a
190 message if one already exists.
192 2003-01-24 Havoc Pennington <hp@pobox.com>
194 * dbus/dbus-list.c (alloc_link): put a thread lock on the global
197 * bus/driver.c (bus_driver_handle_list_services): fix a leak
200 2003-01-25 Anders Carlsson <andersca@codefactory.se>
202 * dbus/dbus-list.c: (alloc_link), (free_link):
203 Use a memory pool for the links.
205 2003-01-25 Anders Carlsson <andersca@codefactory.se>
207 * bus/connection.c: (bus_connection_foreach):
209 Add new bus_connection_foreach function.
211 * bus/driver.c: (send_one_message), (bus_driver_broadcast_message):
212 Add function that broadcasts a message to all clients.
214 (bus_driver_send_service_created), (bus_driver_handle_hello),
215 (bus_driver_send_welcome_message),
216 (bus_driver_handle_list_services), (bus_driver_message_handler):
217 Implement functions that take care of listing services, and notifying
218 clients when new services are created.
220 * bus/services.c: (bus_services_list):
222 Add new function that returns an array of strings with the currently
227 Update copyright year.
229 2003-01-25 Anders Carlsson <andersca@codefactory.se>
231 * dbus/dbus-connection.c: (dbus_connection_send_message):
232 Unlock the message in case it was sent earlier.
234 (dbus_connection_send_message_with_reply_and_block):
235 Remove the reply message from the list.
237 * dbus/dbus-marshal.c: (_dbus_demarshal_string_array):
238 Set array_len and new_pos correctly.
240 (_dbus_marshal_test):
243 * dbus/dbus-message-internal.h:
244 * dbus/dbus-message.c: (_dbus_message_get_reply_serial):
245 New function that returns the reply serial.
247 (_dbus_message_unlock):
248 New function that unlocks a message and resets its header.
250 (dbus_message_append_string_array),
251 (dbus_message_get_fields_valist),
252 (dbus_message_iter_get_field_type),
253 (dbus_message_iter_get_string_array),
254 (dbus_message_get_fields),
255 (dbus_message_append_fields_valist):
256 Handle string arrays.
258 (dbus_message_set_sender):
259 Make this function public since the bus daemon needs it.
261 (decode_header_data):
262 Set the reply serial to -1 initially.
264 * dbus/dbus-message.h:
265 Add dbus_message_set_sender.
267 2003-01-24 Havoc Pennington <hp@pobox.com>
269 * doc/dbus-specification.sgml: add some stuff
271 2003-01-22 Havoc Pennington <hp@pobox.com>
273 * doc/dbus-specification.sgml: Start to document the protocol.
275 2003-01-22 Havoc Pennington <hp@pobox.com>
277 * dbus/dbus-connection.c
278 (dbus_connection_send_message_with_reply_and_block): add some @todo
280 * bus/driver.c (bus_driver_add_connection): add a FIXME about memleak
282 2003-01-21 Havoc Pennington <hp@pobox.com>
284 (patch untested because can't compile)
286 * bus/driver.c (create_unique_client_name): make this function
287 never recycle client names. Also, caller should initialize
290 * dbus/dbus-sysdeps.c (_dbus_get_current_time): new function
292 2003-01-21 Anders Carlsson <andersca@codefactory.se>
294 * dbus/dbus-marshal.c: (_dbus_marshal_double),
295 (_dbus_marshal_int32), (_dbus_marshal_uint32),
296 (_dbus_marshal_int32_array), (_dbus_marshal_uint32_array),
297 (_dbus_marshal_double_array), (_dbus_marshal_string_array),
298 (_dbus_demarshal_int32_array), (_dbus_demarshal_uint32_array),
299 (_dbus_demarshal_double_array), (_dbus_demarshal_string_array),
300 (_dbus_marshal_get_field_end_pos), (_dbus_marshal_test):
301 * dbus/dbus-marshal.h:
302 * dbus/dbus-protocol.h:
303 Add support for marshalling and demarshalling integer, double
306 2003-01-21 Anders Carlsson <andersca@codefactory.se>
311 * bus/connection.c: (connection_disconnect_handler):
312 Remove the connection from the bus driver's list.
314 (connection_watch_callback): Dispatch messages.
316 (free_connection_data): Free connection name.
318 (bus_connection_setup): Add connection to the bus driver's list.
319 (bus_connection_remove_owned_service):
320 (bus_connection_set_name), (bus_connection_get_name):
321 Add functions for setting and getting the connection's name.
324 Add function headers.
326 * bus/driver.c: (create_unique_client_name),
327 (bus_driver_handle_hello_message),
328 (bus_driver_send_welcome_message), (bus_driver_message_handler),
329 (bus_driver_add_connection), (bus_driver_remove_connection):
332 * bus/services.c: (bus_service_free):
334 New file that handles communication and registreation with the bus
337 2003-01-21 Anders Carlsson <andersca@codefactory.se>
339 * dbus/dbus-connection.c: (dbus_connection_send_message):
340 Add a new client_serial parameter.
342 (dbus_connection_send_message_with_reply):
343 Remove a @todo since we've implemented the blocking function.
345 (dbus_connection_send_message_with_reply_and_block):
346 New function that sends a message and waits for a reply and
347 then returns the reply.
349 * dbus/dbus-connection.h:
352 * dbus/dbus-errors.c: (dbus_result_to_string):
353 * dbus/dbus-errors.h:
356 * dbus/dbus-message-internal.h:
357 * dbus/dbus-message.c: (_dbus_message_get_reply_serial),
358 (_dbus_message_set_sender), (dbus_message_write_header),
359 (dbus_message_new_reply), (decode_header_data),
360 (_dbus_message_loader_return_buffer), (_dbus_message_test):
361 * dbus/dbus-message.h:
362 Add new functions that set the reply serial and sender.
363 Also marshal and demarshal them correctly and add test.
365 * dbus/dbus-protocol.h:
366 Add new DBUS_MESSAGE_TYPE_SENDER.
369 * glib/dbus-gmain.c: (watch_callback), (free_callback_data),
370 (add_watch), (remove_watch), (add_timeout), (remove_timeout),
371 (dbus_connection_hookup_with_g_main):
372 * glib/test-dbus-glib.c: (main):
373 Rewrite to use GIOChannel and remove the GSource crack.
375 * test/echo-client.c: (main):
376 * test/watch.c: (check_messages):
377 Update for changed APIs
379 2003-01-19 Anders Carlsson <andersca@codefactory.se>
381 * dbus/Makefile.am: Add dbus-timeout.[cħ]
383 * dbus/dbus-connection.c: (_dbus_connection_new_for_transport):
384 Create a DBusTimeoutList.
385 (dbus_connection_set_timeout_functions): Add new function to
386 set timeout callbacks
388 * dbus/dbus-connection.h: Add public DBusTimeout API.
390 * dbus/dbus-message.c: (dbus_message_get_service):
391 * dbus/dbus-message.h: New function.
393 * dbus/dbus-server.c: Fix small doc typo.
395 * dbus/dbus-timeout.[ch]: New files for mainloop timeouts.
397 2003-01-19 Anders Carlsson <andersca@codefactory.se>
399 * dbus/dbus-string.c (_dbus_string_move_len): Don't delete all
400 of the string, just as long as specified.
402 2003-01-19 Havoc Pennington <hp@pobox.com>
404 * dbus/dbus-connection.c (dbus_connection_get_is_authenticated):
407 * dbus/dbus-server.c (dbus_server_set_max_connections)
408 (dbus_server_get_max_connections, dbus_server_get_n_connections):
409 keep track of current number of connections, and add API for
410 setting a max (but haven't implemented enforcing the max yet)
412 2003-01-18 Havoc Pennington <hp@pobox.com>
414 * dbus/dbus-transport-unix.c (unix_do_iteration): only do the
415 reading/writing if read_watch != NULL or write_watch != NULL.
417 * dbus/dbus-message.c (_dbus_message_loader_return_buffer): fix
418 the message loader code to actually load message->header and
419 message->body into the newly-created message.
421 * dbus/dbus-transport-unix.c (check_write_watch): fix a mem leak
424 * dbus/dbus-connection.c (dbus_connection_set_max_message_size)
425 (dbus_connection_get_max_message_size)
426 (dbus_connection_set_max_live_messages_size)
427 (dbus_connection_get_max_live_messages_size): implement some
428 resource limitation functions
430 * dbus/dbus-resources.c: new file implementing some of the
431 resource limits stuff
433 * dbus/dbus-message.c (dbus_message_iter_get_byte_array): add
434 missing docs, add @todo to handle OOM etc.
436 * dbus/dbus-marshal.c (_dbus_demarshal_byte_array): add missing
439 2003-01-18 Havoc Pennington <hp@pobox.com>
441 * dbus/dbus-connection.c (dbus_connection_unref): disconnect the
442 connection if it hasn't been already.
444 * dbus/dbus-connection.h: kill off the idea of an ErrorFunction,
445 replace with DisconnectFunction.
447 2003-01-18 Havoc Pennington <hp@pobox.com>
449 Building --disable-verbose-mode --disable-asserts --disable-tests
450 cuts the library from 112K to 45K or so
452 * configure.in: check for varargs macro support,
453 add --enable-verbose-mode, --enable-asserts.
455 * dbus/dbus-internals.h (_dbus_assert): support
457 (_dbus_verbose): support DBUS_ENABLE_VERBOSE_MODE
459 2003-01-18 Havoc Pennington <hp@pobox.com>
461 * dbus/dbus-test.c: include config.h so that tests actually run
463 * dbus/dbus-string.c: add assertions that stuff is 8-byte aligned,
464 so the failure mode when that assumption fails will be plenty
467 2003-01-18 Havoc Pennington <hp@pobox.com>
469 * configure.in: default --enable-tests to $USE_MAINTAINER_MODE
471 * dbus/Makefile.am: fix it up so dubs-test-main.c is included in
474 * test/Makefile.am: don't use special variable "TESTS" for echo-*
475 since we don't want to use those in make check
477 2003-01-15 Havoc Pennington <hp@redhat.com>
483 2003-01-15 Havoc Pennington <hp@redhat.com>
485 * test/Makefile.am: fix so that test source code ends up in the
486 distribution on make distcheck
488 2003-01-15 Havoc Pennington <hp@redhat.com>
494 2003-01-15 Havoc Pennington <hp@redhat.com>
496 * dbus/dbus-test.c (dbus_internal_symbol_do_not_use_run_tests):
497 fix build when --disable-tests
499 * Makefile.am (EXTRA_DIST): put HACKING in here
501 * HACKING: document procedure for making a tarball release.
503 2003-01-14 Anders Carlsson <andersca@codefactory.se>
505 * bus/connection.c: (connection_error_handler),
506 (bus_connection_setup):
507 * bus/main.c: (main):
508 Make sure that the DBusConnectionData struct is NULLed
509 out to prevent a segfault.
511 * dbus/dbus-errors.c: (dbus_result_to_string):
512 * dbus/dbus-errors.h:
513 * dbus/dbus-message.c: (dbus_message_get_fields),
514 (dbus_message_get_fields_valist), (_dbus_message_test):
515 * dbus/dbus-message.h:
516 Make dbus_message_get_fields return a result code so we can
517 track invalid fields as well as oom.
519 2003-01-11 Havoc Pennington <hp@pobox.com>
521 * configure.in: change --enable-test/--enable-ansi action-if-given
522 to enable_foo=$enableval instead of enable_foo=yes
524 2003-01-08 Havoc Pennington <hp@pobox.com>
526 * dbus/dbus-string.c (_dbus_string_align_length): new function
528 * dbus/dbus-test-main.c: move main() for test app here
530 (dbus_internal_symbol_do_not_use_run_tests): we have to export a
531 symbol to run tests, because dbus-test isn't in the main
534 Code review nitpicks.
536 * dbus/dbus-message.c (dbus_message_write_header): add newlines
537 for people with narrow emacs ;-). Assert client_serial was filled
538 in. Assert message->name != NULL.
539 (dbus_message_append_fields): have "first_field_type" arg separate
540 from va list, needed for C++ binding that also uses varargs IIRC
541 and helps with type safety
542 (dbus_message_new): add @todo about using DBusString to store
543 service/name internally
544 (dbus_message_new): don't leak ->service and ->name on OOM later
546 (dbus_message_unref): free the service name
547 (dbus_message_get_fields): same change to varargs
548 i.e. first_field_type
549 (_dbus_message_loader_return_buffer): assert that the message data
550 is aligned (if not it's a bug in our code). Put in verbose griping
551 about why we set corrupted = TRUE.
552 (decode_header_data): add FIXME that char* is evil. Was going to
553 add FIXME about evil locale-specific string.h strncmp, but just
554 switched to wacky string-as-uint32 optimization. Move check for
555 "no room for field name" above get_const_data_len() to avoid
556 assertion failure in get_const_data_len if we have trailing 2
557 bytes or the like. Check for service and name fields being
558 provided twice. Don't leak service/name on error. Require field
559 names to be aligned to 4 bytes.
561 * dbus/dbus-marshal.c: move byte swap stuff to header
562 (_dbus_pack_int32): uscore-prefix
563 (_dbus_unpack_int32): uscore-prefix
564 (_dbus_unpack_uint32): export
565 (_dbus_demarshal_string): add @todo complaining about use of
567 (_dbus_marshal_get_field_end_pos): add @todo about bad error
568 handling allowing corrupt data to go unchecked
570 2003-01-08 Havoc Pennington <hp@redhat.com>
572 * dbus/dbus-transport-unix.c (unix_do_iteration): add read/write
573 to the select() as needed for authentication. (should be using
574 _dbus_poll() not select, but for another day)
576 * dbus/dbus.h: include dbus/dbus-protocol.h
578 2003-01-08 Anders Carlsson <andersca@codefactory.se>
580 * dbus/Makefile.am (dbusinclude_HEADERS): Install
583 2003-01-08 Anders Carlsson <andersca@codefactory.se>
585 * dbus/dbus-internals.c: (_dbus_type_to_string):
586 New function that returns a string describing a type.
588 * dbus/dbus-marshal.c: (_dbus_demarshal_byte_array):
589 * dbus/dbus-marshal.h:
590 * dbus/dbus-message.c: (dbus_message_get_fields_valist),
591 (dbus_message_iter_get_field_type), (dbus_message_iter_get_double),
592 (dbus_message_iter_get_byte_array):
593 * dbus/dbus-message.h:
594 Add new convenience functions for appending and getting message fields.
595 Also add demarshalling routines for byte arrays.
597 2003-01-07 Anders Carlsson <andersca@codefactory.se>
599 * dbus/dbus-connection-internal.h:
600 * dbus/dbus-connection.c: (_dbus_connection_new_for_transport),
601 (_dbus_connection_get_next_client_serial),
602 (dbus_connection_send_message):
603 * dbus/dbus-internals.h:
604 * dbus/dbus-marshal.c: (unpack_uint32), (dbus_unpack_int32),
605 (dbus_pack_int32), (_dbus_marshal_double), (_dbus_marshal_int32),
606 (_dbus_marshal_uint32), (_dbus_demarshal_double),
607 (_dbus_demarshal_int32), (_dbus_demarshal_uint32),
608 (_dbus_demarshal_string), (_dbus_marshal_get_field_end_pos),
609 (_dbus_verbose_bytes), (_dbus_marshal_test):
610 * dbus/dbus-marshal.h:
611 * dbus/dbus-message-internal.h:
612 * dbus/dbus-message.c: (_dbus_message_set_client_serial),
613 (dbus_message_write_header), (_dbus_message_lock),
614 (dbus_message_new), (dbus_message_ref), (dbus_message_unref),
615 (dbus_message_get_name), (dbus_message_append_int32),
616 (dbus_message_append_uint32), (dbus_message_append_double),
617 (dbus_message_append_string), (dbus_message_append_byte_array),
618 (dbus_message_get_fields_iter), (dbus_message_iter_ref),
619 (dbus_message_iter_unref), (dbus_message_iter_has_next),
620 (dbus_message_iter_next), (dbus_message_iter_get_field_type),
621 (dbus_message_iter_get_string), (dbus_message_iter_get_int32),
622 (dbus_message_iter_get_uint32), (dbus_message_iter_get_double),
623 (decode_header_data), (_dbus_message_loader_return_buffer),
624 (message_iter_test), (_dbus_message_test):
625 * dbus/dbus-message.h:
626 * dbus/dbus-protocol.h:
627 * dbus/dbus-test.c: (main):
629 * glib/test-dbus-glib.c: (message_handler), (main):
630 * test/echo-client.c: (main):
631 * test/watch.c: (check_messages):
632 Make messages sendable and receivable for real.
634 2003-01-07 Anders Carlsson <andersca@codefactory.se>
636 * dbus/dbus-marshal.c: (_dbus_marshal_double),
637 (_dbus_marshal_string), (_dbus_marshal_byte_array):
638 * dbus/dbus-message.c: (dbus_message_append_int32),
639 (dbus_message_append_uint32), (dbus_message_append_double),
640 (dbus_message_append_string), (dbus_message_append_byte_array):
641 Handle OOM restoration.
643 2003-01-07 Anders Carlsson <andersca@codefactory.se>
645 * dbus/dbus-marshal.c: (_dbus_marshal_string),
646 (_dbus_demarshal_string), (_dbus_marshal_test):
647 * dbus/dbus-marshal.h:
648 * dbus/dbus-message.c: (dbus_message_get_name),
649 Document these functions.
651 (dbus_message_append_int32), (dbus_message_append_uint32),
652 (dbus_message_append_double), (dbus_message_append_string),
653 (dbus_message_append_byte_array):
654 * dbus/dbus-message.h:
655 Add functions for adding message fields of different types.
657 * dbus/dbus-protocol.h:
658 Add the different types.
660 2003-01-05 Havoc Pennington <hp@pobox.com>
662 * bus/connection.c: implement routines for handling connections,
663 first thing is keeping a list of owned services on each connection
664 and setting up watches etc.
666 * bus/services.c: implement a mapping from service names to lists
669 * dbus/dbus-hash.c: add DBUS_HASH_POINTER
671 * dbus/dbus-threads.c (dbus_static_mutex_lock): add functions
672 to use static mutexes for global data
674 * dbus/dbus-connection.c (dbus_connection_set_data): add new
675 collection of functions to set/get application-specific data
676 on the DBusConnection.
678 2003-01-04 Havoc Pennington <hp@pobox.com>
680 * dbus/dbus-sysdeps.c (_dbus_sleep_milliseconds): new function
681 (_dbus_poll): new function
683 * dbus/dbus-internals.h (_DBUS_STRUCT_OFFSET): new macro
686 * bus/loop.c: initial code for the daemon main loop
688 2003-01-04 Havoc Pennington <hp@pobox.com>
690 * test/watch.c (error_handler): make it safe if the error handler
691 is called multiple times (if we s/error handler/disconnect
692 handler/ we should just guarantee it's called only once)
694 * dbus/dbus-transport.c (_dbus_transport_disconnect): call the
695 error handler on disconnect (it's quite possible we should
696 just change the error handler to a "disconnect handler," I'm
697 not sure we have any other meaningful errors)
699 * configure.in: check for getpwnam_r
701 * dbus/dbus-transport.c, dbus/dbus-transport-unix.c,
702 dbus/dbus-auth.c: add credentials support, add EXTERNAL auth
703 mechanism as in SASL spec, using socket credentials
705 * dbus/dbus-sysdeps.c (_dbus_read_credentials_unix_socket): new function
706 (_dbus_send_credentials_unix_socket): new function
708 * dbus/dbus-sysdeps.c (_dbus_accept_unix_socket): rename just
710 (_dbus_write): only check errno if <0 returned
711 (_dbus_write_two): ditto
713 2003-01-02 Anders Carlsson <andersca@codefactory.se>
715 * dbus/dbus-marshal.c: (_dbus_marshal_utf8_string),
716 (_dbus_marshal_byte_array), (_dbus_demarshal_utf8_string),
717 (_dbus_marshal_test):
718 * dbus/dbus-marshal.h:
719 Add _dbus_marshal_byte_array and rename _dbus_marshal_string
720 to _dbus_marshal_utf8_string. Also fix some tests.
722 2002-12-28 Harri Porten <porten@kde.org>
724 * configure.in: added check for C++ compiler and a very cheesy
725 check for the Qt integration
727 * Makefile.am (SUBDIRS): compile qt subdir if support is enabled
729 * qt/Makefile.am: added
731 * qt/.cvsignore: added
733 * qt/dbus-qthread.cc, qt/dbus-qthread.cpp: renamed former to
734 latter, added #ifdef QT_THREAD_SUPPORT guard.
736 * dbus/Makefile.am: added missing headers for make dist
738 2002-12-28 Kristian Rietveld <kris@gtk.org>
740 * dbus/Makefile.am: fixup export-symbols-regex.
742 2002-12-27 Anders Carlsson <andersca@codefactory.se>
744 * acinclude.m4: Add this file and put the
745 PKG_CHECK_MODULE macro in it.
747 2002-12-27 Anders Carlsson <andersca@codefactory.se>
749 * dbus/dbus-marshal.c: (_dbus_marshal_string),
750 (_dbus_demarshal_double), (_dbus_demarshal_int32),
751 (_dbus_demarshal_uint32), (_dbus_demarshal_string),
752 (_dbus_marshal_test):
753 Make the demarshalling routines align the pos argument.
754 Add string marshalling tests and fix the obvious bugs
757 2002-12-26 Havoc Pennington <hp@pobox.com>
759 * dbus/dbus-auth.c: fixes fixes fixes
761 * dbus/dbus-transport-unix.c: wire up support for
762 encoding/decoding data on the wire
764 * dbus/dbus-auth.c (_dbus_auth_encode_data)
765 (_dbus_auth_decode_data): append to target string
766 instead of nuking it.
768 2002-12-26 Havoc Pennington <hp@pobox.com>
770 * dbus/dbus-marshal.h (DBUS_COMPILER_BYTE_ORDER): #ifdef
771 WORDS_BIGENDIAN then compiler byte order is DBUS_BIG_ENDIAN,
774 * dbus/dbus-marshal.c: Add macros to do int swapping in-place and
775 avoid swap_bytes() overhead (ignoring possible assembly stuff for
776 now). Main point is because I wanted unpack_uint32 to implement
778 (_dbus_verbose_bytes): new function
780 * dbus/dbus-string.c (_dbus_string_validate_ascii): new function
782 * dbus/dbus-message.c (_dbus_message_loader_get_is_corrupted): add
783 mechanism to handle a corrupt message stream
784 (_dbus_message_loader_new): fix preallocation to only prealloc,
787 * dbus/dbus-string.c (_dbus_string_skip_blank): fix this function
788 (_dbus_string_test): enhance tests for copy/move and fix the
791 * dbus/dbus-transport-unix.c: Hold references in more places to
792 avoid reentrancy problems
794 * dbus/dbus-transport.c: ditto
796 * dbus/dbus-connection.c (dbus_connection_dispatch_message): don't
797 leak reference count in no-message case
799 * test/watch.c (do_mainloop): handle adding/removing watches
800 during iteration over the watches. Also, ref the connection/server
801 stored on a watch, so we don't try to mangle a destroyed one.
803 * dbus/dbus-transport-unix.c (do_authentication): perform
806 * dbus/dbus-auth.c (get_state): add a state
807 AUTHENTICATED_WITH_UNUSED_BYTES and return it if required
808 (_dbus_auth_get_unused_bytes): append the unused bytes
809 to the passed in string, rather than prepend
811 * dbus/dbus-transport.c (_dbus_transport_init_base): create
812 the auth conversation DBusAuth
814 * dbus/dbus-transport-unix.c (_dbus_transport_new_for_fd)
815 (_dbus_transport_new_for_domain_socket): when creating a
816 transport, pass in whether it's a client-side or server-side
817 transport so we know which DBusAuth to create
819 2002-12-03 Havoc Pennington <hp@pobox.com>
821 * dbus/dbus-transport-unix.c (unix_finalize): finalize base
822 _after_ finalizing the derived members
823 (unix_connection_set): unref watch if we fail to add it
825 * dbus/dbus-connection.c (dbus_connection_unref): delete the
826 transport first, so that the connection owned by the
827 transport will be valid as the transport finalizes.
829 * dbus/dbus-transport-unix.c (unix_finalize): free the write_watch
830 if necessary, and remove watches from the connection.
832 * dbus/dbus-watch.c (_dbus_watch_list_free): improve a comment
834 2002-12-26 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 * dbus/dbus-marshal.h:
841 Add string marshal functions and have the demarshal functions
842 return the new position.
844 2002-12-25 Havoc Pennington <hp@pobox.com>
846 * doc/dbus-sasl-profile.txt: docs on the authentication protocol,
847 it is a simple protocol that just maps directly to SASL.
849 * dbus/dbus-auth.h, dbus/dbus-auth.c: authentication protocol
850 initial implementation, not actually used yet.
852 * dbus/dbus-string.c (_dbus_string_find): new function
853 (_dbus_string_equal): new function
854 (_dbus_string_base64_encode): new function
855 (_dbus_string_base64_decode): new function
857 2002-12-25 Anders Carlsson <andersca@codefactory.se>
860 * dbus/dbus-marshal.c: (swap_bytes), (_dbus_marshal_double),
861 (_dbus_marshal_int32), (_dbus_marshal_uint32),
862 (_dbus_demarshal_double), (_dbus_demarshal_int32),
863 (_dbus_demarshal_uint32), (_dbus_marshal_test):
864 * dbus/dbus-marshal.h:
865 * dbus/dbus-protocol.h:
866 * dbus/dbus-test.c: (main):
868 Add un-optimized marshalling/demarshalling routines.
870 2002-12-25 Harri Porten <porten@kde.org>
872 * qt/dbus-qt.h: adjusted ctor and getter to KDE/Qt conventions
874 2002-12-24 Zack Rusin <zack@kde.org>
876 * qt/dbus-qthread.cc: adding - integrates QMutex into Dbus
877 * qt/dbus-qt.h: skeleton with two sample implemenatation of the
880 2002-12-24 Havoc Pennington <hp@pobox.com>
882 * glib/dbus-gthread.c: fix include
884 * glib/dbus-glib.h: rename DBusMessageHandler for now.
885 I think glib API needs to change, though, as you don't
886 want to use DBusMessageFunction, you want to use the
887 DBusMessageHandler object. Probably
888 dbus_connection_open_with_g_main_loop()
889 and dbus_connection_setup_g_main_loop() or something like that
890 (but think of better names...) that just create a connection
891 that has watch/timeout functions etc. already set up.
893 * dbus/dbus-connection.c
894 (dbus_connection_send_message_with_reply): new function just to
895 show how the message handler helps us deal with replies.
897 * dbus/dbus-list.c (_dbus_list_remove_last): new function
899 * dbus/dbus-string.c (_dbus_string_test): free a string that
902 * dbus/dbus-hash.c: use memory pools for the hash entries
903 (rebuild_table): be more paranoid about overflow, and
904 shrink table when we can
905 (_dbus_hash_test): reduce number of sprintfs and write
906 valid C89. Add tests for case where we grow and then
907 shrink the hash table.
909 * dbus/dbus-mempool.h, dbus/dbus-mempool.c: memory pools
911 * dbus/dbus-connection.c (dbus_connection_register_handler)
912 (dbus_connection_unregister_handler): new functions
914 * dbus/dbus-message.c (dbus_message_get_name): new
916 * dbus/dbus-list.c: fix docs typo
918 * dbus/dbus-message-handler.h, dbus/dbus-message-handler.c:
919 an object representing a handler for messages.
921 2002-12-16 Anders Carlsson <andersca@codefactory.se>
924 * glib/dbus-gthread.c: (dbus_gthread_init):
925 Don't use the gdbus prefix for public functions.
927 2002-12-16 Anders Carlsson <andersca@codefactory.se>
931 Add GLib checks and fixup .pc files
935 * glib/dbus-gmain.c: (gdbus_connection_prepare),
936 (gdbus_connection_check), (gdbus_connection_dispatch),
937 (gdbus_add_connection_watch), (gdbus_remove_connection_watch),
938 (dbus_connection_gsource_new):
939 * glib/dbus-gthread.c: (dbus_gmutex_new), (dbus_gmutex_free),
940 (dbus_gmutex_lock), (dbus_gmutex_unlock), (dbus_gthread_init):
941 * glib/test-dbus-glib.c: (message_handler), (main):
944 2002-12-15 Harri Porten <porten@kde.org>
946 * autogen.sh: check for libtoolize before attempting to use it
948 * dbus/dbus-transport-unix.c: include <sys/time.h> for timeval
951 * .cvsignore: ignore more stamp files
953 * dbus/dbus-watch.c (_dbus_watch_list_new): fixed doc error
955 * test/Makefile.am: added -I$(top_srcdir) to be able to compile
956 without make install.
958 2002-12-15 Havoc Pennington <hp@pobox.com>
960 * dbus/dbus-threads.c: add thread stubs that a higher library
961 layer can fill in. e.g. the GLib wrapper might fill them in with
962 GThread stuff. We still need to use this thread API to
963 thread-safe-ize the library.
965 2002-12-12 Havoc Pennington <hp@pobox.com>
967 * dbus/dbus-transport-unix.c, dbus/dbus-server-unix.c: use the
968 below new interfaces and include fewer system headers.
970 * dbus/dbus-sysdeps.c (_dbus_read): new function
971 (_dbus_write): new function
972 (_dbus_write_two): new function
973 (_dbus_connect_unix_socket): new function
974 (_dbus_listen_unix_socket): new function
976 * dbus/dbus-message-internal.h: change interfaces to use
979 2002-12-11 Havoc Pennington <hp@pobox.com>
981 * dbus/dbus-types.h: add dbus_unichar
983 * dbus/dbus-internals.c (_dbus_verbose): use _dbus_getenv
985 * dbus/dbus-connection.c (dbus_connection_send_message): return
988 * dbus/dbus-transport.c: include dbus-watch.h
990 * dbus/dbus-connection.c: include dbus-message-internal.h
992 * HACKING: add file with coding guidelines stuff.
994 * dbus/dbus-string.h, dbus/dbus-string.c: Encapsulate all string
995 handling here, for security purposes (as in vsftpd). Not actually
996 using this class yet.
998 * dbus/dbus-sysdeps.h, dbus/dbus-sysdeps.c: Encapsulate all
999 system/libc usage here, as in vsftpd, for ease of auditing (and
1000 should also simplify portability). Haven't actually moved all the
1001 system/libc usage into here yet.
1003 2002-11-25 Havoc Pennington <hp@pobox.com>
1005 * dbus/dbus-internals.c (_dbus_verbose): fix to not
1006 always print the first verbose message.
1008 2002-11-24 Havoc Pennington <hp@pobox.com>
1010 * test/echo-client.c, test/echo-server.c: cheesy test
1013 * configure.in (AC_CHECK_FUNCS): check for writev
1015 * dbus/dbus-message.c (_dbus_message_get_network_data): new
1018 * dbus/dbus-list.c (_dbus_list_foreach): new function
1020 * dbus/dbus-internals.c (_dbus_verbose): new function
1022 * dbus/dbus-server.c, dbus/dbus-server.h: public object
1023 representing a server that listens for connections.
1025 * dbus/.cvsignore: create
1027 * dbus/dbus-errors.h, dbus/dbus-errors.c:
1028 public API for reporting errors
1030 * dbus/dbus-connection.h, dbus/dbus-connection.c:
1031 public object representing a connection that
1032 sends/receives messages. (Same object used for
1033 both client and server.)
1035 * dbus/dbus-transport.h, dbus/dbus-transport.c:
1036 Basic abstraction for different kinds of stream
1037 that we might read/write messages from.
1039 2002-11-23 Havoc Pennington <hp@pobox.com>
1041 * dbus/dbus-internals.h (_DBUS_INT_MAX): add _DBUS_INT_MIN
1044 * dbus/dbus-test.c (main): add list test, and include
1045 dbus-test.h as intended
1047 * dbus/dbus-hash.c (_dbus_hash_table_remove_string)
1048 (_dbus_hash_table_remove_int): return value indicates
1049 whether the entry existed to remove
1051 * dbus/dbus-list.c: add linked list utility class,
1054 * dbus/dbus-hash.c: add TODO item about shrinking the hash bucket
1057 2002-11-23 Havoc Pennington <hp@pobox.com>
1059 * Doxyfile.in (INCLUDE_FILE_PATTERNS): expand DBUS_BEGIN_DECLS/
1060 DBUS_END_DECLS to nothing, that should fix this once and for all
1062 * Doxyfile.in (JAVADOC_AUTOBRIEF): set to YES
1064 * dbus/dbus-message.c, dbus/dbus-hash.c:
1065 add some missing @brief
1067 2002-11-23 Havoc Pennington <hp@pobox.com>
1069 * dbus/dbus-message.h: put semicolons after DEBUG_BEGIN_DECLS
1070 to avoid confusing Doxygen
1072 * dbus/dbus-hash.c: @} not }@
1074 * dbus/dbus-message.c (struct DBusMessage): split out
1077 2002-11-23 Havoc Pennington <hp@pobox.com>
1079 * configure.in: pile on more warning flags if using gcc
1081 * Doxyfile.in (EXTRACT_STATIC): set to NO, so we don't have
1082 to document static functions
1084 * configure.in: add summary to end of configure so it
1085 looks nice and attractive
1087 * dbus/dbus-hash.c: finish implementation and write unit
1090 * configure.in: add --enable-tests to enable unit tests
1092 * dbus/dbus-test.c: test program to run unit tests
1093 for all files in dbus/*, initially runs a test for
1096 * dbus/dbus-internals.h: file to hold some internal utility stuff
1098 2002-11-22 Havoc Pennington <hp@redhat.com>
1100 * dbus/dbus-hash.c: copy in Tcl hash table, not yet
1101 "ported" away from Tcl
1103 * dbus/dbus-types.h: header for types such as dbus_bool_t
1105 2002-11-22 Havoc Pennington <hp@redhat.com>
1107 * dbus/dbus.h: fixups for doc warnings
1109 * Doxyfile.in (FILE_PATTERNS): we need to scan .h to pick up
1111 (QUIET): make it quiet so we can see warnings
1113 * dbus/dbus-memory.c: teach D-BUS to allocate and free memory
1115 2002-11-22 Havoc Pennington <hp@redhat.com>
1117 * Makefile.am: include "Doxyfile" target in all-local
1119 * configure.in: generate the Doxyfile
1121 * Doxyfile.in: move Doxyfile here, so we can use
1122 configure to generate a Doxyfile with the right
1125 2002-11-22 Havoc Pennington <hp@redhat.com>
1127 * dbus/dbus-message.c: move inline docs into .c file
1129 * Doxyfile (OUTPUT_DIRECTORY): move output to doc/api
1130 so all docs are under doc/
1131 (MAN_EXTENSION): generate man pages. Use extension
1132 ".3dbus" which matches ".3qt" on my system,
1133 I guess this is OK, I don't know really.
1134 (FILE_PATTERNS): look for .c files not .h, makes sense
1137 2002-11-22 Havoc Pennington <hp@pobox.com>
1139 * Makefile.am (SUBDIRS): rename subdir "server" to "bus"
1140 because any app can be a server, and any app can be a client,
1141 the bus is a special kind of server.
1143 Thu Nov 21 23:35:31 2002 Zack Rusin <zack@kde.org>
1145 * Doxyfile : adding. Still needs Makefile rules to be generated
1146 automatically (just run "doxygen" in the toplevel dir for now to
1149 * dbus/dbus-message.h : Adding sample docs (javadoc since
1150 resembles gtk-doc a little more)
1152 * dbus/dbus.h : Adding sample docs
1154 2002-11-21 Havoc Pennington <hp@redhat.com>
1156 * dbus/Makefile.am (INCLUDES): define DBUS_COMPILATION
1157 so we can allow ourselves to include files directly,
1158 instead of having to use dbus.h
1160 * dbus/dbus.h: fill in
1162 * dbus/dbus-message.h: sketch out a sample header file.
1163 Include griping if you include it directly instead of
1166 * dbus/dbus-macros.h: new file with macros for extern "C",
1167 TRUE/FALSE, NULL, etc.
1169 * doc/file-boilerplate.c: put include guards in here
1171 2002-11-21 Havoc Pennington <hp@redhat.com>
1173 * doc/file-boilerplate.c: include both AFL and GPL boilerplate.
1175 * COPYING: include the GPL as well, and license code
1176 under both AFL and GPL.
1178 2002-11-21 Havoc Pennington <hp@redhat.com>
1180 * acconfig.h: get rid of this
1182 * autogen.sh (run_configure): add --no-configure option
1184 * configure.in: remove AC_ARG_PROGRAM to make
1185 autoconf complain less. add AC_PREREQ.
1186 add AC_DEFINE third arg.
1188 2002-11-21 Anders Carlsson <andersca@codefactory.se>
1191 Fix references so we can distcheck.
1193 2002-11-21 Havoc Pennington <hp@redhat.com>
1195 * Initial module creation