1 2003-01-30 Havoc Pennington <hp@pobox.com>
3 * dbus/dbus-message.c: use message->byte_order instead of
4 DBUS_COMPILER_BYTE_ORDER throughout.
5 (dbus_message_create_header): pad header to align the
6 start of the body of the message to 8-byte boundary
8 * dbus/dbus-marshal.h: make all the demarshalers take const
11 * dbus/dbus-message.c (_dbus_message_loader_return_buffer):
12 validate message args here, so we don't have to do slow validation
13 later, and so we catch bad messages as they are incoming. Also add
14 better checks on header_len and body_len. Also fill in
17 * dbus/dbus-string.c (_dbus_string_validate_utf8): new (not
19 (_dbus_string_validate_nul): new function to check all-nul
21 * dbus/dbus-marshal.c (_dbus_marshal_get_field_end_pos): rename
22 get_arg_end_pos and remove all validation
23 (_dbus_marshal_validate_arg): actually do validation here.
25 2003-01-29 Havoc Pennington <hp@pobox.com>
27 * dbus/dbus-message.c (check_message_handling): fix assertion
28 failure on set_client_serial
30 2003-01-28 Havoc Pennington <hp@pobox.com>
32 * dbus/dbus-server-debug.c: Add doc section comments
34 * dbus/dbus-transport-debug.c: add doc section comments
36 2003-01-28 Havoc Pennington <hp@redhat.com>
38 * dbus/dbus-string.c (_dbus_string_base64_decode): append bytes in
39 the reverse order from how I had it
40 (_dbus_string_base64_encode): reverse encoding order. I was
41 basically byteswapping everything during encoding.
43 2003-01-28 Anders Carlsson <andersca@codefactory.se>
45 * dbus/dbus-connection-internal.h:
46 * dbus/dbus-connection.c: (_dbus_connection_add_timeout),
47 (_dbus_connection_remove_timeout):
48 Add functions for adding and removing timeouts.
50 * dbus/dbus-message.c: (dbus_message_new_from_message):
51 Add new function that takes a message and creates an exact
52 copy of it, but with the refcount set to 1.
53 (check_message_handling):
56 * dbus/dbus-server-protected.h:
57 * dbus/dbus-server.c: (_dbus_server_init_base),
58 (_dbus_server_finalize_base), (_dbus_server_add_timeout),
59 (dbus_server_set_timeout_functions):
60 (_dbus_server_remove_timeout):
61 New functions so that a server can add and remove timeouts.
64 Add commented out call to dbus_server_debug_new.
66 * dbus/dbus-timeout.c: (_dbus_timeout_new):
67 Actually set the handler, doh.
69 * dbus/dbus-transport.c: (_dbus_transport_open):
70 Add commented out call to dbus_transport_debug_client_new.
73 Add dbus-transport-debug.[ch] and dbus-server-debug.[ch]
75 2003-01-28 Havoc Pennington <hp@pobox.com>
77 * dbus/dbus-message.c (check_message_handling): function to check
78 on the loaded message, iterates over it etc.
80 2003-01-28 Havoc Pennington <hp@pobox.com>
82 * test/Makefile.am (dist-hook): fix make distdir
84 * dbus/Makefile.am (TESTS_ENVIRONMENT): fix make check
86 2003-01-27 Havoc Pennington <hp@pobox.com>
88 * dbus/dbus-mempool.c (time_for_size): replace printf with
91 * dbus/dbus-message-builder.c (_dbus_message_data_load): allow
92 empty lines; fix the SAVE_LENGTH stuff to be
93 START_LENGTH/END_LENGTH so it actually works; couple other
96 * test/Makefile.am (dist-hook): add dist-hook for .message files
98 * dbus/dbus-string.c (DBUS_STRING_COPY_PREAMBLE): source of a copy
99 can be constant or locked.
100 (_dbus_string_free): allow freeing a const string as
103 * dbus/dbus-sysdeps.c (_dbus_concat_dir_and_file): utility
105 * dbus/dbus-test-main.c (main): take an argument which is the
106 directory containing test data
108 * dbus/dbus-message.c (_dbus_message_test): pass a test_data_dir
109 argument to this and load all the messages in test/data/
110 checking that they can be loaded or not loaded as appropriate.
112 2003-01-27 Anders Carlsson <andersca@codefactory.se>
114 * bus/dispatch.c: (bus_dispatch_message_handler):
115 Dispatch messages sent to services.
117 * bus/driver.c: (bus_driver_send_service_deleted),
118 (bus_driver_send_service_created), (bus_driver_send_service_lost),
119 (bus_driver_send_service_acquired):
120 Add helper functions for sending service related messages.
122 (bus_driver_send_welcome_message):
123 Send HELLO_REPLY instead of WELCOME.
125 (bus_driver_handle_list_services):
126 Send LIST_SERVICES_REPLY instead of SERVICES.
128 (bus_driver_handle_own_service),
129 (bus_driver_handle_service_exists):
130 New message handlers.
132 (bus_driver_handle_message):
133 Invoke new message handlers.
135 (bus_driver_remove_connection):
136 Don't remove any services here since that's done automatically
137 by bus_service_remove_owner now.
140 New function signatures.
142 * bus/services.c: (bus_service_add_owner):
143 Send ServiceAcquired message if we're the only primary owner.
145 (bus_service_remove_owner):
146 Send ServiceAcquired/ServiceLost messages.
148 (bus_service_set_prohibit_replacement),
149 (bus_service_get_prohibit_replacement):
150 Functions for setting prohibit replacement.
152 (bus_service_has_owner):
153 New function that checks if a connection is in the owner queue of
157 Add new function signatures.
159 * dbus/dbus-list.c: (_dbus_list_test):
160 Add tests for _dbus_list_remove_last and traversing the list backwards.
163 Fix a typo in _dbus_list_get_prev_link, if we're at the first element we can't
164 go any further, so return NULL then.
166 * dbus/dbus-protocol.h:
167 Add new messages, service flags and service replies.
169 2003-01-26 Havoc Pennington <hp@pobox.com>
171 * dbus/dbus-message-builder.c: implement, completely untested.
173 * test/data/*: add data to be used in testing.
174 ".message" files are our simple loadable text format.
175 ".message-raw" will be binary dumps of messages.
177 * dbus/dbus-string.c (_dbus_string_starts_with_c_str): new
179 2003-01-26 Havoc Pennington <hp@pobox.com>
181 * dbus/dbus-sysdeps.c (_dbus_file_get_contents): new function
183 * dbus/dbus-errors.c (dbus_result_to_string): add
186 * dbus/dbus-message-builder.c: new file, will contain code to load
187 up messages from files. Not implemented yet.
189 2003-01-26 Havoc Pennington <hp@pobox.com>
191 * dbus/dbus-message.c (dbus_message_set_sender): support deleting
192 the sender by setting to NULL
194 2003-01-26 Havoc Pennington <hp@pobox.com>
196 The unit tests pass, but otherwise untested. If it breaks, the
197 tests should have been better. ;-)
199 * bus/driver.c (bus_driver_handle_hello): return if we disconnect
202 * dbus/dbus-message.c: redo everything so we maintain
203 message->header as the only copy of the various fields.
204 This avoids the possibility of out-of-memory in some cases,
205 for example dbus_message_lock() can't run out of memory anymore,
206 and avoids extra copying. Figured I may as well go ahead and do
207 this since it was busted for dbus_message_lock to not return
208 failure on OOM, and dbus_message_write_header was totally
209 unchecked for OOM. Also fixed some random other bugs.
211 * dbus/dbus-marshal.c (_dbus_marshal_get_field_end_pos): verify
212 that strings are nul-terminated. Also, end_pos can be equal
213 to string length just not greater than, I think.
214 (_dbus_marshal_set_int32): new function
215 (_dbus_marshal_set_uint32): new function
216 (_dbus_marshal_set_string): new function
218 * dbus/dbus-connection.c (_dbus_connection_new_for_transport): fix
219 a warning, init timeout_list to NULL
220 (dbus_connection_send_message): don't use uninitialized variable
223 * dbus/dbus-string.c (_dbus_string_replace_len): new function
225 2003-01-26 Anders Carlsson <andersca@codefactory.se>
227 * bus/driver.c: (bus_driver_handle_hello),
228 (bus_driver_send_welcome_message):
231 2003-01-26 Anders Carlsson <andersca@codefactory.se>
233 * dbus/dbus-auth.c: (process_auth), (_dbus_auth_unref):
234 * dbus/dbus-connection.c: (_dbus_connection_new_for_transport),
235 (dbus_connection_unref):
236 * dbus/dbus-marshal.c: (_dbus_marshal_test):
237 * dbus/dbus-message.c: (dbus_message_unref),
240 (dbus_message_get_fields):
241 Remove debugging printout.
243 (_dbus_message_loader_return_buffer):
244 Don't store the header string.
246 (_dbus_message_test):
249 2003-01-26 Richard Hult <rhult@codefactory.se>
251 * glib/dbus-gmain.c (dbus_connection_dispatch): Traverse a copy of
252 the file descriptor list, since it can change under us.
254 2003-01-25 Anders Carlsson <andersca@codefactory.se>
256 * glib/dbus-gmain.c: (dbus_connection_prepare),
257 (dbus_connection_check), (dbus_connection_dispatch), (add_watch),
258 (remove_watch), (dbus_connection_hookup_with_g_main):
259 Rewrite the glib handling to use its own GSource instead of a
260 GIOChannel so we can catch messages put in the queue while waiting
263 2003-01-25 Anders Carlsson <andersca@codefactory.se>
266 * bus/connection.c: (connection_disconnect_handler),
267 (connection_watch_callback), (bus_connection_setup):
268 * bus/dispatch.c: (send_one_message),
269 (bus_dispatch_broadcast_message), (bus_dispatch_message_handler),
270 (bus_dispatch_add_connection), (bus_dispatch_remove_connection):
272 * bus/driver.c: (bus_driver_send_service_deleted),
273 (bus_driver_send_service_created), (bus_driver_handle_hello),
274 (bus_driver_send_welcome_message),
275 (bus_driver_handle_list_services), (bus_driver_remove_connection),
276 (bus_driver_handle_message):
278 Refactor code, put the message dispatching in its own file. Use
279 _DBUS_HANDLE_OOM. Also send ServiceDeleted messages when a client
282 2003-01-25 Anders Carlsson <andersca@codefactory.se>
284 * dbus/dbus-internals.h:
285 Add _DBUS_HANDLE_OOM macro, it doesn't do anything currently.
287 * dbus/dbus-message.c: (dbus_message_get_sender):
288 * dbus/dbus-message.h:
289 Implement dbus_message_get_sender.
291 * dbus/dbus-protocol.h:
292 Add message and service defines.
294 2003-01-25 Anders Carlsson <andersca@codefactory.se>
296 * dbus/dbus-connection.c: (dbus_connection_send_message):
297 * dbus/dbus-message-internal.h:
298 * dbus/dbus-message.c: (_dbus_message_get_client_serial),
299 (dbus_message_write_header):
300 Remove _dbus_messag_unlock and don't set the client serial on a
301 message if one already exists.
303 2003-01-24 Havoc Pennington <hp@pobox.com>
305 * dbus/dbus-list.c (alloc_link): put a thread lock on the global
308 * bus/driver.c (bus_driver_handle_list_services): fix a leak
311 2003-01-25 Anders Carlsson <andersca@codefactory.se>
313 * dbus/dbus-list.c: (alloc_link), (free_link):
314 Use a memory pool for the links.
316 2003-01-25 Anders Carlsson <andersca@codefactory.se>
318 * bus/connection.c: (bus_connection_foreach):
320 Add new bus_connection_foreach function.
322 * bus/driver.c: (send_one_message), (bus_driver_broadcast_message):
323 Add function that broadcasts a message to all clients.
325 (bus_driver_send_service_created), (bus_driver_handle_hello),
326 (bus_driver_send_welcome_message),
327 (bus_driver_handle_list_services), (bus_driver_message_handler):
328 Implement functions that take care of listing services, and notifying
329 clients when new services are created.
331 * bus/services.c: (bus_services_list):
333 Add new function that returns an array of strings with the currently
338 Update copyright year.
340 2003-01-25 Anders Carlsson <andersca@codefactory.se>
342 * dbus/dbus-connection.c: (dbus_connection_send_message):
343 Unlock the message in case it was sent earlier.
345 (dbus_connection_send_message_with_reply_and_block):
346 Remove the reply message from the list.
348 * dbus/dbus-marshal.c: (_dbus_demarshal_string_array):
349 Set array_len and new_pos correctly.
351 (_dbus_marshal_test):
354 * dbus/dbus-message-internal.h:
355 * dbus/dbus-message.c: (_dbus_message_get_reply_serial):
356 New function that returns the reply serial.
358 (_dbus_message_unlock):
359 New function that unlocks a message and resets its header.
361 (dbus_message_append_string_array),
362 (dbus_message_get_fields_valist),
363 (dbus_message_iter_get_field_type),
364 (dbus_message_iter_get_string_array),
365 (dbus_message_get_fields),
366 (dbus_message_append_fields_valist):
367 Handle string arrays.
369 (dbus_message_set_sender):
370 Make this function public since the bus daemon needs it.
372 (decode_header_data):
373 Set the reply serial to -1 initially.
375 * dbus/dbus-message.h:
376 Add dbus_message_set_sender.
378 2003-01-24 Havoc Pennington <hp@pobox.com>
380 * doc/dbus-specification.sgml: add some stuff
382 2003-01-22 Havoc Pennington <hp@pobox.com>
384 * doc/dbus-specification.sgml: Start to document the protocol.
386 2003-01-22 Havoc Pennington <hp@pobox.com>
388 * dbus/dbus-connection.c
389 (dbus_connection_send_message_with_reply_and_block): add some @todo
391 * bus/driver.c (bus_driver_add_connection): add a FIXME about memleak
393 2003-01-21 Havoc Pennington <hp@pobox.com>
395 (patch untested because can't compile)
397 * bus/driver.c (create_unique_client_name): make this function
398 never recycle client names. Also, caller should initialize
401 * dbus/dbus-sysdeps.c (_dbus_get_current_time): new function
403 2003-01-21 Anders Carlsson <andersca@codefactory.se>
405 * dbus/dbus-marshal.c: (_dbus_marshal_double),
406 (_dbus_marshal_int32), (_dbus_marshal_uint32),
407 (_dbus_marshal_int32_array), (_dbus_marshal_uint32_array),
408 (_dbus_marshal_double_array), (_dbus_marshal_string_array),
409 (_dbus_demarshal_int32_array), (_dbus_demarshal_uint32_array),
410 (_dbus_demarshal_double_array), (_dbus_demarshal_string_array),
411 (_dbus_marshal_get_field_end_pos), (_dbus_marshal_test):
412 * dbus/dbus-marshal.h:
413 * dbus/dbus-protocol.h:
414 Add support for marshalling and demarshalling integer, double
417 2003-01-21 Anders Carlsson <andersca@codefactory.se>
422 * bus/connection.c: (connection_disconnect_handler):
423 Remove the connection from the bus driver's list.
425 (connection_watch_callback): Dispatch messages.
427 (free_connection_data): Free connection name.
429 (bus_connection_setup): Add connection to the bus driver's list.
430 (bus_connection_remove_owned_service):
431 (bus_connection_set_name), (bus_connection_get_name):
432 Add functions for setting and getting the connection's name.
435 Add function headers.
437 * bus/driver.c: (create_unique_client_name),
438 (bus_driver_handle_hello_message),
439 (bus_driver_send_welcome_message), (bus_driver_message_handler),
440 (bus_driver_add_connection), (bus_driver_remove_connection):
443 * bus/services.c: (bus_service_free):
445 New file that handles communication and registreation with the bus
448 2003-01-21 Anders Carlsson <andersca@codefactory.se>
450 * dbus/dbus-connection.c: (dbus_connection_send_message):
451 Add a new client_serial parameter.
453 (dbus_connection_send_message_with_reply):
454 Remove a @todo since we've implemented the blocking function.
456 (dbus_connection_send_message_with_reply_and_block):
457 New function that sends a message and waits for a reply and
458 then returns the reply.
460 * dbus/dbus-connection.h:
463 * dbus/dbus-errors.c: (dbus_result_to_string):
464 * dbus/dbus-errors.h:
467 * dbus/dbus-message-internal.h:
468 * dbus/dbus-message.c: (_dbus_message_get_reply_serial),
469 (_dbus_message_set_sender), (dbus_message_write_header),
470 (dbus_message_new_reply), (decode_header_data),
471 (_dbus_message_loader_return_buffer), (_dbus_message_test):
472 * dbus/dbus-message.h:
473 Add new functions that set the reply serial and sender.
474 Also marshal and demarshal them correctly and add test.
476 * dbus/dbus-protocol.h:
477 Add new DBUS_MESSAGE_TYPE_SENDER.
480 * glib/dbus-gmain.c: (watch_callback), (free_callback_data),
481 (add_watch), (remove_watch), (add_timeout), (remove_timeout),
482 (dbus_connection_hookup_with_g_main):
483 * glib/test-dbus-glib.c: (main):
484 Rewrite to use GIOChannel and remove the GSource crack.
486 * test/echo-client.c: (main):
487 * test/watch.c: (check_messages):
488 Update for changed APIs
490 2003-01-19 Anders Carlsson <andersca@codefactory.se>
492 * dbus/Makefile.am: Add dbus-timeout.[cħ]
494 * dbus/dbus-connection.c: (_dbus_connection_new_for_transport):
495 Create a DBusTimeoutList.
496 (dbus_connection_set_timeout_functions): Add new function to
497 set timeout callbacks
499 * dbus/dbus-connection.h: Add public DBusTimeout API.
501 * dbus/dbus-message.c: (dbus_message_get_service):
502 * dbus/dbus-message.h: New function.
504 * dbus/dbus-server.c: Fix small doc typo.
506 * dbus/dbus-timeout.[ch]: New files for mainloop timeouts.
508 2003-01-19 Anders Carlsson <andersca@codefactory.se>
510 * dbus/dbus-string.c (_dbus_string_move_len): Don't delete all
511 of the string, just as long as specified.
513 2003-01-19 Havoc Pennington <hp@pobox.com>
515 * dbus/dbus-connection.c (dbus_connection_get_is_authenticated):
518 * dbus/dbus-server.c (dbus_server_set_max_connections)
519 (dbus_server_get_max_connections, dbus_server_get_n_connections):
520 keep track of current number of connections, and add API for
521 setting a max (but haven't implemented enforcing the max yet)
523 2003-01-18 Havoc Pennington <hp@pobox.com>
525 * dbus/dbus-transport-unix.c (unix_do_iteration): only do the
526 reading/writing if read_watch != NULL or write_watch != NULL.
528 * dbus/dbus-message.c (_dbus_message_loader_return_buffer): fix
529 the message loader code to actually load message->header and
530 message->body into the newly-created message.
532 * dbus/dbus-transport-unix.c (check_write_watch): fix a mem leak
535 * dbus/dbus-connection.c (dbus_connection_set_max_message_size)
536 (dbus_connection_get_max_message_size)
537 (dbus_connection_set_max_live_messages_size)
538 (dbus_connection_get_max_live_messages_size): implement some
539 resource limitation functions
541 * dbus/dbus-resources.c: new file implementing some of the
542 resource limits stuff
544 * dbus/dbus-message.c (dbus_message_iter_get_byte_array): add
545 missing docs, add @todo to handle OOM etc.
547 * dbus/dbus-marshal.c (_dbus_demarshal_byte_array): add missing
550 2003-01-18 Havoc Pennington <hp@pobox.com>
552 * dbus/dbus-connection.c (dbus_connection_unref): disconnect the
553 connection if it hasn't been already.
555 * dbus/dbus-connection.h: kill off the idea of an ErrorFunction,
556 replace with DisconnectFunction.
558 2003-01-18 Havoc Pennington <hp@pobox.com>
560 Building --disable-verbose-mode --disable-asserts --disable-tests
561 cuts the library from 112K to 45K or so
563 * configure.in: check for varargs macro support,
564 add --enable-verbose-mode, --enable-asserts.
566 * dbus/dbus-internals.h (_dbus_assert): support
568 (_dbus_verbose): support DBUS_ENABLE_VERBOSE_MODE
570 2003-01-18 Havoc Pennington <hp@pobox.com>
572 * dbus/dbus-test.c: include config.h so that tests actually run
574 * dbus/dbus-string.c: add assertions that stuff is 8-byte aligned,
575 so the failure mode when that assumption fails will be plenty
578 2003-01-18 Havoc Pennington <hp@pobox.com>
580 * configure.in: default --enable-tests to $USE_MAINTAINER_MODE
582 * dbus/Makefile.am: fix it up so dubs-test-main.c is included in
585 * test/Makefile.am: don't use special variable "TESTS" for echo-*
586 since we don't want to use those in make check
588 2003-01-15 Havoc Pennington <hp@redhat.com>
594 2003-01-15 Havoc Pennington <hp@redhat.com>
596 * test/Makefile.am: fix so that test source code ends up in the
597 distribution on make distcheck
599 2003-01-15 Havoc Pennington <hp@redhat.com>
605 2003-01-15 Havoc Pennington <hp@redhat.com>
607 * dbus/dbus-test.c (dbus_internal_symbol_do_not_use_run_tests):
608 fix build when --disable-tests
610 * Makefile.am (EXTRA_DIST): put HACKING in here
612 * HACKING: document procedure for making a tarball release.
614 2003-01-14 Anders Carlsson <andersca@codefactory.se>
616 * bus/connection.c: (connection_error_handler),
617 (bus_connection_setup):
618 * bus/main.c: (main):
619 Make sure that the DBusConnectionData struct is NULLed
620 out to prevent a segfault.
622 * dbus/dbus-errors.c: (dbus_result_to_string):
623 * dbus/dbus-errors.h:
624 * dbus/dbus-message.c: (dbus_message_get_fields),
625 (dbus_message_get_fields_valist), (_dbus_message_test):
626 * dbus/dbus-message.h:
627 Make dbus_message_get_fields return a result code so we can
628 track invalid fields as well as oom.
630 2003-01-11 Havoc Pennington <hp@pobox.com>
632 * configure.in: change --enable-test/--enable-ansi action-if-given
633 to enable_foo=$enableval instead of enable_foo=yes
635 2003-01-08 Havoc Pennington <hp@pobox.com>
637 * dbus/dbus-string.c (_dbus_string_align_length): new function
639 * dbus/dbus-test-main.c: move main() for test app here
641 (dbus_internal_symbol_do_not_use_run_tests): we have to export a
642 symbol to run tests, because dbus-test isn't in the main
645 Code review nitpicks.
647 * dbus/dbus-message.c (dbus_message_write_header): add newlines
648 for people with narrow emacs ;-). Assert client_serial was filled
649 in. Assert message->name != NULL.
650 (dbus_message_append_fields): have "first_field_type" arg separate
651 from va list, needed for C++ binding that also uses varargs IIRC
652 and helps with type safety
653 (dbus_message_new): add @todo about using DBusString to store
654 service/name internally
655 (dbus_message_new): don't leak ->service and ->name on OOM later
657 (dbus_message_unref): free the service name
658 (dbus_message_get_fields): same change to varargs
659 i.e. first_field_type
660 (_dbus_message_loader_return_buffer): assert that the message data
661 is aligned (if not it's a bug in our code). Put in verbose griping
662 about why we set corrupted = TRUE.
663 (decode_header_data): add FIXME that char* is evil. Was going to
664 add FIXME about evil locale-specific string.h strncmp, but just
665 switched to wacky string-as-uint32 optimization. Move check for
666 "no room for field name" above get_const_data_len() to avoid
667 assertion failure in get_const_data_len if we have trailing 2
668 bytes or the like. Check for service and name fields being
669 provided twice. Don't leak service/name on error. Require field
670 names to be aligned to 4 bytes.
672 * dbus/dbus-marshal.c: move byte swap stuff to header
673 (_dbus_pack_int32): uscore-prefix
674 (_dbus_unpack_int32): uscore-prefix
675 (_dbus_unpack_uint32): export
676 (_dbus_demarshal_string): add @todo complaining about use of
678 (_dbus_marshal_get_field_end_pos): add @todo about bad error
679 handling allowing corrupt data to go unchecked
681 2003-01-08 Havoc Pennington <hp@redhat.com>
683 * dbus/dbus-transport-unix.c (unix_do_iteration): add read/write
684 to the select() as needed for authentication. (should be using
685 _dbus_poll() not select, but for another day)
687 * dbus/dbus.h: include dbus/dbus-protocol.h
689 2003-01-08 Anders Carlsson <andersca@codefactory.se>
691 * dbus/Makefile.am (dbusinclude_HEADERS): Install
694 2003-01-08 Anders Carlsson <andersca@codefactory.se>
696 * dbus/dbus-internals.c: (_dbus_type_to_string):
697 New function that returns a string describing a type.
699 * dbus/dbus-marshal.c: (_dbus_demarshal_byte_array):
700 * dbus/dbus-marshal.h:
701 * dbus/dbus-message.c: (dbus_message_get_fields_valist),
702 (dbus_message_iter_get_field_type), (dbus_message_iter_get_double),
703 (dbus_message_iter_get_byte_array):
704 * dbus/dbus-message.h:
705 Add new convenience functions for appending and getting message fields.
706 Also add demarshalling routines for byte arrays.
708 2003-01-07 Anders Carlsson <andersca@codefactory.se>
710 * dbus/dbus-connection-internal.h:
711 * dbus/dbus-connection.c: (_dbus_connection_new_for_transport),
712 (_dbus_connection_get_next_client_serial),
713 (dbus_connection_send_message):
714 * dbus/dbus-internals.h:
715 * dbus/dbus-marshal.c: (unpack_uint32), (dbus_unpack_int32),
716 (dbus_pack_int32), (_dbus_marshal_double), (_dbus_marshal_int32),
717 (_dbus_marshal_uint32), (_dbus_demarshal_double),
718 (_dbus_demarshal_int32), (_dbus_demarshal_uint32),
719 (_dbus_demarshal_string), (_dbus_marshal_get_field_end_pos),
720 (_dbus_verbose_bytes), (_dbus_marshal_test):
721 * dbus/dbus-marshal.h:
722 * dbus/dbus-message-internal.h:
723 * dbus/dbus-message.c: (_dbus_message_set_client_serial),
724 (dbus_message_write_header), (_dbus_message_lock),
725 (dbus_message_new), (dbus_message_ref), (dbus_message_unref),
726 (dbus_message_get_name), (dbus_message_append_int32),
727 (dbus_message_append_uint32), (dbus_message_append_double),
728 (dbus_message_append_string), (dbus_message_append_byte_array),
729 (dbus_message_get_fields_iter), (dbus_message_iter_ref),
730 (dbus_message_iter_unref), (dbus_message_iter_has_next),
731 (dbus_message_iter_next), (dbus_message_iter_get_field_type),
732 (dbus_message_iter_get_string), (dbus_message_iter_get_int32),
733 (dbus_message_iter_get_uint32), (dbus_message_iter_get_double),
734 (decode_header_data), (_dbus_message_loader_return_buffer),
735 (message_iter_test), (_dbus_message_test):
736 * dbus/dbus-message.h:
737 * dbus/dbus-protocol.h:
738 * dbus/dbus-test.c: (main):
740 * glib/test-dbus-glib.c: (message_handler), (main):
741 * test/echo-client.c: (main):
742 * test/watch.c: (check_messages):
743 Make messages sendable and receivable for real.
745 2003-01-07 Anders Carlsson <andersca@codefactory.se>
747 * dbus/dbus-marshal.c: (_dbus_marshal_double),
748 (_dbus_marshal_string), (_dbus_marshal_byte_array):
749 * dbus/dbus-message.c: (dbus_message_append_int32),
750 (dbus_message_append_uint32), (dbus_message_append_double),
751 (dbus_message_append_string), (dbus_message_append_byte_array):
752 Handle OOM restoration.
754 2003-01-07 Anders Carlsson <andersca@codefactory.se>
756 * dbus/dbus-marshal.c: (_dbus_marshal_string),
757 (_dbus_demarshal_string), (_dbus_marshal_test):
758 * dbus/dbus-marshal.h:
759 * dbus/dbus-message.c: (dbus_message_get_name),
760 Document these functions.
762 (dbus_message_append_int32), (dbus_message_append_uint32),
763 (dbus_message_append_double), (dbus_message_append_string),
764 (dbus_message_append_byte_array):
765 * dbus/dbus-message.h:
766 Add functions for adding message fields of different types.
768 * dbus/dbus-protocol.h:
769 Add the different types.
771 2003-01-05 Havoc Pennington <hp@pobox.com>
773 * bus/connection.c: implement routines for handling connections,
774 first thing is keeping a list of owned services on each connection
775 and setting up watches etc.
777 * bus/services.c: implement a mapping from service names to lists
780 * dbus/dbus-hash.c: add DBUS_HASH_POINTER
782 * dbus/dbus-threads.c (dbus_static_mutex_lock): add functions
783 to use static mutexes for global data
785 * dbus/dbus-connection.c (dbus_connection_set_data): add new
786 collection of functions to set/get application-specific data
787 on the DBusConnection.
789 2003-01-04 Havoc Pennington <hp@pobox.com>
791 * dbus/dbus-sysdeps.c (_dbus_sleep_milliseconds): new function
792 (_dbus_poll): new function
794 * dbus/dbus-internals.h (_DBUS_STRUCT_OFFSET): new macro
797 * bus/loop.c: initial code for the daemon main loop
799 2003-01-04 Havoc Pennington <hp@pobox.com>
801 * test/watch.c (error_handler): make it safe if the error handler
802 is called multiple times (if we s/error handler/disconnect
803 handler/ we should just guarantee it's called only once)
805 * dbus/dbus-transport.c (_dbus_transport_disconnect): call the
806 error handler on disconnect (it's quite possible we should
807 just change the error handler to a "disconnect handler," I'm
808 not sure we have any other meaningful errors)
810 * configure.in: check for getpwnam_r
812 * dbus/dbus-transport.c, dbus/dbus-transport-unix.c,
813 dbus/dbus-auth.c: add credentials support, add EXTERNAL auth
814 mechanism as in SASL spec, using socket credentials
816 * dbus/dbus-sysdeps.c (_dbus_read_credentials_unix_socket): new function
817 (_dbus_send_credentials_unix_socket): new function
819 * dbus/dbus-sysdeps.c (_dbus_accept_unix_socket): rename just
821 (_dbus_write): only check errno if <0 returned
822 (_dbus_write_two): ditto
824 2003-01-02 Anders Carlsson <andersca@codefactory.se>
826 * dbus/dbus-marshal.c: (_dbus_marshal_utf8_string),
827 (_dbus_marshal_byte_array), (_dbus_demarshal_utf8_string),
828 (_dbus_marshal_test):
829 * dbus/dbus-marshal.h:
830 Add _dbus_marshal_byte_array and rename _dbus_marshal_string
831 to _dbus_marshal_utf8_string. Also fix some tests.
833 2002-12-28 Harri Porten <porten@kde.org>
835 * configure.in: added check for C++ compiler and a very cheesy
836 check for the Qt integration
838 * Makefile.am (SUBDIRS): compile qt subdir if support is enabled
840 * qt/Makefile.am: added
842 * qt/.cvsignore: added
844 * qt/dbus-qthread.cc, qt/dbus-qthread.cpp: renamed former to
845 latter, added #ifdef QT_THREAD_SUPPORT guard.
847 * dbus/Makefile.am: added missing headers for make dist
849 2002-12-28 Kristian Rietveld <kris@gtk.org>
851 * dbus/Makefile.am: fixup export-symbols-regex.
853 2002-12-27 Anders Carlsson <andersca@codefactory.se>
855 * acinclude.m4: Add this file and put the
856 PKG_CHECK_MODULE macro in it.
858 2002-12-27 Anders Carlsson <andersca@codefactory.se>
860 * dbus/dbus-marshal.c: (_dbus_marshal_string),
861 (_dbus_demarshal_double), (_dbus_demarshal_int32),
862 (_dbus_demarshal_uint32), (_dbus_demarshal_string),
863 (_dbus_marshal_test):
864 Make the demarshalling routines align the pos argument.
865 Add string marshalling tests and fix the obvious bugs
868 2002-12-26 Havoc Pennington <hp@pobox.com>
870 * dbus/dbus-auth.c: fixes fixes fixes
872 * dbus/dbus-transport-unix.c: wire up support for
873 encoding/decoding data on the wire
875 * dbus/dbus-auth.c (_dbus_auth_encode_data)
876 (_dbus_auth_decode_data): append to target string
877 instead of nuking it.
879 2002-12-26 Havoc Pennington <hp@pobox.com>
881 * dbus/dbus-marshal.h (DBUS_COMPILER_BYTE_ORDER): #ifdef
882 WORDS_BIGENDIAN then compiler byte order is DBUS_BIG_ENDIAN,
885 * dbus/dbus-marshal.c: Add macros to do int swapping in-place and
886 avoid swap_bytes() overhead (ignoring possible assembly stuff for
887 now). Main point is because I wanted unpack_uint32 to implement
889 (_dbus_verbose_bytes): new function
891 * dbus/dbus-string.c (_dbus_string_validate_ascii): new function
893 * dbus/dbus-message.c (_dbus_message_loader_get_is_corrupted): add
894 mechanism to handle a corrupt message stream
895 (_dbus_message_loader_new): fix preallocation to only prealloc,
898 * dbus/dbus-string.c (_dbus_string_skip_blank): fix this function
899 (_dbus_string_test): enhance tests for copy/move and fix the
902 * dbus/dbus-transport-unix.c: Hold references in more places to
903 avoid reentrancy problems
905 * dbus/dbus-transport.c: ditto
907 * dbus/dbus-connection.c (dbus_connection_dispatch_message): don't
908 leak reference count in no-message case
910 * test/watch.c (do_mainloop): handle adding/removing watches
911 during iteration over the watches. Also, ref the connection/server
912 stored on a watch, so we don't try to mangle a destroyed one.
914 * dbus/dbus-transport-unix.c (do_authentication): perform
917 * dbus/dbus-auth.c (get_state): add a state
918 AUTHENTICATED_WITH_UNUSED_BYTES and return it if required
919 (_dbus_auth_get_unused_bytes): append the unused bytes
920 to the passed in string, rather than prepend
922 * dbus/dbus-transport.c (_dbus_transport_init_base): create
923 the auth conversation DBusAuth
925 * dbus/dbus-transport-unix.c (_dbus_transport_new_for_fd)
926 (_dbus_transport_new_for_domain_socket): when creating a
927 transport, pass in whether it's a client-side or server-side
928 transport so we know which DBusAuth to create
930 2002-12-03 Havoc Pennington <hp@pobox.com>
932 * dbus/dbus-transport-unix.c (unix_finalize): finalize base
933 _after_ finalizing the derived members
934 (unix_connection_set): unref watch if we fail to add it
936 * dbus/dbus-connection.c (dbus_connection_unref): delete the
937 transport first, so that the connection owned by the
938 transport will be valid as the transport finalizes.
940 * dbus/dbus-transport-unix.c (unix_finalize): free the write_watch
941 if necessary, and remove watches from the connection.
943 * dbus/dbus-watch.c (_dbus_watch_list_free): improve a comment
945 2002-12-26 Anders Carlsson <andersca@codefactory.se>
947 * dbus/dbus-marshal.c: (_dbus_marshal_string),
948 (_dbus_demarshal_double), (_dbus_demarshal_int32),
949 (_dbus_demarshal_uint32), (_dbus_demarshal_string),
950 (_dbus_marshal_test):
951 * dbus/dbus-marshal.h:
952 Add string marshal functions and have the demarshal functions
953 return the new position.
955 2002-12-25 Havoc Pennington <hp@pobox.com>
957 * doc/dbus-sasl-profile.txt: docs on the authentication protocol,
958 it is a simple protocol that just maps directly to SASL.
960 * dbus/dbus-auth.h, dbus/dbus-auth.c: authentication protocol
961 initial implementation, not actually used yet.
963 * dbus/dbus-string.c (_dbus_string_find): new function
964 (_dbus_string_equal): new function
965 (_dbus_string_base64_encode): new function
966 (_dbus_string_base64_decode): new function
968 2002-12-25 Anders Carlsson <andersca@codefactory.se>
971 * dbus/dbus-marshal.c: (swap_bytes), (_dbus_marshal_double),
972 (_dbus_marshal_int32), (_dbus_marshal_uint32),
973 (_dbus_demarshal_double), (_dbus_demarshal_int32),
974 (_dbus_demarshal_uint32), (_dbus_marshal_test):
975 * dbus/dbus-marshal.h:
976 * dbus/dbus-protocol.h:
977 * dbus/dbus-test.c: (main):
979 Add un-optimized marshalling/demarshalling routines.
981 2002-12-25 Harri Porten <porten@kde.org>
983 * qt/dbus-qt.h: adjusted ctor and getter to KDE/Qt conventions
985 2002-12-24 Zack Rusin <zack@kde.org>
987 * qt/dbus-qthread.cc: adding - integrates QMutex into Dbus
988 * qt/dbus-qt.h: skeleton with two sample implemenatation of the
991 2002-12-24 Havoc Pennington <hp@pobox.com>
993 * glib/dbus-gthread.c: fix include
995 * glib/dbus-glib.h: rename DBusMessageHandler for now.
996 I think glib API needs to change, though, as you don't
997 want to use DBusMessageFunction, you want to use the
998 DBusMessageHandler object. Probably
999 dbus_connection_open_with_g_main_loop()
1000 and dbus_connection_setup_g_main_loop() or something like that
1001 (but think of better names...) that just create a connection
1002 that has watch/timeout functions etc. already set up.
1004 * dbus/dbus-connection.c
1005 (dbus_connection_send_message_with_reply): new function just to
1006 show how the message handler helps us deal with replies.
1008 * dbus/dbus-list.c (_dbus_list_remove_last): new function
1010 * dbus/dbus-string.c (_dbus_string_test): free a string that
1013 * dbus/dbus-hash.c: use memory pools for the hash entries
1014 (rebuild_table): be more paranoid about overflow, and
1015 shrink table when we can
1016 (_dbus_hash_test): reduce number of sprintfs and write
1017 valid C89. Add tests for case where we grow and then
1018 shrink the hash table.
1020 * dbus/dbus-mempool.h, dbus/dbus-mempool.c: memory pools
1022 * dbus/dbus-connection.c (dbus_connection_register_handler)
1023 (dbus_connection_unregister_handler): new functions
1025 * dbus/dbus-message.c (dbus_message_get_name): new
1027 * dbus/dbus-list.c: fix docs typo
1029 * dbus/dbus-message-handler.h, dbus/dbus-message-handler.c:
1030 an object representing a handler for messages.
1032 2002-12-16 Anders Carlsson <andersca@codefactory.se>
1035 * glib/dbus-gthread.c: (dbus_gthread_init):
1036 Don't use the gdbus prefix for public functions.
1038 2002-12-16 Anders Carlsson <andersca@codefactory.se>
1042 Add GLib checks and fixup .pc files
1046 * glib/dbus-gmain.c: (gdbus_connection_prepare),
1047 (gdbus_connection_check), (gdbus_connection_dispatch),
1048 (gdbus_add_connection_watch), (gdbus_remove_connection_watch),
1049 (dbus_connection_gsource_new):
1050 * glib/dbus-gthread.c: (dbus_gmutex_new), (dbus_gmutex_free),
1051 (dbus_gmutex_lock), (dbus_gmutex_unlock), (dbus_gthread_init):
1052 * glib/test-dbus-glib.c: (message_handler), (main):
1055 2002-12-15 Harri Porten <porten@kde.org>
1057 * autogen.sh: check for libtoolize before attempting to use it
1059 * dbus/dbus-transport-unix.c: include <sys/time.h> for timeval
1062 * .cvsignore: ignore more stamp files
1064 * dbus/dbus-watch.c (_dbus_watch_list_new): fixed doc error
1066 * test/Makefile.am: added -I$(top_srcdir) to be able to compile
1067 without make install.
1069 2002-12-15 Havoc Pennington <hp@pobox.com>
1071 * dbus/dbus-threads.c: add thread stubs that a higher library
1072 layer can fill in. e.g. the GLib wrapper might fill them in with
1073 GThread stuff. We still need to use this thread API to
1074 thread-safe-ize the library.
1076 2002-12-12 Havoc Pennington <hp@pobox.com>
1078 * dbus/dbus-transport-unix.c, dbus/dbus-server-unix.c: use the
1079 below new interfaces and include fewer system headers.
1081 * dbus/dbus-sysdeps.c (_dbus_read): new function
1082 (_dbus_write): new function
1083 (_dbus_write_two): new function
1084 (_dbus_connect_unix_socket): new function
1085 (_dbus_listen_unix_socket): new function
1087 * dbus/dbus-message-internal.h: change interfaces to use
1090 2002-12-11 Havoc Pennington <hp@pobox.com>
1092 * dbus/dbus-types.h: add dbus_unichar
1094 * dbus/dbus-internals.c (_dbus_verbose): use _dbus_getenv
1096 * dbus/dbus-connection.c (dbus_connection_send_message): return
1099 * dbus/dbus-transport.c: include dbus-watch.h
1101 * dbus/dbus-connection.c: include dbus-message-internal.h
1103 * HACKING: add file with coding guidelines stuff.
1105 * dbus/dbus-string.h, dbus/dbus-string.c: Encapsulate all string
1106 handling here, for security purposes (as in vsftpd). Not actually
1107 using this class yet.
1109 * dbus/dbus-sysdeps.h, dbus/dbus-sysdeps.c: Encapsulate all
1110 system/libc usage here, as in vsftpd, for ease of auditing (and
1111 should also simplify portability). Haven't actually moved all the
1112 system/libc usage into here yet.
1114 2002-11-25 Havoc Pennington <hp@pobox.com>
1116 * dbus/dbus-internals.c (_dbus_verbose): fix to not
1117 always print the first verbose message.
1119 2002-11-24 Havoc Pennington <hp@pobox.com>
1121 * test/echo-client.c, test/echo-server.c: cheesy test
1124 * configure.in (AC_CHECK_FUNCS): check for writev
1126 * dbus/dbus-message.c (_dbus_message_get_network_data): new
1129 * dbus/dbus-list.c (_dbus_list_foreach): new function
1131 * dbus/dbus-internals.c (_dbus_verbose): new function
1133 * dbus/dbus-server.c, dbus/dbus-server.h: public object
1134 representing a server that listens for connections.
1136 * dbus/.cvsignore: create
1138 * dbus/dbus-errors.h, dbus/dbus-errors.c:
1139 public API for reporting errors
1141 * dbus/dbus-connection.h, dbus/dbus-connection.c:
1142 public object representing a connection that
1143 sends/receives messages. (Same object used for
1144 both client and server.)
1146 * dbus/dbus-transport.h, dbus/dbus-transport.c:
1147 Basic abstraction for different kinds of stream
1148 that we might read/write messages from.
1150 2002-11-23 Havoc Pennington <hp@pobox.com>
1152 * dbus/dbus-internals.h (_DBUS_INT_MAX): add _DBUS_INT_MIN
1155 * dbus/dbus-test.c (main): add list test, and include
1156 dbus-test.h as intended
1158 * dbus/dbus-hash.c (_dbus_hash_table_remove_string)
1159 (_dbus_hash_table_remove_int): return value indicates
1160 whether the entry existed to remove
1162 * dbus/dbus-list.c: add linked list utility class,
1165 * dbus/dbus-hash.c: add TODO item about shrinking the hash bucket
1168 2002-11-23 Havoc Pennington <hp@pobox.com>
1170 * Doxyfile.in (INCLUDE_FILE_PATTERNS): expand DBUS_BEGIN_DECLS/
1171 DBUS_END_DECLS to nothing, that should fix this once and for all
1173 * Doxyfile.in (JAVADOC_AUTOBRIEF): set to YES
1175 * dbus/dbus-message.c, dbus/dbus-hash.c:
1176 add some missing @brief
1178 2002-11-23 Havoc Pennington <hp@pobox.com>
1180 * dbus/dbus-message.h: put semicolons after DEBUG_BEGIN_DECLS
1181 to avoid confusing Doxygen
1183 * dbus/dbus-hash.c: @} not }@
1185 * dbus/dbus-message.c (struct DBusMessage): split out
1188 2002-11-23 Havoc Pennington <hp@pobox.com>
1190 * configure.in: pile on more warning flags if using gcc
1192 * Doxyfile.in (EXTRACT_STATIC): set to NO, so we don't have
1193 to document static functions
1195 * configure.in: add summary to end of configure so it
1196 looks nice and attractive
1198 * dbus/dbus-hash.c: finish implementation and write unit
1201 * configure.in: add --enable-tests to enable unit tests
1203 * dbus/dbus-test.c: test program to run unit tests
1204 for all files in dbus/*, initially runs a test for
1207 * dbus/dbus-internals.h: file to hold some internal utility stuff
1209 2002-11-22 Havoc Pennington <hp@redhat.com>
1211 * dbus/dbus-hash.c: copy in Tcl hash table, not yet
1212 "ported" away from Tcl
1214 * dbus/dbus-types.h: header for types such as dbus_bool_t
1216 2002-11-22 Havoc Pennington <hp@redhat.com>
1218 * dbus/dbus.h: fixups for doc warnings
1220 * Doxyfile.in (FILE_PATTERNS): we need to scan .h to pick up
1222 (QUIET): make it quiet so we can see warnings
1224 * dbus/dbus-memory.c: teach D-BUS to allocate and free memory
1226 2002-11-22 Havoc Pennington <hp@redhat.com>
1228 * Makefile.am: include "Doxyfile" target in all-local
1230 * configure.in: generate the Doxyfile
1232 * Doxyfile.in: move Doxyfile here, so we can use
1233 configure to generate a Doxyfile with the right
1236 2002-11-22 Havoc Pennington <hp@redhat.com>
1238 * dbus/dbus-message.c: move inline docs into .c file
1240 * Doxyfile (OUTPUT_DIRECTORY): move output to doc/api
1241 so all docs are under doc/
1242 (MAN_EXTENSION): generate man pages. Use extension
1243 ".3dbus" which matches ".3qt" on my system,
1244 I guess this is OK, I don't know really.
1245 (FILE_PATTERNS): look for .c files not .h, makes sense
1248 2002-11-22 Havoc Pennington <hp@pobox.com>
1250 * Makefile.am (SUBDIRS): rename subdir "server" to "bus"
1251 because any app can be a server, and any app can be a client,
1252 the bus is a special kind of server.
1254 Thu Nov 21 23:35:31 2002 Zack Rusin <zack@kde.org>
1256 * Doxyfile : adding. Still needs Makefile rules to be generated
1257 automatically (just run "doxygen" in the toplevel dir for now to
1260 * dbus/dbus-message.h : Adding sample docs (javadoc since
1261 resembles gtk-doc a little more)
1263 * dbus/dbus.h : Adding sample docs
1265 2002-11-21 Havoc Pennington <hp@redhat.com>
1267 * dbus/Makefile.am (INCLUDES): define DBUS_COMPILATION
1268 so we can allow ourselves to include files directly,
1269 instead of having to use dbus.h
1271 * dbus/dbus.h: fill in
1273 * dbus/dbus-message.h: sketch out a sample header file.
1274 Include griping if you include it directly instead of
1277 * dbus/dbus-macros.h: new file with macros for extern "C",
1278 TRUE/FALSE, NULL, etc.
1280 * doc/file-boilerplate.c: put include guards in here
1282 2002-11-21 Havoc Pennington <hp@redhat.com>
1284 * doc/file-boilerplate.c: include both AFL and GPL boilerplate.
1286 * COPYING: include the GPL as well, and license code
1287 under both AFL and GPL.
1289 2002-11-21 Havoc Pennington <hp@redhat.com>
1291 * acconfig.h: get rid of this
1293 * autogen.sh (run_configure): add --no-configure option
1295 * configure.in: remove AC_ARG_PROGRAM to make
1296 autoconf complain less. add AC_PREREQ.
1297 add AC_DEFINE third arg.
1299 2002-11-21 Anders Carlsson <andersca@codefactory.se>
1302 Fix references so we can distcheck.
1304 2002-11-21 Havoc Pennington <hp@redhat.com>
1306 * Initial module creation