1 2003-02-17 Anders Carlsson <andersca@codefactory.se>
3 * dbus/dbus-message.c: (decode_header_data),
4 (_dbus_message_loader_return_buffer):
5 Set the header padding amount when loading a message.
7 2003-02-16 Anders Carlsson <andersca@codefactory.se>
9 * bus/dispatch.c: (send_one_message):
10 Only send broadcast messages to registered connections.
12 * dbus/dbus-message.c: (dbus_message_name_is):
13 * dbus/dbus-message.h:
14 New convenience function.
16 * dbus/dbus-transport-debug.c: (do_reading):
17 Only dispatch one message per run.
20 * test/bus-test.c: (new_connection_callback), (die),
21 (test_hello_client1_handler), (test_hello_client2_handler),
22 (test_hello_replies), (main):
24 * test/bus-test-loop.[ch]:
27 2003-02-16 Havoc Pennington <hp@pobox.com>
29 * dbus/dbus-connection.c (dbus_connection_dispatch_message): fix
32 2003-02-16 Alexander Larsson <alexl@redhat.com>
34 * dbus/dbus-connection.c:
35 Implement sent_message_with_reply. (with_reply_and block is still
37 Made dispatch_message not lose message if OOM.
40 Add NoReply error (for reply timeouts).
42 2003-02-16 Alexander Larsson <alexl@redhat.com>
44 * dbus/dbus-hash.c (_dbus_hash_table_unref):
45 Actually free keys and values when destroying hashtable.
47 2003-02-16 Anders Carlsson <andersca@codefactory.se>
49 * dbus/dbus-auth.c: (client_try_next_mechanism):
52 * dbus/dbus-threads.c: (dbus_condvar_wait_timeout):
53 Return TRUE if there's no thread implementation around.
55 * glib/dbus-gmain.c: (free_source),
56 (dbus_connection_hookup_with_g_main):
57 Make sure to remove the GSource when the connection is finalized.
59 2003-02-16 Anders Carlsson <andersca@codefactory.se>
61 * bus/dispatch.c: (bus_dispatch_message_handler):
63 Return an error if someone tries to send a message to a service
66 2003-02-16 Anders Carlsson <andersca@codefactory.se>
68 * bus/activation.c: (load_directory), (bus_activation_init),
69 (bus_activation_activate_service):
72 (bus_driver_handle_activate_service), (bus_driver_handle_message):
73 More work on the activation handling.
76 Add some error messages
78 * dbus/dbus-message.c: (dbus_message_new_error_reply):
79 * dbus/dbus-message.h:
80 New function that creates an error message.
82 * dbus/dbus-protocol.h:
83 Add ACTIVATE_SERVER message.
85 * dbus/dbus-server-unix.c: (unix_handle_watch),
86 (_dbus_server_new_for_domain_socket):
87 Call _dbus_fd_set_close_on_exec.
89 * dbus/dbus-sysdeps.c: (make_pipe), (do_exec),
90 (_dbus_spawn_async), (_dbus_disable_sigpipe),
91 (_dbus_fd_set_close_on_exec):
92 * dbus/dbus-sysdeps.h:
93 Add _dbus_fd_set_close_on exec function. Also add function that checks
94 that all open fds are set to close-on-exec and warns otherwise.
96 * dbus/dbus-transport-unix.c:
97 (_dbus_transport_new_for_domain_socket):
98 Call _dbus_fd_set_close_on_exec.
100 2003-02-16 Havoc Pennington <hp@pobox.com>
102 * dbus/dbus-connection.c (dbus_connection_set_change_sigpipe):
103 allow people to avoid setting SIGPIPE to SIG_IGN
104 (_dbus_connection_new_for_transport): disable SIGPIPE unless
105 we've been asked not to
107 2003-02-15 Anders Carlsson <andersca@codefactory.se>
109 * dbus/dbus-list.c: (_dbus_list_append_link),
110 (_dbus_list_prepend_link):
111 * dbus/dbus-memory.c: (dbus_malloc), (dbus_malloc0),
115 2003-02-15 Anders Carlsson <andersca@codefactory.se>
118 * bus/activation.c: (bus_activation_entry_free),
119 (add_desktop_file_entry), (load_directory), (bus_activation_init):
121 * bus/main.c: (main):
122 Add simple activation support, doesn't work yet though.
124 2003-02-15 Zack Rusin <zack@kde.org>
126 * qt/dbus-qthread.cpp: small casting fix
128 2003-02-15 Anders Carlsson <andersca@codefactory.se>
130 * dbus/dbus-errors.c: (dbus_set_error):
131 * dbus/dbus-errors.h:
132 Add a few errors and make dbus_set_error void.
134 * dbus/dbus-sysdeps.c:
135 (_dbus_errno_to_string), (close_and_invalidate), (make_pipe),
136 (write_err_and_exit), (read_ints), (do_exec), (_dbus_spawn_async):
137 * dbus/dbus-sysdeps.h:
138 Add _dbus_spawn_async.
140 * test/spawn-test.c: (main):
141 Test for _dbus_spawn_async.
143 2003-02-15 Anders Carlsson <andersca@codefactory.se>
145 * dbus/dbus-internals.h:
146 Fix build without tests.
148 * dbus/dbus-list.c: (alloc_link):
149 Fix a segfault when a malloc fails.
151 * dbus/dbus-memory.c: (initialize_malloc_debug), (dbus_malloc),
152 (dbus_malloc0), (dbus_realloc):
153 Add support for malloc debugging.
155 2003-02-15 Alexander Larsson <alexl@redhat.com>
157 * dbus/dbus-threads.c:
158 * dbus/dbus-threads.h:
159 Add condvars. Remove static mutext from API.
160 Implement static mutexes by initializing them from threads_init.
162 * glib/dbus-gthread.c:
163 * qt/dbus-qthread.cpp:
164 Update with the thread api changes.
169 Turn StaticMutex into normal mutex + init function.
170 Export new functions _dbus_list_alloc_link, _dbus_list_free_link,
171 _dbus_list_append_link, _dbus_list_prepend_link
174 * dbus/dbus-sysdeps.c:
175 * dbus/dbus-sysdeps.h:
176 New type dbus_atomic_t, and new functions _dbus_atomic_inc,
177 _dbus_atomic_dec. Only slow fallback implementation at the moment.
179 * dbus/dbus-protocol.h:
180 Add DBUS_MESSAGE_LOCAL_DISCONNECT define
182 * dbus/dbus-message.c:
183 Make ref/unref atomic.
186 * dbus/dbus-connection-internal.h:
187 * dbus/dbus-connection.c:
188 * dbus/dbus-connection.h:
190 Change _peek to _borrow,_return & _steal_borrowed.
191 Change disconnect callback to event.
192 Make dbus_connection_dispatch_messages reentrant.
194 * dbus/dbus-transport.c:
195 Don't ref the connection on calls to the transport
198 * dbus/dbus-message-handler.c:
202 Don't use peek_message anymore
205 * test/debug-thread.c:
206 * test/debug-thread.h:
207 Simple thread implementation that asserts() on deadlocks in
208 single-threaded code.
211 (main) Call debug_threads_init.
214 Use disconnect message instead of disconnect callback.
218 Don't call dbus_connection_set_disconnect_function. Instead export
219 bus_connection_disconnect.
222 Call bus_connection_disconnect when we get a disconnected message.
224 2003-02-15 Havoc Pennington <hp@pobox.com>
226 * dbus/dbus-message.c (dbus_message_new): fool around with the
229 2003-02-14 Havoc Pennington <hp@pobox.com>
231 * dbus/dbus-mempool.c: fail if the debug functions so indicate
233 * dbus/dbus-memory.c: fail if the debug functions indicate we
236 * dbus/dbus-internals.c (_dbus_set_fail_alloc_counter)
237 (_dbus_decrement_fail_alloc_counter): debug functions to
238 simulate memory allocation failures
240 2003-02-14 Havoc Pennington <hp@pobox.com>
242 * dbus/dbus-errors.h (struct DBusError): add a word of padding
245 2003-02-13 Anders Carlsson <andersca@codefactory.se>
247 * bus/driver.c: (bus_driver_handle_hello):
249 * bus/services.c: (bus_service_lookup):
250 Reorder message sending so we get a more sane order.
252 * test/bus-test.c: (message_handler):
255 2003-02-13 Anders Carlsson <andersca@codefactory.se>
257 * bus/driver.c: (bus_driver_send_service_deleted),
258 (bus_driver_send_service_created), (bus_driver_send_service_lost),
259 (bus_driver_send_service_acquired), (bus_driver_handle_hello),
260 (bus_driver_send_welcome_message),
261 (bus_driver_handle_list_services),
262 (bus_driver_handle_acquire_service),
263 (bus_driver_handle_service_exists):
264 * dbus/dbus-bus.c: (dbus_bus_register_client),
265 (dbus_bus_acquire_service), (dbus_bus_service_exists):
266 * dbus/dbus-errors.c: (dbus_result_to_string):
267 * dbus/dbus-errors.h:
268 * dbus/dbus-message.c: (dbus_message_append_args),
269 (dbus_message_append_args_valist), (dbus_message_get_args),
270 (dbus_message_get_args_valist), (dbus_message_get_args_iter),
271 (dbus_message_iter_get_arg_type), (dbus_message_iter_get_string),
272 (dbus_message_iter_get_byte_array),
273 (dbus_message_iter_get_string_array), (message_iter_test),
274 (check_message_handling), (_dbus_message_test):
275 * dbus/dbus-message.h:
276 * test/bus-test.c: (main):
277 Change fields to arguments in messages, so that they won't be
278 confused with header fields.
280 * glib/test-dbus-glib.c: (main):
281 Remove append_fields from hello message.
283 2003-02-13 Anders Carlsson <andersca@codefactory.se>
285 * dbus/dbus-errors.c:
286 * dbus/dbus-message.c:
287 * dbus/dbus-string.c:
290 2003-02-13 Anders Carlsson <andersca@codefactory.se>
292 * glib/dbus-gmain.c: (timeout_handler), (add_timeout),
294 Implement support for timeouts in dbus-glib.
296 2003-02-13 Anders Carlsson <andersca@codefactory.se>
298 * dbus/dbus-message-builder.c: (_dbus_message_data_load):
299 * dbus/dbus-message.c: (process_test_subdir):
300 * test/break-loader.c: (find_breaks_based_on):
301 Plug some memory leaks.
303 2003-02-13 Richard Hult <rhult@codefactory.se>
305 * bus/main.c: Fix build.
307 * dbus/dbus-errors.h:
308 * dbus/dbus-errors.c: Fix copyright for Anders.
310 2003-02-13 Anders Carlsson <andersca@codefactory.se>
315 * bus/connection.c: (bus_connection_foreach):
318 * bus/desktop-file.c: (grow_lines_in_section), (grow_sections),
319 (unescape_string), (new_section), (parse_section_start),
320 (parse_key_value), (report_error), (bus_desktop_file_load),
321 (bus_desktop_file_get_string):
322 * bus/desktop-file.h:
323 Use DBusError for error reporting.
325 * bus/dispatch.c: (send_one_message),
326 (bus_dispatch_message_handler):
327 * bus/driver.c: (bus_driver_send_service_deleted),
328 (bus_driver_send_service_created), (bus_driver_send_service_lost),
329 (bus_driver_send_service_acquired), (bus_driver_handle_hello),
330 (bus_driver_send_welcome_message),
331 (bus_driver_handle_list_services),
332 (bus_driver_handle_acquire_service),
333 (bus_driver_handle_service_exists):
334 * bus/loop.c: (bus_loop_run):
336 Use BUS_HANDLE_OOM instead of _DBUS_HANDLE_OOM.
338 * bus/utils.c: (bus_wait_for_memory):
340 New files with general utility functions.
342 * dbus/dbus-internals.h:
343 Remove _DBUS_HANDLE_OOM.
345 2003-02-13 Anders Carlsson <andersca@codefactory.se>
347 * dbus/dbus-errors.c: (dbus_result_to_string), (dbus_error_init),
348 (dbus_error_free), (dbus_set_error_const), (dbus_set_error):
349 * dbus/dbus-errors.h:
350 Add DBusError structure.
352 2003-02-13 Anders Carlsson <andersca@codefactory.se>
354 * test/data/valid-messages/standard-acquire-service.message:
355 * test/data/valid-messages/standard-hello.message:
356 * test/data/valid-messages/standard-list-services.message:
357 * test/data/valid-messages/standard-service-exists.message:
358 Add some standard messages.
360 2003-02-13 Anders Carlsson <andersca@codefactory.se>
362 * bus/driver.c: (bus_driver_send_welcome_message),
363 (bus_driver_handle_list_services),
364 (bus_driver_handle_acquire_service),
365 (bus_driver_handle_service_exists), (bus_driver_handle_message):
366 Update for API changes in libdbus.
368 * dbus/dbus-message.c: (dbus_message_new_reply):
369 * dbus/dbus-message.h:
370 Remove the name argument. The spec states that replies shouldn't
373 2003-02-13 Anders Carlsson <andersca@codefactory.se>
375 * bus/desktop-file.c: (parse_section_start), (parse_key_value),
376 (report_error), (bus_desktop_file_load), (lookup_section),
377 (lookup_line), (bus_desktop_file_get_raw),
378 (bus_desktop_file_get_string):
379 * bus/desktop-file.h:
380 Some fixes, and new functions for getting a key value from a section.
382 2003-02-13 Havoc Pennington <hp@pobox.com>
384 * test/data/auth/fail-after-n-attempts.auth-script: new test
386 * dbus/dbus-auth.c (send_rejected): shutdown_mech() when we
389 2003-02-13 Havoc Pennington <hp@pobox.com>
391 * dbus/dbus-auth.c (handle_server_data_external_mech): args to
392 dbus_credentials_match were backward
394 * dbus/dbus-auth-script.c (_dbus_auth_script_run): support
395 NO_CREDENTIALS and ROOT_CREDENTIALS
397 * dbus/dbus-auth.c (_dbus_auth_do_work): move get_state() routine
398 into here. Never process more commands after we've reached an
399 end state; store further data as unused bytes.
401 * test/data/auth/*: add more auth tests
403 * dbus/dbus-auth-script.c (_dbus_auth_script_run): support EXPECT
404 command to match exact string and EXPECT_UNUSED to match unused
407 * test/Makefile.am (dist-hook): fix to dist all the test stuff
409 2003-02-12 Havoc Pennington <hp@pobox.com>
411 * dbus/dbus-string.c (_dbus_string_pop_line): fix to also strip
412 \r off of popped lines
414 * dbus/dbus-auth.c (_dbus_auth_test): write code to run auth
417 * dbus/dbus-auth-script.c (_dbus_auth_script_run): when doing a
420 2003-02-12 Havoc Pennington <hp@pobox.com>
422 * dbus/Makefile.am: remove break-loader from the build, since it
425 * configure.in: add --enable-gcov to turn on coverage profiling
426 flags and disable optimization
428 2003-02-10 Havoc Pennington <hp@pobox.com>
430 * dbus/dbus-auth-script.c, dbus/dbus-auth-script.h: sync
431 initial cut at test framework for DBusAuth from laptop.
432 Doesn't quite work yet but it compiles and I need to get
433 it off the 266mhz laptop. ;-)
435 * dbus/dbus-server-debug.c (_dbus_server_debug_accept_transport):
436 fix a memleak in error case
438 2003-02-12 Anders Carlsson <andersca@codefactory.se>
441 * bus/desktop-file.c:
442 * bus/desktop-file.h:
443 Add a desktop file parser.
445 2003-02-11 Zack Rusin <zack@kde.org>
447 * qt/message.[h|cpp]: sample implementation
448 of the KDE wrapper for DBusMessage
450 2003-02-09 Zack Rusin <zack@kde.org>
452 * test/bus-test.c: make_it_compile
453 * doc/dbus-specification.sgml: minimal semantic fix
455 2003-02-06 Anders Carlsson <andersca@codefactory.se>
461 2003-02-06 Anders Carlsson <andersca@codefactory.se>
464 * dbus/dbus-break-loader.c:
466 * test/break-loader.c:
467 Move dbus-break-loader to test/ and rename it to break-loader.
469 2003-02-02 Havoc Pennington <hp@pobox.com>
471 * dbus/dbus-keyring.c, dbus/dbus-keyring.h: template files
472 for code to manage cookies in your home directory
474 * dbus/dbus-sysdeps.c (_dbus_generate_random_bytes): new function
476 * dbus/dbus-auth.c (get_state): impose a maximum number of tries
477 to authenticate, then disconnect the client.
479 2003-02-03 Alexander Larsson <alexl@redhat.com>
481 * dbus/dbus-message.c (dbus_message_append_fields):
484 2003-02-02 Anders Carlsson <andersca@codefactory.se>
486 * doc/dbus-specification.sgml:
487 Update address format section.
489 2003-02-02 Anders Carlsson <andersca@codefactory.se>
492 * test/bus-test.c: (get_time), (add_timeout), (remove_timeout),
493 (message_handler), (new_connection_callback), (loop_quit),
497 2003-02-02 Anders Carlsson <andersca@codefactory.se>
499 * bus/driver.c: (bus_driver_handle_service_exists):
500 Simplify the code a bit.
502 * dbus/dbus-bus.c: (dbus_bus_service_exists):
505 2003-02-02 Anders Carlsson <andersca@codefactory.se>
508 Add libdbus-daemon.la and link to it.
510 2003-02-01 James Willcox <jwillcox@gnome.org>
512 * bus/driver.c: (bus_driver_handle_own_service):
513 Actually include the service reply code in the message.
515 2003-02-02 Anders Carlsson <andersca@codefactory.se>
517 * bus/driver.c: (bus_driver_handle_service_exists):
518 Don't unref the incoming message.
520 2003-02-02 Anders Carlsson <andersca@codefactory.se>
522 * dbus/dbus.h: Add dbus-address.h and dbus-bus.h
524 2003-02-02 Anders Carlsson <andersca@codefactory.se>
526 * dbus/dbus-server.c: (dbus_server_listen):
527 * dbus/dbus-transport.c: (_dbus_transport_open):
528 ifdef out the calls to the debug transport and server.
530 2003-02-02 Alexander Larsson <alexl@redhat.com>
532 * dbus/dbus-watch.c (dbus_watch_get_flags):
533 Add note in the docs that ERROR or HANGUP won't be returned
534 and are assumed always on.
536 * glib/dbus-gmain.c (add_watch):
537 Always add IO_ERR | IO_HUP
539 * dbus/dbus-message.h:
540 Add semicolon after dbus_message_iter_get_string_array().
541 Makes qt code build again
543 2003-02-01 Anders Carlsson <andersca@codefactory.se>
545 * bus/driver.c: (create_unique_client_name),
546 (bus_driver_handle_hello):
547 Don't take a name, just use a numeric id to identify
551 * dbus/dbus-bus.c: (dbus_bus_register_client),
552 (dbus_bus_acquire_service), (dbus_bus_service_exists):
554 Add new convenience functions for communicating with the bus.
556 * dbus/dbus-message.h:
558 * dbus/dbus-protocol.h:
561 2003-02-01 Alexander Larsson <alexl@redhat.com>
563 * dbus/dbus-message.c (dbus_message_append_fields):
564 Add some more doc comments.
566 2003-02-01 Havoc Pennington <hp@pobox.com>
568 * dbus/dbus-break-loader.c (randomly_modify_length): change
569 a 4-byte value in the message as if it were a length
571 * dbus/dbus-sysdeps.c (_dbus_string_save_to_file): don't set
572 execute bit on saved files
574 2003-02-01 Havoc Pennington <hp@pobox.com>
576 * dbus/dbus-break-loader.c (main): new program to find messages
577 that break the loader.
579 * dbus/dbus-sysdeps.c (_dbus_string_append_uint): new function
580 * dbus/dbus-sysdeps.c (_dbus_string_save_to_file): new function
582 * dbus/dbus-string.c (_dbus_string_set_byte): new
584 2003-01-31 Havoc Pennington <hp@pobox.com>
586 * dbus/dbus-message.c: refactor the test code to be more general,
587 in preparation for writing a "randomly permute test cases to
588 try to break the loader" program.
590 2003-01-31 Havoc Pennington <hp@pobox.com>
592 * doc/dbus-specification.sgml: work on the specification
594 * dbus/dbus-message.c (_dbus_message_loader_return_buffer): check
595 the protocol version of the message.
597 * dbus/dbus-protocol.h: drop special _REPLY names, the spec
598 no longer specifies that.
599 (DBUS_SERVICE_REPLY_SERVICE_EXISTS): fix flags (1/2/4/8 not
602 * dbus/dbus-marshal.c (_dbus_marshal_get_arg_end_pos): add missing
603 "break" for DBUS_TYPE_NIL, remove @todo
605 2003-01-31 Havoc Pennington <hp@pobox.com>
607 * dbus/dbus-message.c (dbus_message_set_is_error_reply): rename
608 just set_is_error/get_is_error as this is a commonly-used
609 function, and write docs.
611 2003-01-31 Anders Carlsson <andersca@codefactory.se>
613 * dbus/dbus-address.c: (dbus_address_entry_free):
614 Free key and value lists.
616 * dbus/dbus-internals.c: (_dbus_type_to_string):
617 Add the types we didn't have.
619 * dbus/dbus-marshal.c: (_dbus_marshal_get_arg_end_pos),
620 (_dbus_marshal_validate_arg):
623 * dbus/dbus-message.c: (dbus_message_set_sender):
624 Remove todo about being able to set sender to NULL.
626 (dbus_message_set_is_error_reply),
627 (dbus_message_get_is_error_reply):
628 * dbus/dbus-message.h:
631 * dbus/dbus-protocol.h:
632 Add error reply flag.
634 * test/data/valid-messages/opposite-endian.message:
635 Add NIL type to test.
637 2003-01-31 Havoc Pennington <hp@pobox.com>
639 * doc/dbus-specification.sgml: fully specify the header. Add
640 flags and major protocol version, and change header/body len to
643 * dbus/dbus-message-builder.c (append_saved_length): append length
646 * dbus/dbus-message.c (dbus_message_create_header): change header
647 length and body length to unsigned. Add the new fields from the
649 (_dbus_message_loader_return_buffer): unsigned header/body len
651 2003-01-30 Havoc Pennington <hp@pobox.com>
653 * dbus/dbus-auth.c: rework to use only REJECTED, no
656 * doc/dbus-sasl-profile.txt: drop MECHANISMS and just
657 use REJECTED, suggested by Mark McLoughlin
659 2003-01-30 Havoc Pennington <hp@pobox.com>
661 * dbus/dbus-server.c (dbus_server_listen): @todo about how we need
662 a better way to report errors here. e.g. "unix address lacks
663 path" or something. also "no such file" when the path doesn't
666 * dbus/dbus-address.c (dbus_address_entries_free): add @todo about
668 (dbus_parse_address): add @todo about documenting address format,
669 and allowing , and ; to be escaped
671 2003-01-30 Anders Carlsson <andersca@codefactory.se>
674 Add dbus-address.[ch]
676 * dbus/dbus-address.c: (dbus_address_entry_free),
677 (dbus_address_entries_free), (create_entry),
678 (dbus_address_entry_get_method), (dbus_address_entry_get_value),
679 (dbus_parse_address), (_dbus_address_test):
680 * dbus/dbus-address.h:
681 New files for dealing with address parsing.
683 * dbus/dbus-connection.c:
684 Document timeout functions.
686 * dbus/dbus-message.c:
687 Document dbus_message_new_from_message.
689 * dbus/dbus-server-debug.c:
692 * dbus/dbus-server.c: (dbus_server_listen):
693 Parse address and use correct server implementation.
695 * dbus/dbus-string.c: (_dbus_string_find_to), (_dbus_string_test):
696 * dbus/dbus-string.h:
697 New function with test.
699 * dbus/dbus-test.c: (dbus_internal_symbol_do_not_use_run_tests):
703 * dbus/dbus-transport-debug.c:
706 * dbus/dbus-transport.c: (_dbus_transport_open):
707 Parse address and use correct transport implementation.
709 2003-01-30 Havoc Pennington <hp@pobox.com>
711 * dbus/dbus-message.c: use message->byte_order instead of
712 DBUS_COMPILER_BYTE_ORDER throughout.
713 (dbus_message_create_header): pad header to align the
714 start of the body of the message to 8-byte boundary
716 * dbus/dbus-marshal.h: make all the demarshalers take const
717 DBusString arguments.
719 * dbus/dbus-message.c (_dbus_message_loader_return_buffer):
720 validate message args here, so we don't have to do slow validation
721 later, and so we catch bad messages as they are incoming. Also add
722 better checks on header_len and body_len. Also fill in
725 * dbus/dbus-string.c (_dbus_string_validate_utf8): new (not
726 implemented properly)
727 (_dbus_string_validate_nul): new function to check all-nul
729 * dbus/dbus-marshal.c (_dbus_marshal_get_field_end_pos): rename
730 get_arg_end_pos and remove all validation
731 (_dbus_marshal_validate_arg): actually do validation here.
733 2003-01-29 Havoc Pennington <hp@pobox.com>
735 * dbus/dbus-message.c (check_message_handling): fix assertion
736 failure on set_client_serial
738 2003-01-28 Havoc Pennington <hp@pobox.com>
740 * dbus/dbus-server-debug.c: Add doc section comments
742 * dbus/dbus-transport-debug.c: add doc section comments
744 2003-01-28 Havoc Pennington <hp@redhat.com>
746 * dbus/dbus-string.c (_dbus_string_base64_decode): append bytes in
747 the reverse order from how I had it
748 (_dbus_string_base64_encode): reverse encoding order. I was
749 basically byteswapping everything during encoding.
751 2003-01-28 Anders Carlsson <andersca@codefactory.se>
753 * dbus/dbus-connection-internal.h:
754 * dbus/dbus-connection.c: (_dbus_connection_add_timeout),
755 (_dbus_connection_remove_timeout):
756 Add functions for adding and removing timeouts.
758 * dbus/dbus-message.c: (dbus_message_new_from_message):
759 Add new function that takes a message and creates an exact
760 copy of it, but with the refcount set to 1.
761 (check_message_handling):
764 * dbus/dbus-server-protected.h:
765 * dbus/dbus-server.c: (_dbus_server_init_base),
766 (_dbus_server_finalize_base), (_dbus_server_add_timeout),
767 (dbus_server_set_timeout_functions):
768 (_dbus_server_remove_timeout):
769 New functions so that a server can add and remove timeouts.
771 (dbus_server_listen):
772 Add commented out call to dbus_server_debug_new.
774 * dbus/dbus-timeout.c: (_dbus_timeout_new):
775 Actually set the handler, doh.
777 * dbus/dbus-transport.c: (_dbus_transport_open):
778 Add commented out call to dbus_transport_debug_client_new.
781 Add dbus-transport-debug.[ch] and dbus-server-debug.[ch]
783 2003-01-28 Havoc Pennington <hp@pobox.com>
785 * dbus/dbus-message.c (check_message_handling): function to check
786 on the loaded message, iterates over it etc.
788 2003-01-28 Havoc Pennington <hp@pobox.com>
790 * test/Makefile.am (dist-hook): fix make distdir
792 * dbus/Makefile.am (TESTS_ENVIRONMENT): fix make check
794 2003-01-27 Havoc Pennington <hp@pobox.com>
796 * dbus/dbus-mempool.c (time_for_size): replace printf with
799 * dbus/dbus-message-builder.c (_dbus_message_data_load): allow
800 empty lines; fix the SAVE_LENGTH stuff to be
801 START_LENGTH/END_LENGTH so it actually works; couple other
804 * test/Makefile.am (dist-hook): add dist-hook for .message files
806 * dbus/dbus-string.c (DBUS_STRING_COPY_PREAMBLE): source of a copy
807 can be constant or locked.
808 (_dbus_string_free): allow freeing a const string as
811 * dbus/dbus-sysdeps.c (_dbus_concat_dir_and_file): utility
813 * dbus/dbus-test-main.c (main): take an argument which is the
814 directory containing test data
816 * dbus/dbus-message.c (_dbus_message_test): pass a test_data_dir
817 argument to this and load all the messages in test/data/
818 checking that they can be loaded or not loaded as appropriate.
820 2003-01-27 Anders Carlsson <andersca@codefactory.se>
822 * bus/dispatch.c: (bus_dispatch_message_handler):
823 Dispatch messages sent to services.
825 * bus/driver.c: (bus_driver_send_service_deleted),
826 (bus_driver_send_service_created), (bus_driver_send_service_lost),
827 (bus_driver_send_service_acquired):
828 Add helper functions for sending service related messages.
830 (bus_driver_send_welcome_message):
831 Send HELLO_REPLY instead of WELCOME.
833 (bus_driver_handle_list_services):
834 Send LIST_SERVICES_REPLY instead of SERVICES.
836 (bus_driver_handle_own_service),
837 (bus_driver_handle_service_exists):
838 New message handlers.
840 (bus_driver_handle_message):
841 Invoke new message handlers.
843 (bus_driver_remove_connection):
844 Don't remove any services here since that's done automatically
845 by bus_service_remove_owner now.
848 New function signatures.
850 * bus/services.c: (bus_service_add_owner):
851 Send ServiceAcquired message if we're the only primary owner.
853 (bus_service_remove_owner):
854 Send ServiceAcquired/ServiceLost messages.
856 (bus_service_set_prohibit_replacement),
857 (bus_service_get_prohibit_replacement):
858 Functions for setting prohibit replacement.
860 (bus_service_has_owner):
861 New function that checks if a connection is in the owner queue of
865 Add new function signatures.
867 * dbus/dbus-list.c: (_dbus_list_test):
868 Add tests for _dbus_list_remove_last and traversing the list backwards.
871 Fix a typo in _dbus_list_get_prev_link, if we're at the first element we can't
872 go any further, so return NULL then.
874 * dbus/dbus-protocol.h:
875 Add new messages, service flags and service replies.
877 2003-01-26 Havoc Pennington <hp@pobox.com>
879 * dbus/dbus-message-builder.c: implement, completely untested.
881 * test/data/*: add data to be used in testing.
882 ".message" files are our simple loadable text format.
883 ".message-raw" will be binary dumps of messages.
885 * dbus/dbus-string.c (_dbus_string_starts_with_c_str): new
887 2003-01-26 Havoc Pennington <hp@pobox.com>
889 * dbus/dbus-sysdeps.c (_dbus_file_get_contents): new function
891 * dbus/dbus-errors.c (dbus_result_to_string): add
894 * dbus/dbus-message-builder.c: new file, will contain code to load
895 up messages from files. Not implemented yet.
897 2003-01-26 Havoc Pennington <hp@pobox.com>
899 * dbus/dbus-message.c (dbus_message_set_sender): support deleting
900 the sender by setting to NULL
902 2003-01-26 Havoc Pennington <hp@pobox.com>
904 The unit tests pass, but otherwise untested. If it breaks, the
905 tests should have been better. ;-)
907 * bus/driver.c (bus_driver_handle_hello): return if we disconnect
910 * dbus/dbus-message.c: redo everything so we maintain
911 message->header as the only copy of the various fields.
912 This avoids the possibility of out-of-memory in some cases,
913 for example dbus_message_lock() can't run out of memory anymore,
914 and avoids extra copying. Figured I may as well go ahead and do
915 this since it was busted for dbus_message_lock to not return
916 failure on OOM, and dbus_message_write_header was totally
917 unchecked for OOM. Also fixed some random other bugs.
919 * dbus/dbus-marshal.c (_dbus_marshal_get_field_end_pos): verify
920 that strings are nul-terminated. Also, end_pos can be equal
921 to string length just not greater than, I think.
922 (_dbus_marshal_set_int32): new function
923 (_dbus_marshal_set_uint32): new function
924 (_dbus_marshal_set_string): new function
926 * dbus/dbus-connection.c (_dbus_connection_new_for_transport): fix
927 a warning, init timeout_list to NULL
928 (dbus_connection_send_message): don't use uninitialized variable
931 * dbus/dbus-string.c (_dbus_string_replace_len): new function
933 2003-01-26 Anders Carlsson <andersca@codefactory.se>
935 * bus/driver.c: (bus_driver_handle_hello),
936 (bus_driver_send_welcome_message):
939 2003-01-26 Anders Carlsson <andersca@codefactory.se>
941 * dbus/dbus-auth.c: (process_auth), (_dbus_auth_unref):
942 * dbus/dbus-connection.c: (_dbus_connection_new_for_transport),
943 (dbus_connection_unref):
944 * dbus/dbus-marshal.c: (_dbus_marshal_test):
945 * dbus/dbus-message.c: (dbus_message_unref),
948 (dbus_message_get_fields):
949 Remove debugging printout.
951 (_dbus_message_loader_return_buffer):
952 Don't store the header string.
954 (_dbus_message_test):
957 2003-01-26 Richard Hult <rhult@codefactory.se>
959 * glib/dbus-gmain.c (dbus_connection_dispatch): Traverse a copy of
960 the file descriptor list, since it can change under us.
962 2003-01-25 Anders Carlsson <andersca@codefactory.se>
964 * glib/dbus-gmain.c: (dbus_connection_prepare),
965 (dbus_connection_check), (dbus_connection_dispatch), (add_watch),
966 (remove_watch), (dbus_connection_hookup_with_g_main):
967 Rewrite the glib handling to use its own GSource instead of a
968 GIOChannel so we can catch messages put in the queue while waiting
971 2003-01-25 Anders Carlsson <andersca@codefactory.se>
974 * bus/connection.c: (connection_disconnect_handler),
975 (connection_watch_callback), (bus_connection_setup):
976 * bus/dispatch.c: (send_one_message),
977 (bus_dispatch_broadcast_message), (bus_dispatch_message_handler),
978 (bus_dispatch_add_connection), (bus_dispatch_remove_connection):
980 * bus/driver.c: (bus_driver_send_service_deleted),
981 (bus_driver_send_service_created), (bus_driver_handle_hello),
982 (bus_driver_send_welcome_message),
983 (bus_driver_handle_list_services), (bus_driver_remove_connection),
984 (bus_driver_handle_message):
986 Refactor code, put the message dispatching in its own file. Use
987 _DBUS_HANDLE_OOM. Also send ServiceDeleted messages when a client
990 2003-01-25 Anders Carlsson <andersca@codefactory.se>
992 * dbus/dbus-internals.h:
993 Add _DBUS_HANDLE_OOM macro, it doesn't do anything currently.
995 * dbus/dbus-message.c: (dbus_message_get_sender):
996 * dbus/dbus-message.h:
997 Implement dbus_message_get_sender.
999 * dbus/dbus-protocol.h:
1000 Add message and service defines.
1002 2003-01-25 Anders Carlsson <andersca@codefactory.se>
1004 * dbus/dbus-connection.c: (dbus_connection_send_message):
1005 * dbus/dbus-message-internal.h:
1006 * dbus/dbus-message.c: (_dbus_message_get_client_serial),
1007 (dbus_message_write_header):
1008 Remove _dbus_messag_unlock and don't set the client serial on a
1009 message if one already exists.
1011 2003-01-24 Havoc Pennington <hp@pobox.com>
1013 * dbus/dbus-list.c (alloc_link): put a thread lock on the global
1016 * bus/driver.c (bus_driver_handle_list_services): fix a leak
1019 2003-01-25 Anders Carlsson <andersca@codefactory.se>
1021 * dbus/dbus-list.c: (alloc_link), (free_link):
1022 Use a memory pool for the links.
1024 2003-01-25 Anders Carlsson <andersca@codefactory.se>
1026 * bus/connection.c: (bus_connection_foreach):
1028 Add new bus_connection_foreach function.
1030 * bus/driver.c: (send_one_message), (bus_driver_broadcast_message):
1031 Add function that broadcasts a message to all clients.
1033 (bus_driver_send_service_created), (bus_driver_handle_hello),
1034 (bus_driver_send_welcome_message),
1035 (bus_driver_handle_list_services), (bus_driver_message_handler):
1036 Implement functions that take care of listing services, and notifying
1037 clients when new services are created.
1039 * bus/services.c: (bus_services_list):
1041 Add new function that returns an array of strings with the currently
1042 registered services.
1045 * glib/dbus-gmain.c:
1046 Update copyright year.
1048 2003-01-25 Anders Carlsson <andersca@codefactory.se>
1050 * dbus/dbus-connection.c: (dbus_connection_send_message):
1051 Unlock the message in case it was sent earlier.
1053 (dbus_connection_send_message_with_reply_and_block):
1054 Remove the reply message from the list.
1056 * dbus/dbus-marshal.c: (_dbus_demarshal_string_array):
1057 Set array_len and new_pos correctly.
1059 (_dbus_marshal_test):
1060 Remove debug output.
1062 * dbus/dbus-message-internal.h:
1063 * dbus/dbus-message.c: (_dbus_message_get_reply_serial):
1064 New function that returns the reply serial.
1066 (_dbus_message_unlock):
1067 New function that unlocks a message and resets its header.
1069 (dbus_message_append_string_array),
1070 (dbus_message_get_fields_valist),
1071 (dbus_message_iter_get_field_type),
1072 (dbus_message_iter_get_string_array),
1073 (dbus_message_get_fields),
1074 (dbus_message_append_fields_valist):
1075 Handle string arrays.
1077 (dbus_message_set_sender):
1078 Make this function public since the bus daemon needs it.
1080 (decode_header_data):
1081 Set the reply serial to -1 initially.
1083 * dbus/dbus-message.h:
1084 Add dbus_message_set_sender.
1086 2003-01-24 Havoc Pennington <hp@pobox.com>
1088 * doc/dbus-specification.sgml: add some stuff
1090 2003-01-22 Havoc Pennington <hp@pobox.com>
1092 * doc/dbus-specification.sgml: Start to document the protocol.
1094 2003-01-22 Havoc Pennington <hp@pobox.com>
1096 * dbus/dbus-connection.c
1097 (dbus_connection_send_message_with_reply_and_block): add some @todo
1099 * bus/driver.c (bus_driver_add_connection): add a FIXME about memleak
1101 2003-01-21 Havoc Pennington <hp@pobox.com>
1103 (patch untested because can't compile)
1105 * bus/driver.c (create_unique_client_name): make this function
1106 never recycle client names. Also, caller should initialize
1109 * dbus/dbus-sysdeps.c (_dbus_get_current_time): new function
1111 2003-01-21 Anders Carlsson <andersca@codefactory.se>
1113 * dbus/dbus-marshal.c: (_dbus_marshal_double),
1114 (_dbus_marshal_int32), (_dbus_marshal_uint32),
1115 (_dbus_marshal_int32_array), (_dbus_marshal_uint32_array),
1116 (_dbus_marshal_double_array), (_dbus_marshal_string_array),
1117 (_dbus_demarshal_int32_array), (_dbus_demarshal_uint32_array),
1118 (_dbus_demarshal_double_array), (_dbus_demarshal_string_array),
1119 (_dbus_marshal_get_field_end_pos), (_dbus_marshal_test):
1120 * dbus/dbus-marshal.h:
1121 * dbus/dbus-protocol.h:
1122 Add support for marshalling and demarshalling integer, double
1125 2003-01-21 Anders Carlsson <andersca@codefactory.se>
1130 * bus/connection.c: (connection_disconnect_handler):
1131 Remove the connection from the bus driver's list.
1133 (connection_watch_callback): Dispatch messages.
1135 (free_connection_data): Free connection name.
1137 (bus_connection_setup): Add connection to the bus driver's list.
1138 (bus_connection_remove_owned_service):
1139 (bus_connection_set_name), (bus_connection_get_name):
1140 Add functions for setting and getting the connection's name.
1143 Add function headers.
1145 * bus/driver.c: (create_unique_client_name),
1146 (bus_driver_handle_hello_message),
1147 (bus_driver_send_welcome_message), (bus_driver_message_handler),
1148 (bus_driver_add_connection), (bus_driver_remove_connection):
1151 * bus/services.c: (bus_service_free):
1153 New file that handles communication and registreation with the bus
1156 2003-01-21 Anders Carlsson <andersca@codefactory.se>
1158 * dbus/dbus-connection.c: (dbus_connection_send_message):
1159 Add a new client_serial parameter.
1161 (dbus_connection_send_message_with_reply):
1162 Remove a @todo since we've implemented the blocking function.
1164 (dbus_connection_send_message_with_reply_and_block):
1165 New function that sends a message and waits for a reply and
1166 then returns the reply.
1168 * dbus/dbus-connection.h:
1171 * dbus/dbus-errors.c: (dbus_result_to_string):
1172 * dbus/dbus-errors.h:
1173 Add new DBUS_RESULT.
1175 * dbus/dbus-message-internal.h:
1176 * dbus/dbus-message.c: (_dbus_message_get_reply_serial),
1177 (_dbus_message_set_sender), (dbus_message_write_header),
1178 (dbus_message_new_reply), (decode_header_data),
1179 (_dbus_message_loader_return_buffer), (_dbus_message_test):
1180 * dbus/dbus-message.h:
1181 Add new functions that set the reply serial and sender.
1182 Also marshal and demarshal them correctly and add test.
1184 * dbus/dbus-protocol.h:
1185 Add new DBUS_MESSAGE_TYPE_SENDER.
1188 * glib/dbus-gmain.c: (watch_callback), (free_callback_data),
1189 (add_watch), (remove_watch), (add_timeout), (remove_timeout),
1190 (dbus_connection_hookup_with_g_main):
1191 * glib/test-dbus-glib.c: (main):
1192 Rewrite to use GIOChannel and remove the GSource crack.
1194 * test/echo-client.c: (main):
1195 * test/watch.c: (check_messages):
1196 Update for changed APIs
1198 2003-01-19 Anders Carlsson <andersca@codefactory.se>
1200 * dbus/Makefile.am: Add dbus-timeout.[cħ]
1202 * dbus/dbus-connection.c: (_dbus_connection_new_for_transport):
1203 Create a DBusTimeoutList.
1204 (dbus_connection_set_timeout_functions): Add new function to
1205 set timeout callbacks
1207 * dbus/dbus-connection.h: Add public DBusTimeout API.
1209 * dbus/dbus-message.c: (dbus_message_get_service):
1210 * dbus/dbus-message.h: New function.
1212 * dbus/dbus-server.c: Fix small doc typo.
1214 * dbus/dbus-timeout.[ch]: New files for mainloop timeouts.
1216 2003-01-19 Anders Carlsson <andersca@codefactory.se>
1218 * dbus/dbus-string.c (_dbus_string_move_len): Don't delete all
1219 of the string, just as long as specified.
1221 2003-01-19 Havoc Pennington <hp@pobox.com>
1223 * dbus/dbus-connection.c (dbus_connection_get_is_authenticated):
1226 * dbus/dbus-server.c (dbus_server_set_max_connections)
1227 (dbus_server_get_max_connections, dbus_server_get_n_connections):
1228 keep track of current number of connections, and add API for
1229 setting a max (but haven't implemented enforcing the max yet)
1231 2003-01-18 Havoc Pennington <hp@pobox.com>
1233 * dbus/dbus-transport-unix.c (unix_do_iteration): only do the
1234 reading/writing if read_watch != NULL or write_watch != NULL.
1236 * dbus/dbus-message.c (_dbus_message_loader_return_buffer): fix
1237 the message loader code to actually load message->header and
1238 message->body into the newly-created message.
1240 * dbus/dbus-transport-unix.c (check_write_watch): fix a mem leak
1243 * dbus/dbus-connection.c (dbus_connection_set_max_message_size)
1244 (dbus_connection_get_max_message_size)
1245 (dbus_connection_set_max_live_messages_size)
1246 (dbus_connection_get_max_live_messages_size): implement some
1247 resource limitation functions
1249 * dbus/dbus-resources.c: new file implementing some of the
1250 resource limits stuff
1252 * dbus/dbus-message.c (dbus_message_iter_get_byte_array): add
1253 missing docs, add @todo to handle OOM etc.
1255 * dbus/dbus-marshal.c (_dbus_demarshal_byte_array): add missing
1258 2003-01-18 Havoc Pennington <hp@pobox.com>
1260 * dbus/dbus-connection.c (dbus_connection_unref): disconnect the
1261 connection if it hasn't been already.
1263 * dbus/dbus-connection.h: kill off the idea of an ErrorFunction,
1264 replace with DisconnectFunction.
1266 2003-01-18 Havoc Pennington <hp@pobox.com>
1268 Building --disable-verbose-mode --disable-asserts --disable-tests
1269 cuts the library from 112K to 45K or so
1271 * configure.in: check for varargs macro support,
1272 add --enable-verbose-mode, --enable-asserts.
1274 * dbus/dbus-internals.h (_dbus_assert): support
1276 (_dbus_verbose): support DBUS_ENABLE_VERBOSE_MODE
1278 2003-01-18 Havoc Pennington <hp@pobox.com>
1280 * dbus/dbus-test.c: include config.h so that tests actually run
1282 * dbus/dbus-string.c: add assertions that stuff is 8-byte aligned,
1283 so the failure mode when that assumption fails will be plenty
1286 2003-01-18 Havoc Pennington <hp@pobox.com>
1288 * configure.in: default --enable-tests to $USE_MAINTAINER_MODE
1290 * dbus/Makefile.am: fix it up so dubs-test-main.c is included in
1293 * test/Makefile.am: don't use special variable "TESTS" for echo-*
1294 since we don't want to use those in make check
1296 2003-01-15 Havoc Pennington <hp@redhat.com>
1302 2003-01-15 Havoc Pennington <hp@redhat.com>
1304 * test/Makefile.am: fix so that test source code ends up in the
1305 distribution on make distcheck
1307 2003-01-15 Havoc Pennington <hp@redhat.com>
1313 2003-01-15 Havoc Pennington <hp@redhat.com>
1315 * dbus/dbus-test.c (dbus_internal_symbol_do_not_use_run_tests):
1316 fix build when --disable-tests
1318 * Makefile.am (EXTRA_DIST): put HACKING in here
1320 * HACKING: document procedure for making a tarball release.
1322 2003-01-14 Anders Carlsson <andersca@codefactory.se>
1324 * bus/connection.c: (connection_error_handler),
1325 (bus_connection_setup):
1326 * bus/main.c: (main):
1327 Make sure that the DBusConnectionData struct is NULLed
1328 out to prevent a segfault.
1330 * dbus/dbus-errors.c: (dbus_result_to_string):
1331 * dbus/dbus-errors.h:
1332 * dbus/dbus-message.c: (dbus_message_get_fields),
1333 (dbus_message_get_fields_valist), (_dbus_message_test):
1334 * dbus/dbus-message.h:
1335 Make dbus_message_get_fields return a result code so we can
1336 track invalid fields as well as oom.
1338 2003-01-11 Havoc Pennington <hp@pobox.com>
1340 * configure.in: change --enable-test/--enable-ansi action-if-given
1341 to enable_foo=$enableval instead of enable_foo=yes
1343 2003-01-08 Havoc Pennington <hp@pobox.com>
1345 * dbus/dbus-string.c (_dbus_string_align_length): new function
1347 * dbus/dbus-test-main.c: move main() for test app here
1349 (dbus_internal_symbol_do_not_use_run_tests): we have to export a
1350 symbol to run tests, because dbus-test isn't in the main
1353 Code review nitpicks.
1355 * dbus/dbus-message.c (dbus_message_write_header): add newlines
1356 for people with narrow emacs ;-). Assert client_serial was filled
1357 in. Assert message->name != NULL.
1358 (dbus_message_append_fields): have "first_field_type" arg separate
1359 from va list, needed for C++ binding that also uses varargs IIRC
1360 and helps with type safety
1361 (dbus_message_new): add @todo about using DBusString to store
1362 service/name internally
1363 (dbus_message_new): don't leak ->service and ->name on OOM later
1365 (dbus_message_unref): free the service name
1366 (dbus_message_get_fields): same change to varargs
1367 i.e. first_field_type
1368 (_dbus_message_loader_return_buffer): assert that the message data
1369 is aligned (if not it's a bug in our code). Put in verbose griping
1370 about why we set corrupted = TRUE.
1371 (decode_header_data): add FIXME that char* is evil. Was going to
1372 add FIXME about evil locale-specific string.h strncmp, but just
1373 switched to wacky string-as-uint32 optimization. Move check for
1374 "no room for field name" above get_const_data_len() to avoid
1375 assertion failure in get_const_data_len if we have trailing 2
1376 bytes or the like. Check for service and name fields being
1377 provided twice. Don't leak service/name on error. Require field
1378 names to be aligned to 4 bytes.
1380 * dbus/dbus-marshal.c: move byte swap stuff to header
1381 (_dbus_pack_int32): uscore-prefix
1382 (_dbus_unpack_int32): uscore-prefix
1383 (_dbus_unpack_uint32): export
1384 (_dbus_demarshal_string): add @todo complaining about use of
1386 (_dbus_marshal_get_field_end_pos): add @todo about bad error
1387 handling allowing corrupt data to go unchecked
1389 2003-01-08 Havoc Pennington <hp@redhat.com>
1391 * dbus/dbus-transport-unix.c (unix_do_iteration): add read/write
1392 to the select() as needed for authentication. (should be using
1393 _dbus_poll() not select, but for another day)
1395 * dbus/dbus.h: include dbus/dbus-protocol.h
1397 2003-01-08 Anders Carlsson <andersca@codefactory.se>
1399 * dbus/Makefile.am (dbusinclude_HEADERS): Install
1402 2003-01-08 Anders Carlsson <andersca@codefactory.se>
1404 * dbus/dbus-internals.c: (_dbus_type_to_string):
1405 New function that returns a string describing a type.
1407 * dbus/dbus-marshal.c: (_dbus_demarshal_byte_array):
1408 * dbus/dbus-marshal.h:
1409 * dbus/dbus-message.c: (dbus_message_get_fields_valist),
1410 (dbus_message_iter_get_field_type), (dbus_message_iter_get_double),
1411 (dbus_message_iter_get_byte_array):
1412 * dbus/dbus-message.h:
1413 Add new convenience functions for appending and getting message fields.
1414 Also add demarshalling routines for byte arrays.
1416 2003-01-07 Anders Carlsson <andersca@codefactory.se>
1418 * dbus/dbus-connection-internal.h:
1419 * dbus/dbus-connection.c: (_dbus_connection_new_for_transport),
1420 (_dbus_connection_get_next_client_serial),
1421 (dbus_connection_send_message):
1422 * dbus/dbus-internals.h:
1423 * dbus/dbus-marshal.c: (unpack_uint32), (dbus_unpack_int32),
1424 (dbus_pack_int32), (_dbus_marshal_double), (_dbus_marshal_int32),
1425 (_dbus_marshal_uint32), (_dbus_demarshal_double),
1426 (_dbus_demarshal_int32), (_dbus_demarshal_uint32),
1427 (_dbus_demarshal_string), (_dbus_marshal_get_field_end_pos),
1428 (_dbus_verbose_bytes), (_dbus_marshal_test):
1429 * dbus/dbus-marshal.h:
1430 * dbus/dbus-message-internal.h:
1431 * dbus/dbus-message.c: (_dbus_message_set_client_serial),
1432 (dbus_message_write_header), (_dbus_message_lock),
1433 (dbus_message_new), (dbus_message_ref), (dbus_message_unref),
1434 (dbus_message_get_name), (dbus_message_append_int32),
1435 (dbus_message_append_uint32), (dbus_message_append_double),
1436 (dbus_message_append_string), (dbus_message_append_byte_array),
1437 (dbus_message_get_fields_iter), (dbus_message_iter_ref),
1438 (dbus_message_iter_unref), (dbus_message_iter_has_next),
1439 (dbus_message_iter_next), (dbus_message_iter_get_field_type),
1440 (dbus_message_iter_get_string), (dbus_message_iter_get_int32),
1441 (dbus_message_iter_get_uint32), (dbus_message_iter_get_double),
1442 (decode_header_data), (_dbus_message_loader_return_buffer),
1443 (message_iter_test), (_dbus_message_test):
1444 * dbus/dbus-message.h:
1445 * dbus/dbus-protocol.h:
1446 * dbus/dbus-test.c: (main):
1448 * glib/test-dbus-glib.c: (message_handler), (main):
1449 * test/echo-client.c: (main):
1450 * test/watch.c: (check_messages):
1451 Make messages sendable and receivable for real.
1453 2003-01-07 Anders Carlsson <andersca@codefactory.se>
1455 * dbus/dbus-marshal.c: (_dbus_marshal_double),
1456 (_dbus_marshal_string), (_dbus_marshal_byte_array):
1457 * dbus/dbus-message.c: (dbus_message_append_int32),
1458 (dbus_message_append_uint32), (dbus_message_append_double),
1459 (dbus_message_append_string), (dbus_message_append_byte_array):
1460 Handle OOM restoration.
1462 2003-01-07 Anders Carlsson <andersca@codefactory.se>
1464 * dbus/dbus-marshal.c: (_dbus_marshal_string),
1465 (_dbus_demarshal_string), (_dbus_marshal_test):
1466 * dbus/dbus-marshal.h:
1467 * dbus/dbus-message.c: (dbus_message_get_name),
1468 Document these functions.
1470 (dbus_message_append_int32), (dbus_message_append_uint32),
1471 (dbus_message_append_double), (dbus_message_append_string),
1472 (dbus_message_append_byte_array):
1473 * dbus/dbus-message.h:
1474 Add functions for adding message fields of different types.
1476 * dbus/dbus-protocol.h:
1477 Add the different types.
1479 2003-01-05 Havoc Pennington <hp@pobox.com>
1481 * bus/connection.c: implement routines for handling connections,
1482 first thing is keeping a list of owned services on each connection
1483 and setting up watches etc.
1485 * bus/services.c: implement a mapping from service names to lists
1488 * dbus/dbus-hash.c: add DBUS_HASH_POINTER
1490 * dbus/dbus-threads.c (dbus_static_mutex_lock): add functions
1491 to use static mutexes for global data
1493 * dbus/dbus-connection.c (dbus_connection_set_data): add new
1494 collection of functions to set/get application-specific data
1495 on the DBusConnection.
1497 2003-01-04 Havoc Pennington <hp@pobox.com>
1499 * dbus/dbus-sysdeps.c (_dbus_sleep_milliseconds): new function
1500 (_dbus_poll): new function
1502 * dbus/dbus-internals.h (_DBUS_STRUCT_OFFSET): new macro
1505 * bus/loop.c: initial code for the daemon main loop
1507 2003-01-04 Havoc Pennington <hp@pobox.com>
1509 * test/watch.c (error_handler): make it safe if the error handler
1510 is called multiple times (if we s/error handler/disconnect
1511 handler/ we should just guarantee it's called only once)
1513 * dbus/dbus-transport.c (_dbus_transport_disconnect): call the
1514 error handler on disconnect (it's quite possible we should
1515 just change the error handler to a "disconnect handler," I'm
1516 not sure we have any other meaningful errors)
1518 * configure.in: check for getpwnam_r
1520 * dbus/dbus-transport.c, dbus/dbus-transport-unix.c,
1521 dbus/dbus-auth.c: add credentials support, add EXTERNAL auth
1522 mechanism as in SASL spec, using socket credentials
1524 * dbus/dbus-sysdeps.c (_dbus_read_credentials_unix_socket): new function
1525 (_dbus_send_credentials_unix_socket): new function
1527 * dbus/dbus-sysdeps.c (_dbus_accept_unix_socket): rename just
1529 (_dbus_write): only check errno if <0 returned
1530 (_dbus_write_two): ditto
1532 2003-01-02 Anders Carlsson <andersca@codefactory.se>
1534 * dbus/dbus-marshal.c: (_dbus_marshal_utf8_string),
1535 (_dbus_marshal_byte_array), (_dbus_demarshal_utf8_string),
1536 (_dbus_marshal_test):
1537 * dbus/dbus-marshal.h:
1538 Add _dbus_marshal_byte_array and rename _dbus_marshal_string
1539 to _dbus_marshal_utf8_string. Also fix some tests.
1541 2002-12-28 Harri Porten <porten@kde.org>
1543 * configure.in: added check for C++ compiler and a very cheesy
1544 check for the Qt integration
1546 * Makefile.am (SUBDIRS): compile qt subdir if support is enabled
1548 * qt/Makefile.am: added
1550 * qt/.cvsignore: added
1552 * qt/dbus-qthread.cc, qt/dbus-qthread.cpp: renamed former to
1553 latter, added #ifdef QT_THREAD_SUPPORT guard.
1555 * dbus/Makefile.am: added missing headers for make dist
1557 2002-12-28 Kristian Rietveld <kris@gtk.org>
1559 * dbus/Makefile.am: fixup export-symbols-regex.
1561 2002-12-27 Anders Carlsson <andersca@codefactory.se>
1563 * acinclude.m4: Add this file and put the
1564 PKG_CHECK_MODULE macro in it.
1566 2002-12-27 Anders Carlsson <andersca@codefactory.se>
1568 * dbus/dbus-marshal.c: (_dbus_marshal_string),
1569 (_dbus_demarshal_double), (_dbus_demarshal_int32),
1570 (_dbus_demarshal_uint32), (_dbus_demarshal_string),
1571 (_dbus_marshal_test):
1572 Make the demarshalling routines align the pos argument.
1573 Add string marshalling tests and fix the obvious bugs
1576 2002-12-26 Havoc Pennington <hp@pobox.com>
1578 * dbus/dbus-auth.c: fixes fixes fixes
1580 * dbus/dbus-transport-unix.c: wire up support for
1581 encoding/decoding data on the wire
1583 * dbus/dbus-auth.c (_dbus_auth_encode_data)
1584 (_dbus_auth_decode_data): append to target string
1585 instead of nuking it.
1587 2002-12-26 Havoc Pennington <hp@pobox.com>
1589 * dbus/dbus-marshal.h (DBUS_COMPILER_BYTE_ORDER): #ifdef
1590 WORDS_BIGENDIAN then compiler byte order is DBUS_BIG_ENDIAN,
1593 * dbus/dbus-marshal.c: Add macros to do int swapping in-place and
1594 avoid swap_bytes() overhead (ignoring possible assembly stuff for
1595 now). Main point is because I wanted unpack_uint32 to implement
1597 (_dbus_verbose_bytes): new function
1599 * dbus/dbus-string.c (_dbus_string_validate_ascii): new function
1601 * dbus/dbus-message.c (_dbus_message_loader_get_is_corrupted): add
1602 mechanism to handle a corrupt message stream
1603 (_dbus_message_loader_new): fix preallocation to only prealloc,
1606 * dbus/dbus-string.c (_dbus_string_skip_blank): fix this function
1607 (_dbus_string_test): enhance tests for copy/move and fix the
1610 * dbus/dbus-transport-unix.c: Hold references in more places to
1611 avoid reentrancy problems
1613 * dbus/dbus-transport.c: ditto
1615 * dbus/dbus-connection.c (dbus_connection_dispatch_message): don't
1616 leak reference count in no-message case
1618 * test/watch.c (do_mainloop): handle adding/removing watches
1619 during iteration over the watches. Also, ref the connection/server
1620 stored on a watch, so we don't try to mangle a destroyed one.
1622 * dbus/dbus-transport-unix.c (do_authentication): perform
1625 * dbus/dbus-auth.c (get_state): add a state
1626 AUTHENTICATED_WITH_UNUSED_BYTES and return it if required
1627 (_dbus_auth_get_unused_bytes): append the unused bytes
1628 to the passed in string, rather than prepend
1630 * dbus/dbus-transport.c (_dbus_transport_init_base): create
1631 the auth conversation DBusAuth
1633 * dbus/dbus-transport-unix.c (_dbus_transport_new_for_fd)
1634 (_dbus_transport_new_for_domain_socket): when creating a
1635 transport, pass in whether it's a client-side or server-side
1636 transport so we know which DBusAuth to create
1638 2002-12-03 Havoc Pennington <hp@pobox.com>
1640 * dbus/dbus-transport-unix.c (unix_finalize): finalize base
1641 _after_ finalizing the derived members
1642 (unix_connection_set): unref watch if we fail to add it
1644 * dbus/dbus-connection.c (dbus_connection_unref): delete the
1645 transport first, so that the connection owned by the
1646 transport will be valid as the transport finalizes.
1648 * dbus/dbus-transport-unix.c (unix_finalize): free the write_watch
1649 if necessary, and remove watches from the connection.
1651 * dbus/dbus-watch.c (_dbus_watch_list_free): improve a comment
1653 2002-12-26 Anders Carlsson <andersca@codefactory.se>
1655 * dbus/dbus-marshal.c: (_dbus_marshal_string),
1656 (_dbus_demarshal_double), (_dbus_demarshal_int32),
1657 (_dbus_demarshal_uint32), (_dbus_demarshal_string),
1658 (_dbus_marshal_test):
1659 * dbus/dbus-marshal.h:
1660 Add string marshal functions and have the demarshal functions
1661 return the new position.
1663 2002-12-25 Havoc Pennington <hp@pobox.com>
1665 * doc/dbus-sasl-profile.txt: docs on the authentication protocol,
1666 it is a simple protocol that just maps directly to SASL.
1668 * dbus/dbus-auth.h, dbus/dbus-auth.c: authentication protocol
1669 initial implementation, not actually used yet.
1671 * dbus/dbus-string.c (_dbus_string_find): new function
1672 (_dbus_string_equal): new function
1673 (_dbus_string_base64_encode): new function
1674 (_dbus_string_base64_decode): new function
1676 2002-12-25 Anders Carlsson <andersca@codefactory.se>
1679 * dbus/dbus-marshal.c: (swap_bytes), (_dbus_marshal_double),
1680 (_dbus_marshal_int32), (_dbus_marshal_uint32),
1681 (_dbus_demarshal_double), (_dbus_demarshal_int32),
1682 (_dbus_demarshal_uint32), (_dbus_marshal_test):
1683 * dbus/dbus-marshal.h:
1684 * dbus/dbus-protocol.h:
1685 * dbus/dbus-test.c: (main):
1687 Add un-optimized marshalling/demarshalling routines.
1689 2002-12-25 Harri Porten <porten@kde.org>
1691 * qt/dbus-qt.h: adjusted ctor and getter to KDE/Qt conventions
1693 2002-12-24 Zack Rusin <zack@kde.org>
1695 * qt/dbus-qthread.cc: adding - integrates QMutex into Dbus
1696 * qt/dbus-qt.h: skeleton with two sample implemenatation of the
1699 2002-12-24 Havoc Pennington <hp@pobox.com>
1701 * glib/dbus-gthread.c: fix include
1703 * glib/dbus-glib.h: rename DBusMessageHandler for now.
1704 I think glib API needs to change, though, as you don't
1705 want to use DBusMessageFunction, you want to use the
1706 DBusMessageHandler object. Probably
1707 dbus_connection_open_with_g_main_loop()
1708 and dbus_connection_setup_g_main_loop() or something like that
1709 (but think of better names...) that just create a connection
1710 that has watch/timeout functions etc. already set up.
1712 * dbus/dbus-connection.c
1713 (dbus_connection_send_message_with_reply): new function just to
1714 show how the message handler helps us deal with replies.
1716 * dbus/dbus-list.c (_dbus_list_remove_last): new function
1718 * dbus/dbus-string.c (_dbus_string_test): free a string that
1721 * dbus/dbus-hash.c: use memory pools for the hash entries
1722 (rebuild_table): be more paranoid about overflow, and
1723 shrink table when we can
1724 (_dbus_hash_test): reduce number of sprintfs and write
1725 valid C89. Add tests for case where we grow and then
1726 shrink the hash table.
1728 * dbus/dbus-mempool.h, dbus/dbus-mempool.c: memory pools
1730 * dbus/dbus-connection.c (dbus_connection_register_handler)
1731 (dbus_connection_unregister_handler): new functions
1733 * dbus/dbus-message.c (dbus_message_get_name): new
1735 * dbus/dbus-list.c: fix docs typo
1737 * dbus/dbus-message-handler.h, dbus/dbus-message-handler.c:
1738 an object representing a handler for messages.
1740 2002-12-16 Anders Carlsson <andersca@codefactory.se>
1743 * glib/dbus-gthread.c: (dbus_gthread_init):
1744 Don't use the gdbus prefix for public functions.
1746 2002-12-16 Anders Carlsson <andersca@codefactory.se>
1750 Add GLib checks and fixup .pc files
1754 * glib/dbus-gmain.c: (gdbus_connection_prepare),
1755 (gdbus_connection_check), (gdbus_connection_dispatch),
1756 (gdbus_add_connection_watch), (gdbus_remove_connection_watch),
1757 (dbus_connection_gsource_new):
1758 * glib/dbus-gthread.c: (dbus_gmutex_new), (dbus_gmutex_free),
1759 (dbus_gmutex_lock), (dbus_gmutex_unlock), (dbus_gthread_init):
1760 * glib/test-dbus-glib.c: (message_handler), (main):
1763 2002-12-15 Harri Porten <porten@kde.org>
1765 * autogen.sh: check for libtoolize before attempting to use it
1767 * dbus/dbus-transport-unix.c: include <sys/time.h> for timeval
1770 * .cvsignore: ignore more stamp files
1772 * dbus/dbus-watch.c (_dbus_watch_list_new): fixed doc error
1774 * test/Makefile.am: added -I$(top_srcdir) to be able to compile
1775 without make install.
1777 2002-12-15 Havoc Pennington <hp@pobox.com>
1779 * dbus/dbus-threads.c: add thread stubs that a higher library
1780 layer can fill in. e.g. the GLib wrapper might fill them in with
1781 GThread stuff. We still need to use this thread API to
1782 thread-safe-ize the library.
1784 2002-12-12 Havoc Pennington <hp@pobox.com>
1786 * dbus/dbus-transport-unix.c, dbus/dbus-server-unix.c: use the
1787 below new interfaces and include fewer system headers.
1789 * dbus/dbus-sysdeps.c (_dbus_read): new function
1790 (_dbus_write): new function
1791 (_dbus_write_two): new function
1792 (_dbus_connect_unix_socket): new function
1793 (_dbus_listen_unix_socket): new function
1795 * dbus/dbus-message-internal.h: change interfaces to use
1798 2002-12-11 Havoc Pennington <hp@pobox.com>
1800 * dbus/dbus-types.h: add dbus_unichar
1802 * dbus/dbus-internals.c (_dbus_verbose): use _dbus_getenv
1804 * dbus/dbus-connection.c (dbus_connection_send_message): return
1807 * dbus/dbus-transport.c: include dbus-watch.h
1809 * dbus/dbus-connection.c: include dbus-message-internal.h
1811 * HACKING: add file with coding guidelines stuff.
1813 * dbus/dbus-string.h, dbus/dbus-string.c: Encapsulate all string
1814 handling here, for security purposes (as in vsftpd). Not actually
1815 using this class yet.
1817 * dbus/dbus-sysdeps.h, dbus/dbus-sysdeps.c: Encapsulate all
1818 system/libc usage here, as in vsftpd, for ease of auditing (and
1819 should also simplify portability). Haven't actually moved all the
1820 system/libc usage into here yet.
1822 2002-11-25 Havoc Pennington <hp@pobox.com>
1824 * dbus/dbus-internals.c (_dbus_verbose): fix to not
1825 always print the first verbose message.
1827 2002-11-24 Havoc Pennington <hp@pobox.com>
1829 * test/echo-client.c, test/echo-server.c: cheesy test
1832 * configure.in (AC_CHECK_FUNCS): check for writev
1834 * dbus/dbus-message.c (_dbus_message_get_network_data): new
1837 * dbus/dbus-list.c (_dbus_list_foreach): new function
1839 * dbus/dbus-internals.c (_dbus_verbose): new function
1841 * dbus/dbus-server.c, dbus/dbus-server.h: public object
1842 representing a server that listens for connections.
1844 * dbus/.cvsignore: create
1846 * dbus/dbus-errors.h, dbus/dbus-errors.c:
1847 public API for reporting errors
1849 * dbus/dbus-connection.h, dbus/dbus-connection.c:
1850 public object representing a connection that
1851 sends/receives messages. (Same object used for
1852 both client and server.)
1854 * dbus/dbus-transport.h, dbus/dbus-transport.c:
1855 Basic abstraction for different kinds of stream
1856 that we might read/write messages from.
1858 2002-11-23 Havoc Pennington <hp@pobox.com>
1860 * dbus/dbus-internals.h (_DBUS_INT_MAX): add _DBUS_INT_MIN
1863 * dbus/dbus-test.c (main): add list test, and include
1864 dbus-test.h as intended
1866 * dbus/dbus-hash.c (_dbus_hash_table_remove_string)
1867 (_dbus_hash_table_remove_int): return value indicates
1868 whether the entry existed to remove
1870 * dbus/dbus-list.c: add linked list utility class,
1873 * dbus/dbus-hash.c: add TODO item about shrinking the hash bucket
1876 2002-11-23 Havoc Pennington <hp@pobox.com>
1878 * Doxyfile.in (INCLUDE_FILE_PATTERNS): expand DBUS_BEGIN_DECLS/
1879 DBUS_END_DECLS to nothing, that should fix this once and for all
1881 * Doxyfile.in (JAVADOC_AUTOBRIEF): set to YES
1883 * dbus/dbus-message.c, dbus/dbus-hash.c:
1884 add some missing @brief
1886 2002-11-23 Havoc Pennington <hp@pobox.com>
1888 * dbus/dbus-message.h: put semicolons after DEBUG_BEGIN_DECLS
1889 to avoid confusing Doxygen
1891 * dbus/dbus-hash.c: @} not }@
1893 * dbus/dbus-message.c (struct DBusMessage): split out
1896 2002-11-23 Havoc Pennington <hp@pobox.com>
1898 * configure.in: pile on more warning flags if using gcc
1900 * Doxyfile.in (EXTRACT_STATIC): set to NO, so we don't have
1901 to document static functions
1903 * configure.in: add summary to end of configure so it
1904 looks nice and attractive
1906 * dbus/dbus-hash.c: finish implementation and write unit
1909 * configure.in: add --enable-tests to enable unit tests
1911 * dbus/dbus-test.c: test program to run unit tests
1912 for all files in dbus/*, initially runs a test for
1915 * dbus/dbus-internals.h: file to hold some internal utility stuff
1917 2002-11-22 Havoc Pennington <hp@redhat.com>
1919 * dbus/dbus-hash.c: copy in Tcl hash table, not yet
1920 "ported" away from Tcl
1922 * dbus/dbus-types.h: header for types such as dbus_bool_t
1924 2002-11-22 Havoc Pennington <hp@redhat.com>
1926 * dbus/dbus.h: fixups for doc warnings
1928 * Doxyfile.in (FILE_PATTERNS): we need to scan .h to pick up
1930 (QUIET): make it quiet so we can see warnings
1932 * dbus/dbus-memory.c: teach D-BUS to allocate and free memory
1934 2002-11-22 Havoc Pennington <hp@redhat.com>
1936 * Makefile.am: include "Doxyfile" target in all-local
1938 * configure.in: generate the Doxyfile
1940 * Doxyfile.in: move Doxyfile here, so we can use
1941 configure to generate a Doxyfile with the right
1944 2002-11-22 Havoc Pennington <hp@redhat.com>
1946 * dbus/dbus-message.c: move inline docs into .c file
1948 * Doxyfile (OUTPUT_DIRECTORY): move output to doc/api
1949 so all docs are under doc/
1950 (MAN_EXTENSION): generate man pages. Use extension
1951 ".3dbus" which matches ".3qt" on my system,
1952 I guess this is OK, I don't know really.
1953 (FILE_PATTERNS): look for .c files not .h, makes sense
1956 2002-11-22 Havoc Pennington <hp@pobox.com>
1958 * Makefile.am (SUBDIRS): rename subdir "server" to "bus"
1959 because any app can be a server, and any app can be a client,
1960 the bus is a special kind of server.
1962 Thu Nov 21 23:35:31 2002 Zack Rusin <zack@kde.org>
1964 * Doxyfile : adding. Still needs Makefile rules to be generated
1965 automatically (just run "doxygen" in the toplevel dir for now to
1968 * dbus/dbus-message.h : Adding sample docs (javadoc since
1969 resembles gtk-doc a little more)
1971 * dbus/dbus.h : Adding sample docs
1973 2002-11-21 Havoc Pennington <hp@redhat.com>
1975 * dbus/Makefile.am (INCLUDES): define DBUS_COMPILATION
1976 so we can allow ourselves to include files directly,
1977 instead of having to use dbus.h
1979 * dbus/dbus.h: fill in
1981 * dbus/dbus-message.h: sketch out a sample header file.
1982 Include griping if you include it directly instead of
1985 * dbus/dbus-macros.h: new file with macros for extern "C",
1986 TRUE/FALSE, NULL, etc.
1988 * doc/file-boilerplate.c: put include guards in here
1990 2002-11-21 Havoc Pennington <hp@redhat.com>
1992 * doc/file-boilerplate.c: include both AFL and GPL boilerplate.
1994 * COPYING: include the GPL as well, and license code
1995 under both AFL and GPL.
1997 2002-11-21 Havoc Pennington <hp@redhat.com>
1999 * acconfig.h: get rid of this
2001 * autogen.sh (run_configure): add --no-configure option
2003 * configure.in: remove AC_ARG_PROGRAM to make
2004 autoconf complain less. add AC_PREREQ.
2005 add AC_DEFINE third arg.
2007 2002-11-21 Anders Carlsson <andersca@codefactory.se>
2010 Fix references so we can distcheck.
2012 2002-11-21 Havoc Pennington <hp@redhat.com>
2014 * Initial module creation