1 2003-02-15 Zack Rusin <zack@kde.org>
3 * qt/dbus-qthread.cpp: small casting fix
5 2003-02-15 Anders Carlsson <andersca@codefactory.se>
7 * dbus/dbus-errors.c: (dbus_set_error):
9 Add a few errors and make dbus_set_error void.
11 * dbus/dbus-sysdeps.c:
12 (_dbus_errno_to_string), (close_and_invalidate), (make_pipe),
13 (write_err_and_exit), (read_ints), (do_exec), (_dbus_spawn_async):
14 * dbus/dbus-sysdeps.h:
15 Add _dbus_spawn_async.
17 * test/spawn-test.c: (main):
18 Test for _dbus_spawn_async.
20 2003-02-15 Anders Carlsson <andersca@codefactory.se>
22 * dbus/dbus-internals.h:
23 Fix build without tests.
25 * dbus/dbus-list.c: (alloc_link):
26 Fix a segfault when a malloc fails.
28 * dbus/dbus-memory.c: (initialize_malloc_debug), (dbus_malloc),
29 (dbus_malloc0), (dbus_realloc):
30 Add support for malloc debugging.
32 2003-02-15 Alexander Larsson <alexl@redhat.com>
34 * dbus/dbus-threads.c:
35 * dbus/dbus-threads.h:
36 Add condvars. Remove static mutext from API.
37 Implement static mutexes by initializing them from threads_init.
39 * glib/dbus-gthread.c:
40 * qt/dbus-qthread.cpp:
41 Update with the thread api changes.
46 Turn StaticMutex into normal mutex + init function.
47 Export new functions _dbus_list_alloc_link, _dbus_list_free_link,
48 _dbus_list_append_link, _dbus_list_prepend_link
51 * dbus/dbus-sysdeps.c:
52 * dbus/dbus-sysdeps.h:
53 New type dbus_atomic_t, and new functions _dbus_atomic_inc,
54 _dbus_atomic_dec. Only slow fallback implementation at the moment.
56 * dbus/dbus-protocol.h:
57 Add DBUS_MESSAGE_LOCAL_DISCONNECT define
59 * dbus/dbus-message.c:
60 Make ref/unref atomic.
63 * dbus/dbus-connection-internal.h:
64 * dbus/dbus-connection.c:
65 * dbus/dbus-connection.h:
67 Change _peek to _borrow,_return & _steal_borrowed.
68 Change disconnect callback to event.
69 Make dbus_connection_dispatch_messages reentrant.
71 * dbus/dbus-transport.c:
72 Don't ref the connection on calls to the transport
75 * dbus/dbus-message-handler.c:
79 Don't use peek_message anymore
82 * test/debug-thread.c:
83 * test/debug-thread.h:
84 Simple thread implementation that asserts() on deadlocks in
88 (main) Call debug_threads_init.
91 Use disconnect message instead of disconnect callback.
95 Don't call dbus_connection_set_disconnect_function. Instead export
96 bus_connection_disconnect.
99 Call bus_connection_disconnect when we get a disconnected message.
101 2003-02-15 Havoc Pennington <hp@pobox.com>
103 * dbus/dbus-message.c (dbus_message_new): fool around with the
106 2003-02-14 Havoc Pennington <hp@pobox.com>
108 * dbus/dbus-mempool.c: fail if the debug functions so indicate
110 * dbus/dbus-memory.c: fail if the debug functions indicate we
113 * dbus/dbus-internals.c (_dbus_set_fail_alloc_counter)
114 (_dbus_decrement_fail_alloc_counter): debug functions to
115 simulate memory allocation failures
117 2003-02-14 Havoc Pennington <hp@pobox.com>
119 * dbus/dbus-errors.h (struct DBusError): add a word of padding
122 2003-02-13 Anders Carlsson <andersca@codefactory.se>
124 * bus/driver.c: (bus_driver_handle_hello):
126 * bus/services.c: (bus_service_lookup):
127 Reorder message sending so we get a more sane order.
129 * test/bus-test.c: (message_handler):
132 2003-02-13 Anders Carlsson <andersca@codefactory.se>
134 * bus/driver.c: (bus_driver_send_service_deleted),
135 (bus_driver_send_service_created), (bus_driver_send_service_lost),
136 (bus_driver_send_service_acquired), (bus_driver_handle_hello),
137 (bus_driver_send_welcome_message),
138 (bus_driver_handle_list_services),
139 (bus_driver_handle_acquire_service),
140 (bus_driver_handle_service_exists):
141 * dbus/dbus-bus.c: (dbus_bus_register_client),
142 (dbus_bus_acquire_service), (dbus_bus_service_exists):
143 * dbus/dbus-errors.c: (dbus_result_to_string):
144 * dbus/dbus-errors.h:
145 * dbus/dbus-message.c: (dbus_message_append_args),
146 (dbus_message_append_args_valist), (dbus_message_get_args),
147 (dbus_message_get_args_valist), (dbus_message_get_args_iter),
148 (dbus_message_iter_get_arg_type), (dbus_message_iter_get_string),
149 (dbus_message_iter_get_byte_array),
150 (dbus_message_iter_get_string_array), (message_iter_test),
151 (check_message_handling), (_dbus_message_test):
152 * dbus/dbus-message.h:
153 * test/bus-test.c: (main):
154 Change fields to arguments in messages, so that they won't be
155 confused with header fields.
157 * glib/test-dbus-glib.c: (main):
158 Remove append_fields from hello message.
160 2003-02-13 Anders Carlsson <andersca@codefactory.se>
162 * dbus/dbus-errors.c:
163 * dbus/dbus-message.c:
164 * dbus/dbus-string.c:
167 2003-02-13 Anders Carlsson <andersca@codefactory.se>
169 * glib/dbus-gmain.c: (timeout_handler), (add_timeout),
171 Implement support for timeouts in dbus-glib.
173 2003-02-13 Anders Carlsson <andersca@codefactory.se>
175 * dbus/dbus-message-builder.c: (_dbus_message_data_load):
176 * dbus/dbus-message.c: (process_test_subdir):
177 * test/break-loader.c: (find_breaks_based_on):
178 Plug some memory leaks.
180 2003-02-13 Richard Hult <rhult@codefactory.se>
182 * bus/main.c: Fix build.
184 * dbus/dbus-errors.h:
185 * dbus/dbus-errors.c: Fix copyright for Anders.
187 2003-02-13 Anders Carlsson <andersca@codefactory.se>
192 * bus/connection.c: (bus_connection_foreach):
195 * bus/desktop-file.c: (grow_lines_in_section), (grow_sections),
196 (unescape_string), (new_section), (parse_section_start),
197 (parse_key_value), (report_error), (bus_desktop_file_load),
198 (bus_desktop_file_get_string):
199 * bus/desktop-file.h:
200 Use DBusError for error reporting.
202 * bus/dispatch.c: (send_one_message),
203 (bus_dispatch_message_handler):
204 * bus/driver.c: (bus_driver_send_service_deleted),
205 (bus_driver_send_service_created), (bus_driver_send_service_lost),
206 (bus_driver_send_service_acquired), (bus_driver_handle_hello),
207 (bus_driver_send_welcome_message),
208 (bus_driver_handle_list_services),
209 (bus_driver_handle_acquire_service),
210 (bus_driver_handle_service_exists):
211 * bus/loop.c: (bus_loop_run):
213 Use BUS_HANDLE_OOM instead of _DBUS_HANDLE_OOM.
215 * bus/utils.c: (bus_wait_for_memory):
217 New files with general utility functions.
219 * dbus/dbus-internals.h:
220 Remove _DBUS_HANDLE_OOM.
222 2003-02-13 Anders Carlsson <andersca@codefactory.se>
224 * dbus/dbus-errors.c: (dbus_result_to_string), (dbus_error_init),
225 (dbus_error_free), (dbus_set_error_const), (dbus_set_error):
226 * dbus/dbus-errors.h:
227 Add DBusError structure.
229 2003-02-13 Anders Carlsson <andersca@codefactory.se>
231 * test/data/valid-messages/standard-acquire-service.message:
232 * test/data/valid-messages/standard-hello.message:
233 * test/data/valid-messages/standard-list-services.message:
234 * test/data/valid-messages/standard-service-exists.message:
235 Add some standard messages.
237 2003-02-13 Anders Carlsson <andersca@codefactory.se>
239 * bus/driver.c: (bus_driver_send_welcome_message),
240 (bus_driver_handle_list_services),
241 (bus_driver_handle_acquire_service),
242 (bus_driver_handle_service_exists), (bus_driver_handle_message):
243 Update for API changes in libdbus.
245 * dbus/dbus-message.c: (dbus_message_new_reply):
246 * dbus/dbus-message.h:
247 Remove the name argument. The spec states that replies shouldn't
250 2003-02-13 Anders Carlsson <andersca@codefactory.se>
252 * bus/desktop-file.c: (parse_section_start), (parse_key_value),
253 (report_error), (bus_desktop_file_load), (lookup_section),
254 (lookup_line), (bus_desktop_file_get_raw),
255 (bus_desktop_file_get_string):
256 * bus/desktop-file.h:
257 Some fixes, and new functions for getting a key value from a section.
259 2003-02-13 Havoc Pennington <hp@pobox.com>
261 * test/data/auth/fail-after-n-attempts.auth-script: new test
263 * dbus/dbus-auth.c (send_rejected): shutdown_mech() when we
266 2003-02-13 Havoc Pennington <hp@pobox.com>
268 * dbus/dbus-auth.c (handle_server_data_external_mech): args to
269 dbus_credentials_match were backward
271 * dbus/dbus-auth-script.c (_dbus_auth_script_run): support
272 NO_CREDENTIALS and ROOT_CREDENTIALS
274 * dbus/dbus-auth.c (_dbus_auth_do_work): move get_state() routine
275 into here. Never process more commands after we've reached an
276 end state; store further data as unused bytes.
278 * test/data/auth/*: add more auth tests
280 * dbus/dbus-auth-script.c (_dbus_auth_script_run): support EXPECT
281 command to match exact string and EXPECT_UNUSED to match unused
284 * test/Makefile.am (dist-hook): fix to dist all the test stuff
286 2003-02-12 Havoc Pennington <hp@pobox.com>
288 * dbus/dbus-string.c (_dbus_string_pop_line): fix to also strip
289 \r off of popped lines
291 * dbus/dbus-auth.c (_dbus_auth_test): write code to run auth
294 * dbus/dbus-auth-script.c (_dbus_auth_script_run): when doing a
297 2003-02-12 Havoc Pennington <hp@pobox.com>
299 * dbus/Makefile.am: remove break-loader from the build, since it
302 * configure.in: add --enable-gcov to turn on coverage profiling
303 flags and disable optimization
305 2003-02-10 Havoc Pennington <hp@pobox.com>
307 * dbus/dbus-auth-script.c, dbus/dbus-auth-script.h: sync
308 initial cut at test framework for DBusAuth from laptop.
309 Doesn't quite work yet but it compiles and I need to get
310 it off the 266mhz laptop. ;-)
312 * dbus/dbus-server-debug.c (_dbus_server_debug_accept_transport):
313 fix a memleak in error case
315 2003-02-12 Anders Carlsson <andersca@codefactory.se>
318 * bus/desktop-file.c:
319 * bus/desktop-file.h:
320 Add a desktop file parser.
322 2003-02-11 Zack Rusin <zack@kde.org>
324 * qt/message.[h|cpp]: sample implementation
325 of the KDE wrapper for DBusMessage
327 2003-02-09 Zack Rusin <zack@kde.org>
329 * test/bus-test.c: make_it_compile
330 * doc/dbus-specification.sgml: minimal semantic fix
332 2003-02-06 Anders Carlsson <andersca@codefactory.se>
338 2003-02-06 Anders Carlsson <andersca@codefactory.se>
341 * dbus/dbus-break-loader.c:
343 * test/break-loader.c:
344 Move dbus-break-loader to test/ and rename it to break-loader.
346 2003-02-02 Havoc Pennington <hp@pobox.com>
348 * dbus/dbus-keyring.c, dbus/dbus-keyring.h: template files
349 for code to manage cookies in your home directory
351 * dbus/dbus-sysdeps.c (_dbus_generate_random_bytes): new function
353 * dbus/dbus-auth.c (get_state): impose a maximum number of tries
354 to authenticate, then disconnect the client.
356 2003-02-03 Alexander Larsson <alexl@redhat.com>
358 * dbus/dbus-message.c (dbus_message_append_fields):
361 2003-02-02 Anders Carlsson <andersca@codefactory.se>
363 * doc/dbus-specification.sgml:
364 Update address format section.
366 2003-02-02 Anders Carlsson <andersca@codefactory.se>
369 * test/bus-test.c: (get_time), (add_timeout), (remove_timeout),
370 (message_handler), (new_connection_callback), (loop_quit),
374 2003-02-02 Anders Carlsson <andersca@codefactory.se>
376 * bus/driver.c: (bus_driver_handle_service_exists):
377 Simplify the code a bit.
379 * dbus/dbus-bus.c: (dbus_bus_service_exists):
382 2003-02-02 Anders Carlsson <andersca@codefactory.se>
385 Add libdbus-daemon.la and link to it.
387 2003-02-01 James Willcox <jwillcox@gnome.org>
389 * bus/driver.c: (bus_driver_handle_own_service):
390 Actually include the service reply code in the message.
392 2003-02-02 Anders Carlsson <andersca@codefactory.se>
394 * bus/driver.c: (bus_driver_handle_service_exists):
395 Don't unref the incoming message.
397 2003-02-02 Anders Carlsson <andersca@codefactory.se>
399 * dbus/dbus.h: Add dbus-address.h and dbus-bus.h
401 2003-02-02 Anders Carlsson <andersca@codefactory.se>
403 * dbus/dbus-server.c: (dbus_server_listen):
404 * dbus/dbus-transport.c: (_dbus_transport_open):
405 ifdef out the calls to the debug transport and server.
407 2003-02-02 Alexander Larsson <alexl@redhat.com>
409 * dbus/dbus-watch.c (dbus_watch_get_flags):
410 Add note in the docs that ERROR or HANGUP won't be returned
411 and are assumed always on.
413 * glib/dbus-gmain.c (add_watch):
414 Always add IO_ERR | IO_HUP
416 * dbus/dbus-message.h:
417 Add semicolon after dbus_message_iter_get_string_array().
418 Makes qt code build again
420 2003-02-01 Anders Carlsson <andersca@codefactory.se>
422 * bus/driver.c: (create_unique_client_name),
423 (bus_driver_handle_hello):
424 Don't take a name, just use a numeric id to identify
428 * dbus/dbus-bus.c: (dbus_bus_register_client),
429 (dbus_bus_acquire_service), (dbus_bus_service_exists):
431 Add new convenience functions for communicating with the bus.
433 * dbus/dbus-message.h:
435 * dbus/dbus-protocol.h:
438 2003-02-01 Alexander Larsson <alexl@redhat.com>
440 * dbus/dbus-message.c (dbus_message_append_fields):
441 Add some more doc comments.
443 2003-02-01 Havoc Pennington <hp@pobox.com>
445 * dbus/dbus-break-loader.c (randomly_modify_length): change
446 a 4-byte value in the message as if it were a length
448 * dbus/dbus-sysdeps.c (_dbus_string_save_to_file): don't set
449 execute bit on saved files
451 2003-02-01 Havoc Pennington <hp@pobox.com>
453 * dbus/dbus-break-loader.c (main): new program to find messages
454 that break the loader.
456 * dbus/dbus-sysdeps.c (_dbus_string_append_uint): new function
457 * dbus/dbus-sysdeps.c (_dbus_string_save_to_file): new function
459 * dbus/dbus-string.c (_dbus_string_set_byte): new
461 2003-01-31 Havoc Pennington <hp@pobox.com>
463 * dbus/dbus-message.c: refactor the test code to be more general,
464 in preparation for writing a "randomly permute test cases to
465 try to break the loader" program.
467 2003-01-31 Havoc Pennington <hp@pobox.com>
469 * doc/dbus-specification.sgml: work on the specification
471 * dbus/dbus-message.c (_dbus_message_loader_return_buffer): check
472 the protocol version of the message.
474 * dbus/dbus-protocol.h: drop special _REPLY names, the spec
475 no longer specifies that.
476 (DBUS_SERVICE_REPLY_SERVICE_EXISTS): fix flags (1/2/4/8 not
479 * dbus/dbus-marshal.c (_dbus_marshal_get_arg_end_pos): add missing
480 "break" for DBUS_TYPE_NIL, remove @todo
482 2003-01-31 Havoc Pennington <hp@pobox.com>
484 * dbus/dbus-message.c (dbus_message_set_is_error_reply): rename
485 just set_is_error/get_is_error as this is a commonly-used
486 function, and write docs.
488 2003-01-31 Anders Carlsson <andersca@codefactory.se>
490 * dbus/dbus-address.c: (dbus_address_entry_free):
491 Free key and value lists.
493 * dbus/dbus-internals.c: (_dbus_type_to_string):
494 Add the types we didn't have.
496 * dbus/dbus-marshal.c: (_dbus_marshal_get_arg_end_pos),
497 (_dbus_marshal_validate_arg):
500 * dbus/dbus-message.c: (dbus_message_set_sender):
501 Remove todo about being able to set sender to NULL.
503 (dbus_message_set_is_error_reply),
504 (dbus_message_get_is_error_reply):
505 * dbus/dbus-message.h:
508 * dbus/dbus-protocol.h:
509 Add error reply flag.
511 * test/data/valid-messages/opposite-endian.message:
512 Add NIL type to test.
514 2003-01-31 Havoc Pennington <hp@pobox.com>
516 * doc/dbus-specification.sgml: fully specify the header. Add
517 flags and major protocol version, and change header/body len to
520 * dbus/dbus-message-builder.c (append_saved_length): append length
523 * dbus/dbus-message.c (dbus_message_create_header): change header
524 length and body length to unsigned. Add the new fields from the
526 (_dbus_message_loader_return_buffer): unsigned header/body len
528 2003-01-30 Havoc Pennington <hp@pobox.com>
530 * dbus/dbus-auth.c: rework to use only REJECTED, no
533 * doc/dbus-sasl-profile.txt: drop MECHANISMS and just
534 use REJECTED, suggested by Mark McLoughlin
536 2003-01-30 Havoc Pennington <hp@pobox.com>
538 * dbus/dbus-server.c (dbus_server_listen): @todo about how we need
539 a better way to report errors here. e.g. "unix address lacks
540 path" or something. also "no such file" when the path doesn't
543 * dbus/dbus-address.c (dbus_address_entries_free): add @todo about
545 (dbus_parse_address): add @todo about documenting address format,
546 and allowing , and ; to be escaped
548 2003-01-30 Anders Carlsson <andersca@codefactory.se>
551 Add dbus-address.[ch]
553 * dbus/dbus-address.c: (dbus_address_entry_free),
554 (dbus_address_entries_free), (create_entry),
555 (dbus_address_entry_get_method), (dbus_address_entry_get_value),
556 (dbus_parse_address), (_dbus_address_test):
557 * dbus/dbus-address.h:
558 New files for dealing with address parsing.
560 * dbus/dbus-connection.c:
561 Document timeout functions.
563 * dbus/dbus-message.c:
564 Document dbus_message_new_from_message.
566 * dbus/dbus-server-debug.c:
569 * dbus/dbus-server.c: (dbus_server_listen):
570 Parse address and use correct server implementation.
572 * dbus/dbus-string.c: (_dbus_string_find_to), (_dbus_string_test):
573 * dbus/dbus-string.h:
574 New function with test.
576 * dbus/dbus-test.c: (dbus_internal_symbol_do_not_use_run_tests):
580 * dbus/dbus-transport-debug.c:
583 * dbus/dbus-transport.c: (_dbus_transport_open):
584 Parse address and use correct transport implementation.
586 2003-01-30 Havoc Pennington <hp@pobox.com>
588 * dbus/dbus-message.c: use message->byte_order instead of
589 DBUS_COMPILER_BYTE_ORDER throughout.
590 (dbus_message_create_header): pad header to align the
591 start of the body of the message to 8-byte boundary
593 * dbus/dbus-marshal.h: make all the demarshalers take const
594 DBusString arguments.
596 * dbus/dbus-message.c (_dbus_message_loader_return_buffer):
597 validate message args here, so we don't have to do slow validation
598 later, and so we catch bad messages as they are incoming. Also add
599 better checks on header_len and body_len. Also fill in
602 * dbus/dbus-string.c (_dbus_string_validate_utf8): new (not
603 implemented properly)
604 (_dbus_string_validate_nul): new function to check all-nul
606 * dbus/dbus-marshal.c (_dbus_marshal_get_field_end_pos): rename
607 get_arg_end_pos and remove all validation
608 (_dbus_marshal_validate_arg): actually do validation here.
610 2003-01-29 Havoc Pennington <hp@pobox.com>
612 * dbus/dbus-message.c (check_message_handling): fix assertion
613 failure on set_client_serial
615 2003-01-28 Havoc Pennington <hp@pobox.com>
617 * dbus/dbus-server-debug.c: Add doc section comments
619 * dbus/dbus-transport-debug.c: add doc section comments
621 2003-01-28 Havoc Pennington <hp@redhat.com>
623 * dbus/dbus-string.c (_dbus_string_base64_decode): append bytes in
624 the reverse order from how I had it
625 (_dbus_string_base64_encode): reverse encoding order. I was
626 basically byteswapping everything during encoding.
628 2003-01-28 Anders Carlsson <andersca@codefactory.se>
630 * dbus/dbus-connection-internal.h:
631 * dbus/dbus-connection.c: (_dbus_connection_add_timeout),
632 (_dbus_connection_remove_timeout):
633 Add functions for adding and removing timeouts.
635 * dbus/dbus-message.c: (dbus_message_new_from_message):
636 Add new function that takes a message and creates an exact
637 copy of it, but with the refcount set to 1.
638 (check_message_handling):
641 * dbus/dbus-server-protected.h:
642 * dbus/dbus-server.c: (_dbus_server_init_base),
643 (_dbus_server_finalize_base), (_dbus_server_add_timeout),
644 (dbus_server_set_timeout_functions):
645 (_dbus_server_remove_timeout):
646 New functions so that a server can add and remove timeouts.
648 (dbus_server_listen):
649 Add commented out call to dbus_server_debug_new.
651 * dbus/dbus-timeout.c: (_dbus_timeout_new):
652 Actually set the handler, doh.
654 * dbus/dbus-transport.c: (_dbus_transport_open):
655 Add commented out call to dbus_transport_debug_client_new.
658 Add dbus-transport-debug.[ch] and dbus-server-debug.[ch]
660 2003-01-28 Havoc Pennington <hp@pobox.com>
662 * dbus/dbus-message.c (check_message_handling): function to check
663 on the loaded message, iterates over it etc.
665 2003-01-28 Havoc Pennington <hp@pobox.com>
667 * test/Makefile.am (dist-hook): fix make distdir
669 * dbus/Makefile.am (TESTS_ENVIRONMENT): fix make check
671 2003-01-27 Havoc Pennington <hp@pobox.com>
673 * dbus/dbus-mempool.c (time_for_size): replace printf with
676 * dbus/dbus-message-builder.c (_dbus_message_data_load): allow
677 empty lines; fix the SAVE_LENGTH stuff to be
678 START_LENGTH/END_LENGTH so it actually works; couple other
681 * test/Makefile.am (dist-hook): add dist-hook for .message files
683 * dbus/dbus-string.c (DBUS_STRING_COPY_PREAMBLE): source of a copy
684 can be constant or locked.
685 (_dbus_string_free): allow freeing a const string as
688 * dbus/dbus-sysdeps.c (_dbus_concat_dir_and_file): utility
690 * dbus/dbus-test-main.c (main): take an argument which is the
691 directory containing test data
693 * dbus/dbus-message.c (_dbus_message_test): pass a test_data_dir
694 argument to this and load all the messages in test/data/
695 checking that they can be loaded or not loaded as appropriate.
697 2003-01-27 Anders Carlsson <andersca@codefactory.se>
699 * bus/dispatch.c: (bus_dispatch_message_handler):
700 Dispatch messages sent to services.
702 * bus/driver.c: (bus_driver_send_service_deleted),
703 (bus_driver_send_service_created), (bus_driver_send_service_lost),
704 (bus_driver_send_service_acquired):
705 Add helper functions for sending service related messages.
707 (bus_driver_send_welcome_message):
708 Send HELLO_REPLY instead of WELCOME.
710 (bus_driver_handle_list_services):
711 Send LIST_SERVICES_REPLY instead of SERVICES.
713 (bus_driver_handle_own_service),
714 (bus_driver_handle_service_exists):
715 New message handlers.
717 (bus_driver_handle_message):
718 Invoke new message handlers.
720 (bus_driver_remove_connection):
721 Don't remove any services here since that's done automatically
722 by bus_service_remove_owner now.
725 New function signatures.
727 * bus/services.c: (bus_service_add_owner):
728 Send ServiceAcquired message if we're the only primary owner.
730 (bus_service_remove_owner):
731 Send ServiceAcquired/ServiceLost messages.
733 (bus_service_set_prohibit_replacement),
734 (bus_service_get_prohibit_replacement):
735 Functions for setting prohibit replacement.
737 (bus_service_has_owner):
738 New function that checks if a connection is in the owner queue of
742 Add new function signatures.
744 * dbus/dbus-list.c: (_dbus_list_test):
745 Add tests for _dbus_list_remove_last and traversing the list backwards.
748 Fix a typo in _dbus_list_get_prev_link, if we're at the first element we can't
749 go any further, so return NULL then.
751 * dbus/dbus-protocol.h:
752 Add new messages, service flags and service replies.
754 2003-01-26 Havoc Pennington <hp@pobox.com>
756 * dbus/dbus-message-builder.c: implement, completely untested.
758 * test/data/*: add data to be used in testing.
759 ".message" files are our simple loadable text format.
760 ".message-raw" will be binary dumps of messages.
762 * dbus/dbus-string.c (_dbus_string_starts_with_c_str): new
764 2003-01-26 Havoc Pennington <hp@pobox.com>
766 * dbus/dbus-sysdeps.c (_dbus_file_get_contents): new function
768 * dbus/dbus-errors.c (dbus_result_to_string): add
771 * dbus/dbus-message-builder.c: new file, will contain code to load
772 up messages from files. Not implemented yet.
774 2003-01-26 Havoc Pennington <hp@pobox.com>
776 * dbus/dbus-message.c (dbus_message_set_sender): support deleting
777 the sender by setting to NULL
779 2003-01-26 Havoc Pennington <hp@pobox.com>
781 The unit tests pass, but otherwise untested. If it breaks, the
782 tests should have been better. ;-)
784 * bus/driver.c (bus_driver_handle_hello): return if we disconnect
787 * dbus/dbus-message.c: redo everything so we maintain
788 message->header as the only copy of the various fields.
789 This avoids the possibility of out-of-memory in some cases,
790 for example dbus_message_lock() can't run out of memory anymore,
791 and avoids extra copying. Figured I may as well go ahead and do
792 this since it was busted for dbus_message_lock to not return
793 failure on OOM, and dbus_message_write_header was totally
794 unchecked for OOM. Also fixed some random other bugs.
796 * dbus/dbus-marshal.c (_dbus_marshal_get_field_end_pos): verify
797 that strings are nul-terminated. Also, end_pos can be equal
798 to string length just not greater than, I think.
799 (_dbus_marshal_set_int32): new function
800 (_dbus_marshal_set_uint32): new function
801 (_dbus_marshal_set_string): new function
803 * dbus/dbus-connection.c (_dbus_connection_new_for_transport): fix
804 a warning, init timeout_list to NULL
805 (dbus_connection_send_message): don't use uninitialized variable
808 * dbus/dbus-string.c (_dbus_string_replace_len): new function
810 2003-01-26 Anders Carlsson <andersca@codefactory.se>
812 * bus/driver.c: (bus_driver_handle_hello),
813 (bus_driver_send_welcome_message):
816 2003-01-26 Anders Carlsson <andersca@codefactory.se>
818 * dbus/dbus-auth.c: (process_auth), (_dbus_auth_unref):
819 * dbus/dbus-connection.c: (_dbus_connection_new_for_transport),
820 (dbus_connection_unref):
821 * dbus/dbus-marshal.c: (_dbus_marshal_test):
822 * dbus/dbus-message.c: (dbus_message_unref),
825 (dbus_message_get_fields):
826 Remove debugging printout.
828 (_dbus_message_loader_return_buffer):
829 Don't store the header string.
831 (_dbus_message_test):
834 2003-01-26 Richard Hult <rhult@codefactory.se>
836 * glib/dbus-gmain.c (dbus_connection_dispatch): Traverse a copy of
837 the file descriptor list, since it can change under us.
839 2003-01-25 Anders Carlsson <andersca@codefactory.se>
841 * glib/dbus-gmain.c: (dbus_connection_prepare),
842 (dbus_connection_check), (dbus_connection_dispatch), (add_watch),
843 (remove_watch), (dbus_connection_hookup_with_g_main):
844 Rewrite the glib handling to use its own GSource instead of a
845 GIOChannel so we can catch messages put in the queue while waiting
848 2003-01-25 Anders Carlsson <andersca@codefactory.se>
851 * bus/connection.c: (connection_disconnect_handler),
852 (connection_watch_callback), (bus_connection_setup):
853 * bus/dispatch.c: (send_one_message),
854 (bus_dispatch_broadcast_message), (bus_dispatch_message_handler),
855 (bus_dispatch_add_connection), (bus_dispatch_remove_connection):
857 * bus/driver.c: (bus_driver_send_service_deleted),
858 (bus_driver_send_service_created), (bus_driver_handle_hello),
859 (bus_driver_send_welcome_message),
860 (bus_driver_handle_list_services), (bus_driver_remove_connection),
861 (bus_driver_handle_message):
863 Refactor code, put the message dispatching in its own file. Use
864 _DBUS_HANDLE_OOM. Also send ServiceDeleted messages when a client
867 2003-01-25 Anders Carlsson <andersca@codefactory.se>
869 * dbus/dbus-internals.h:
870 Add _DBUS_HANDLE_OOM macro, it doesn't do anything currently.
872 * dbus/dbus-message.c: (dbus_message_get_sender):
873 * dbus/dbus-message.h:
874 Implement dbus_message_get_sender.
876 * dbus/dbus-protocol.h:
877 Add message and service defines.
879 2003-01-25 Anders Carlsson <andersca@codefactory.se>
881 * dbus/dbus-connection.c: (dbus_connection_send_message):
882 * dbus/dbus-message-internal.h:
883 * dbus/dbus-message.c: (_dbus_message_get_client_serial),
884 (dbus_message_write_header):
885 Remove _dbus_messag_unlock and don't set the client serial on a
886 message if one already exists.
888 2003-01-24 Havoc Pennington <hp@pobox.com>
890 * dbus/dbus-list.c (alloc_link): put a thread lock on the global
893 * bus/driver.c (bus_driver_handle_list_services): fix a leak
896 2003-01-25 Anders Carlsson <andersca@codefactory.se>
898 * dbus/dbus-list.c: (alloc_link), (free_link):
899 Use a memory pool for the links.
901 2003-01-25 Anders Carlsson <andersca@codefactory.se>
903 * bus/connection.c: (bus_connection_foreach):
905 Add new bus_connection_foreach function.
907 * bus/driver.c: (send_one_message), (bus_driver_broadcast_message):
908 Add function that broadcasts a message to all clients.
910 (bus_driver_send_service_created), (bus_driver_handle_hello),
911 (bus_driver_send_welcome_message),
912 (bus_driver_handle_list_services), (bus_driver_message_handler):
913 Implement functions that take care of listing services, and notifying
914 clients when new services are created.
916 * bus/services.c: (bus_services_list):
918 Add new function that returns an array of strings with the currently
923 Update copyright year.
925 2003-01-25 Anders Carlsson <andersca@codefactory.se>
927 * dbus/dbus-connection.c: (dbus_connection_send_message):
928 Unlock the message in case it was sent earlier.
930 (dbus_connection_send_message_with_reply_and_block):
931 Remove the reply message from the list.
933 * dbus/dbus-marshal.c: (_dbus_demarshal_string_array):
934 Set array_len and new_pos correctly.
936 (_dbus_marshal_test):
939 * dbus/dbus-message-internal.h:
940 * dbus/dbus-message.c: (_dbus_message_get_reply_serial):
941 New function that returns the reply serial.
943 (_dbus_message_unlock):
944 New function that unlocks a message and resets its header.
946 (dbus_message_append_string_array),
947 (dbus_message_get_fields_valist),
948 (dbus_message_iter_get_field_type),
949 (dbus_message_iter_get_string_array),
950 (dbus_message_get_fields),
951 (dbus_message_append_fields_valist):
952 Handle string arrays.
954 (dbus_message_set_sender):
955 Make this function public since the bus daemon needs it.
957 (decode_header_data):
958 Set the reply serial to -1 initially.
960 * dbus/dbus-message.h:
961 Add dbus_message_set_sender.
963 2003-01-24 Havoc Pennington <hp@pobox.com>
965 * doc/dbus-specification.sgml: add some stuff
967 2003-01-22 Havoc Pennington <hp@pobox.com>
969 * doc/dbus-specification.sgml: Start to document the protocol.
971 2003-01-22 Havoc Pennington <hp@pobox.com>
973 * dbus/dbus-connection.c
974 (dbus_connection_send_message_with_reply_and_block): add some @todo
976 * bus/driver.c (bus_driver_add_connection): add a FIXME about memleak
978 2003-01-21 Havoc Pennington <hp@pobox.com>
980 (patch untested because can't compile)
982 * bus/driver.c (create_unique_client_name): make this function
983 never recycle client names. Also, caller should initialize
986 * dbus/dbus-sysdeps.c (_dbus_get_current_time): new function
988 2003-01-21 Anders Carlsson <andersca@codefactory.se>
990 * dbus/dbus-marshal.c: (_dbus_marshal_double),
991 (_dbus_marshal_int32), (_dbus_marshal_uint32),
992 (_dbus_marshal_int32_array), (_dbus_marshal_uint32_array),
993 (_dbus_marshal_double_array), (_dbus_marshal_string_array),
994 (_dbus_demarshal_int32_array), (_dbus_demarshal_uint32_array),
995 (_dbus_demarshal_double_array), (_dbus_demarshal_string_array),
996 (_dbus_marshal_get_field_end_pos), (_dbus_marshal_test):
997 * dbus/dbus-marshal.h:
998 * dbus/dbus-protocol.h:
999 Add support for marshalling and demarshalling integer, double
1002 2003-01-21 Anders Carlsson <andersca@codefactory.se>
1007 * bus/connection.c: (connection_disconnect_handler):
1008 Remove the connection from the bus driver's list.
1010 (connection_watch_callback): Dispatch messages.
1012 (free_connection_data): Free connection name.
1014 (bus_connection_setup): Add connection to the bus driver's list.
1015 (bus_connection_remove_owned_service):
1016 (bus_connection_set_name), (bus_connection_get_name):
1017 Add functions for setting and getting the connection's name.
1020 Add function headers.
1022 * bus/driver.c: (create_unique_client_name),
1023 (bus_driver_handle_hello_message),
1024 (bus_driver_send_welcome_message), (bus_driver_message_handler),
1025 (bus_driver_add_connection), (bus_driver_remove_connection):
1028 * bus/services.c: (bus_service_free):
1030 New file that handles communication and registreation with the bus
1033 2003-01-21 Anders Carlsson <andersca@codefactory.se>
1035 * dbus/dbus-connection.c: (dbus_connection_send_message):
1036 Add a new client_serial parameter.
1038 (dbus_connection_send_message_with_reply):
1039 Remove a @todo since we've implemented the blocking function.
1041 (dbus_connection_send_message_with_reply_and_block):
1042 New function that sends a message and waits for a reply and
1043 then returns the reply.
1045 * dbus/dbus-connection.h:
1048 * dbus/dbus-errors.c: (dbus_result_to_string):
1049 * dbus/dbus-errors.h:
1050 Add new DBUS_RESULT.
1052 * dbus/dbus-message-internal.h:
1053 * dbus/dbus-message.c: (_dbus_message_get_reply_serial),
1054 (_dbus_message_set_sender), (dbus_message_write_header),
1055 (dbus_message_new_reply), (decode_header_data),
1056 (_dbus_message_loader_return_buffer), (_dbus_message_test):
1057 * dbus/dbus-message.h:
1058 Add new functions that set the reply serial and sender.
1059 Also marshal and demarshal them correctly and add test.
1061 * dbus/dbus-protocol.h:
1062 Add new DBUS_MESSAGE_TYPE_SENDER.
1065 * glib/dbus-gmain.c: (watch_callback), (free_callback_data),
1066 (add_watch), (remove_watch), (add_timeout), (remove_timeout),
1067 (dbus_connection_hookup_with_g_main):
1068 * glib/test-dbus-glib.c: (main):
1069 Rewrite to use GIOChannel and remove the GSource crack.
1071 * test/echo-client.c: (main):
1072 * test/watch.c: (check_messages):
1073 Update for changed APIs
1075 2003-01-19 Anders Carlsson <andersca@codefactory.se>
1077 * dbus/Makefile.am: Add dbus-timeout.[cħ]
1079 * dbus/dbus-connection.c: (_dbus_connection_new_for_transport):
1080 Create a DBusTimeoutList.
1081 (dbus_connection_set_timeout_functions): Add new function to
1082 set timeout callbacks
1084 * dbus/dbus-connection.h: Add public DBusTimeout API.
1086 * dbus/dbus-message.c: (dbus_message_get_service):
1087 * dbus/dbus-message.h: New function.
1089 * dbus/dbus-server.c: Fix small doc typo.
1091 * dbus/dbus-timeout.[ch]: New files for mainloop timeouts.
1093 2003-01-19 Anders Carlsson <andersca@codefactory.se>
1095 * dbus/dbus-string.c (_dbus_string_move_len): Don't delete all
1096 of the string, just as long as specified.
1098 2003-01-19 Havoc Pennington <hp@pobox.com>
1100 * dbus/dbus-connection.c (dbus_connection_get_is_authenticated):
1103 * dbus/dbus-server.c (dbus_server_set_max_connections)
1104 (dbus_server_get_max_connections, dbus_server_get_n_connections):
1105 keep track of current number of connections, and add API for
1106 setting a max (but haven't implemented enforcing the max yet)
1108 2003-01-18 Havoc Pennington <hp@pobox.com>
1110 * dbus/dbus-transport-unix.c (unix_do_iteration): only do the
1111 reading/writing if read_watch != NULL or write_watch != NULL.
1113 * dbus/dbus-message.c (_dbus_message_loader_return_buffer): fix
1114 the message loader code to actually load message->header and
1115 message->body into the newly-created message.
1117 * dbus/dbus-transport-unix.c (check_write_watch): fix a mem leak
1120 * dbus/dbus-connection.c (dbus_connection_set_max_message_size)
1121 (dbus_connection_get_max_message_size)
1122 (dbus_connection_set_max_live_messages_size)
1123 (dbus_connection_get_max_live_messages_size): implement some
1124 resource limitation functions
1126 * dbus/dbus-resources.c: new file implementing some of the
1127 resource limits stuff
1129 * dbus/dbus-message.c (dbus_message_iter_get_byte_array): add
1130 missing docs, add @todo to handle OOM etc.
1132 * dbus/dbus-marshal.c (_dbus_demarshal_byte_array): add missing
1135 2003-01-18 Havoc Pennington <hp@pobox.com>
1137 * dbus/dbus-connection.c (dbus_connection_unref): disconnect the
1138 connection if it hasn't been already.
1140 * dbus/dbus-connection.h: kill off the idea of an ErrorFunction,
1141 replace with DisconnectFunction.
1143 2003-01-18 Havoc Pennington <hp@pobox.com>
1145 Building --disable-verbose-mode --disable-asserts --disable-tests
1146 cuts the library from 112K to 45K or so
1148 * configure.in: check for varargs macro support,
1149 add --enable-verbose-mode, --enable-asserts.
1151 * dbus/dbus-internals.h (_dbus_assert): support
1153 (_dbus_verbose): support DBUS_ENABLE_VERBOSE_MODE
1155 2003-01-18 Havoc Pennington <hp@pobox.com>
1157 * dbus/dbus-test.c: include config.h so that tests actually run
1159 * dbus/dbus-string.c: add assertions that stuff is 8-byte aligned,
1160 so the failure mode when that assumption fails will be plenty
1163 2003-01-18 Havoc Pennington <hp@pobox.com>
1165 * configure.in: default --enable-tests to $USE_MAINTAINER_MODE
1167 * dbus/Makefile.am: fix it up so dubs-test-main.c is included in
1170 * test/Makefile.am: don't use special variable "TESTS" for echo-*
1171 since we don't want to use those in make check
1173 2003-01-15 Havoc Pennington <hp@redhat.com>
1179 2003-01-15 Havoc Pennington <hp@redhat.com>
1181 * test/Makefile.am: fix so that test source code ends up in the
1182 distribution on make distcheck
1184 2003-01-15 Havoc Pennington <hp@redhat.com>
1190 2003-01-15 Havoc Pennington <hp@redhat.com>
1192 * dbus/dbus-test.c (dbus_internal_symbol_do_not_use_run_tests):
1193 fix build when --disable-tests
1195 * Makefile.am (EXTRA_DIST): put HACKING in here
1197 * HACKING: document procedure for making a tarball release.
1199 2003-01-14 Anders Carlsson <andersca@codefactory.se>
1201 * bus/connection.c: (connection_error_handler),
1202 (bus_connection_setup):
1203 * bus/main.c: (main):
1204 Make sure that the DBusConnectionData struct is NULLed
1205 out to prevent a segfault.
1207 * dbus/dbus-errors.c: (dbus_result_to_string):
1208 * dbus/dbus-errors.h:
1209 * dbus/dbus-message.c: (dbus_message_get_fields),
1210 (dbus_message_get_fields_valist), (_dbus_message_test):
1211 * dbus/dbus-message.h:
1212 Make dbus_message_get_fields return a result code so we can
1213 track invalid fields as well as oom.
1215 2003-01-11 Havoc Pennington <hp@pobox.com>
1217 * configure.in: change --enable-test/--enable-ansi action-if-given
1218 to enable_foo=$enableval instead of enable_foo=yes
1220 2003-01-08 Havoc Pennington <hp@pobox.com>
1222 * dbus/dbus-string.c (_dbus_string_align_length): new function
1224 * dbus/dbus-test-main.c: move main() for test app here
1226 (dbus_internal_symbol_do_not_use_run_tests): we have to export a
1227 symbol to run tests, because dbus-test isn't in the main
1230 Code review nitpicks.
1232 * dbus/dbus-message.c (dbus_message_write_header): add newlines
1233 for people with narrow emacs ;-). Assert client_serial was filled
1234 in. Assert message->name != NULL.
1235 (dbus_message_append_fields): have "first_field_type" arg separate
1236 from va list, needed for C++ binding that also uses varargs IIRC
1237 and helps with type safety
1238 (dbus_message_new): add @todo about using DBusString to store
1239 service/name internally
1240 (dbus_message_new): don't leak ->service and ->name on OOM later
1242 (dbus_message_unref): free the service name
1243 (dbus_message_get_fields): same change to varargs
1244 i.e. first_field_type
1245 (_dbus_message_loader_return_buffer): assert that the message data
1246 is aligned (if not it's a bug in our code). Put in verbose griping
1247 about why we set corrupted = TRUE.
1248 (decode_header_data): add FIXME that char* is evil. Was going to
1249 add FIXME about evil locale-specific string.h strncmp, but just
1250 switched to wacky string-as-uint32 optimization. Move check for
1251 "no room for field name" above get_const_data_len() to avoid
1252 assertion failure in get_const_data_len if we have trailing 2
1253 bytes or the like. Check for service and name fields being
1254 provided twice. Don't leak service/name on error. Require field
1255 names to be aligned to 4 bytes.
1257 * dbus/dbus-marshal.c: move byte swap stuff to header
1258 (_dbus_pack_int32): uscore-prefix
1259 (_dbus_unpack_int32): uscore-prefix
1260 (_dbus_unpack_uint32): export
1261 (_dbus_demarshal_string): add @todo complaining about use of
1263 (_dbus_marshal_get_field_end_pos): add @todo about bad error
1264 handling allowing corrupt data to go unchecked
1266 2003-01-08 Havoc Pennington <hp@redhat.com>
1268 * dbus/dbus-transport-unix.c (unix_do_iteration): add read/write
1269 to the select() as needed for authentication. (should be using
1270 _dbus_poll() not select, but for another day)
1272 * dbus/dbus.h: include dbus/dbus-protocol.h
1274 2003-01-08 Anders Carlsson <andersca@codefactory.se>
1276 * dbus/Makefile.am (dbusinclude_HEADERS): Install
1279 2003-01-08 Anders Carlsson <andersca@codefactory.se>
1281 * dbus/dbus-internals.c: (_dbus_type_to_string):
1282 New function that returns a string describing a type.
1284 * dbus/dbus-marshal.c: (_dbus_demarshal_byte_array):
1285 * dbus/dbus-marshal.h:
1286 * dbus/dbus-message.c: (dbus_message_get_fields_valist),
1287 (dbus_message_iter_get_field_type), (dbus_message_iter_get_double),
1288 (dbus_message_iter_get_byte_array):
1289 * dbus/dbus-message.h:
1290 Add new convenience functions for appending and getting message fields.
1291 Also add demarshalling routines for byte arrays.
1293 2003-01-07 Anders Carlsson <andersca@codefactory.se>
1295 * dbus/dbus-connection-internal.h:
1296 * dbus/dbus-connection.c: (_dbus_connection_new_for_transport),
1297 (_dbus_connection_get_next_client_serial),
1298 (dbus_connection_send_message):
1299 * dbus/dbus-internals.h:
1300 * dbus/dbus-marshal.c: (unpack_uint32), (dbus_unpack_int32),
1301 (dbus_pack_int32), (_dbus_marshal_double), (_dbus_marshal_int32),
1302 (_dbus_marshal_uint32), (_dbus_demarshal_double),
1303 (_dbus_demarshal_int32), (_dbus_demarshal_uint32),
1304 (_dbus_demarshal_string), (_dbus_marshal_get_field_end_pos),
1305 (_dbus_verbose_bytes), (_dbus_marshal_test):
1306 * dbus/dbus-marshal.h:
1307 * dbus/dbus-message-internal.h:
1308 * dbus/dbus-message.c: (_dbus_message_set_client_serial),
1309 (dbus_message_write_header), (_dbus_message_lock),
1310 (dbus_message_new), (dbus_message_ref), (dbus_message_unref),
1311 (dbus_message_get_name), (dbus_message_append_int32),
1312 (dbus_message_append_uint32), (dbus_message_append_double),
1313 (dbus_message_append_string), (dbus_message_append_byte_array),
1314 (dbus_message_get_fields_iter), (dbus_message_iter_ref),
1315 (dbus_message_iter_unref), (dbus_message_iter_has_next),
1316 (dbus_message_iter_next), (dbus_message_iter_get_field_type),
1317 (dbus_message_iter_get_string), (dbus_message_iter_get_int32),
1318 (dbus_message_iter_get_uint32), (dbus_message_iter_get_double),
1319 (decode_header_data), (_dbus_message_loader_return_buffer),
1320 (message_iter_test), (_dbus_message_test):
1321 * dbus/dbus-message.h:
1322 * dbus/dbus-protocol.h:
1323 * dbus/dbus-test.c: (main):
1325 * glib/test-dbus-glib.c: (message_handler), (main):
1326 * test/echo-client.c: (main):
1327 * test/watch.c: (check_messages):
1328 Make messages sendable and receivable for real.
1330 2003-01-07 Anders Carlsson <andersca@codefactory.se>
1332 * dbus/dbus-marshal.c: (_dbus_marshal_double),
1333 (_dbus_marshal_string), (_dbus_marshal_byte_array):
1334 * dbus/dbus-message.c: (dbus_message_append_int32),
1335 (dbus_message_append_uint32), (dbus_message_append_double),
1336 (dbus_message_append_string), (dbus_message_append_byte_array):
1337 Handle OOM restoration.
1339 2003-01-07 Anders Carlsson <andersca@codefactory.se>
1341 * dbus/dbus-marshal.c: (_dbus_marshal_string),
1342 (_dbus_demarshal_string), (_dbus_marshal_test):
1343 * dbus/dbus-marshal.h:
1344 * dbus/dbus-message.c: (dbus_message_get_name),
1345 Document these functions.
1347 (dbus_message_append_int32), (dbus_message_append_uint32),
1348 (dbus_message_append_double), (dbus_message_append_string),
1349 (dbus_message_append_byte_array):
1350 * dbus/dbus-message.h:
1351 Add functions for adding message fields of different types.
1353 * dbus/dbus-protocol.h:
1354 Add the different types.
1356 2003-01-05 Havoc Pennington <hp@pobox.com>
1358 * bus/connection.c: implement routines for handling connections,
1359 first thing is keeping a list of owned services on each connection
1360 and setting up watches etc.
1362 * bus/services.c: implement a mapping from service names to lists
1365 * dbus/dbus-hash.c: add DBUS_HASH_POINTER
1367 * dbus/dbus-threads.c (dbus_static_mutex_lock): add functions
1368 to use static mutexes for global data
1370 * dbus/dbus-connection.c (dbus_connection_set_data): add new
1371 collection of functions to set/get application-specific data
1372 on the DBusConnection.
1374 2003-01-04 Havoc Pennington <hp@pobox.com>
1376 * dbus/dbus-sysdeps.c (_dbus_sleep_milliseconds): new function
1377 (_dbus_poll): new function
1379 * dbus/dbus-internals.h (_DBUS_STRUCT_OFFSET): new macro
1382 * bus/loop.c: initial code for the daemon main loop
1384 2003-01-04 Havoc Pennington <hp@pobox.com>
1386 * test/watch.c (error_handler): make it safe if the error handler
1387 is called multiple times (if we s/error handler/disconnect
1388 handler/ we should just guarantee it's called only once)
1390 * dbus/dbus-transport.c (_dbus_transport_disconnect): call the
1391 error handler on disconnect (it's quite possible we should
1392 just change the error handler to a "disconnect handler," I'm
1393 not sure we have any other meaningful errors)
1395 * configure.in: check for getpwnam_r
1397 * dbus/dbus-transport.c, dbus/dbus-transport-unix.c,
1398 dbus/dbus-auth.c: add credentials support, add EXTERNAL auth
1399 mechanism as in SASL spec, using socket credentials
1401 * dbus/dbus-sysdeps.c (_dbus_read_credentials_unix_socket): new function
1402 (_dbus_send_credentials_unix_socket): new function
1404 * dbus/dbus-sysdeps.c (_dbus_accept_unix_socket): rename just
1406 (_dbus_write): only check errno if <0 returned
1407 (_dbus_write_two): ditto
1409 2003-01-02 Anders Carlsson <andersca@codefactory.se>
1411 * dbus/dbus-marshal.c: (_dbus_marshal_utf8_string),
1412 (_dbus_marshal_byte_array), (_dbus_demarshal_utf8_string),
1413 (_dbus_marshal_test):
1414 * dbus/dbus-marshal.h:
1415 Add _dbus_marshal_byte_array and rename _dbus_marshal_string
1416 to _dbus_marshal_utf8_string. Also fix some tests.
1418 2002-12-28 Harri Porten <porten@kde.org>
1420 * configure.in: added check for C++ compiler and a very cheesy
1421 check for the Qt integration
1423 * Makefile.am (SUBDIRS): compile qt subdir if support is enabled
1425 * qt/Makefile.am: added
1427 * qt/.cvsignore: added
1429 * qt/dbus-qthread.cc, qt/dbus-qthread.cpp: renamed former to
1430 latter, added #ifdef QT_THREAD_SUPPORT guard.
1432 * dbus/Makefile.am: added missing headers for make dist
1434 2002-12-28 Kristian Rietveld <kris@gtk.org>
1436 * dbus/Makefile.am: fixup export-symbols-regex.
1438 2002-12-27 Anders Carlsson <andersca@codefactory.se>
1440 * acinclude.m4: Add this file and put the
1441 PKG_CHECK_MODULE macro in it.
1443 2002-12-27 Anders Carlsson <andersca@codefactory.se>
1445 * dbus/dbus-marshal.c: (_dbus_marshal_string),
1446 (_dbus_demarshal_double), (_dbus_demarshal_int32),
1447 (_dbus_demarshal_uint32), (_dbus_demarshal_string),
1448 (_dbus_marshal_test):
1449 Make the demarshalling routines align the pos argument.
1450 Add string marshalling tests and fix the obvious bugs
1453 2002-12-26 Havoc Pennington <hp@pobox.com>
1455 * dbus/dbus-auth.c: fixes fixes fixes
1457 * dbus/dbus-transport-unix.c: wire up support for
1458 encoding/decoding data on the wire
1460 * dbus/dbus-auth.c (_dbus_auth_encode_data)
1461 (_dbus_auth_decode_data): append to target string
1462 instead of nuking it.
1464 2002-12-26 Havoc Pennington <hp@pobox.com>
1466 * dbus/dbus-marshal.h (DBUS_COMPILER_BYTE_ORDER): #ifdef
1467 WORDS_BIGENDIAN then compiler byte order is DBUS_BIG_ENDIAN,
1470 * dbus/dbus-marshal.c: Add macros to do int swapping in-place and
1471 avoid swap_bytes() overhead (ignoring possible assembly stuff for
1472 now). Main point is because I wanted unpack_uint32 to implement
1474 (_dbus_verbose_bytes): new function
1476 * dbus/dbus-string.c (_dbus_string_validate_ascii): new function
1478 * dbus/dbus-message.c (_dbus_message_loader_get_is_corrupted): add
1479 mechanism to handle a corrupt message stream
1480 (_dbus_message_loader_new): fix preallocation to only prealloc,
1483 * dbus/dbus-string.c (_dbus_string_skip_blank): fix this function
1484 (_dbus_string_test): enhance tests for copy/move and fix the
1487 * dbus/dbus-transport-unix.c: Hold references in more places to
1488 avoid reentrancy problems
1490 * dbus/dbus-transport.c: ditto
1492 * dbus/dbus-connection.c (dbus_connection_dispatch_message): don't
1493 leak reference count in no-message case
1495 * test/watch.c (do_mainloop): handle adding/removing watches
1496 during iteration over the watches. Also, ref the connection/server
1497 stored on a watch, so we don't try to mangle a destroyed one.
1499 * dbus/dbus-transport-unix.c (do_authentication): perform
1502 * dbus/dbus-auth.c (get_state): add a state
1503 AUTHENTICATED_WITH_UNUSED_BYTES and return it if required
1504 (_dbus_auth_get_unused_bytes): append the unused bytes
1505 to the passed in string, rather than prepend
1507 * dbus/dbus-transport.c (_dbus_transport_init_base): create
1508 the auth conversation DBusAuth
1510 * dbus/dbus-transport-unix.c (_dbus_transport_new_for_fd)
1511 (_dbus_transport_new_for_domain_socket): when creating a
1512 transport, pass in whether it's a client-side or server-side
1513 transport so we know which DBusAuth to create
1515 2002-12-03 Havoc Pennington <hp@pobox.com>
1517 * dbus/dbus-transport-unix.c (unix_finalize): finalize base
1518 _after_ finalizing the derived members
1519 (unix_connection_set): unref watch if we fail to add it
1521 * dbus/dbus-connection.c (dbus_connection_unref): delete the
1522 transport first, so that the connection owned by the
1523 transport will be valid as the transport finalizes.
1525 * dbus/dbus-transport-unix.c (unix_finalize): free the write_watch
1526 if necessary, and remove watches from the connection.
1528 * dbus/dbus-watch.c (_dbus_watch_list_free): improve a comment
1530 2002-12-26 Anders Carlsson <andersca@codefactory.se>
1532 * dbus/dbus-marshal.c: (_dbus_marshal_string),
1533 (_dbus_demarshal_double), (_dbus_demarshal_int32),
1534 (_dbus_demarshal_uint32), (_dbus_demarshal_string),
1535 (_dbus_marshal_test):
1536 * dbus/dbus-marshal.h:
1537 Add string marshal functions and have the demarshal functions
1538 return the new position.
1540 2002-12-25 Havoc Pennington <hp@pobox.com>
1542 * doc/dbus-sasl-profile.txt: docs on the authentication protocol,
1543 it is a simple protocol that just maps directly to SASL.
1545 * dbus/dbus-auth.h, dbus/dbus-auth.c: authentication protocol
1546 initial implementation, not actually used yet.
1548 * dbus/dbus-string.c (_dbus_string_find): new function
1549 (_dbus_string_equal): new function
1550 (_dbus_string_base64_encode): new function
1551 (_dbus_string_base64_decode): new function
1553 2002-12-25 Anders Carlsson <andersca@codefactory.se>
1556 * dbus/dbus-marshal.c: (swap_bytes), (_dbus_marshal_double),
1557 (_dbus_marshal_int32), (_dbus_marshal_uint32),
1558 (_dbus_demarshal_double), (_dbus_demarshal_int32),
1559 (_dbus_demarshal_uint32), (_dbus_marshal_test):
1560 * dbus/dbus-marshal.h:
1561 * dbus/dbus-protocol.h:
1562 * dbus/dbus-test.c: (main):
1564 Add un-optimized marshalling/demarshalling routines.
1566 2002-12-25 Harri Porten <porten@kde.org>
1568 * qt/dbus-qt.h: adjusted ctor and getter to KDE/Qt conventions
1570 2002-12-24 Zack Rusin <zack@kde.org>
1572 * qt/dbus-qthread.cc: adding - integrates QMutex into Dbus
1573 * qt/dbus-qt.h: skeleton with two sample implemenatation of the
1576 2002-12-24 Havoc Pennington <hp@pobox.com>
1578 * glib/dbus-gthread.c: fix include
1580 * glib/dbus-glib.h: rename DBusMessageHandler for now.
1581 I think glib API needs to change, though, as you don't
1582 want to use DBusMessageFunction, you want to use the
1583 DBusMessageHandler object. Probably
1584 dbus_connection_open_with_g_main_loop()
1585 and dbus_connection_setup_g_main_loop() or something like that
1586 (but think of better names...) that just create a connection
1587 that has watch/timeout functions etc. already set up.
1589 * dbus/dbus-connection.c
1590 (dbus_connection_send_message_with_reply): new function just to
1591 show how the message handler helps us deal with replies.
1593 * dbus/dbus-list.c (_dbus_list_remove_last): new function
1595 * dbus/dbus-string.c (_dbus_string_test): free a string that
1598 * dbus/dbus-hash.c: use memory pools for the hash entries
1599 (rebuild_table): be more paranoid about overflow, and
1600 shrink table when we can
1601 (_dbus_hash_test): reduce number of sprintfs and write
1602 valid C89. Add tests for case where we grow and then
1603 shrink the hash table.
1605 * dbus/dbus-mempool.h, dbus/dbus-mempool.c: memory pools
1607 * dbus/dbus-connection.c (dbus_connection_register_handler)
1608 (dbus_connection_unregister_handler): new functions
1610 * dbus/dbus-message.c (dbus_message_get_name): new
1612 * dbus/dbus-list.c: fix docs typo
1614 * dbus/dbus-message-handler.h, dbus/dbus-message-handler.c:
1615 an object representing a handler for messages.
1617 2002-12-16 Anders Carlsson <andersca@codefactory.se>
1620 * glib/dbus-gthread.c: (dbus_gthread_init):
1621 Don't use the gdbus prefix for public functions.
1623 2002-12-16 Anders Carlsson <andersca@codefactory.se>
1627 Add GLib checks and fixup .pc files
1631 * glib/dbus-gmain.c: (gdbus_connection_prepare),
1632 (gdbus_connection_check), (gdbus_connection_dispatch),
1633 (gdbus_add_connection_watch), (gdbus_remove_connection_watch),
1634 (dbus_connection_gsource_new):
1635 * glib/dbus-gthread.c: (dbus_gmutex_new), (dbus_gmutex_free),
1636 (dbus_gmutex_lock), (dbus_gmutex_unlock), (dbus_gthread_init):
1637 * glib/test-dbus-glib.c: (message_handler), (main):
1640 2002-12-15 Harri Porten <porten@kde.org>
1642 * autogen.sh: check for libtoolize before attempting to use it
1644 * dbus/dbus-transport-unix.c: include <sys/time.h> for timeval
1647 * .cvsignore: ignore more stamp files
1649 * dbus/dbus-watch.c (_dbus_watch_list_new): fixed doc error
1651 * test/Makefile.am: added -I$(top_srcdir) to be able to compile
1652 without make install.
1654 2002-12-15 Havoc Pennington <hp@pobox.com>
1656 * dbus/dbus-threads.c: add thread stubs that a higher library
1657 layer can fill in. e.g. the GLib wrapper might fill them in with
1658 GThread stuff. We still need to use this thread API to
1659 thread-safe-ize the library.
1661 2002-12-12 Havoc Pennington <hp@pobox.com>
1663 * dbus/dbus-transport-unix.c, dbus/dbus-server-unix.c: use the
1664 below new interfaces and include fewer system headers.
1666 * dbus/dbus-sysdeps.c (_dbus_read): new function
1667 (_dbus_write): new function
1668 (_dbus_write_two): new function
1669 (_dbus_connect_unix_socket): new function
1670 (_dbus_listen_unix_socket): new function
1672 * dbus/dbus-message-internal.h: change interfaces to use
1675 2002-12-11 Havoc Pennington <hp@pobox.com>
1677 * dbus/dbus-types.h: add dbus_unichar
1679 * dbus/dbus-internals.c (_dbus_verbose): use _dbus_getenv
1681 * dbus/dbus-connection.c (dbus_connection_send_message): return
1684 * dbus/dbus-transport.c: include dbus-watch.h
1686 * dbus/dbus-connection.c: include dbus-message-internal.h
1688 * HACKING: add file with coding guidelines stuff.
1690 * dbus/dbus-string.h, dbus/dbus-string.c: Encapsulate all string
1691 handling here, for security purposes (as in vsftpd). Not actually
1692 using this class yet.
1694 * dbus/dbus-sysdeps.h, dbus/dbus-sysdeps.c: Encapsulate all
1695 system/libc usage here, as in vsftpd, for ease of auditing (and
1696 should also simplify portability). Haven't actually moved all the
1697 system/libc usage into here yet.
1699 2002-11-25 Havoc Pennington <hp@pobox.com>
1701 * dbus/dbus-internals.c (_dbus_verbose): fix to not
1702 always print the first verbose message.
1704 2002-11-24 Havoc Pennington <hp@pobox.com>
1706 * test/echo-client.c, test/echo-server.c: cheesy test
1709 * configure.in (AC_CHECK_FUNCS): check for writev
1711 * dbus/dbus-message.c (_dbus_message_get_network_data): new
1714 * dbus/dbus-list.c (_dbus_list_foreach): new function
1716 * dbus/dbus-internals.c (_dbus_verbose): new function
1718 * dbus/dbus-server.c, dbus/dbus-server.h: public object
1719 representing a server that listens for connections.
1721 * dbus/.cvsignore: create
1723 * dbus/dbus-errors.h, dbus/dbus-errors.c:
1724 public API for reporting errors
1726 * dbus/dbus-connection.h, dbus/dbus-connection.c:
1727 public object representing a connection that
1728 sends/receives messages. (Same object used for
1729 both client and server.)
1731 * dbus/dbus-transport.h, dbus/dbus-transport.c:
1732 Basic abstraction for different kinds of stream
1733 that we might read/write messages from.
1735 2002-11-23 Havoc Pennington <hp@pobox.com>
1737 * dbus/dbus-internals.h (_DBUS_INT_MAX): add _DBUS_INT_MIN
1740 * dbus/dbus-test.c (main): add list test, and include
1741 dbus-test.h as intended
1743 * dbus/dbus-hash.c (_dbus_hash_table_remove_string)
1744 (_dbus_hash_table_remove_int): return value indicates
1745 whether the entry existed to remove
1747 * dbus/dbus-list.c: add linked list utility class,
1750 * dbus/dbus-hash.c: add TODO item about shrinking the hash bucket
1753 2002-11-23 Havoc Pennington <hp@pobox.com>
1755 * Doxyfile.in (INCLUDE_FILE_PATTERNS): expand DBUS_BEGIN_DECLS/
1756 DBUS_END_DECLS to nothing, that should fix this once and for all
1758 * Doxyfile.in (JAVADOC_AUTOBRIEF): set to YES
1760 * dbus/dbus-message.c, dbus/dbus-hash.c:
1761 add some missing @brief
1763 2002-11-23 Havoc Pennington <hp@pobox.com>
1765 * dbus/dbus-message.h: put semicolons after DEBUG_BEGIN_DECLS
1766 to avoid confusing Doxygen
1768 * dbus/dbus-hash.c: @} not }@
1770 * dbus/dbus-message.c (struct DBusMessage): split out
1773 2002-11-23 Havoc Pennington <hp@pobox.com>
1775 * configure.in: pile on more warning flags if using gcc
1777 * Doxyfile.in (EXTRACT_STATIC): set to NO, so we don't have
1778 to document static functions
1780 * configure.in: add summary to end of configure so it
1781 looks nice and attractive
1783 * dbus/dbus-hash.c: finish implementation and write unit
1786 * configure.in: add --enable-tests to enable unit tests
1788 * dbus/dbus-test.c: test program to run unit tests
1789 for all files in dbus/*, initially runs a test for
1792 * dbus/dbus-internals.h: file to hold some internal utility stuff
1794 2002-11-22 Havoc Pennington <hp@redhat.com>
1796 * dbus/dbus-hash.c: copy in Tcl hash table, not yet
1797 "ported" away from Tcl
1799 * dbus/dbus-types.h: header for types such as dbus_bool_t
1801 2002-11-22 Havoc Pennington <hp@redhat.com>
1803 * dbus/dbus.h: fixups for doc warnings
1805 * Doxyfile.in (FILE_PATTERNS): we need to scan .h to pick up
1807 (QUIET): make it quiet so we can see warnings
1809 * dbus/dbus-memory.c: teach D-BUS to allocate and free memory
1811 2002-11-22 Havoc Pennington <hp@redhat.com>
1813 * Makefile.am: include "Doxyfile" target in all-local
1815 * configure.in: generate the Doxyfile
1817 * Doxyfile.in: move Doxyfile here, so we can use
1818 configure to generate a Doxyfile with the right
1821 2002-11-22 Havoc Pennington <hp@redhat.com>
1823 * dbus/dbus-message.c: move inline docs into .c file
1825 * Doxyfile (OUTPUT_DIRECTORY): move output to doc/api
1826 so all docs are under doc/
1827 (MAN_EXTENSION): generate man pages. Use extension
1828 ".3dbus" which matches ".3qt" on my system,
1829 I guess this is OK, I don't know really.
1830 (FILE_PATTERNS): look for .c files not .h, makes sense
1833 2002-11-22 Havoc Pennington <hp@pobox.com>
1835 * Makefile.am (SUBDIRS): rename subdir "server" to "bus"
1836 because any app can be a server, and any app can be a client,
1837 the bus is a special kind of server.
1839 Thu Nov 21 23:35:31 2002 Zack Rusin <zack@kde.org>
1841 * Doxyfile : adding. Still needs Makefile rules to be generated
1842 automatically (just run "doxygen" in the toplevel dir for now to
1845 * dbus/dbus-message.h : Adding sample docs (javadoc since
1846 resembles gtk-doc a little more)
1848 * dbus/dbus.h : Adding sample docs
1850 2002-11-21 Havoc Pennington <hp@redhat.com>
1852 * dbus/Makefile.am (INCLUDES): define DBUS_COMPILATION
1853 so we can allow ourselves to include files directly,
1854 instead of having to use dbus.h
1856 * dbus/dbus.h: fill in
1858 * dbus/dbus-message.h: sketch out a sample header file.
1859 Include griping if you include it directly instead of
1862 * dbus/dbus-macros.h: new file with macros for extern "C",
1863 TRUE/FALSE, NULL, etc.
1865 * doc/file-boilerplate.c: put include guards in here
1867 2002-11-21 Havoc Pennington <hp@redhat.com>
1869 * doc/file-boilerplate.c: include both AFL and GPL boilerplate.
1871 * COPYING: include the GPL as well, and license code
1872 under both AFL and GPL.
1874 2002-11-21 Havoc Pennington <hp@redhat.com>
1876 * acconfig.h: get rid of this
1878 * autogen.sh (run_configure): add --no-configure option
1880 * configure.in: remove AC_ARG_PROGRAM to make
1881 autoconf complain less. add AC_PREREQ.
1882 add AC_DEFINE third arg.
1884 2002-11-21 Anders Carlsson <andersca@codefactory.se>
1887 Fix references so we can distcheck.
1889 2002-11-21 Havoc Pennington <hp@redhat.com>
1891 * Initial module creation