1 2003-01-30 Anders Carlsson <andersca@codefactory.se>
6 * dbus/dbus-address.c: (dbus_address_entry_free),
7 (dbus_address_entries_free), (create_entry),
8 (dbus_address_entry_get_method), (dbus_address_entry_get_value),
9 (dbus_parse_address), (_dbus_address_test):
10 * dbus/dbus-address.h:
11 New files for dealing with address parsing.
13 * dbus/dbus-connection.c:
14 Document timeout functions.
16 * dbus/dbus-message.c:
17 Document dbus_message_new_from_message.
19 * dbus/dbus-server-debug.c:
22 * dbus/dbus-server.c: (dbus_server_listen):
23 Parse address and use correct server implementation.
25 * dbus/dbus-string.c: (_dbus_string_find_to), (_dbus_string_test):
27 New function with test.
29 * dbus/dbus-test.c: (dbus_internal_symbol_do_not_use_run_tests):
33 * dbus/dbus-transport-debug.c:
36 * dbus/dbus-transport.c: (_dbus_transport_open):
37 Parse address and use correct transport implementation.
39 2003-01-30 Havoc Pennington <hp@pobox.com>
41 * dbus/dbus-message.c: use message->byte_order instead of
42 DBUS_COMPILER_BYTE_ORDER throughout.
43 (dbus_message_create_header): pad header to align the
44 start of the body of the message to 8-byte boundary
46 * dbus/dbus-marshal.h: make all the demarshalers take const
49 * dbus/dbus-message.c (_dbus_message_loader_return_buffer):
50 validate message args here, so we don't have to do slow validation
51 later, and so we catch bad messages as they are incoming. Also add
52 better checks on header_len and body_len. Also fill in
55 * dbus/dbus-string.c (_dbus_string_validate_utf8): new (not
57 (_dbus_string_validate_nul): new function to check all-nul
59 * dbus/dbus-marshal.c (_dbus_marshal_get_field_end_pos): rename
60 get_arg_end_pos and remove all validation
61 (_dbus_marshal_validate_arg): actually do validation here.
63 2003-01-29 Havoc Pennington <hp@pobox.com>
65 * dbus/dbus-message.c (check_message_handling): fix assertion
66 failure on set_client_serial
68 2003-01-28 Havoc Pennington <hp@pobox.com>
70 * dbus/dbus-server-debug.c: Add doc section comments
72 * dbus/dbus-transport-debug.c: add doc section comments
74 2003-01-28 Havoc Pennington <hp@redhat.com>
76 * dbus/dbus-string.c (_dbus_string_base64_decode): append bytes in
77 the reverse order from how I had it
78 (_dbus_string_base64_encode): reverse encoding order. I was
79 basically byteswapping everything during encoding.
81 2003-01-28 Anders Carlsson <andersca@codefactory.se>
83 * dbus/dbus-connection-internal.h:
84 * dbus/dbus-connection.c: (_dbus_connection_add_timeout),
85 (_dbus_connection_remove_timeout):
86 Add functions for adding and removing timeouts.
88 * dbus/dbus-message.c: (dbus_message_new_from_message):
89 Add new function that takes a message and creates an exact
90 copy of it, but with the refcount set to 1.
91 (check_message_handling):
94 * dbus/dbus-server-protected.h:
95 * dbus/dbus-server.c: (_dbus_server_init_base),
96 (_dbus_server_finalize_base), (_dbus_server_add_timeout),
97 (dbus_server_set_timeout_functions):
98 (_dbus_server_remove_timeout):
99 New functions so that a server can add and remove timeouts.
101 (dbus_server_listen):
102 Add commented out call to dbus_server_debug_new.
104 * dbus/dbus-timeout.c: (_dbus_timeout_new):
105 Actually set the handler, doh.
107 * dbus/dbus-transport.c: (_dbus_transport_open):
108 Add commented out call to dbus_transport_debug_client_new.
111 Add dbus-transport-debug.[ch] and dbus-server-debug.[ch]
113 2003-01-28 Havoc Pennington <hp@pobox.com>
115 * dbus/dbus-message.c (check_message_handling): function to check
116 on the loaded message, iterates over it etc.
118 2003-01-28 Havoc Pennington <hp@pobox.com>
120 * test/Makefile.am (dist-hook): fix make distdir
122 * dbus/Makefile.am (TESTS_ENVIRONMENT): fix make check
124 2003-01-27 Havoc Pennington <hp@pobox.com>
126 * dbus/dbus-mempool.c (time_for_size): replace printf with
129 * dbus/dbus-message-builder.c (_dbus_message_data_load): allow
130 empty lines; fix the SAVE_LENGTH stuff to be
131 START_LENGTH/END_LENGTH so it actually works; couple other
134 * test/Makefile.am (dist-hook): add dist-hook for .message files
136 * dbus/dbus-string.c (DBUS_STRING_COPY_PREAMBLE): source of a copy
137 can be constant or locked.
138 (_dbus_string_free): allow freeing a const string as
141 * dbus/dbus-sysdeps.c (_dbus_concat_dir_and_file): utility
143 * dbus/dbus-test-main.c (main): take an argument which is the
144 directory containing test data
146 * dbus/dbus-message.c (_dbus_message_test): pass a test_data_dir
147 argument to this and load all the messages in test/data/
148 checking that they can be loaded or not loaded as appropriate.
150 2003-01-27 Anders Carlsson <andersca@codefactory.se>
152 * bus/dispatch.c: (bus_dispatch_message_handler):
153 Dispatch messages sent to services.
155 * bus/driver.c: (bus_driver_send_service_deleted),
156 (bus_driver_send_service_created), (bus_driver_send_service_lost),
157 (bus_driver_send_service_acquired):
158 Add helper functions for sending service related messages.
160 (bus_driver_send_welcome_message):
161 Send HELLO_REPLY instead of WELCOME.
163 (bus_driver_handle_list_services):
164 Send LIST_SERVICES_REPLY instead of SERVICES.
166 (bus_driver_handle_own_service),
167 (bus_driver_handle_service_exists):
168 New message handlers.
170 (bus_driver_handle_message):
171 Invoke new message handlers.
173 (bus_driver_remove_connection):
174 Don't remove any services here since that's done automatically
175 by bus_service_remove_owner now.
178 New function signatures.
180 * bus/services.c: (bus_service_add_owner):
181 Send ServiceAcquired message if we're the only primary owner.
183 (bus_service_remove_owner):
184 Send ServiceAcquired/ServiceLost messages.
186 (bus_service_set_prohibit_replacement),
187 (bus_service_get_prohibit_replacement):
188 Functions for setting prohibit replacement.
190 (bus_service_has_owner):
191 New function that checks if a connection is in the owner queue of
195 Add new function signatures.
197 * dbus/dbus-list.c: (_dbus_list_test):
198 Add tests for _dbus_list_remove_last and traversing the list backwards.
201 Fix a typo in _dbus_list_get_prev_link, if we're at the first element we can't
202 go any further, so return NULL then.
204 * dbus/dbus-protocol.h:
205 Add new messages, service flags and service replies.
207 2003-01-26 Havoc Pennington <hp@pobox.com>
209 * dbus/dbus-message-builder.c: implement, completely untested.
211 * test/data/*: add data to be used in testing.
212 ".message" files are our simple loadable text format.
213 ".message-raw" will be binary dumps of messages.
215 * dbus/dbus-string.c (_dbus_string_starts_with_c_str): new
217 2003-01-26 Havoc Pennington <hp@pobox.com>
219 * dbus/dbus-sysdeps.c (_dbus_file_get_contents): new function
221 * dbus/dbus-errors.c (dbus_result_to_string): add
224 * dbus/dbus-message-builder.c: new file, will contain code to load
225 up messages from files. Not implemented yet.
227 2003-01-26 Havoc Pennington <hp@pobox.com>
229 * dbus/dbus-message.c (dbus_message_set_sender): support deleting
230 the sender by setting to NULL
232 2003-01-26 Havoc Pennington <hp@pobox.com>
234 The unit tests pass, but otherwise untested. If it breaks, the
235 tests should have been better. ;-)
237 * bus/driver.c (bus_driver_handle_hello): return if we disconnect
240 * dbus/dbus-message.c: redo everything so we maintain
241 message->header as the only copy of the various fields.
242 This avoids the possibility of out-of-memory in some cases,
243 for example dbus_message_lock() can't run out of memory anymore,
244 and avoids extra copying. Figured I may as well go ahead and do
245 this since it was busted for dbus_message_lock to not return
246 failure on OOM, and dbus_message_write_header was totally
247 unchecked for OOM. Also fixed some random other bugs.
249 * dbus/dbus-marshal.c (_dbus_marshal_get_field_end_pos): verify
250 that strings are nul-terminated. Also, end_pos can be equal
251 to string length just not greater than, I think.
252 (_dbus_marshal_set_int32): new function
253 (_dbus_marshal_set_uint32): new function
254 (_dbus_marshal_set_string): new function
256 * dbus/dbus-connection.c (_dbus_connection_new_for_transport): fix
257 a warning, init timeout_list to NULL
258 (dbus_connection_send_message): don't use uninitialized variable
261 * dbus/dbus-string.c (_dbus_string_replace_len): new function
263 2003-01-26 Anders Carlsson <andersca@codefactory.se>
265 * bus/driver.c: (bus_driver_handle_hello),
266 (bus_driver_send_welcome_message):
269 2003-01-26 Anders Carlsson <andersca@codefactory.se>
271 * dbus/dbus-auth.c: (process_auth), (_dbus_auth_unref):
272 * dbus/dbus-connection.c: (_dbus_connection_new_for_transport),
273 (dbus_connection_unref):
274 * dbus/dbus-marshal.c: (_dbus_marshal_test):
275 * dbus/dbus-message.c: (dbus_message_unref),
278 (dbus_message_get_fields):
279 Remove debugging printout.
281 (_dbus_message_loader_return_buffer):
282 Don't store the header string.
284 (_dbus_message_test):
287 2003-01-26 Richard Hult <rhult@codefactory.se>
289 * glib/dbus-gmain.c (dbus_connection_dispatch): Traverse a copy of
290 the file descriptor list, since it can change under us.
292 2003-01-25 Anders Carlsson <andersca@codefactory.se>
294 * glib/dbus-gmain.c: (dbus_connection_prepare),
295 (dbus_connection_check), (dbus_connection_dispatch), (add_watch),
296 (remove_watch), (dbus_connection_hookup_with_g_main):
297 Rewrite the glib handling to use its own GSource instead of a
298 GIOChannel so we can catch messages put in the queue while waiting
301 2003-01-25 Anders Carlsson <andersca@codefactory.se>
304 * bus/connection.c: (connection_disconnect_handler),
305 (connection_watch_callback), (bus_connection_setup):
306 * bus/dispatch.c: (send_one_message),
307 (bus_dispatch_broadcast_message), (bus_dispatch_message_handler),
308 (bus_dispatch_add_connection), (bus_dispatch_remove_connection):
310 * bus/driver.c: (bus_driver_send_service_deleted),
311 (bus_driver_send_service_created), (bus_driver_handle_hello),
312 (bus_driver_send_welcome_message),
313 (bus_driver_handle_list_services), (bus_driver_remove_connection),
314 (bus_driver_handle_message):
316 Refactor code, put the message dispatching in its own file. Use
317 _DBUS_HANDLE_OOM. Also send ServiceDeleted messages when a client
320 2003-01-25 Anders Carlsson <andersca@codefactory.se>
322 * dbus/dbus-internals.h:
323 Add _DBUS_HANDLE_OOM macro, it doesn't do anything currently.
325 * dbus/dbus-message.c: (dbus_message_get_sender):
326 * dbus/dbus-message.h:
327 Implement dbus_message_get_sender.
329 * dbus/dbus-protocol.h:
330 Add message and service defines.
332 2003-01-25 Anders Carlsson <andersca@codefactory.se>
334 * dbus/dbus-connection.c: (dbus_connection_send_message):
335 * dbus/dbus-message-internal.h:
336 * dbus/dbus-message.c: (_dbus_message_get_client_serial),
337 (dbus_message_write_header):
338 Remove _dbus_messag_unlock and don't set the client serial on a
339 message if one already exists.
341 2003-01-24 Havoc Pennington <hp@pobox.com>
343 * dbus/dbus-list.c (alloc_link): put a thread lock on the global
346 * bus/driver.c (bus_driver_handle_list_services): fix a leak
349 2003-01-25 Anders Carlsson <andersca@codefactory.se>
351 * dbus/dbus-list.c: (alloc_link), (free_link):
352 Use a memory pool for the links.
354 2003-01-25 Anders Carlsson <andersca@codefactory.se>
356 * bus/connection.c: (bus_connection_foreach):
358 Add new bus_connection_foreach function.
360 * bus/driver.c: (send_one_message), (bus_driver_broadcast_message):
361 Add function that broadcasts a message to all clients.
363 (bus_driver_send_service_created), (bus_driver_handle_hello),
364 (bus_driver_send_welcome_message),
365 (bus_driver_handle_list_services), (bus_driver_message_handler):
366 Implement functions that take care of listing services, and notifying
367 clients when new services are created.
369 * bus/services.c: (bus_services_list):
371 Add new function that returns an array of strings with the currently
376 Update copyright year.
378 2003-01-25 Anders Carlsson <andersca@codefactory.se>
380 * dbus/dbus-connection.c: (dbus_connection_send_message):
381 Unlock the message in case it was sent earlier.
383 (dbus_connection_send_message_with_reply_and_block):
384 Remove the reply message from the list.
386 * dbus/dbus-marshal.c: (_dbus_demarshal_string_array):
387 Set array_len and new_pos correctly.
389 (_dbus_marshal_test):
392 * dbus/dbus-message-internal.h:
393 * dbus/dbus-message.c: (_dbus_message_get_reply_serial):
394 New function that returns the reply serial.
396 (_dbus_message_unlock):
397 New function that unlocks a message and resets its header.
399 (dbus_message_append_string_array),
400 (dbus_message_get_fields_valist),
401 (dbus_message_iter_get_field_type),
402 (dbus_message_iter_get_string_array),
403 (dbus_message_get_fields),
404 (dbus_message_append_fields_valist):
405 Handle string arrays.
407 (dbus_message_set_sender):
408 Make this function public since the bus daemon needs it.
410 (decode_header_data):
411 Set the reply serial to -1 initially.
413 * dbus/dbus-message.h:
414 Add dbus_message_set_sender.
416 2003-01-24 Havoc Pennington <hp@pobox.com>
418 * doc/dbus-specification.sgml: add some stuff
420 2003-01-22 Havoc Pennington <hp@pobox.com>
422 * doc/dbus-specification.sgml: Start to document the protocol.
424 2003-01-22 Havoc Pennington <hp@pobox.com>
426 * dbus/dbus-connection.c
427 (dbus_connection_send_message_with_reply_and_block): add some @todo
429 * bus/driver.c (bus_driver_add_connection): add a FIXME about memleak
431 2003-01-21 Havoc Pennington <hp@pobox.com>
433 (patch untested because can't compile)
435 * bus/driver.c (create_unique_client_name): make this function
436 never recycle client names. Also, caller should initialize
439 * dbus/dbus-sysdeps.c (_dbus_get_current_time): new function
441 2003-01-21 Anders Carlsson <andersca@codefactory.se>
443 * dbus/dbus-marshal.c: (_dbus_marshal_double),
444 (_dbus_marshal_int32), (_dbus_marshal_uint32),
445 (_dbus_marshal_int32_array), (_dbus_marshal_uint32_array),
446 (_dbus_marshal_double_array), (_dbus_marshal_string_array),
447 (_dbus_demarshal_int32_array), (_dbus_demarshal_uint32_array),
448 (_dbus_demarshal_double_array), (_dbus_demarshal_string_array),
449 (_dbus_marshal_get_field_end_pos), (_dbus_marshal_test):
450 * dbus/dbus-marshal.h:
451 * dbus/dbus-protocol.h:
452 Add support for marshalling and demarshalling integer, double
455 2003-01-21 Anders Carlsson <andersca@codefactory.se>
460 * bus/connection.c: (connection_disconnect_handler):
461 Remove the connection from the bus driver's list.
463 (connection_watch_callback): Dispatch messages.
465 (free_connection_data): Free connection name.
467 (bus_connection_setup): Add connection to the bus driver's list.
468 (bus_connection_remove_owned_service):
469 (bus_connection_set_name), (bus_connection_get_name):
470 Add functions for setting and getting the connection's name.
473 Add function headers.
475 * bus/driver.c: (create_unique_client_name),
476 (bus_driver_handle_hello_message),
477 (bus_driver_send_welcome_message), (bus_driver_message_handler),
478 (bus_driver_add_connection), (bus_driver_remove_connection):
481 * bus/services.c: (bus_service_free):
483 New file that handles communication and registreation with the bus
486 2003-01-21 Anders Carlsson <andersca@codefactory.se>
488 * dbus/dbus-connection.c: (dbus_connection_send_message):
489 Add a new client_serial parameter.
491 (dbus_connection_send_message_with_reply):
492 Remove a @todo since we've implemented the blocking function.
494 (dbus_connection_send_message_with_reply_and_block):
495 New function that sends a message and waits for a reply and
496 then returns the reply.
498 * dbus/dbus-connection.h:
501 * dbus/dbus-errors.c: (dbus_result_to_string):
502 * dbus/dbus-errors.h:
505 * dbus/dbus-message-internal.h:
506 * dbus/dbus-message.c: (_dbus_message_get_reply_serial),
507 (_dbus_message_set_sender), (dbus_message_write_header),
508 (dbus_message_new_reply), (decode_header_data),
509 (_dbus_message_loader_return_buffer), (_dbus_message_test):
510 * dbus/dbus-message.h:
511 Add new functions that set the reply serial and sender.
512 Also marshal and demarshal them correctly and add test.
514 * dbus/dbus-protocol.h:
515 Add new DBUS_MESSAGE_TYPE_SENDER.
518 * glib/dbus-gmain.c: (watch_callback), (free_callback_data),
519 (add_watch), (remove_watch), (add_timeout), (remove_timeout),
520 (dbus_connection_hookup_with_g_main):
521 * glib/test-dbus-glib.c: (main):
522 Rewrite to use GIOChannel and remove the GSource crack.
524 * test/echo-client.c: (main):
525 * test/watch.c: (check_messages):
526 Update for changed APIs
528 2003-01-19 Anders Carlsson <andersca@codefactory.se>
530 * dbus/Makefile.am: Add dbus-timeout.[cħ]
532 * dbus/dbus-connection.c: (_dbus_connection_new_for_transport):
533 Create a DBusTimeoutList.
534 (dbus_connection_set_timeout_functions): Add new function to
535 set timeout callbacks
537 * dbus/dbus-connection.h: Add public DBusTimeout API.
539 * dbus/dbus-message.c: (dbus_message_get_service):
540 * dbus/dbus-message.h: New function.
542 * dbus/dbus-server.c: Fix small doc typo.
544 * dbus/dbus-timeout.[ch]: New files for mainloop timeouts.
546 2003-01-19 Anders Carlsson <andersca@codefactory.se>
548 * dbus/dbus-string.c (_dbus_string_move_len): Don't delete all
549 of the string, just as long as specified.
551 2003-01-19 Havoc Pennington <hp@pobox.com>
553 * dbus/dbus-connection.c (dbus_connection_get_is_authenticated):
556 * dbus/dbus-server.c (dbus_server_set_max_connections)
557 (dbus_server_get_max_connections, dbus_server_get_n_connections):
558 keep track of current number of connections, and add API for
559 setting a max (but haven't implemented enforcing the max yet)
561 2003-01-18 Havoc Pennington <hp@pobox.com>
563 * dbus/dbus-transport-unix.c (unix_do_iteration): only do the
564 reading/writing if read_watch != NULL or write_watch != NULL.
566 * dbus/dbus-message.c (_dbus_message_loader_return_buffer): fix
567 the message loader code to actually load message->header and
568 message->body into the newly-created message.
570 * dbus/dbus-transport-unix.c (check_write_watch): fix a mem leak
573 * dbus/dbus-connection.c (dbus_connection_set_max_message_size)
574 (dbus_connection_get_max_message_size)
575 (dbus_connection_set_max_live_messages_size)
576 (dbus_connection_get_max_live_messages_size): implement some
577 resource limitation functions
579 * dbus/dbus-resources.c: new file implementing some of the
580 resource limits stuff
582 * dbus/dbus-message.c (dbus_message_iter_get_byte_array): add
583 missing docs, add @todo to handle OOM etc.
585 * dbus/dbus-marshal.c (_dbus_demarshal_byte_array): add missing
588 2003-01-18 Havoc Pennington <hp@pobox.com>
590 * dbus/dbus-connection.c (dbus_connection_unref): disconnect the
591 connection if it hasn't been already.
593 * dbus/dbus-connection.h: kill off the idea of an ErrorFunction,
594 replace with DisconnectFunction.
596 2003-01-18 Havoc Pennington <hp@pobox.com>
598 Building --disable-verbose-mode --disable-asserts --disable-tests
599 cuts the library from 112K to 45K or so
601 * configure.in: check for varargs macro support,
602 add --enable-verbose-mode, --enable-asserts.
604 * dbus/dbus-internals.h (_dbus_assert): support
606 (_dbus_verbose): support DBUS_ENABLE_VERBOSE_MODE
608 2003-01-18 Havoc Pennington <hp@pobox.com>
610 * dbus/dbus-test.c: include config.h so that tests actually run
612 * dbus/dbus-string.c: add assertions that stuff is 8-byte aligned,
613 so the failure mode when that assumption fails will be plenty
616 2003-01-18 Havoc Pennington <hp@pobox.com>
618 * configure.in: default --enable-tests to $USE_MAINTAINER_MODE
620 * dbus/Makefile.am: fix it up so dubs-test-main.c is included in
623 * test/Makefile.am: don't use special variable "TESTS" for echo-*
624 since we don't want to use those in make check
626 2003-01-15 Havoc Pennington <hp@redhat.com>
632 2003-01-15 Havoc Pennington <hp@redhat.com>
634 * test/Makefile.am: fix so that test source code ends up in the
635 distribution on make distcheck
637 2003-01-15 Havoc Pennington <hp@redhat.com>
643 2003-01-15 Havoc Pennington <hp@redhat.com>
645 * dbus/dbus-test.c (dbus_internal_symbol_do_not_use_run_tests):
646 fix build when --disable-tests
648 * Makefile.am (EXTRA_DIST): put HACKING in here
650 * HACKING: document procedure for making a tarball release.
652 2003-01-14 Anders Carlsson <andersca@codefactory.se>
654 * bus/connection.c: (connection_error_handler),
655 (bus_connection_setup):
656 * bus/main.c: (main):
657 Make sure that the DBusConnectionData struct is NULLed
658 out to prevent a segfault.
660 * dbus/dbus-errors.c: (dbus_result_to_string):
661 * dbus/dbus-errors.h:
662 * dbus/dbus-message.c: (dbus_message_get_fields),
663 (dbus_message_get_fields_valist), (_dbus_message_test):
664 * dbus/dbus-message.h:
665 Make dbus_message_get_fields return a result code so we can
666 track invalid fields as well as oom.
668 2003-01-11 Havoc Pennington <hp@pobox.com>
670 * configure.in: change --enable-test/--enable-ansi action-if-given
671 to enable_foo=$enableval instead of enable_foo=yes
673 2003-01-08 Havoc Pennington <hp@pobox.com>
675 * dbus/dbus-string.c (_dbus_string_align_length): new function
677 * dbus/dbus-test-main.c: move main() for test app here
679 (dbus_internal_symbol_do_not_use_run_tests): we have to export a
680 symbol to run tests, because dbus-test isn't in the main
683 Code review nitpicks.
685 * dbus/dbus-message.c (dbus_message_write_header): add newlines
686 for people with narrow emacs ;-). Assert client_serial was filled
687 in. Assert message->name != NULL.
688 (dbus_message_append_fields): have "first_field_type" arg separate
689 from va list, needed for C++ binding that also uses varargs IIRC
690 and helps with type safety
691 (dbus_message_new): add @todo about using DBusString to store
692 service/name internally
693 (dbus_message_new): don't leak ->service and ->name on OOM later
695 (dbus_message_unref): free the service name
696 (dbus_message_get_fields): same change to varargs
697 i.e. first_field_type
698 (_dbus_message_loader_return_buffer): assert that the message data
699 is aligned (if not it's a bug in our code). Put in verbose griping
700 about why we set corrupted = TRUE.
701 (decode_header_data): add FIXME that char* is evil. Was going to
702 add FIXME about evil locale-specific string.h strncmp, but just
703 switched to wacky string-as-uint32 optimization. Move check for
704 "no room for field name" above get_const_data_len() to avoid
705 assertion failure in get_const_data_len if we have trailing 2
706 bytes or the like. Check for service and name fields being
707 provided twice. Don't leak service/name on error. Require field
708 names to be aligned to 4 bytes.
710 * dbus/dbus-marshal.c: move byte swap stuff to header
711 (_dbus_pack_int32): uscore-prefix
712 (_dbus_unpack_int32): uscore-prefix
713 (_dbus_unpack_uint32): export
714 (_dbus_demarshal_string): add @todo complaining about use of
716 (_dbus_marshal_get_field_end_pos): add @todo about bad error
717 handling allowing corrupt data to go unchecked
719 2003-01-08 Havoc Pennington <hp@redhat.com>
721 * dbus/dbus-transport-unix.c (unix_do_iteration): add read/write
722 to the select() as needed for authentication. (should be using
723 _dbus_poll() not select, but for another day)
725 * dbus/dbus.h: include dbus/dbus-protocol.h
727 2003-01-08 Anders Carlsson <andersca@codefactory.se>
729 * dbus/Makefile.am (dbusinclude_HEADERS): Install
732 2003-01-08 Anders Carlsson <andersca@codefactory.se>
734 * dbus/dbus-internals.c: (_dbus_type_to_string):
735 New function that returns a string describing a type.
737 * dbus/dbus-marshal.c: (_dbus_demarshal_byte_array):
738 * dbus/dbus-marshal.h:
739 * dbus/dbus-message.c: (dbus_message_get_fields_valist),
740 (dbus_message_iter_get_field_type), (dbus_message_iter_get_double),
741 (dbus_message_iter_get_byte_array):
742 * dbus/dbus-message.h:
743 Add new convenience functions for appending and getting message fields.
744 Also add demarshalling routines for byte arrays.
746 2003-01-07 Anders Carlsson <andersca@codefactory.se>
748 * dbus/dbus-connection-internal.h:
749 * dbus/dbus-connection.c: (_dbus_connection_new_for_transport),
750 (_dbus_connection_get_next_client_serial),
751 (dbus_connection_send_message):
752 * dbus/dbus-internals.h:
753 * dbus/dbus-marshal.c: (unpack_uint32), (dbus_unpack_int32),
754 (dbus_pack_int32), (_dbus_marshal_double), (_dbus_marshal_int32),
755 (_dbus_marshal_uint32), (_dbus_demarshal_double),
756 (_dbus_demarshal_int32), (_dbus_demarshal_uint32),
757 (_dbus_demarshal_string), (_dbus_marshal_get_field_end_pos),
758 (_dbus_verbose_bytes), (_dbus_marshal_test):
759 * dbus/dbus-marshal.h:
760 * dbus/dbus-message-internal.h:
761 * dbus/dbus-message.c: (_dbus_message_set_client_serial),
762 (dbus_message_write_header), (_dbus_message_lock),
763 (dbus_message_new), (dbus_message_ref), (dbus_message_unref),
764 (dbus_message_get_name), (dbus_message_append_int32),
765 (dbus_message_append_uint32), (dbus_message_append_double),
766 (dbus_message_append_string), (dbus_message_append_byte_array),
767 (dbus_message_get_fields_iter), (dbus_message_iter_ref),
768 (dbus_message_iter_unref), (dbus_message_iter_has_next),
769 (dbus_message_iter_next), (dbus_message_iter_get_field_type),
770 (dbus_message_iter_get_string), (dbus_message_iter_get_int32),
771 (dbus_message_iter_get_uint32), (dbus_message_iter_get_double),
772 (decode_header_data), (_dbus_message_loader_return_buffer),
773 (message_iter_test), (_dbus_message_test):
774 * dbus/dbus-message.h:
775 * dbus/dbus-protocol.h:
776 * dbus/dbus-test.c: (main):
778 * glib/test-dbus-glib.c: (message_handler), (main):
779 * test/echo-client.c: (main):
780 * test/watch.c: (check_messages):
781 Make messages sendable and receivable for real.
783 2003-01-07 Anders Carlsson <andersca@codefactory.se>
785 * dbus/dbus-marshal.c: (_dbus_marshal_double),
786 (_dbus_marshal_string), (_dbus_marshal_byte_array):
787 * dbus/dbus-message.c: (dbus_message_append_int32),
788 (dbus_message_append_uint32), (dbus_message_append_double),
789 (dbus_message_append_string), (dbus_message_append_byte_array):
790 Handle OOM restoration.
792 2003-01-07 Anders Carlsson <andersca@codefactory.se>
794 * dbus/dbus-marshal.c: (_dbus_marshal_string),
795 (_dbus_demarshal_string), (_dbus_marshal_test):
796 * dbus/dbus-marshal.h:
797 * dbus/dbus-message.c: (dbus_message_get_name),
798 Document these functions.
800 (dbus_message_append_int32), (dbus_message_append_uint32),
801 (dbus_message_append_double), (dbus_message_append_string),
802 (dbus_message_append_byte_array):
803 * dbus/dbus-message.h:
804 Add functions for adding message fields of different types.
806 * dbus/dbus-protocol.h:
807 Add the different types.
809 2003-01-05 Havoc Pennington <hp@pobox.com>
811 * bus/connection.c: implement routines for handling connections,
812 first thing is keeping a list of owned services on each connection
813 and setting up watches etc.
815 * bus/services.c: implement a mapping from service names to lists
818 * dbus/dbus-hash.c: add DBUS_HASH_POINTER
820 * dbus/dbus-threads.c (dbus_static_mutex_lock): add functions
821 to use static mutexes for global data
823 * dbus/dbus-connection.c (dbus_connection_set_data): add new
824 collection of functions to set/get application-specific data
825 on the DBusConnection.
827 2003-01-04 Havoc Pennington <hp@pobox.com>
829 * dbus/dbus-sysdeps.c (_dbus_sleep_milliseconds): new function
830 (_dbus_poll): new function
832 * dbus/dbus-internals.h (_DBUS_STRUCT_OFFSET): new macro
835 * bus/loop.c: initial code for the daemon main loop
837 2003-01-04 Havoc Pennington <hp@pobox.com>
839 * test/watch.c (error_handler): make it safe if the error handler
840 is called multiple times (if we s/error handler/disconnect
841 handler/ we should just guarantee it's called only once)
843 * dbus/dbus-transport.c (_dbus_transport_disconnect): call the
844 error handler on disconnect (it's quite possible we should
845 just change the error handler to a "disconnect handler," I'm
846 not sure we have any other meaningful errors)
848 * configure.in: check for getpwnam_r
850 * dbus/dbus-transport.c, dbus/dbus-transport-unix.c,
851 dbus/dbus-auth.c: add credentials support, add EXTERNAL auth
852 mechanism as in SASL spec, using socket credentials
854 * dbus/dbus-sysdeps.c (_dbus_read_credentials_unix_socket): new function
855 (_dbus_send_credentials_unix_socket): new function
857 * dbus/dbus-sysdeps.c (_dbus_accept_unix_socket): rename just
859 (_dbus_write): only check errno if <0 returned
860 (_dbus_write_two): ditto
862 2003-01-02 Anders Carlsson <andersca@codefactory.se>
864 * dbus/dbus-marshal.c: (_dbus_marshal_utf8_string),
865 (_dbus_marshal_byte_array), (_dbus_demarshal_utf8_string),
866 (_dbus_marshal_test):
867 * dbus/dbus-marshal.h:
868 Add _dbus_marshal_byte_array and rename _dbus_marshal_string
869 to _dbus_marshal_utf8_string. Also fix some tests.
871 2002-12-28 Harri Porten <porten@kde.org>
873 * configure.in: added check for C++ compiler and a very cheesy
874 check for the Qt integration
876 * Makefile.am (SUBDIRS): compile qt subdir if support is enabled
878 * qt/Makefile.am: added
880 * qt/.cvsignore: added
882 * qt/dbus-qthread.cc, qt/dbus-qthread.cpp: renamed former to
883 latter, added #ifdef QT_THREAD_SUPPORT guard.
885 * dbus/Makefile.am: added missing headers for make dist
887 2002-12-28 Kristian Rietveld <kris@gtk.org>
889 * dbus/Makefile.am: fixup export-symbols-regex.
891 2002-12-27 Anders Carlsson <andersca@codefactory.se>
893 * acinclude.m4: Add this file and put the
894 PKG_CHECK_MODULE macro in it.
896 2002-12-27 Anders Carlsson <andersca@codefactory.se>
898 * dbus/dbus-marshal.c: (_dbus_marshal_string),
899 (_dbus_demarshal_double), (_dbus_demarshal_int32),
900 (_dbus_demarshal_uint32), (_dbus_demarshal_string),
901 (_dbus_marshal_test):
902 Make the demarshalling routines align the pos argument.
903 Add string marshalling tests and fix the obvious bugs
906 2002-12-26 Havoc Pennington <hp@pobox.com>
908 * dbus/dbus-auth.c: fixes fixes fixes
910 * dbus/dbus-transport-unix.c: wire up support for
911 encoding/decoding data on the wire
913 * dbus/dbus-auth.c (_dbus_auth_encode_data)
914 (_dbus_auth_decode_data): append to target string
915 instead of nuking it.
917 2002-12-26 Havoc Pennington <hp@pobox.com>
919 * dbus/dbus-marshal.h (DBUS_COMPILER_BYTE_ORDER): #ifdef
920 WORDS_BIGENDIAN then compiler byte order is DBUS_BIG_ENDIAN,
923 * dbus/dbus-marshal.c: Add macros to do int swapping in-place and
924 avoid swap_bytes() overhead (ignoring possible assembly stuff for
925 now). Main point is because I wanted unpack_uint32 to implement
927 (_dbus_verbose_bytes): new function
929 * dbus/dbus-string.c (_dbus_string_validate_ascii): new function
931 * dbus/dbus-message.c (_dbus_message_loader_get_is_corrupted): add
932 mechanism to handle a corrupt message stream
933 (_dbus_message_loader_new): fix preallocation to only prealloc,
936 * dbus/dbus-string.c (_dbus_string_skip_blank): fix this function
937 (_dbus_string_test): enhance tests for copy/move and fix the
940 * dbus/dbus-transport-unix.c: Hold references in more places to
941 avoid reentrancy problems
943 * dbus/dbus-transport.c: ditto
945 * dbus/dbus-connection.c (dbus_connection_dispatch_message): don't
946 leak reference count in no-message case
948 * test/watch.c (do_mainloop): handle adding/removing watches
949 during iteration over the watches. Also, ref the connection/server
950 stored on a watch, so we don't try to mangle a destroyed one.
952 * dbus/dbus-transport-unix.c (do_authentication): perform
955 * dbus/dbus-auth.c (get_state): add a state
956 AUTHENTICATED_WITH_UNUSED_BYTES and return it if required
957 (_dbus_auth_get_unused_bytes): append the unused bytes
958 to the passed in string, rather than prepend
960 * dbus/dbus-transport.c (_dbus_transport_init_base): create
961 the auth conversation DBusAuth
963 * dbus/dbus-transport-unix.c (_dbus_transport_new_for_fd)
964 (_dbus_transport_new_for_domain_socket): when creating a
965 transport, pass in whether it's a client-side or server-side
966 transport so we know which DBusAuth to create
968 2002-12-03 Havoc Pennington <hp@pobox.com>
970 * dbus/dbus-transport-unix.c (unix_finalize): finalize base
971 _after_ finalizing the derived members
972 (unix_connection_set): unref watch if we fail to add it
974 * dbus/dbus-connection.c (dbus_connection_unref): delete the
975 transport first, so that the connection owned by the
976 transport will be valid as the transport finalizes.
978 * dbus/dbus-transport-unix.c (unix_finalize): free the write_watch
979 if necessary, and remove watches from the connection.
981 * dbus/dbus-watch.c (_dbus_watch_list_free): improve a comment
983 2002-12-26 Anders Carlsson <andersca@codefactory.se>
985 * dbus/dbus-marshal.c: (_dbus_marshal_string),
986 (_dbus_demarshal_double), (_dbus_demarshal_int32),
987 (_dbus_demarshal_uint32), (_dbus_demarshal_string),
988 (_dbus_marshal_test):
989 * dbus/dbus-marshal.h:
990 Add string marshal functions and have the demarshal functions
991 return the new position.
993 2002-12-25 Havoc Pennington <hp@pobox.com>
995 * doc/dbus-sasl-profile.txt: docs on the authentication protocol,
996 it is a simple protocol that just maps directly to SASL.
998 * dbus/dbus-auth.h, dbus/dbus-auth.c: authentication protocol
999 initial implementation, not actually used yet.
1001 * dbus/dbus-string.c (_dbus_string_find): new function
1002 (_dbus_string_equal): new function
1003 (_dbus_string_base64_encode): new function
1004 (_dbus_string_base64_decode): new function
1006 2002-12-25 Anders Carlsson <andersca@codefactory.se>
1009 * dbus/dbus-marshal.c: (swap_bytes), (_dbus_marshal_double),
1010 (_dbus_marshal_int32), (_dbus_marshal_uint32),
1011 (_dbus_demarshal_double), (_dbus_demarshal_int32),
1012 (_dbus_demarshal_uint32), (_dbus_marshal_test):
1013 * dbus/dbus-marshal.h:
1014 * dbus/dbus-protocol.h:
1015 * dbus/dbus-test.c: (main):
1017 Add un-optimized marshalling/demarshalling routines.
1019 2002-12-25 Harri Porten <porten@kde.org>
1021 * qt/dbus-qt.h: adjusted ctor and getter to KDE/Qt conventions
1023 2002-12-24 Zack Rusin <zack@kde.org>
1025 * qt/dbus-qthread.cc: adding - integrates QMutex into Dbus
1026 * qt/dbus-qt.h: skeleton with two sample implemenatation of the
1029 2002-12-24 Havoc Pennington <hp@pobox.com>
1031 * glib/dbus-gthread.c: fix include
1033 * glib/dbus-glib.h: rename DBusMessageHandler for now.
1034 I think glib API needs to change, though, as you don't
1035 want to use DBusMessageFunction, you want to use the
1036 DBusMessageHandler object. Probably
1037 dbus_connection_open_with_g_main_loop()
1038 and dbus_connection_setup_g_main_loop() or something like that
1039 (but think of better names...) that just create a connection
1040 that has watch/timeout functions etc. already set up.
1042 * dbus/dbus-connection.c
1043 (dbus_connection_send_message_with_reply): new function just to
1044 show how the message handler helps us deal with replies.
1046 * dbus/dbus-list.c (_dbus_list_remove_last): new function
1048 * dbus/dbus-string.c (_dbus_string_test): free a string that
1051 * dbus/dbus-hash.c: use memory pools for the hash entries
1052 (rebuild_table): be more paranoid about overflow, and
1053 shrink table when we can
1054 (_dbus_hash_test): reduce number of sprintfs and write
1055 valid C89. Add tests for case where we grow and then
1056 shrink the hash table.
1058 * dbus/dbus-mempool.h, dbus/dbus-mempool.c: memory pools
1060 * dbus/dbus-connection.c (dbus_connection_register_handler)
1061 (dbus_connection_unregister_handler): new functions
1063 * dbus/dbus-message.c (dbus_message_get_name): new
1065 * dbus/dbus-list.c: fix docs typo
1067 * dbus/dbus-message-handler.h, dbus/dbus-message-handler.c:
1068 an object representing a handler for messages.
1070 2002-12-16 Anders Carlsson <andersca@codefactory.se>
1073 * glib/dbus-gthread.c: (dbus_gthread_init):
1074 Don't use the gdbus prefix for public functions.
1076 2002-12-16 Anders Carlsson <andersca@codefactory.se>
1080 Add GLib checks and fixup .pc files
1084 * glib/dbus-gmain.c: (gdbus_connection_prepare),
1085 (gdbus_connection_check), (gdbus_connection_dispatch),
1086 (gdbus_add_connection_watch), (gdbus_remove_connection_watch),
1087 (dbus_connection_gsource_new):
1088 * glib/dbus-gthread.c: (dbus_gmutex_new), (dbus_gmutex_free),
1089 (dbus_gmutex_lock), (dbus_gmutex_unlock), (dbus_gthread_init):
1090 * glib/test-dbus-glib.c: (message_handler), (main):
1093 2002-12-15 Harri Porten <porten@kde.org>
1095 * autogen.sh: check for libtoolize before attempting to use it
1097 * dbus/dbus-transport-unix.c: include <sys/time.h> for timeval
1100 * .cvsignore: ignore more stamp files
1102 * dbus/dbus-watch.c (_dbus_watch_list_new): fixed doc error
1104 * test/Makefile.am: added -I$(top_srcdir) to be able to compile
1105 without make install.
1107 2002-12-15 Havoc Pennington <hp@pobox.com>
1109 * dbus/dbus-threads.c: add thread stubs that a higher library
1110 layer can fill in. e.g. the GLib wrapper might fill them in with
1111 GThread stuff. We still need to use this thread API to
1112 thread-safe-ize the library.
1114 2002-12-12 Havoc Pennington <hp@pobox.com>
1116 * dbus/dbus-transport-unix.c, dbus/dbus-server-unix.c: use the
1117 below new interfaces and include fewer system headers.
1119 * dbus/dbus-sysdeps.c (_dbus_read): new function
1120 (_dbus_write): new function
1121 (_dbus_write_two): new function
1122 (_dbus_connect_unix_socket): new function
1123 (_dbus_listen_unix_socket): new function
1125 * dbus/dbus-message-internal.h: change interfaces to use
1128 2002-12-11 Havoc Pennington <hp@pobox.com>
1130 * dbus/dbus-types.h: add dbus_unichar
1132 * dbus/dbus-internals.c (_dbus_verbose): use _dbus_getenv
1134 * dbus/dbus-connection.c (dbus_connection_send_message): return
1137 * dbus/dbus-transport.c: include dbus-watch.h
1139 * dbus/dbus-connection.c: include dbus-message-internal.h
1141 * HACKING: add file with coding guidelines stuff.
1143 * dbus/dbus-string.h, dbus/dbus-string.c: Encapsulate all string
1144 handling here, for security purposes (as in vsftpd). Not actually
1145 using this class yet.
1147 * dbus/dbus-sysdeps.h, dbus/dbus-sysdeps.c: Encapsulate all
1148 system/libc usage here, as in vsftpd, for ease of auditing (and
1149 should also simplify portability). Haven't actually moved all the
1150 system/libc usage into here yet.
1152 2002-11-25 Havoc Pennington <hp@pobox.com>
1154 * dbus/dbus-internals.c (_dbus_verbose): fix to not
1155 always print the first verbose message.
1157 2002-11-24 Havoc Pennington <hp@pobox.com>
1159 * test/echo-client.c, test/echo-server.c: cheesy test
1162 * configure.in (AC_CHECK_FUNCS): check for writev
1164 * dbus/dbus-message.c (_dbus_message_get_network_data): new
1167 * dbus/dbus-list.c (_dbus_list_foreach): new function
1169 * dbus/dbus-internals.c (_dbus_verbose): new function
1171 * dbus/dbus-server.c, dbus/dbus-server.h: public object
1172 representing a server that listens for connections.
1174 * dbus/.cvsignore: create
1176 * dbus/dbus-errors.h, dbus/dbus-errors.c:
1177 public API for reporting errors
1179 * dbus/dbus-connection.h, dbus/dbus-connection.c:
1180 public object representing a connection that
1181 sends/receives messages. (Same object used for
1182 both client and server.)
1184 * dbus/dbus-transport.h, dbus/dbus-transport.c:
1185 Basic abstraction for different kinds of stream
1186 that we might read/write messages from.
1188 2002-11-23 Havoc Pennington <hp@pobox.com>
1190 * dbus/dbus-internals.h (_DBUS_INT_MAX): add _DBUS_INT_MIN
1193 * dbus/dbus-test.c (main): add list test, and include
1194 dbus-test.h as intended
1196 * dbus/dbus-hash.c (_dbus_hash_table_remove_string)
1197 (_dbus_hash_table_remove_int): return value indicates
1198 whether the entry existed to remove
1200 * dbus/dbus-list.c: add linked list utility class,
1203 * dbus/dbus-hash.c: add TODO item about shrinking the hash bucket
1206 2002-11-23 Havoc Pennington <hp@pobox.com>
1208 * Doxyfile.in (INCLUDE_FILE_PATTERNS): expand DBUS_BEGIN_DECLS/
1209 DBUS_END_DECLS to nothing, that should fix this once and for all
1211 * Doxyfile.in (JAVADOC_AUTOBRIEF): set to YES
1213 * dbus/dbus-message.c, dbus/dbus-hash.c:
1214 add some missing @brief
1216 2002-11-23 Havoc Pennington <hp@pobox.com>
1218 * dbus/dbus-message.h: put semicolons after DEBUG_BEGIN_DECLS
1219 to avoid confusing Doxygen
1221 * dbus/dbus-hash.c: @} not }@
1223 * dbus/dbus-message.c (struct DBusMessage): split out
1226 2002-11-23 Havoc Pennington <hp@pobox.com>
1228 * configure.in: pile on more warning flags if using gcc
1230 * Doxyfile.in (EXTRACT_STATIC): set to NO, so we don't have
1231 to document static functions
1233 * configure.in: add summary to end of configure so it
1234 looks nice and attractive
1236 * dbus/dbus-hash.c: finish implementation and write unit
1239 * configure.in: add --enable-tests to enable unit tests
1241 * dbus/dbus-test.c: test program to run unit tests
1242 for all files in dbus/*, initially runs a test for
1245 * dbus/dbus-internals.h: file to hold some internal utility stuff
1247 2002-11-22 Havoc Pennington <hp@redhat.com>
1249 * dbus/dbus-hash.c: copy in Tcl hash table, not yet
1250 "ported" away from Tcl
1252 * dbus/dbus-types.h: header for types such as dbus_bool_t
1254 2002-11-22 Havoc Pennington <hp@redhat.com>
1256 * dbus/dbus.h: fixups for doc warnings
1258 * Doxyfile.in (FILE_PATTERNS): we need to scan .h to pick up
1260 (QUIET): make it quiet so we can see warnings
1262 * dbus/dbus-memory.c: teach D-BUS to allocate and free memory
1264 2002-11-22 Havoc Pennington <hp@redhat.com>
1266 * Makefile.am: include "Doxyfile" target in all-local
1268 * configure.in: generate the Doxyfile
1270 * Doxyfile.in: move Doxyfile here, so we can use
1271 configure to generate a Doxyfile with the right
1274 2002-11-22 Havoc Pennington <hp@redhat.com>
1276 * dbus/dbus-message.c: move inline docs into .c file
1278 * Doxyfile (OUTPUT_DIRECTORY): move output to doc/api
1279 so all docs are under doc/
1280 (MAN_EXTENSION): generate man pages. Use extension
1281 ".3dbus" which matches ".3qt" on my system,
1282 I guess this is OK, I don't know really.
1283 (FILE_PATTERNS): look for .c files not .h, makes sense
1286 2002-11-22 Havoc Pennington <hp@pobox.com>
1288 * Makefile.am (SUBDIRS): rename subdir "server" to "bus"
1289 because any app can be a server, and any app can be a client,
1290 the bus is a special kind of server.
1292 Thu Nov 21 23:35:31 2002 Zack Rusin <zack@kde.org>
1294 * Doxyfile : adding. Still needs Makefile rules to be generated
1295 automatically (just run "doxygen" in the toplevel dir for now to
1298 * dbus/dbus-message.h : Adding sample docs (javadoc since
1299 resembles gtk-doc a little more)
1301 * dbus/dbus.h : Adding sample docs
1303 2002-11-21 Havoc Pennington <hp@redhat.com>
1305 * dbus/Makefile.am (INCLUDES): define DBUS_COMPILATION
1306 so we can allow ourselves to include files directly,
1307 instead of having to use dbus.h
1309 * dbus/dbus.h: fill in
1311 * dbus/dbus-message.h: sketch out a sample header file.
1312 Include griping if you include it directly instead of
1315 * dbus/dbus-macros.h: new file with macros for extern "C",
1316 TRUE/FALSE, NULL, etc.
1318 * doc/file-boilerplate.c: put include guards in here
1320 2002-11-21 Havoc Pennington <hp@redhat.com>
1322 * doc/file-boilerplate.c: include both AFL and GPL boilerplate.
1324 * COPYING: include the GPL as well, and license code
1325 under both AFL and GPL.
1327 2002-11-21 Havoc Pennington <hp@redhat.com>
1329 * acconfig.h: get rid of this
1331 * autogen.sh (run_configure): add --no-configure option
1333 * configure.in: remove AC_ARG_PROGRAM to make
1334 autoconf complain less. add AC_PREREQ.
1335 add AC_DEFINE third arg.
1337 2002-11-21 Anders Carlsson <andersca@codefactory.se>
1340 Fix references so we can distcheck.
1342 2002-11-21 Havoc Pennington <hp@redhat.com>
1344 * Initial module creation