1 2003-03-05 Anders Carlsson <andersca@codefactory.se>
3 * README: Add some things.
5 2003-03-04 Anders Carlsson <andersca@codefactory.se>
7 * dbus/dbus-message.c (dbus_message_append_args_valist): Add a break;
8 after case DBUS_TYPE_BOOELAN.
10 2003-03-02 Havoc Pennington <hp@pobox.com>
12 * test/break-loader.c (randomly_set_extreme_ints): add test that
13 sets really huge and small integers
15 * dbus/dbus-marshal.c (_dbus_marshal_validate_arg): add check
16 that length of boolean array fits in the string, and that
17 string has room for boolean value in single-bool case.
19 * dbus/dbus-message-builder.c (_dbus_message_data_load): add
20 optional value to "ALIGN" command which is what to fill the
23 * test/data/valid-messages/no-padding.message: add regression
24 test for the message padding problem
26 2003-03-02 Havoc Pennington <hp@pobox.com>
28 * dbus/dbus-message.c (decode_header_data): fix to always init
29 message_padding, from Benjamin Dauvergne
31 2003-03-02 Havoc Pennington <hp@pobox.com>
37 2003-03-01 Joe Shaw <joe@assbarn.com>
39 * configure.in: Check for "struct cmsgcred" and try to access its
40 members for BSD-like unices.
42 * dbus/dbus-sysdeps.c (read_credentials_byte): Fold this back into
43 _dbus_read_credentials_unix_socket().
44 (_dbus_read_credentials_unix_socket): Use recvmsg() instead of
45 read() for reading the credential byte off the unix socket. Use
46 struct cmsgcred on systems that support it.
48 2003-02-27 Alexander Larsson <alexl@redhat.com>
52 Make gthreads-2.0 dependency optional. Don't build thread test if
55 2003-02-27 Havoc Pennington <hp@pobox.com>
57 * dbus/dbus-connection.c
58 (dbus_connection_send_message_with_reply_and_block): fix doh!
59 doh! doh! bug that resulted in never removing a reply from the
60 queue, no wonder we called get_reply_serial so much ;-)
62 * dbus/dbus-message.c (struct DBusMessage): cache reply serial
63 and client serial instead of demarshaling them every time
65 2003-02-27 Havoc Pennington <hp@pobox.com>
67 * dbus/dbus-marshal.c (_dbus_demarshal_int32): rewrite to be much
68 more inlined, using dbus-string-private.h, speeds things up
71 * dbus/dbus-string.c (_dbus_string_free): apply align offset
72 when freeing the string
73 (_dbus_string_steal_data): fix for align offset
74 (undo_alignment): new function
76 2003-02-26 Havoc Pennington <hp@redhat.com>
78 All kinds of audit fixes from Owen, plus initial attempt to
79 handle unaligned memory returned from malloc.
81 * dbus/dbus-string.c (_dbus_string_init): clamp max length to
82 leave room for align_offset and nul byte
83 (fixup_alignment): function to track an align_offset and
84 ensure real->str is aligned
85 (DBUS_GENERIC_STRING_PREAMBLE): len must be less than allocated,
86 to allow a nul byte plus align offset
87 (_dbus_string_lock): fix overflow issue
88 (_dbus_string_init_const_len): add assertions on sanity of len,
89 assign allocated to be ALLOCATION_PADDING larger than len
90 (set_length): fixup the overflow handling
91 (_dbus_string_get_data_len): fix overflow in assertion
92 (open_gap): detect overflow in size of gap to be opened
93 (_dbus_string_lengthen): add overflow check
94 (_dbus_string_align_length): fix overflow with _DBUS_ALIGN_VALUE
95 (_dbus_string_append): add overflow check
96 (_dbus_string_append_unichar): overflow
97 (_dbus_string_delete): fix overflow in assertion
98 (_dbus_string_copy_len): overflow in assertion
99 (_dbus_string_replace_len): overflows in assertions
100 (_dbus_string_find): change to implement in terms of
102 (_dbus_string_find_to): assorted fixage
103 (_dbus_string_equal_c_str): assert c_str != NULL,
104 fix logic so the function works
105 (_dbus_string_ends_with_c_str): fix overflow thingy
106 (_dbus_string_base64_encode): overflow fix
107 (_dbus_string_validate_ascii): overflow
108 (_dbus_string_validate_nul): overflow
110 2003-02-26 Havoc Pennington <hp@redhat.com>
112 * dbus/dbus-marshal.c (_dbus_marshal_test): fix to work with DISABLE_ASSERTS
114 2003-02-26 Alexander Larsson <alexl@redhat.com>
117 Set DBUS_GLIB_THREADS_LIBS for apps using gthread-2.0
119 * dbus/dbus-connection.c:
120 * dbus/dbus-connection.h:
121 Fix _dbus_connection_acquire_io_path and _dbus_connection_acquire_dispatch.
122 Add dbus_connection_set_wakeup_main_function and use it when queueing
123 incoming and outgoing messages.
126 * dbus/dbus-dataslot.c:
127 Threadsafe usage of DBusDataSlotAllocator
129 * dbus/dbus-message.c: (dbus_message_get_args_iter):
132 * dbus/dbus-server-unix.c:
136 Implement the new wakeup functions for glib.
139 * glib/test-thread-client.c:
140 * glib/test-thread-server.c:
141 * glib/test-thread.h:
142 Initial cut at some thread test code. Not really done yet.
144 2003-02-26 Havoc Pennington <hp@pobox.com>
146 * dbus/dbus-connection.c
147 (dbus_connection_send_message_with_reply_and_block): fix crash
148 where we ref'd the outgoing message instead of the returned reply
150 * dbus/dbus-transport-unix.c (do_authentication): check read watch
151 at the end of this function, so if we didn't need to read for
152 authentication, we reinstall it for receiving messages
154 * dbus/dbus-message.c (dbus_message_new_reply): allow replies to
155 a NULL sender for peer-to-peer case
157 * dbus/dbus-transport-unix.c (check_read_watch): handle
158 !authenticated case correctly
160 * glib/dbus-gmain.c: add support for DBusServer
162 * dbus/dbus-server.c: add data slot support
164 * glib/dbus-gmain.c (dbus_connection_setup_with_g_main): check
165 return values and handle errors
167 * dbus/dbus-dataslot.c: factor out the data slot stuff from
170 * Doxyfile.in (INPUT): add glib subdir
172 * glib/dbus-gmain.c (dbus_connection_setup_with_g_main): rename
173 setup_with_g_main instead of hookup_with_g_main; write docs
175 2003-02-24 Anders Carlsson <andersca@codefactory.se>
177 * dbus/dbus-marshal.c: (_dbus_marshal_validate_arg):
178 * dbus/dbus-message-builder.c: (_dbus_message_data_load):
179 * dbus/dbus-message.c: (dbus_message_append_boolean),
180 (dbus_message_append_boolean_array),
181 (dbus_message_get_args_valist), (_dbus_message_test):
182 * dbus/dbus-message.h:
183 * doc/dbus-specification.sgml:
184 Various fixes as pointed out by Havoc.
186 * test/data/invalid-messages/bad-boolean-array.message:
187 * test/data/invalid-messages/bad-boolean.message:
188 Add invalid boolean value test cases.
190 2003-02-24 Anders Carlsson <andersca@codefactory.se>
192 * dbus/dbus-internals.c: (_dbus_type_to_string):
193 * dbus/dbus-marshal.c: (_dbus_marshal_get_arg_end_pos),
194 (_dbus_marshal_validate_arg):
195 * dbus/dbus-message-builder.c: (_dbus_message_data_load):
196 * dbus/dbus-message.c: (dbus_message_append_args_valist),
197 (dbus_message_append_boolean), (dbus_message_append_boolean_array),
198 (dbus_message_get_args_valist), (dbus_message_iter_get_boolean),
199 (dbus_message_iter_get_int32), (dbus_message_iter_get_uint32),
200 (dbus_message_iter_get_double),
201 (dbus_message_iter_get_boolean_array), (message_iter_test):
202 * dbus/dbus-message.h:
203 * dbus/dbus-protocol.h:
204 * doc/dbus-specification.sgml:
205 * test/data/valid-messages/lots-of-arguments.message:
206 Add support for boolean and boolean array types.
208 2003-02-23 Havoc Pennington <hp@pobox.com>
210 * dbus/dbus-keyring.c: finish most of this implementation and
213 * dbus/dbus-errors.c (dbus_set_error_const, dbus_set_error): make
214 these barf if the error isn't cleared to NULL
216 * dbus/dbus-sysdeps.c (_dbus_delete_file): set error on failure
217 (_dbus_create_directory): new function
219 * dbus/dbus-errors.c (dbus_set_error): fix warning
221 * dbus/dbus-string.c (_dbus_string_hex_encode): new function
222 (_dbus_string_hex_decode): new function
223 (test_hex_roundtrip): test code
225 * dbus/dbus-sha.c (_dbus_sha_compute): use dbus_string_hex_encode
227 * dbus/dbus-md5.c (_dbus_md5_compute): use dbus_string_hex_encode
229 * dbus/dbus-sysdeps.c (_dbus_string_save_to_file): make this use
230 the save-to-temp/rename trick to atomically write the new file
231 (_dbus_string_parse_uint): new function
233 2003-02-22 Havoc Pennington <hp@pobox.com>
235 * test/Makefile.am (dist-hook): fix dist for test/data/sha-1
237 2003-02-22 Havoc Pennington <hp@pobox.com>
239 * dbus/dbus-message.c (dbus_message_iter_get_string_array):
240 (dbus_message_iter_get_byte_array): Fix up doxygen warnings
242 * dbus/dbus-sha.c: add implementation of SHA-1 algorithm
244 * dbus/test/data/sha-1: add US government test suite for SHA-1
246 2003-02-21 Anders Carlsson <andersca@codefactory.se>
248 * dbus/dbus-marshal.c: (_dbus_demarshal_string_array):
249 Make string arrays NULL-terminated.
251 * dbus/dbus-memory.c: (dbus_free_string_array):
252 * dbus/dbus-memory.h:
253 New function for freeing NULL-terminated string arrays.
255 * dbus/dbus-message-builder.c: (append_quoted_string),
256 (_dbus_message_data_load):
257 Add support for array types.
259 * dbus/dbus-message.c: (check_message_handling):
260 Add more types as test cases.
262 * dbus/dbus-sysdeps.c: (_dbus_string_parse_int),
263 (_dbus_string_parse_double):
264 Add the start offset to the end offset.
266 * test/data/valid-messages/lots-of-arguments.message:
267 New test message with lots of arguments.
269 2003-02-21 Anders Carlsson <andersca@codefactory.se>
271 * dbus/dbus-message.c: (dbus_message_append_nil),
272 (dbus_message_append_int32), (dbus_message_append_uint32),
273 (dbus_message_append_double), (dbus_message_append_string),
274 (dbus_message_append_int32_array),
275 (dbus_message_append_uint32_array),
276 (dbus_message_append_double_array),
277 (dbus_message_append_byte_array),
278 (dbus_message_append_string_array):
279 Fix all out-of-memory handling in these functions.
281 2003-02-21 Anders Carlsson <andersca@codefactory.se>
283 * dbus/dbus-message.c: (dbus_message_append_nil):
286 2003-02-21 Anders Carlsson <andersca@codefactory.se>
288 * dbus/dbus-message.c: (dbus_message_append_args_valist),
289 (dbus_message_append_nil), (dbus_message_append_int32_array),
290 (dbus_message_append_uint32_array),
291 (dbus_message_append_double_array),
292 (dbus_message_append_byte_array),
293 (dbus_message_append_string_array), (dbus_message_get_args_valist),
294 (dbus_message_iter_get_int32_array),
295 (dbus_message_iter_get_uint32_array),
296 (dbus_message_iter_get_double_array),
297 (dbus_message_iter_get_byte_array),
298 (dbus_message_iter_get_string_array):
300 * dbus/dbus-message.h:
301 Add functions for appending and getting arrays.
303 2003-02-21 Anders Carlsson <andersca@codefactory.se>
305 * dbus/dbus-mempool.c (_dbus_mem_pool_new): Make the
306 element size at least 8 bytes, fixes mempool tests on
309 2003-02-20 Alexander Larsson <alexl@redhat.com>
311 * dbus/dbus-transport-unix.c (unix_do_iteration):
312 Unlock the connection mutex during a blocking select call.
313 Add todo about how we need a way to wake up the select.
315 * dbus/dbus-connection-internal.h:
316 * dbus/dbus-connection.c:
317 Add _dbus_connection_lock and _dbus_connection_unlock.
319 2003-02-19 Havoc Pennington <hp@pobox.com>
321 * Doxyfile.in (PREDEFINED): put DOXYGEN_SHOULD_SKIP_THIS in
322 Doxyfile.in, not Doxyfile
324 * dbus/dbus-keyring.c: do some hacking on this
326 * dbus/dbus-sysdeps.c (_dbus_delete_file): new
328 * dbus/dbus-errors.c (dbus_set_error_const): do not call
330 (dbus_set_error): remove dbus_error_init, check for message ==
331 NULL *before* we sprintf into it, and add @todo about including
332 system headers in this file
334 * dbus/dbus-sysdeps.c (_dbus_create_file_exclusively): new
336 * dbus/dbus-errors.h (DBUS_ERROR_FAILED): add
338 * dbus/dbus-sysdeps.c (get_user_info): break this function out to
339 get various bits of user information based on either username
341 (_dbus_homedir_from_username): new function
343 2003-02-19 Anders Carlsson <andersca@codefactory.se>
346 Add check for nonposix getpwnam_r
348 * dbus/dbus-mempool.c: (_dbus_mem_pool_new):
349 Align the pool element size to a sizeof (void *) boundary.
351 * dbus/dbus-sysdeps.c: (_dbus_setenv), (_dbus_connect_unix_socket),
352 (_dbus_listen_unix_socket), (_dbus_credentials_from_username):
353 General Solaris fixes.
355 * test/data/valid-messages/simplest-manual.message:
356 Explicitly state that we want little-endian packing.
358 2003-02-19 Mikael Hallendal <micke@codefactory.se>
360 * dbus/dbus-server.c (dbus_server_listen): Support tcp: addresses.
362 * dbus/dbus-transport-unix.c (_dbus_transport_new_for_tcp_socket):
363 Added to create a transport connecting using a tcp/ip socket.
365 * dbus/dbus-sysdeps.c (_dbus_connect_tcp_socket): Added to connect
366 to a tcp socket at given host and port.
367 (_dbus_listen_tcp_socket): added to listen on tcp socket for given
370 * dbus/dbus-server.c (dbus_server_listen): Support tcp: addresses.
372 * dbus/dbus-server-unix.c (_dbus_server_new_for_tcp_socket):
373 Added to create a server listening on a TCP/IP socket.
375 2003-02-19 Havoc Pennington <hp@pobox.com>
377 Throughout: mop up all the Doxygen warnings and undocumented
380 * dbus/dbus-sysdeps.c (do_exec): do not use execvp, we don't want
383 * dbus/dbus-threads.c: move global mutex initializers to
384 dbus-internals.h, multiple prototypes was confusing doxygen
385 besides being kind of ugly
387 * Doxyfile (PREDEFINED): have Doxygen define
388 DOXYGEN_SHOULD_SKIP_THIS so we can exclude things from
389 docs with #ifndef DOXYGEN_SHOULD_SKIP_THIS
390 (do not abuse the feature! it's for stuff like the autogenerated
391 macros in dbus-md5.c, not just for things you don't feel like
394 2003-02-18 Havoc Pennington <hp@pobox.com>
396 * dbus/dbus-string.c (_dbus_string_zero): new function
398 * dbus/dbus-md5.c: include MD5 implementation by L. Peter Deutsch,
399 wrap it in some dbus-friendly API
401 * dbus/dbus-types.h: add 16-bit types
403 2003-02-18 Joe Shaw <joe@assbarn.com>
405 * dbus/dbus-auth.c (handle_server_data_stupid_test_mech): Just get
406 credentials from our currently running process.
407 (get_word): Fix a buglet where we were copying the entire length
408 instead of relative to our position.
410 * dbus/dbus-hash.c (_dbus_hash_test): Don't try to allocate the
411 keys on the stack... it's 640k of data.
413 * dbus/dbus-sysdeps.c (_dbus_read_credentials_unix_socket): Always
414 read the credentials byte off the socket, even if we don't have
416 (_dbus_poll): Implement poll() using select() for systems which
419 * glib/test-dbus-glib.c (main): Print out an error if no
420 parameters are given.
422 * test/data/auth/fallback.auth-script: Added. Tests that a client
423 can fallback to a secondary auth mechanism if the first fails.
425 2003-02-18 Havoc Pennington <hp@pobox.com>
429 2003-02-17 Havoc Pennington <hp@pobox.com>
431 * doc/dbus-specification.sgml: lots of cosmetic
432 cleanups/rearrangement, add assorted FIXME, change DBUS_ADDRESS
433 env variable to DBUS_BUS_ADDRESS, s/client/application/,
434 s/server/bus/ (except in authentication section). Add a section
435 "Message Bus Message Routing"
437 2003-02-17 Anders Carlsson <andersca@codefactory.se.>
443 2003-02-17 Anders Carlsson <andersca@codefactory.se>
445 * doc/dbus-specification.sgml:
446 Specification updates.
448 2003-02-17 Anders Carlsson <andersca@codefactory.se>
450 * bus/activation.c: (bus_activation_init), (child_setup),
451 (bus_activation_activate_service):
453 * bus/main.c: (main):
454 Set DBUS_ADDRESS environment variable.
456 * dbus/dbus-errors.c: (dbus_set_error):
457 Don't use va_copy since that's a C99 feature.
459 * dbus/dbus-sysdeps.c: (_dbus_setenv), (do_exec),
461 * dbus/dbus-sysdeps.h:
462 Add child_setup_func to _dbus_spawn_async.
464 * doc/dbus-specification.sgml:
465 Update specification.
467 * test/spawn-test.c: (setup_func), (main):
470 2003-02-17 Alexander Larsson <alexl@redhat.com>
472 * dbus/dbus-connection.c (_dbus_connection_handler_destroyed_locked):
475 2003-02-17 Anders Carlsson <andersca@codefactory.se>
479 * doc/dbus-test-plan.sgml:
480 Add test plan document.
485 2003-02-17 Anders Carlsson <andersca@codefactory.se>
487 * dbus/dbus-message.c: (decode_header_data),
488 (_dbus_message_loader_return_buffer):
489 Set the header padding amount when loading a message.
491 2003-02-16 Anders Carlsson <andersca@codefactory.se>
493 * bus/dispatch.c: (send_one_message):
494 Only send broadcast messages to registered connections.
496 * dbus/dbus-message.c: (dbus_message_name_is):
497 * dbus/dbus-message.h:
498 New convenience function.
500 * dbus/dbus-transport-debug.c: (do_reading):
501 Only dispatch one message per run.
504 * test/bus-test.c: (new_connection_callback), (die),
505 (test_hello_client1_handler), (test_hello_client2_handler),
506 (test_hello_replies), (main):
508 * test/bus-test-loop.[ch]:
511 2003-02-16 Havoc Pennington <hp@pobox.com>
513 * dbus/dbus-connection.c (dbus_connection_dispatch_message): fix
516 2003-02-16 Alexander Larsson <alexl@redhat.com>
518 * dbus/dbus-connection.c:
519 Implement sent_message_with_reply. (with_reply_and block is still
521 Made dispatch_message not lose message if OOM.
523 * dbus/dbus-errors.h:
524 Add NoReply error (for reply timeouts).
526 2003-02-16 Alexander Larsson <alexl@redhat.com>
528 * dbus/dbus-hash.c (_dbus_hash_table_unref):
529 Actually free keys and values when destroying hashtable.
531 2003-02-16 Anders Carlsson <andersca@codefactory.se>
533 * dbus/dbus-auth.c: (client_try_next_mechanism):
536 * dbus/dbus-threads.c: (dbus_condvar_wait_timeout):
537 Return TRUE if there's no thread implementation around.
539 * glib/dbus-gmain.c: (free_source),
540 (dbus_connection_hookup_with_g_main):
541 Make sure to remove the GSource when the connection is finalized.
543 2003-02-16 Anders Carlsson <andersca@codefactory.se>
545 * bus/dispatch.c: (bus_dispatch_message_handler):
546 * dbus/dbus-errors.h:
547 Return an error if someone tries to send a message to a service
550 2003-02-16 Anders Carlsson <andersca@codefactory.se>
552 * bus/activation.c: (load_directory), (bus_activation_init),
553 (bus_activation_activate_service):
556 (bus_driver_handle_activate_service), (bus_driver_handle_message):
557 More work on the activation handling.
559 * dbus/dbus-errors.h:
560 Add some error messages
562 * dbus/dbus-message.c: (dbus_message_new_error_reply):
563 * dbus/dbus-message.h:
564 New function that creates an error message.
566 * dbus/dbus-protocol.h:
567 Add ACTIVATE_SERVER message.
569 * dbus/dbus-server-unix.c: (unix_handle_watch),
570 (_dbus_server_new_for_domain_socket):
571 Call _dbus_fd_set_close_on_exec.
573 * dbus/dbus-sysdeps.c: (make_pipe), (do_exec),
574 (_dbus_spawn_async), (_dbus_disable_sigpipe),
575 (_dbus_fd_set_close_on_exec):
576 * dbus/dbus-sysdeps.h:
577 Add _dbus_fd_set_close_on exec function. Also add function that checks
578 that all open fds are set to close-on-exec and warns otherwise.
580 * dbus/dbus-transport-unix.c:
581 (_dbus_transport_new_for_domain_socket):
582 Call _dbus_fd_set_close_on_exec.
584 2003-02-16 Havoc Pennington <hp@pobox.com>
586 * dbus/dbus-connection.c (dbus_connection_set_change_sigpipe):
587 allow people to avoid setting SIGPIPE to SIG_IGN
588 (_dbus_connection_new_for_transport): disable SIGPIPE unless
589 we've been asked not to
591 2003-02-15 Anders Carlsson <andersca@codefactory.se>
593 * dbus/dbus-list.c: (_dbus_list_append_link),
594 (_dbus_list_prepend_link):
595 * dbus/dbus-memory.c: (dbus_malloc), (dbus_malloc0),
599 2003-02-15 Anders Carlsson <andersca@codefactory.se>
602 * bus/activation.c: (bus_activation_entry_free),
603 (add_desktop_file_entry), (load_directory), (bus_activation_init):
605 * bus/main.c: (main):
606 Add simple activation support, doesn't work yet though.
608 2003-02-15 Zack Rusin <zack@kde.org>
610 * qt/dbus-qthread.cpp: small casting fix
612 2003-02-15 Anders Carlsson <andersca@codefactory.se>
614 * dbus/dbus-errors.c: (dbus_set_error):
615 * dbus/dbus-errors.h:
616 Add a few errors and make dbus_set_error void.
618 * dbus/dbus-sysdeps.c:
619 (_dbus_errno_to_string), (close_and_invalidate), (make_pipe),
620 (write_err_and_exit), (read_ints), (do_exec), (_dbus_spawn_async):
621 * dbus/dbus-sysdeps.h:
622 Add _dbus_spawn_async.
624 * test/spawn-test.c: (main):
625 Test for _dbus_spawn_async.
627 2003-02-15 Anders Carlsson <andersca@codefactory.se>
629 * dbus/dbus-internals.h:
630 Fix build without tests.
632 * dbus/dbus-list.c: (alloc_link):
633 Fix a segfault when a malloc fails.
635 * dbus/dbus-memory.c: (initialize_malloc_debug), (dbus_malloc),
636 (dbus_malloc0), (dbus_realloc):
637 Add support for malloc debugging.
639 2003-02-15 Alexander Larsson <alexl@redhat.com>
641 * dbus/dbus-threads.c:
642 * dbus/dbus-threads.h:
643 Add condvars. Remove static mutext from API.
644 Implement static mutexes by initializing them from threads_init.
646 * glib/dbus-gthread.c:
647 * qt/dbus-qthread.cpp:
648 Update with the thread api changes.
653 Turn StaticMutex into normal mutex + init function.
654 Export new functions _dbus_list_alloc_link, _dbus_list_free_link,
655 _dbus_list_append_link, _dbus_list_prepend_link
658 * dbus/dbus-sysdeps.c:
659 * dbus/dbus-sysdeps.h:
660 New type dbus_atomic_t, and new functions _dbus_atomic_inc,
661 _dbus_atomic_dec. Only slow fallback implementation at the moment.
663 * dbus/dbus-protocol.h:
664 Add DBUS_MESSAGE_LOCAL_DISCONNECT define
666 * dbus/dbus-message.c:
667 Make ref/unref atomic.
670 * dbus/dbus-connection-internal.h:
671 * dbus/dbus-connection.c:
672 * dbus/dbus-connection.h:
674 Change _peek to _borrow,_return & _steal_borrowed.
675 Change disconnect callback to event.
676 Make dbus_connection_dispatch_messages reentrant.
678 * dbus/dbus-transport.c:
679 Don't ref the connection on calls to the transport
682 * dbus/dbus-message-handler.c:
686 Don't use peek_message anymore
689 * test/debug-thread.c:
690 * test/debug-thread.h:
691 Simple thread implementation that asserts() on deadlocks in
692 single-threaded code.
695 (main) Call debug_threads_init.
698 Use disconnect message instead of disconnect callback.
702 Don't call dbus_connection_set_disconnect_function. Instead export
703 bus_connection_disconnect.
706 Call bus_connection_disconnect when we get a disconnected message.
708 2003-02-15 Havoc Pennington <hp@pobox.com>
710 * dbus/dbus-message.c (dbus_message_new): fool around with the
713 2003-02-14 Havoc Pennington <hp@pobox.com>
715 * dbus/dbus-mempool.c: fail if the debug functions so indicate
717 * dbus/dbus-memory.c: fail if the debug functions indicate we
720 * dbus/dbus-internals.c (_dbus_set_fail_alloc_counter)
721 (_dbus_decrement_fail_alloc_counter): debug functions to
722 simulate memory allocation failures
724 2003-02-14 Havoc Pennington <hp@pobox.com>
726 * dbus/dbus-errors.h (struct DBusError): add a word of padding
729 2003-02-13 Anders Carlsson <andersca@codefactory.se>
731 * bus/driver.c: (bus_driver_handle_hello):
733 * bus/services.c: (bus_service_lookup):
734 Reorder message sending so we get a more sane order.
736 * test/bus-test.c: (message_handler):
739 2003-02-13 Anders Carlsson <andersca@codefactory.se>
741 * bus/driver.c: (bus_driver_send_service_deleted),
742 (bus_driver_send_service_created), (bus_driver_send_service_lost),
743 (bus_driver_send_service_acquired), (bus_driver_handle_hello),
744 (bus_driver_send_welcome_message),
745 (bus_driver_handle_list_services),
746 (bus_driver_handle_acquire_service),
747 (bus_driver_handle_service_exists):
748 * dbus/dbus-bus.c: (dbus_bus_register_client),
749 (dbus_bus_acquire_service), (dbus_bus_service_exists):
750 * dbus/dbus-errors.c: (dbus_result_to_string):
751 * dbus/dbus-errors.h:
752 * dbus/dbus-message.c: (dbus_message_append_args),
753 (dbus_message_append_args_valist), (dbus_message_get_args),
754 (dbus_message_get_args_valist), (dbus_message_get_args_iter),
755 (dbus_message_iter_get_arg_type), (dbus_message_iter_get_string),
756 (dbus_message_iter_get_byte_array),
757 (dbus_message_iter_get_string_array), (message_iter_test),
758 (check_message_handling), (_dbus_message_test):
759 * dbus/dbus-message.h:
760 * test/bus-test.c: (main):
761 Change fields to arguments in messages, so that they won't be
762 confused with header fields.
764 * glib/test-dbus-glib.c: (main):
765 Remove append_fields from hello message.
767 2003-02-13 Anders Carlsson <andersca@codefactory.se>
769 * dbus/dbus-errors.c:
770 * dbus/dbus-message.c:
771 * dbus/dbus-string.c:
774 2003-02-13 Anders Carlsson <andersca@codefactory.se>
776 * glib/dbus-gmain.c: (timeout_handler), (add_timeout),
778 Implement support for timeouts in dbus-glib.
780 2003-02-13 Anders Carlsson <andersca@codefactory.se>
782 * dbus/dbus-message-builder.c: (_dbus_message_data_load):
783 * dbus/dbus-message.c: (process_test_subdir):
784 * test/break-loader.c: (find_breaks_based_on):
785 Plug some memory leaks.
787 2003-02-13 Richard Hult <rhult@codefactory.se>
789 * bus/main.c: Fix build.
791 * dbus/dbus-errors.h:
792 * dbus/dbus-errors.c: Fix copyright for Anders.
794 2003-02-13 Anders Carlsson <andersca@codefactory.se>
799 * bus/connection.c: (bus_connection_foreach):
802 * bus/desktop-file.c: (grow_lines_in_section), (grow_sections),
803 (unescape_string), (new_section), (parse_section_start),
804 (parse_key_value), (report_error), (bus_desktop_file_load),
805 (bus_desktop_file_get_string):
806 * bus/desktop-file.h:
807 Use DBusError for error reporting.
809 * bus/dispatch.c: (send_one_message),
810 (bus_dispatch_message_handler):
811 * bus/driver.c: (bus_driver_send_service_deleted),
812 (bus_driver_send_service_created), (bus_driver_send_service_lost),
813 (bus_driver_send_service_acquired), (bus_driver_handle_hello),
814 (bus_driver_send_welcome_message),
815 (bus_driver_handle_list_services),
816 (bus_driver_handle_acquire_service),
817 (bus_driver_handle_service_exists):
818 * bus/loop.c: (bus_loop_run):
820 Use BUS_HANDLE_OOM instead of _DBUS_HANDLE_OOM.
822 * bus/utils.c: (bus_wait_for_memory):
824 New files with general utility functions.
826 * dbus/dbus-internals.h:
827 Remove _DBUS_HANDLE_OOM.
829 2003-02-13 Anders Carlsson <andersca@codefactory.se>
831 * dbus/dbus-errors.c: (dbus_result_to_string), (dbus_error_init),
832 (dbus_error_free), (dbus_set_error_const), (dbus_set_error):
833 * dbus/dbus-errors.h:
834 Add DBusError structure.
836 2003-02-13 Anders Carlsson <andersca@codefactory.se>
838 * test/data/valid-messages/standard-acquire-service.message:
839 * test/data/valid-messages/standard-hello.message:
840 * test/data/valid-messages/standard-list-services.message:
841 * test/data/valid-messages/standard-service-exists.message:
842 Add some standard messages.
844 2003-02-13 Anders Carlsson <andersca@codefactory.se>
846 * bus/driver.c: (bus_driver_send_welcome_message),
847 (bus_driver_handle_list_services),
848 (bus_driver_handle_acquire_service),
849 (bus_driver_handle_service_exists), (bus_driver_handle_message):
850 Update for API changes in libdbus.
852 * dbus/dbus-message.c: (dbus_message_new_reply):
853 * dbus/dbus-message.h:
854 Remove the name argument. The spec states that replies shouldn't
857 2003-02-13 Anders Carlsson <andersca@codefactory.se>
859 * bus/desktop-file.c: (parse_section_start), (parse_key_value),
860 (report_error), (bus_desktop_file_load), (lookup_section),
861 (lookup_line), (bus_desktop_file_get_raw),
862 (bus_desktop_file_get_string):
863 * bus/desktop-file.h:
864 Some fixes, and new functions for getting a key value from a section.
866 2003-02-13 Havoc Pennington <hp@pobox.com>
868 * test/data/auth/fail-after-n-attempts.auth-script: new test
870 * dbus/dbus-auth.c (send_rejected): shutdown_mech() when we
873 2003-02-13 Havoc Pennington <hp@pobox.com>
875 * dbus/dbus-auth.c (handle_server_data_external_mech): args to
876 dbus_credentials_match were backward
878 * dbus/dbus-auth-script.c (_dbus_auth_script_run): support
879 NO_CREDENTIALS and ROOT_CREDENTIALS
881 * dbus/dbus-auth.c (_dbus_auth_do_work): move get_state() routine
882 into here. Never process more commands after we've reached an
883 end state; store further data as unused bytes.
885 * test/data/auth/*: add more auth tests
887 * dbus/dbus-auth-script.c (_dbus_auth_script_run): support EXPECT
888 command to match exact string and EXPECT_UNUSED to match unused
891 * test/Makefile.am (dist-hook): fix to dist all the test stuff
893 2003-02-12 Havoc Pennington <hp@pobox.com>
895 * dbus/dbus-string.c (_dbus_string_pop_line): fix to also strip
896 \r off of popped lines
898 * dbus/dbus-auth.c (_dbus_auth_test): write code to run auth
901 * dbus/dbus-auth-script.c (_dbus_auth_script_run): when doing a
904 2003-02-12 Havoc Pennington <hp@pobox.com>
906 * dbus/Makefile.am: remove break-loader from the build, since it
909 * configure.in: add --enable-gcov to turn on coverage profiling
910 flags and disable optimization
912 2003-02-10 Havoc Pennington <hp@pobox.com>
914 * dbus/dbus-auth-script.c, dbus/dbus-auth-script.h: sync
915 initial cut at test framework for DBusAuth from laptop.
916 Doesn't quite work yet but it compiles and I need to get
917 it off the 266mhz laptop. ;-)
919 * dbus/dbus-server-debug.c (_dbus_server_debug_accept_transport):
920 fix a memleak in error case
922 2003-02-12 Anders Carlsson <andersca@codefactory.se>
925 * bus/desktop-file.c:
926 * bus/desktop-file.h:
927 Add a desktop file parser.
929 2003-02-11 Zack Rusin <zack@kde.org>
931 * qt/message.[h|cpp]: sample implementation
932 of the KDE wrapper for DBusMessage
934 2003-02-09 Zack Rusin <zack@kde.org>
936 * test/bus-test.c: make_it_compile
937 * doc/dbus-specification.sgml: minimal semantic fix
939 2003-02-06 Anders Carlsson <andersca@codefactory.se>
945 2003-02-06 Anders Carlsson <andersca@codefactory.se>
948 * dbus/dbus-break-loader.c:
950 * test/break-loader.c:
951 Move dbus-break-loader to test/ and rename it to break-loader.
953 2003-02-02 Havoc Pennington <hp@pobox.com>
955 * dbus/dbus-keyring.c, dbus/dbus-keyring.h: template files
956 for code to manage cookies in your home directory
958 * dbus/dbus-sysdeps.c (_dbus_generate_random_bytes): new function
960 * dbus/dbus-auth.c (get_state): impose a maximum number of tries
961 to authenticate, then disconnect the client.
963 2003-02-03 Alexander Larsson <alexl@redhat.com>
965 * dbus/dbus-message.c (dbus_message_append_fields):
968 2003-02-02 Anders Carlsson <andersca@codefactory.se>
970 * doc/dbus-specification.sgml:
971 Update address format section.
973 2003-02-02 Anders Carlsson <andersca@codefactory.se>
976 * test/bus-test.c: (get_time), (add_timeout), (remove_timeout),
977 (message_handler), (new_connection_callback), (loop_quit),
981 2003-02-02 Anders Carlsson <andersca@codefactory.se>
983 * bus/driver.c: (bus_driver_handle_service_exists):
984 Simplify the code a bit.
986 * dbus/dbus-bus.c: (dbus_bus_service_exists):
989 2003-02-02 Anders Carlsson <andersca@codefactory.se>
992 Add libdbus-daemon.la and link to it.
994 2003-02-01 James Willcox <jwillcox@gnome.org>
996 * bus/driver.c: (bus_driver_handle_own_service):
997 Actually include the service reply code in the message.
999 2003-02-02 Anders Carlsson <andersca@codefactory.se>
1001 * bus/driver.c: (bus_driver_handle_service_exists):
1002 Don't unref the incoming message.
1004 2003-02-02 Anders Carlsson <andersca@codefactory.se>
1006 * dbus/dbus.h: Add dbus-address.h and dbus-bus.h
1008 2003-02-02 Anders Carlsson <andersca@codefactory.se>
1010 * dbus/dbus-server.c: (dbus_server_listen):
1011 * dbus/dbus-transport.c: (_dbus_transport_open):
1012 ifdef out the calls to the debug transport and server.
1014 2003-02-02 Alexander Larsson <alexl@redhat.com>
1016 * dbus/dbus-watch.c (dbus_watch_get_flags):
1017 Add note in the docs that ERROR or HANGUP won't be returned
1018 and are assumed always on.
1020 * glib/dbus-gmain.c (add_watch):
1021 Always add IO_ERR | IO_HUP
1023 * dbus/dbus-message.h:
1024 Add semicolon after dbus_message_iter_get_string_array().
1025 Makes qt code build again
1027 2003-02-01 Anders Carlsson <andersca@codefactory.se>
1029 * bus/driver.c: (create_unique_client_name),
1030 (bus_driver_handle_hello):
1031 Don't take a name, just use a numeric id to identify
1035 * dbus/dbus-bus.c: (dbus_bus_register_client),
1036 (dbus_bus_acquire_service), (dbus_bus_service_exists):
1038 Add new convenience functions for communicating with the bus.
1040 * dbus/dbus-message.h:
1042 * dbus/dbus-protocol.h:
1045 2003-02-01 Alexander Larsson <alexl@redhat.com>
1047 * dbus/dbus-message.c (dbus_message_append_fields):
1048 Add some more doc comments.
1050 2003-02-01 Havoc Pennington <hp@pobox.com>
1052 * dbus/dbus-break-loader.c (randomly_modify_length): change
1053 a 4-byte value in the message as if it were a length
1055 * dbus/dbus-sysdeps.c (_dbus_string_save_to_file): don't set
1056 execute bit on saved files
1058 2003-02-01 Havoc Pennington <hp@pobox.com>
1060 * dbus/dbus-break-loader.c (main): new program to find messages
1061 that break the loader.
1063 * dbus/dbus-sysdeps.c (_dbus_string_append_uint): new function
1064 * dbus/dbus-sysdeps.c (_dbus_string_save_to_file): new function
1066 * dbus/dbus-string.c (_dbus_string_set_byte): new
1068 2003-01-31 Havoc Pennington <hp@pobox.com>
1070 * dbus/dbus-message.c: refactor the test code to be more general,
1071 in preparation for writing a "randomly permute test cases to
1072 try to break the loader" program.
1074 2003-01-31 Havoc Pennington <hp@pobox.com>
1076 * doc/dbus-specification.sgml: work on the specification
1078 * dbus/dbus-message.c (_dbus_message_loader_return_buffer): check
1079 the protocol version of the message.
1081 * dbus/dbus-protocol.h: drop special _REPLY names, the spec
1082 no longer specifies that.
1083 (DBUS_SERVICE_REPLY_SERVICE_EXISTS): fix flags (1/2/4/8 not
1086 * dbus/dbus-marshal.c (_dbus_marshal_get_arg_end_pos): add missing
1087 "break" for DBUS_TYPE_NIL, remove @todo
1089 2003-01-31 Havoc Pennington <hp@pobox.com>
1091 * dbus/dbus-message.c (dbus_message_set_is_error_reply): rename
1092 just set_is_error/get_is_error as this is a commonly-used
1093 function, and write docs.
1095 2003-01-31 Anders Carlsson <andersca@codefactory.se>
1097 * dbus/dbus-address.c: (dbus_address_entry_free):
1098 Free key and value lists.
1100 * dbus/dbus-internals.c: (_dbus_type_to_string):
1101 Add the types we didn't have.
1103 * dbus/dbus-marshal.c: (_dbus_marshal_get_arg_end_pos),
1104 (_dbus_marshal_validate_arg):
1107 * dbus/dbus-message.c: (dbus_message_set_sender):
1108 Remove todo about being able to set sender to NULL.
1110 (dbus_message_set_is_error_reply),
1111 (dbus_message_get_is_error_reply):
1112 * dbus/dbus-message.h:
1115 * dbus/dbus-protocol.h:
1116 Add error reply flag.
1118 * test/data/valid-messages/opposite-endian.message:
1119 Add NIL type to test.
1121 2003-01-31 Havoc Pennington <hp@pobox.com>
1123 * doc/dbus-specification.sgml: fully specify the header. Add
1124 flags and major protocol version, and change header/body len to
1127 * dbus/dbus-message-builder.c (append_saved_length): append length
1130 * dbus/dbus-message.c (dbus_message_create_header): change header
1131 length and body length to unsigned. Add the new fields from the
1133 (_dbus_message_loader_return_buffer): unsigned header/body len
1135 2003-01-30 Havoc Pennington <hp@pobox.com>
1137 * dbus/dbus-auth.c: rework to use only REJECTED, no
1140 * doc/dbus-sasl-profile.txt: drop MECHANISMS and just
1141 use REJECTED, suggested by Mark McLoughlin
1143 2003-01-30 Havoc Pennington <hp@pobox.com>
1145 * dbus/dbus-server.c (dbus_server_listen): @todo about how we need
1146 a better way to report errors here. e.g. "unix address lacks
1147 path" or something. also "no such file" when the path doesn't
1150 * dbus/dbus-address.c (dbus_address_entries_free): add @todo about
1152 (dbus_parse_address): add @todo about documenting address format,
1153 and allowing , and ; to be escaped
1155 2003-01-30 Anders Carlsson <andersca@codefactory.se>
1158 Add dbus-address.[ch]
1160 * dbus/dbus-address.c: (dbus_address_entry_free),
1161 (dbus_address_entries_free), (create_entry),
1162 (dbus_address_entry_get_method), (dbus_address_entry_get_value),
1163 (dbus_parse_address), (_dbus_address_test):
1164 * dbus/dbus-address.h:
1165 New files for dealing with address parsing.
1167 * dbus/dbus-connection.c:
1168 Document timeout functions.
1170 * dbus/dbus-message.c:
1171 Document dbus_message_new_from_message.
1173 * dbus/dbus-server-debug.c:
1176 * dbus/dbus-server.c: (dbus_server_listen):
1177 Parse address and use correct server implementation.
1179 * dbus/dbus-string.c: (_dbus_string_find_to), (_dbus_string_test):
1180 * dbus/dbus-string.h:
1181 New function with test.
1183 * dbus/dbus-test.c: (dbus_internal_symbol_do_not_use_run_tests):
1187 * dbus/dbus-transport-debug.c:
1190 * dbus/dbus-transport.c: (_dbus_transport_open):
1191 Parse address and use correct transport implementation.
1193 2003-01-30 Havoc Pennington <hp@pobox.com>
1195 * dbus/dbus-message.c: use message->byte_order instead of
1196 DBUS_COMPILER_BYTE_ORDER throughout.
1197 (dbus_message_create_header): pad header to align the
1198 start of the body of the message to 8-byte boundary
1200 * dbus/dbus-marshal.h: make all the demarshalers take const
1201 DBusString arguments.
1203 * dbus/dbus-message.c (_dbus_message_loader_return_buffer):
1204 validate message args here, so we don't have to do slow validation
1205 later, and so we catch bad messages as they are incoming. Also add
1206 better checks on header_len and body_len. Also fill in
1209 * dbus/dbus-string.c (_dbus_string_validate_utf8): new (not
1210 implemented properly)
1211 (_dbus_string_validate_nul): new function to check all-nul
1213 * dbus/dbus-marshal.c (_dbus_marshal_get_field_end_pos): rename
1214 get_arg_end_pos and remove all validation
1215 (_dbus_marshal_validate_arg): actually do validation here.
1217 2003-01-29 Havoc Pennington <hp@pobox.com>
1219 * dbus/dbus-message.c (check_message_handling): fix assertion
1220 failure on set_client_serial
1222 2003-01-28 Havoc Pennington <hp@pobox.com>
1224 * dbus/dbus-server-debug.c: Add doc section comments
1226 * dbus/dbus-transport-debug.c: add doc section comments
1228 2003-01-28 Havoc Pennington <hp@redhat.com>
1230 * dbus/dbus-string.c (_dbus_string_base64_decode): append bytes in
1231 the reverse order from how I had it
1232 (_dbus_string_base64_encode): reverse encoding order. I was
1233 basically byteswapping everything during encoding.
1235 2003-01-28 Anders Carlsson <andersca@codefactory.se>
1237 * dbus/dbus-connection-internal.h:
1238 * dbus/dbus-connection.c: (_dbus_connection_add_timeout),
1239 (_dbus_connection_remove_timeout):
1240 Add functions for adding and removing timeouts.
1242 * dbus/dbus-message.c: (dbus_message_new_from_message):
1243 Add new function that takes a message and creates an exact
1244 copy of it, but with the refcount set to 1.
1245 (check_message_handling):
1248 * dbus/dbus-server-protected.h:
1249 * dbus/dbus-server.c: (_dbus_server_init_base),
1250 (_dbus_server_finalize_base), (_dbus_server_add_timeout),
1251 (dbus_server_set_timeout_functions):
1252 (_dbus_server_remove_timeout):
1253 New functions so that a server can add and remove timeouts.
1255 (dbus_server_listen):
1256 Add commented out call to dbus_server_debug_new.
1258 * dbus/dbus-timeout.c: (_dbus_timeout_new):
1259 Actually set the handler, doh.
1261 * dbus/dbus-transport.c: (_dbus_transport_open):
1262 Add commented out call to dbus_transport_debug_client_new.
1265 Add dbus-transport-debug.[ch] and dbus-server-debug.[ch]
1267 2003-01-28 Havoc Pennington <hp@pobox.com>
1269 * dbus/dbus-message.c (check_message_handling): function to check
1270 on the loaded message, iterates over it etc.
1272 2003-01-28 Havoc Pennington <hp@pobox.com>
1274 * test/Makefile.am (dist-hook): fix make distdir
1276 * dbus/Makefile.am (TESTS_ENVIRONMENT): fix make check
1278 2003-01-27 Havoc Pennington <hp@pobox.com>
1280 * dbus/dbus-mempool.c (time_for_size): replace printf with
1283 * dbus/dbus-message-builder.c (_dbus_message_data_load): allow
1284 empty lines; fix the SAVE_LENGTH stuff to be
1285 START_LENGTH/END_LENGTH so it actually works; couple other
1288 * test/Makefile.am (dist-hook): add dist-hook for .message files
1290 * dbus/dbus-string.c (DBUS_STRING_COPY_PREAMBLE): source of a copy
1291 can be constant or locked.
1292 (_dbus_string_free): allow freeing a const string as
1295 * dbus/dbus-sysdeps.c (_dbus_concat_dir_and_file): utility
1297 * dbus/dbus-test-main.c (main): take an argument which is the
1298 directory containing test data
1300 * dbus/dbus-message.c (_dbus_message_test): pass a test_data_dir
1301 argument to this and load all the messages in test/data/
1302 checking that they can be loaded or not loaded as appropriate.
1304 2003-01-27 Anders Carlsson <andersca@codefactory.se>
1306 * bus/dispatch.c: (bus_dispatch_message_handler):
1307 Dispatch messages sent to services.
1309 * bus/driver.c: (bus_driver_send_service_deleted),
1310 (bus_driver_send_service_created), (bus_driver_send_service_lost),
1311 (bus_driver_send_service_acquired):
1312 Add helper functions for sending service related messages.
1314 (bus_driver_send_welcome_message):
1315 Send HELLO_REPLY instead of WELCOME.
1317 (bus_driver_handle_list_services):
1318 Send LIST_SERVICES_REPLY instead of SERVICES.
1320 (bus_driver_handle_own_service),
1321 (bus_driver_handle_service_exists):
1322 New message handlers.
1324 (bus_driver_handle_message):
1325 Invoke new message handlers.
1327 (bus_driver_remove_connection):
1328 Don't remove any services here since that's done automatically
1329 by bus_service_remove_owner now.
1332 New function signatures.
1334 * bus/services.c: (bus_service_add_owner):
1335 Send ServiceAcquired message if we're the only primary owner.
1337 (bus_service_remove_owner):
1338 Send ServiceAcquired/ServiceLost messages.
1340 (bus_service_set_prohibit_replacement),
1341 (bus_service_get_prohibit_replacement):
1342 Functions for setting prohibit replacement.
1344 (bus_service_has_owner):
1345 New function that checks if a connection is in the owner queue of
1349 Add new function signatures.
1351 * dbus/dbus-list.c: (_dbus_list_test):
1352 Add tests for _dbus_list_remove_last and traversing the list backwards.
1355 Fix a typo in _dbus_list_get_prev_link, if we're at the first element we can't
1356 go any further, so return NULL then.
1358 * dbus/dbus-protocol.h:
1359 Add new messages, service flags and service replies.
1361 2003-01-26 Havoc Pennington <hp@pobox.com>
1363 * dbus/dbus-message-builder.c: implement, completely untested.
1365 * test/data/*: add data to be used in testing.
1366 ".message" files are our simple loadable text format.
1367 ".message-raw" will be binary dumps of messages.
1369 * dbus/dbus-string.c (_dbus_string_starts_with_c_str): new
1371 2003-01-26 Havoc Pennington <hp@pobox.com>
1373 * dbus/dbus-sysdeps.c (_dbus_file_get_contents): new function
1375 * dbus/dbus-errors.c (dbus_result_to_string): add
1378 * dbus/dbus-message-builder.c: new file, will contain code to load
1379 up messages from files. Not implemented yet.
1381 2003-01-26 Havoc Pennington <hp@pobox.com>
1383 * dbus/dbus-message.c (dbus_message_set_sender): support deleting
1384 the sender by setting to NULL
1386 2003-01-26 Havoc Pennington <hp@pobox.com>
1388 The unit tests pass, but otherwise untested. If it breaks, the
1389 tests should have been better. ;-)
1391 * bus/driver.c (bus_driver_handle_hello): return if we disconnect
1394 * dbus/dbus-message.c: redo everything so we maintain
1395 message->header as the only copy of the various fields.
1396 This avoids the possibility of out-of-memory in some cases,
1397 for example dbus_message_lock() can't run out of memory anymore,
1398 and avoids extra copying. Figured I may as well go ahead and do
1399 this since it was busted for dbus_message_lock to not return
1400 failure on OOM, and dbus_message_write_header was totally
1401 unchecked for OOM. Also fixed some random other bugs.
1403 * dbus/dbus-marshal.c (_dbus_marshal_get_field_end_pos): verify
1404 that strings are nul-terminated. Also, end_pos can be equal
1405 to string length just not greater than, I think.
1406 (_dbus_marshal_set_int32): new function
1407 (_dbus_marshal_set_uint32): new function
1408 (_dbus_marshal_set_string): new function
1410 * dbus/dbus-connection.c (_dbus_connection_new_for_transport): fix
1411 a warning, init timeout_list to NULL
1412 (dbus_connection_send_message): don't use uninitialized variable
1415 * dbus/dbus-string.c (_dbus_string_replace_len): new function
1417 2003-01-26 Anders Carlsson <andersca@codefactory.se>
1419 * bus/driver.c: (bus_driver_handle_hello),
1420 (bus_driver_send_welcome_message):
1423 2003-01-26 Anders Carlsson <andersca@codefactory.se>
1425 * dbus/dbus-auth.c: (process_auth), (_dbus_auth_unref):
1426 * dbus/dbus-connection.c: (_dbus_connection_new_for_transport),
1427 (dbus_connection_unref):
1428 * dbus/dbus-marshal.c: (_dbus_marshal_test):
1429 * dbus/dbus-message.c: (dbus_message_unref),
1432 (dbus_message_get_fields):
1433 Remove debugging printout.
1435 (_dbus_message_loader_return_buffer):
1436 Don't store the header string.
1438 (_dbus_message_test):
1441 2003-01-26 Richard Hult <rhult@codefactory.se>
1443 * glib/dbus-gmain.c (dbus_connection_dispatch): Traverse a copy of
1444 the file descriptor list, since it can change under us.
1446 2003-01-25 Anders Carlsson <andersca@codefactory.se>
1448 * glib/dbus-gmain.c: (dbus_connection_prepare),
1449 (dbus_connection_check), (dbus_connection_dispatch), (add_watch),
1450 (remove_watch), (dbus_connection_hookup_with_g_main):
1451 Rewrite the glib handling to use its own GSource instead of a
1452 GIOChannel so we can catch messages put in the queue while waiting
1455 2003-01-25 Anders Carlsson <andersca@codefactory.se>
1458 * bus/connection.c: (connection_disconnect_handler),
1459 (connection_watch_callback), (bus_connection_setup):
1460 * bus/dispatch.c: (send_one_message),
1461 (bus_dispatch_broadcast_message), (bus_dispatch_message_handler),
1462 (bus_dispatch_add_connection), (bus_dispatch_remove_connection):
1464 * bus/driver.c: (bus_driver_send_service_deleted),
1465 (bus_driver_send_service_created), (bus_driver_handle_hello),
1466 (bus_driver_send_welcome_message),
1467 (bus_driver_handle_list_services), (bus_driver_remove_connection),
1468 (bus_driver_handle_message):
1470 Refactor code, put the message dispatching in its own file. Use
1471 _DBUS_HANDLE_OOM. Also send ServiceDeleted messages when a client
1474 2003-01-25 Anders Carlsson <andersca@codefactory.se>
1476 * dbus/dbus-internals.h:
1477 Add _DBUS_HANDLE_OOM macro, it doesn't do anything currently.
1479 * dbus/dbus-message.c: (dbus_message_get_sender):
1480 * dbus/dbus-message.h:
1481 Implement dbus_message_get_sender.
1483 * dbus/dbus-protocol.h:
1484 Add message and service defines.
1486 2003-01-25 Anders Carlsson <andersca@codefactory.se>
1488 * dbus/dbus-connection.c: (dbus_connection_send_message):
1489 * dbus/dbus-message-internal.h:
1490 * dbus/dbus-message.c: (_dbus_message_get_client_serial),
1491 (dbus_message_write_header):
1492 Remove _dbus_messag_unlock and don't set the client serial on a
1493 message if one already exists.
1495 2003-01-24 Havoc Pennington <hp@pobox.com>
1497 * dbus/dbus-list.c (alloc_link): put a thread lock on the global
1500 * bus/driver.c (bus_driver_handle_list_services): fix a leak
1503 2003-01-25 Anders Carlsson <andersca@codefactory.se>
1505 * dbus/dbus-list.c: (alloc_link), (free_link):
1506 Use a memory pool for the links.
1508 2003-01-25 Anders Carlsson <andersca@codefactory.se>
1510 * bus/connection.c: (bus_connection_foreach):
1512 Add new bus_connection_foreach function.
1514 * bus/driver.c: (send_one_message), (bus_driver_broadcast_message):
1515 Add function that broadcasts a message to all clients.
1517 (bus_driver_send_service_created), (bus_driver_handle_hello),
1518 (bus_driver_send_welcome_message),
1519 (bus_driver_handle_list_services), (bus_driver_message_handler):
1520 Implement functions that take care of listing services, and notifying
1521 clients when new services are created.
1523 * bus/services.c: (bus_services_list):
1525 Add new function that returns an array of strings with the currently
1526 registered services.
1529 * glib/dbus-gmain.c:
1530 Update copyright year.
1532 2003-01-25 Anders Carlsson <andersca@codefactory.se>
1534 * dbus/dbus-connection.c: (dbus_connection_send_message):
1535 Unlock the message in case it was sent earlier.
1537 (dbus_connection_send_message_with_reply_and_block):
1538 Remove the reply message from the list.
1540 * dbus/dbus-marshal.c: (_dbus_demarshal_string_array):
1541 Set array_len and new_pos correctly.
1543 (_dbus_marshal_test):
1544 Remove debug output.
1546 * dbus/dbus-message-internal.h:
1547 * dbus/dbus-message.c: (_dbus_message_get_reply_serial):
1548 New function that returns the reply serial.
1550 (_dbus_message_unlock):
1551 New function that unlocks a message and resets its header.
1553 (dbus_message_append_string_array),
1554 (dbus_message_get_fields_valist),
1555 (dbus_message_iter_get_field_type),
1556 (dbus_message_iter_get_string_array),
1557 (dbus_message_get_fields),
1558 (dbus_message_append_fields_valist):
1559 Handle string arrays.
1561 (dbus_message_set_sender):
1562 Make this function public since the bus daemon needs it.
1564 (decode_header_data):
1565 Set the reply serial to -1 initially.
1567 * dbus/dbus-message.h:
1568 Add dbus_message_set_sender.
1570 2003-01-24 Havoc Pennington <hp@pobox.com>
1572 * doc/dbus-specification.sgml: add some stuff
1574 2003-01-22 Havoc Pennington <hp@pobox.com>
1576 * doc/dbus-specification.sgml: Start to document the protocol.
1578 2003-01-22 Havoc Pennington <hp@pobox.com>
1580 * dbus/dbus-connection.c
1581 (dbus_connection_send_message_with_reply_and_block): add some @todo
1583 * bus/driver.c (bus_driver_add_connection): add a FIXME about memleak
1585 2003-01-21 Havoc Pennington <hp@pobox.com>
1587 (patch untested because can't compile)
1589 * bus/driver.c (create_unique_client_name): make this function
1590 never recycle client names. Also, caller should initialize
1593 * dbus/dbus-sysdeps.c (_dbus_get_current_time): new function
1595 2003-01-21 Anders Carlsson <andersca@codefactory.se>
1597 * dbus/dbus-marshal.c: (_dbus_marshal_double),
1598 (_dbus_marshal_int32), (_dbus_marshal_uint32),
1599 (_dbus_marshal_int32_array), (_dbus_marshal_uint32_array),
1600 (_dbus_marshal_double_array), (_dbus_marshal_string_array),
1601 (_dbus_demarshal_int32_array), (_dbus_demarshal_uint32_array),
1602 (_dbus_demarshal_double_array), (_dbus_demarshal_string_array),
1603 (_dbus_marshal_get_field_end_pos), (_dbus_marshal_test):
1604 * dbus/dbus-marshal.h:
1605 * dbus/dbus-protocol.h:
1606 Add support for marshalling and demarshalling integer, double
1609 2003-01-21 Anders Carlsson <andersca@codefactory.se>
1614 * bus/connection.c: (connection_disconnect_handler):
1615 Remove the connection from the bus driver's list.
1617 (connection_watch_callback): Dispatch messages.
1619 (free_connection_data): Free connection name.
1621 (bus_connection_setup): Add connection to the bus driver's list.
1622 (bus_connection_remove_owned_service):
1623 (bus_connection_set_name), (bus_connection_get_name):
1624 Add functions for setting and getting the connection's name.
1627 Add function headers.
1629 * bus/driver.c: (create_unique_client_name),
1630 (bus_driver_handle_hello_message),
1631 (bus_driver_send_welcome_message), (bus_driver_message_handler),
1632 (bus_driver_add_connection), (bus_driver_remove_connection):
1635 * bus/services.c: (bus_service_free):
1637 New file that handles communication and registreation with the bus
1640 2003-01-21 Anders Carlsson <andersca@codefactory.se>
1642 * dbus/dbus-connection.c: (dbus_connection_send_message):
1643 Add a new client_serial parameter.
1645 (dbus_connection_send_message_with_reply):
1646 Remove a @todo since we've implemented the blocking function.
1648 (dbus_connection_send_message_with_reply_and_block):
1649 New function that sends a message and waits for a reply and
1650 then returns the reply.
1652 * dbus/dbus-connection.h:
1655 * dbus/dbus-errors.c: (dbus_result_to_string):
1656 * dbus/dbus-errors.h:
1657 Add new DBUS_RESULT.
1659 * dbus/dbus-message-internal.h:
1660 * dbus/dbus-message.c: (_dbus_message_get_reply_serial),
1661 (_dbus_message_set_sender), (dbus_message_write_header),
1662 (dbus_message_new_reply), (decode_header_data),
1663 (_dbus_message_loader_return_buffer), (_dbus_message_test):
1664 * dbus/dbus-message.h:
1665 Add new functions that set the reply serial and sender.
1666 Also marshal and demarshal them correctly and add test.
1668 * dbus/dbus-protocol.h:
1669 Add new DBUS_MESSAGE_TYPE_SENDER.
1672 * glib/dbus-gmain.c: (watch_callback), (free_callback_data),
1673 (add_watch), (remove_watch), (add_timeout), (remove_timeout),
1674 (dbus_connection_hookup_with_g_main):
1675 * glib/test-dbus-glib.c: (main):
1676 Rewrite to use GIOChannel and remove the GSource crack.
1678 * test/echo-client.c: (main):
1679 * test/watch.c: (check_messages):
1680 Update for changed APIs
1682 2003-01-19 Anders Carlsson <andersca@codefactory.se>
1684 * dbus/Makefile.am: Add dbus-timeout.[cħ]
1686 * dbus/dbus-connection.c: (_dbus_connection_new_for_transport):
1687 Create a DBusTimeoutList.
1688 (dbus_connection_set_timeout_functions): Add new function to
1689 set timeout callbacks
1691 * dbus/dbus-connection.h: Add public DBusTimeout API.
1693 * dbus/dbus-message.c: (dbus_message_get_service):
1694 * dbus/dbus-message.h: New function.
1696 * dbus/dbus-server.c: Fix small doc typo.
1698 * dbus/dbus-timeout.[ch]: New files for mainloop timeouts.
1700 2003-01-19 Anders Carlsson <andersca@codefactory.se>
1702 * dbus/dbus-string.c (_dbus_string_move_len): Don't delete all
1703 of the string, just as long as specified.
1705 2003-01-19 Havoc Pennington <hp@pobox.com>
1707 * dbus/dbus-connection.c (dbus_connection_get_is_authenticated):
1710 * dbus/dbus-server.c (dbus_server_set_max_connections)
1711 (dbus_server_get_max_connections, dbus_server_get_n_connections):
1712 keep track of current number of connections, and add API for
1713 setting a max (but haven't implemented enforcing the max yet)
1715 2003-01-18 Havoc Pennington <hp@pobox.com>
1717 * dbus/dbus-transport-unix.c (unix_do_iteration): only do the
1718 reading/writing if read_watch != NULL or write_watch != NULL.
1720 * dbus/dbus-message.c (_dbus_message_loader_return_buffer): fix
1721 the message loader code to actually load message->header and
1722 message->body into the newly-created message.
1724 * dbus/dbus-transport-unix.c (check_write_watch): fix a mem leak
1727 * dbus/dbus-connection.c (dbus_connection_set_max_message_size)
1728 (dbus_connection_get_max_message_size)
1729 (dbus_connection_set_max_live_messages_size)
1730 (dbus_connection_get_max_live_messages_size): implement some
1731 resource limitation functions
1733 * dbus/dbus-resources.c: new file implementing some of the
1734 resource limits stuff
1736 * dbus/dbus-message.c (dbus_message_iter_get_byte_array): add
1737 missing docs, add @todo to handle OOM etc.
1739 * dbus/dbus-marshal.c (_dbus_demarshal_byte_array): add missing
1742 2003-01-18 Havoc Pennington <hp@pobox.com>
1744 * dbus/dbus-connection.c (dbus_connection_unref): disconnect the
1745 connection if it hasn't been already.
1747 * dbus/dbus-connection.h: kill off the idea of an ErrorFunction,
1748 replace with DisconnectFunction.
1750 2003-01-18 Havoc Pennington <hp@pobox.com>
1752 Building --disable-verbose-mode --disable-asserts --disable-tests
1753 cuts the library from 112K to 45K or so
1755 * configure.in: check for varargs macro support,
1756 add --enable-verbose-mode, --enable-asserts.
1758 * dbus/dbus-internals.h (_dbus_assert): support
1760 (_dbus_verbose): support DBUS_ENABLE_VERBOSE_MODE
1762 2003-01-18 Havoc Pennington <hp@pobox.com>
1764 * dbus/dbus-test.c: include config.h so that tests actually run
1766 * dbus/dbus-string.c: add assertions that stuff is 8-byte aligned,
1767 so the failure mode when that assumption fails will be plenty
1770 2003-01-18 Havoc Pennington <hp@pobox.com>
1772 * configure.in: default --enable-tests to $USE_MAINTAINER_MODE
1774 * dbus/Makefile.am: fix it up so dubs-test-main.c is included in
1777 * test/Makefile.am: don't use special variable "TESTS" for echo-*
1778 since we don't want to use those in make check
1780 2003-01-15 Havoc Pennington <hp@redhat.com>
1786 2003-01-15 Havoc Pennington <hp@redhat.com>
1788 * test/Makefile.am: fix so that test source code ends up in the
1789 distribution on make distcheck
1791 2003-01-15 Havoc Pennington <hp@redhat.com>
1797 2003-01-15 Havoc Pennington <hp@redhat.com>
1799 * dbus/dbus-test.c (dbus_internal_symbol_do_not_use_run_tests):
1800 fix build when --disable-tests
1802 * Makefile.am (EXTRA_DIST): put HACKING in here
1804 * HACKING: document procedure for making a tarball release.
1806 2003-01-14 Anders Carlsson <andersca@codefactory.se>
1808 * bus/connection.c: (connection_error_handler),
1809 (bus_connection_setup):
1810 * bus/main.c: (main):
1811 Make sure that the DBusConnectionData struct is NULLed
1812 out to prevent a segfault.
1814 * dbus/dbus-errors.c: (dbus_result_to_string):
1815 * dbus/dbus-errors.h:
1816 * dbus/dbus-message.c: (dbus_message_get_fields),
1817 (dbus_message_get_fields_valist), (_dbus_message_test):
1818 * dbus/dbus-message.h:
1819 Make dbus_message_get_fields return a result code so we can
1820 track invalid fields as well as oom.
1822 2003-01-11 Havoc Pennington <hp@pobox.com>
1824 * configure.in: change --enable-test/--enable-ansi action-if-given
1825 to enable_foo=$enableval instead of enable_foo=yes
1827 2003-01-08 Havoc Pennington <hp@pobox.com>
1829 * dbus/dbus-string.c (_dbus_string_align_length): new function
1831 * dbus/dbus-test-main.c: move main() for test app here
1833 (dbus_internal_symbol_do_not_use_run_tests): we have to export a
1834 symbol to run tests, because dbus-test isn't in the main
1837 Code review nitpicks.
1839 * dbus/dbus-message.c (dbus_message_write_header): add newlines
1840 for people with narrow emacs ;-). Assert client_serial was filled
1841 in. Assert message->name != NULL.
1842 (dbus_message_append_fields): have "first_field_type" arg separate
1843 from va list, needed for C++ binding that also uses varargs IIRC
1844 and helps with type safety
1845 (dbus_message_new): add @todo about using DBusString to store
1846 service/name internally
1847 (dbus_message_new): don't leak ->service and ->name on OOM later
1849 (dbus_message_unref): free the service name
1850 (dbus_message_get_fields): same change to varargs
1851 i.e. first_field_type
1852 (_dbus_message_loader_return_buffer): assert that the message data
1853 is aligned (if not it's a bug in our code). Put in verbose griping
1854 about why we set corrupted = TRUE.
1855 (decode_header_data): add FIXME that char* is evil. Was going to
1856 add FIXME about evil locale-specific string.h strncmp, but just
1857 switched to wacky string-as-uint32 optimization. Move check for
1858 "no room for field name" above get_const_data_len() to avoid
1859 assertion failure in get_const_data_len if we have trailing 2
1860 bytes or the like. Check for service and name fields being
1861 provided twice. Don't leak service/name on error. Require field
1862 names to be aligned to 4 bytes.
1864 * dbus/dbus-marshal.c: move byte swap stuff to header
1865 (_dbus_pack_int32): uscore-prefix
1866 (_dbus_unpack_int32): uscore-prefix
1867 (_dbus_unpack_uint32): export
1868 (_dbus_demarshal_string): add @todo complaining about use of
1870 (_dbus_marshal_get_field_end_pos): add @todo about bad error
1871 handling allowing corrupt data to go unchecked
1873 2003-01-08 Havoc Pennington <hp@redhat.com>
1875 * dbus/dbus-transport-unix.c (unix_do_iteration): add read/write
1876 to the select() as needed for authentication. (should be using
1877 _dbus_poll() not select, but for another day)
1879 * dbus/dbus.h: include dbus/dbus-protocol.h
1881 2003-01-08 Anders Carlsson <andersca@codefactory.se>
1883 * dbus/Makefile.am (dbusinclude_HEADERS): Install
1886 2003-01-08 Anders Carlsson <andersca@codefactory.se>
1888 * dbus/dbus-internals.c: (_dbus_type_to_string):
1889 New function that returns a string describing a type.
1891 * dbus/dbus-marshal.c: (_dbus_demarshal_byte_array):
1892 * dbus/dbus-marshal.h:
1893 * dbus/dbus-message.c: (dbus_message_get_fields_valist),
1894 (dbus_message_iter_get_field_type), (dbus_message_iter_get_double),
1895 (dbus_message_iter_get_byte_array):
1896 * dbus/dbus-message.h:
1897 Add new convenience functions for appending and getting message fields.
1898 Also add demarshalling routines for byte arrays.
1900 2003-01-07 Anders Carlsson <andersca@codefactory.se>
1902 * dbus/dbus-connection-internal.h:
1903 * dbus/dbus-connection.c: (_dbus_connection_new_for_transport),
1904 (_dbus_connection_get_next_client_serial),
1905 (dbus_connection_send_message):
1906 * dbus/dbus-internals.h:
1907 * dbus/dbus-marshal.c: (unpack_uint32), (dbus_unpack_int32),
1908 (dbus_pack_int32), (_dbus_marshal_double), (_dbus_marshal_int32),
1909 (_dbus_marshal_uint32), (_dbus_demarshal_double),
1910 (_dbus_demarshal_int32), (_dbus_demarshal_uint32),
1911 (_dbus_demarshal_string), (_dbus_marshal_get_field_end_pos),
1912 (_dbus_verbose_bytes), (_dbus_marshal_test):
1913 * dbus/dbus-marshal.h:
1914 * dbus/dbus-message-internal.h:
1915 * dbus/dbus-message.c: (_dbus_message_set_client_serial),
1916 (dbus_message_write_header), (_dbus_message_lock),
1917 (dbus_message_new), (dbus_message_ref), (dbus_message_unref),
1918 (dbus_message_get_name), (dbus_message_append_int32),
1919 (dbus_message_append_uint32), (dbus_message_append_double),
1920 (dbus_message_append_string), (dbus_message_append_byte_array),
1921 (dbus_message_get_fields_iter), (dbus_message_iter_ref),
1922 (dbus_message_iter_unref), (dbus_message_iter_has_next),
1923 (dbus_message_iter_next), (dbus_message_iter_get_field_type),
1924 (dbus_message_iter_get_string), (dbus_message_iter_get_int32),
1925 (dbus_message_iter_get_uint32), (dbus_message_iter_get_double),
1926 (decode_header_data), (_dbus_message_loader_return_buffer),
1927 (message_iter_test), (_dbus_message_test):
1928 * dbus/dbus-message.h:
1929 * dbus/dbus-protocol.h:
1930 * dbus/dbus-test.c: (main):
1932 * glib/test-dbus-glib.c: (message_handler), (main):
1933 * test/echo-client.c: (main):
1934 * test/watch.c: (check_messages):
1935 Make messages sendable and receivable for real.
1937 2003-01-07 Anders Carlsson <andersca@codefactory.se>
1939 * dbus/dbus-marshal.c: (_dbus_marshal_double),
1940 (_dbus_marshal_string), (_dbus_marshal_byte_array):
1941 * dbus/dbus-message.c: (dbus_message_append_int32),
1942 (dbus_message_append_uint32), (dbus_message_append_double),
1943 (dbus_message_append_string), (dbus_message_append_byte_array):
1944 Handle OOM restoration.
1946 2003-01-07 Anders Carlsson <andersca@codefactory.se>
1948 * dbus/dbus-marshal.c: (_dbus_marshal_string),
1949 (_dbus_demarshal_string), (_dbus_marshal_test):
1950 * dbus/dbus-marshal.h:
1951 * dbus/dbus-message.c: (dbus_message_get_name),
1952 Document these functions.
1954 (dbus_message_append_int32), (dbus_message_append_uint32),
1955 (dbus_message_append_double), (dbus_message_append_string),
1956 (dbus_message_append_byte_array):
1957 * dbus/dbus-message.h:
1958 Add functions for adding message fields of different types.
1960 * dbus/dbus-protocol.h:
1961 Add the different types.
1963 2003-01-05 Havoc Pennington <hp@pobox.com>
1965 * bus/connection.c: implement routines for handling connections,
1966 first thing is keeping a list of owned services on each connection
1967 and setting up watches etc.
1969 * bus/services.c: implement a mapping from service names to lists
1972 * dbus/dbus-hash.c: add DBUS_HASH_POINTER
1974 * dbus/dbus-threads.c (dbus_static_mutex_lock): add functions
1975 to use static mutexes for global data
1977 * dbus/dbus-connection.c (dbus_connection_set_data): add new
1978 collection of functions to set/get application-specific data
1979 on the DBusConnection.
1981 2003-01-04 Havoc Pennington <hp@pobox.com>
1983 * dbus/dbus-sysdeps.c (_dbus_sleep_milliseconds): new function
1984 (_dbus_poll): new function
1986 * dbus/dbus-internals.h (_DBUS_STRUCT_OFFSET): new macro
1989 * bus/loop.c: initial code for the daemon main loop
1991 2003-01-04 Havoc Pennington <hp@pobox.com>
1993 * test/watch.c (error_handler): make it safe if the error handler
1994 is called multiple times (if we s/error handler/disconnect
1995 handler/ we should just guarantee it's called only once)
1997 * dbus/dbus-transport.c (_dbus_transport_disconnect): call the
1998 error handler on disconnect (it's quite possible we should
1999 just change the error handler to a "disconnect handler," I'm
2000 not sure we have any other meaningful errors)
2002 * configure.in: check for getpwnam_r
2004 * dbus/dbus-transport.c, dbus/dbus-transport-unix.c,
2005 dbus/dbus-auth.c: add credentials support, add EXTERNAL auth
2006 mechanism as in SASL spec, using socket credentials
2008 * dbus/dbus-sysdeps.c (_dbus_read_credentials_unix_socket): new function
2009 (_dbus_send_credentials_unix_socket): new function
2011 * dbus/dbus-sysdeps.c (_dbus_accept_unix_socket): rename just
2013 (_dbus_write): only check errno if <0 returned
2014 (_dbus_write_two): ditto
2016 2003-01-02 Anders Carlsson <andersca@codefactory.se>
2018 * dbus/dbus-marshal.c: (_dbus_marshal_utf8_string),
2019 (_dbus_marshal_byte_array), (_dbus_demarshal_utf8_string),
2020 (_dbus_marshal_test):
2021 * dbus/dbus-marshal.h:
2022 Add _dbus_marshal_byte_array and rename _dbus_marshal_string
2023 to _dbus_marshal_utf8_string. Also fix some tests.
2025 2002-12-28 Harri Porten <porten@kde.org>
2027 * configure.in: added check for C++ compiler and a very cheesy
2028 check for the Qt integration
2030 * Makefile.am (SUBDIRS): compile qt subdir if support is enabled
2032 * qt/Makefile.am: added
2034 * qt/.cvsignore: added
2036 * qt/dbus-qthread.cc, qt/dbus-qthread.cpp: renamed former to
2037 latter, added #ifdef QT_THREAD_SUPPORT guard.
2039 * dbus/Makefile.am: added missing headers for make dist
2041 2002-12-28 Kristian Rietveld <kris@gtk.org>
2043 * dbus/Makefile.am: fixup export-symbols-regex.
2045 2002-12-27 Anders Carlsson <andersca@codefactory.se>
2047 * acinclude.m4: Add this file and put the
2048 PKG_CHECK_MODULE macro in it.
2050 2002-12-27 Anders Carlsson <andersca@codefactory.se>
2052 * dbus/dbus-marshal.c: (_dbus_marshal_string),
2053 (_dbus_demarshal_double), (_dbus_demarshal_int32),
2054 (_dbus_demarshal_uint32), (_dbus_demarshal_string),
2055 (_dbus_marshal_test):
2056 Make the demarshalling routines align the pos argument.
2057 Add string marshalling tests and fix the obvious bugs
2060 2002-12-26 Havoc Pennington <hp@pobox.com>
2062 * dbus/dbus-auth.c: fixes fixes fixes
2064 * dbus/dbus-transport-unix.c: wire up support for
2065 encoding/decoding data on the wire
2067 * dbus/dbus-auth.c (_dbus_auth_encode_data)
2068 (_dbus_auth_decode_data): append to target string
2069 instead of nuking it.
2071 2002-12-26 Havoc Pennington <hp@pobox.com>
2073 * dbus/dbus-marshal.h (DBUS_COMPILER_BYTE_ORDER): #ifdef
2074 WORDS_BIGENDIAN then compiler byte order is DBUS_BIG_ENDIAN,
2077 * dbus/dbus-marshal.c: Add macros to do int swapping in-place and
2078 avoid swap_bytes() overhead (ignoring possible assembly stuff for
2079 now). Main point is because I wanted unpack_uint32 to implement
2081 (_dbus_verbose_bytes): new function
2083 * dbus/dbus-string.c (_dbus_string_validate_ascii): new function
2085 * dbus/dbus-message.c (_dbus_message_loader_get_is_corrupted): add
2086 mechanism to handle a corrupt message stream
2087 (_dbus_message_loader_new): fix preallocation to only prealloc,
2090 * dbus/dbus-string.c (_dbus_string_skip_blank): fix this function
2091 (_dbus_string_test): enhance tests for copy/move and fix the
2094 * dbus/dbus-transport-unix.c: Hold references in more places to
2095 avoid reentrancy problems
2097 * dbus/dbus-transport.c: ditto
2099 * dbus/dbus-connection.c (dbus_connection_dispatch_message): don't
2100 leak reference count in no-message case
2102 * test/watch.c (do_mainloop): handle adding/removing watches
2103 during iteration over the watches. Also, ref the connection/server
2104 stored on a watch, so we don't try to mangle a destroyed one.
2106 * dbus/dbus-transport-unix.c (do_authentication): perform
2109 * dbus/dbus-auth.c (get_state): add a state
2110 AUTHENTICATED_WITH_UNUSED_BYTES and return it if required
2111 (_dbus_auth_get_unused_bytes): append the unused bytes
2112 to the passed in string, rather than prepend
2114 * dbus/dbus-transport.c (_dbus_transport_init_base): create
2115 the auth conversation DBusAuth
2117 * dbus/dbus-transport-unix.c (_dbus_transport_new_for_fd)
2118 (_dbus_transport_new_for_domain_socket): when creating a
2119 transport, pass in whether it's a client-side or server-side
2120 transport so we know which DBusAuth to create
2122 2002-12-03 Havoc Pennington <hp@pobox.com>
2124 * dbus/dbus-transport-unix.c (unix_finalize): finalize base
2125 _after_ finalizing the derived members
2126 (unix_connection_set): unref watch if we fail to add it
2128 * dbus/dbus-connection.c (dbus_connection_unref): delete the
2129 transport first, so that the connection owned by the
2130 transport will be valid as the transport finalizes.
2132 * dbus/dbus-transport-unix.c (unix_finalize): free the write_watch
2133 if necessary, and remove watches from the connection.
2135 * dbus/dbus-watch.c (_dbus_watch_list_free): improve a comment
2137 2002-12-26 Anders Carlsson <andersca@codefactory.se>
2139 * dbus/dbus-marshal.c: (_dbus_marshal_string),
2140 (_dbus_demarshal_double), (_dbus_demarshal_int32),
2141 (_dbus_demarshal_uint32), (_dbus_demarshal_string),
2142 (_dbus_marshal_test):
2143 * dbus/dbus-marshal.h:
2144 Add string marshal functions and have the demarshal functions
2145 return the new position.
2147 2002-12-25 Havoc Pennington <hp@pobox.com>
2149 * doc/dbus-sasl-profile.txt: docs on the authentication protocol,
2150 it is a simple protocol that just maps directly to SASL.
2152 * dbus/dbus-auth.h, dbus/dbus-auth.c: authentication protocol
2153 initial implementation, not actually used yet.
2155 * dbus/dbus-string.c (_dbus_string_find): new function
2156 (_dbus_string_equal): new function
2157 (_dbus_string_base64_encode): new function
2158 (_dbus_string_base64_decode): new function
2160 2002-12-25 Anders Carlsson <andersca@codefactory.se>
2163 * dbus/dbus-marshal.c: (swap_bytes), (_dbus_marshal_double),
2164 (_dbus_marshal_int32), (_dbus_marshal_uint32),
2165 (_dbus_demarshal_double), (_dbus_demarshal_int32),
2166 (_dbus_demarshal_uint32), (_dbus_marshal_test):
2167 * dbus/dbus-marshal.h:
2168 * dbus/dbus-protocol.h:
2169 * dbus/dbus-test.c: (main):
2171 Add un-optimized marshalling/demarshalling routines.
2173 2002-12-25 Harri Porten <porten@kde.org>
2175 * qt/dbus-qt.h: adjusted ctor and getter to KDE/Qt conventions
2177 2002-12-24 Zack Rusin <zack@kde.org>
2179 * qt/dbus-qthread.cc: adding - integrates QMutex into Dbus
2180 * qt/dbus-qt.h: skeleton with two sample implemenatation of the
2183 2002-12-24 Havoc Pennington <hp@pobox.com>
2185 * glib/dbus-gthread.c: fix include
2187 * glib/dbus-glib.h: rename DBusMessageHandler for now.
2188 I think glib API needs to change, though, as you don't
2189 want to use DBusMessageFunction, you want to use the
2190 DBusMessageHandler object. Probably
2191 dbus_connection_open_with_g_main_loop()
2192 and dbus_connection_setup_g_main_loop() or something like that
2193 (but think of better names...) that just create a connection
2194 that has watch/timeout functions etc. already set up.
2196 * dbus/dbus-connection.c
2197 (dbus_connection_send_message_with_reply): new function just to
2198 show how the message handler helps us deal with replies.
2200 * dbus/dbus-list.c (_dbus_list_remove_last): new function
2202 * dbus/dbus-string.c (_dbus_string_test): free a string that
2205 * dbus/dbus-hash.c: use memory pools for the hash entries
2206 (rebuild_table): be more paranoid about overflow, and
2207 shrink table when we can
2208 (_dbus_hash_test): reduce number of sprintfs and write
2209 valid C89. Add tests for case where we grow and then
2210 shrink the hash table.
2212 * dbus/dbus-mempool.h, dbus/dbus-mempool.c: memory pools
2214 * dbus/dbus-connection.c (dbus_connection_register_handler)
2215 (dbus_connection_unregister_handler): new functions
2217 * dbus/dbus-message.c (dbus_message_get_name): new
2219 * dbus/dbus-list.c: fix docs typo
2221 * dbus/dbus-message-handler.h, dbus/dbus-message-handler.c:
2222 an object representing a handler for messages.
2224 2002-12-16 Anders Carlsson <andersca@codefactory.se>
2227 * glib/dbus-gthread.c: (dbus_gthread_init):
2228 Don't use the gdbus prefix for public functions.
2230 2002-12-16 Anders Carlsson <andersca@codefactory.se>
2234 Add GLib checks and fixup .pc files
2238 * glib/dbus-gmain.c: (gdbus_connection_prepare),
2239 (gdbus_connection_check), (gdbus_connection_dispatch),
2240 (gdbus_add_connection_watch), (gdbus_remove_connection_watch),
2241 (dbus_connection_gsource_new):
2242 * glib/dbus-gthread.c: (dbus_gmutex_new), (dbus_gmutex_free),
2243 (dbus_gmutex_lock), (dbus_gmutex_unlock), (dbus_gthread_init):
2244 * glib/test-dbus-glib.c: (message_handler), (main):
2247 2002-12-15 Harri Porten <porten@kde.org>
2249 * autogen.sh: check for libtoolize before attempting to use it
2251 * dbus/dbus-transport-unix.c: include <sys/time.h> for timeval
2254 * .cvsignore: ignore more stamp files
2256 * dbus/dbus-watch.c (_dbus_watch_list_new): fixed doc error
2258 * test/Makefile.am: added -I$(top_srcdir) to be able to compile
2259 without make install.
2261 2002-12-15 Havoc Pennington <hp@pobox.com>
2263 * dbus/dbus-threads.c: add thread stubs that a higher library
2264 layer can fill in. e.g. the GLib wrapper might fill them in with
2265 GThread stuff. We still need to use this thread API to
2266 thread-safe-ize the library.
2268 2002-12-12 Havoc Pennington <hp@pobox.com>
2270 * dbus/dbus-transport-unix.c, dbus/dbus-server-unix.c: use the
2271 below new interfaces and include fewer system headers.
2273 * dbus/dbus-sysdeps.c (_dbus_read): new function
2274 (_dbus_write): new function
2275 (_dbus_write_two): new function
2276 (_dbus_connect_unix_socket): new function
2277 (_dbus_listen_unix_socket): new function
2279 * dbus/dbus-message-internal.h: change interfaces to use
2282 2002-12-11 Havoc Pennington <hp@pobox.com>
2284 * dbus/dbus-types.h: add dbus_unichar
2286 * dbus/dbus-internals.c (_dbus_verbose): use _dbus_getenv
2288 * dbus/dbus-connection.c (dbus_connection_send_message): return
2291 * dbus/dbus-transport.c: include dbus-watch.h
2293 * dbus/dbus-connection.c: include dbus-message-internal.h
2295 * HACKING: add file with coding guidelines stuff.
2297 * dbus/dbus-string.h, dbus/dbus-string.c: Encapsulate all string
2298 handling here, for security purposes (as in vsftpd). Not actually
2299 using this class yet.
2301 * dbus/dbus-sysdeps.h, dbus/dbus-sysdeps.c: Encapsulate all
2302 system/libc usage here, as in vsftpd, for ease of auditing (and
2303 should also simplify portability). Haven't actually moved all the
2304 system/libc usage into here yet.
2306 2002-11-25 Havoc Pennington <hp@pobox.com>
2308 * dbus/dbus-internals.c (_dbus_verbose): fix to not
2309 always print the first verbose message.
2311 2002-11-24 Havoc Pennington <hp@pobox.com>
2313 * test/echo-client.c, test/echo-server.c: cheesy test
2316 * configure.in (AC_CHECK_FUNCS): check for writev
2318 * dbus/dbus-message.c (_dbus_message_get_network_data): new
2321 * dbus/dbus-list.c (_dbus_list_foreach): new function
2323 * dbus/dbus-internals.c (_dbus_verbose): new function
2325 * dbus/dbus-server.c, dbus/dbus-server.h: public object
2326 representing a server that listens for connections.
2328 * dbus/.cvsignore: create
2330 * dbus/dbus-errors.h, dbus/dbus-errors.c:
2331 public API for reporting errors
2333 * dbus/dbus-connection.h, dbus/dbus-connection.c:
2334 public object representing a connection that
2335 sends/receives messages. (Same object used for
2336 both client and server.)
2338 * dbus/dbus-transport.h, dbus/dbus-transport.c:
2339 Basic abstraction for different kinds of stream
2340 that we might read/write messages from.
2342 2002-11-23 Havoc Pennington <hp@pobox.com>
2344 * dbus/dbus-internals.h (_DBUS_INT_MAX): add _DBUS_INT_MIN
2347 * dbus/dbus-test.c (main): add list test, and include
2348 dbus-test.h as intended
2350 * dbus/dbus-hash.c (_dbus_hash_table_remove_string)
2351 (_dbus_hash_table_remove_int): return value indicates
2352 whether the entry existed to remove
2354 * dbus/dbus-list.c: add linked list utility class,
2357 * dbus/dbus-hash.c: add TODO item about shrinking the hash bucket
2360 2002-11-23 Havoc Pennington <hp@pobox.com>
2362 * Doxyfile.in (INCLUDE_FILE_PATTERNS): expand DBUS_BEGIN_DECLS/
2363 DBUS_END_DECLS to nothing, that should fix this once and for all
2365 * Doxyfile.in (JAVADOC_AUTOBRIEF): set to YES
2367 * dbus/dbus-message.c, dbus/dbus-hash.c:
2368 add some missing @brief
2370 2002-11-23 Havoc Pennington <hp@pobox.com>
2372 * dbus/dbus-message.h: put semicolons after DEBUG_BEGIN_DECLS
2373 to avoid confusing Doxygen
2375 * dbus/dbus-hash.c: @} not }@
2377 * dbus/dbus-message.c (struct DBusMessage): split out
2380 2002-11-23 Havoc Pennington <hp@pobox.com>
2382 * configure.in: pile on more warning flags if using gcc
2384 * Doxyfile.in (EXTRACT_STATIC): set to NO, so we don't have
2385 to document static functions
2387 * configure.in: add summary to end of configure so it
2388 looks nice and attractive
2390 * dbus/dbus-hash.c: finish implementation and write unit
2393 * configure.in: add --enable-tests to enable unit tests
2395 * dbus/dbus-test.c: test program to run unit tests
2396 for all files in dbus/*, initially runs a test for
2399 * dbus/dbus-internals.h: file to hold some internal utility stuff
2401 2002-11-22 Havoc Pennington <hp@redhat.com>
2403 * dbus/dbus-hash.c: copy in Tcl hash table, not yet
2404 "ported" away from Tcl
2406 * dbus/dbus-types.h: header for types such as dbus_bool_t
2408 2002-11-22 Havoc Pennington <hp@redhat.com>
2410 * dbus/dbus.h: fixups for doc warnings
2412 * Doxyfile.in (FILE_PATTERNS): we need to scan .h to pick up
2414 (QUIET): make it quiet so we can see warnings
2416 * dbus/dbus-memory.c: teach D-BUS to allocate and free memory
2418 2002-11-22 Havoc Pennington <hp@redhat.com>
2420 * Makefile.am: include "Doxyfile" target in all-local
2422 * configure.in: generate the Doxyfile
2424 * Doxyfile.in: move Doxyfile here, so we can use
2425 configure to generate a Doxyfile with the right
2428 2002-11-22 Havoc Pennington <hp@redhat.com>
2430 * dbus/dbus-message.c: move inline docs into .c file
2432 * Doxyfile (OUTPUT_DIRECTORY): move output to doc/api
2433 so all docs are under doc/
2434 (MAN_EXTENSION): generate man pages. Use extension
2435 ".3dbus" which matches ".3qt" on my system,
2436 I guess this is OK, I don't know really.
2437 (FILE_PATTERNS): look for .c files not .h, makes sense
2440 2002-11-22 Havoc Pennington <hp@pobox.com>
2442 * Makefile.am (SUBDIRS): rename subdir "server" to "bus"
2443 because any app can be a server, and any app can be a client,
2444 the bus is a special kind of server.
2446 Thu Nov 21 23:35:31 2002 Zack Rusin <zack@kde.org>
2448 * Doxyfile : adding. Still needs Makefile rules to be generated
2449 automatically (just run "doxygen" in the toplevel dir for now to
2452 * dbus/dbus-message.h : Adding sample docs (javadoc since
2453 resembles gtk-doc a little more)
2455 * dbus/dbus.h : Adding sample docs
2457 2002-11-21 Havoc Pennington <hp@redhat.com>
2459 * dbus/Makefile.am (INCLUDES): define DBUS_COMPILATION
2460 so we can allow ourselves to include files directly,
2461 instead of having to use dbus.h
2463 * dbus/dbus.h: fill in
2465 * dbus/dbus-message.h: sketch out a sample header file.
2466 Include griping if you include it directly instead of
2469 * dbus/dbus-macros.h: new file with macros for extern "C",
2470 TRUE/FALSE, NULL, etc.
2472 * doc/file-boilerplate.c: put include guards in here
2474 2002-11-21 Havoc Pennington <hp@redhat.com>
2476 * doc/file-boilerplate.c: include both AFL and GPL boilerplate.
2478 * COPYING: include the GPL as well, and license code
2479 under both AFL and GPL.
2481 2002-11-21 Havoc Pennington <hp@redhat.com>
2483 * acconfig.h: get rid of this
2485 * autogen.sh (run_configure): add --no-configure option
2487 * configure.in: remove AC_ARG_PROGRAM to make
2488 autoconf complain less. add AC_PREREQ.
2489 add AC_DEFINE third arg.
2491 2002-11-21 Anders Carlsson <andersca@codefactory.se>
2494 Fix references so we can distcheck.
2496 2002-11-21 Havoc Pennington <hp@redhat.com>
2498 * Initial module creation