1 2003-03-04 Havoc Pennington <hp@pobox.com>
3 * test/data/auth/*: adapt to changes
5 * dbus/dbus-auth-script.c (_dbus_auth_script_run): add
6 USERID_BASE64 and change USERNAME_BASE64 to put in username not
9 * dbus/dbus-keyring.c (_dbus_keyring_validate_context): prevent
10 more stuff from being in a context name, to make the protocol
13 * dbus/dbus-errors.c (dbus_error_has_name): new function
14 (dbus_error_is_set): new function
16 * dbus/dbus-auth.c: replace DBUS_STUPID_TEST_MECH auth
17 with DBUS_COOKIE_SHA1, implement DBUS_COOKIE_SHA1
19 * dbus/dbus-connection.c (dbus_connection_flush): also read
20 messages during a flush operation
22 * dbus/Makefile.am: remove dbus-md5 since it isn't currently used.
24 2003-03-05 Anders Carlsson <andersca@codefactory.se>
26 * configure.in: Check for gethostbyname on Solaris.
28 * dbus/dbus-transport.c: (_dbus_transport_open):
29 Remove duplicate "tcp" entry.
31 * doc/dbus-specification.sgml:
34 2003-03-05 Anders Carlsson <andersca@codefactory.se>
36 * dbus/dbus-auth.c: (send_rejected), (process_test_subdir):
37 * dbus/dbus-keyring.c: (_dbus_keyring_new_homedir),
39 * dbus/dbus-md5.c: (_dbus_md5_compute):
40 * dbus/dbus-sha.c: (_dbus_sha_compute):
43 2003-03-05 Anders Carlsson <andersca@codefactory.se>
45 * README: Add some things.
47 2003-03-04 Anders Carlsson <andersca@codefactory.se>
49 * dbus/dbus-message.c (dbus_message_append_args_valist): Add a break;
50 after case DBUS_TYPE_BOOELAN.
52 2003-03-02 Havoc Pennington <hp@pobox.com>
54 * test/break-loader.c (randomly_set_extreme_ints): add test that
55 sets really huge and small integers
57 * dbus/dbus-marshal.c (_dbus_marshal_validate_arg): add check
58 that length of boolean array fits in the string, and that
59 string has room for boolean value in single-bool case.
61 * dbus/dbus-message-builder.c (_dbus_message_data_load): add
62 optional value to "ALIGN" command which is what to fill the
65 * test/data/valid-messages/no-padding.message: add regression
66 test for the message padding problem
68 2003-03-02 Havoc Pennington <hp@pobox.com>
70 * dbus/dbus-message.c (decode_header_data): fix to always init
71 message_padding, from Benjamin Dauvergne
73 2003-03-02 Havoc Pennington <hp@pobox.com>
79 2003-03-01 Joe Shaw <joe@assbarn.com>
81 * configure.in: Check for "struct cmsgcred" and try to access its
82 members for BSD-like unices.
84 * dbus/dbus-sysdeps.c (read_credentials_byte): Fold this back into
85 _dbus_read_credentials_unix_socket().
86 (_dbus_read_credentials_unix_socket): Use recvmsg() instead of
87 read() for reading the credential byte off the unix socket. Use
88 struct cmsgcred on systems that support it.
90 2003-02-27 Alexander Larsson <alexl@redhat.com>
94 Make gthreads-2.0 dependency optional. Don't build thread test if
97 2003-02-27 Havoc Pennington <hp@pobox.com>
99 * dbus/dbus-connection.c
100 (dbus_connection_send_message_with_reply_and_block): fix doh!
101 doh! doh! bug that resulted in never removing a reply from the
102 queue, no wonder we called get_reply_serial so much ;-)
104 * dbus/dbus-message.c (struct DBusMessage): cache reply serial
105 and client serial instead of demarshaling them every time
107 2003-02-27 Havoc Pennington <hp@pobox.com>
109 * dbus/dbus-marshal.c (_dbus_demarshal_int32): rewrite to be much
110 more inlined, using dbus-string-private.h, speeds things up
113 * dbus/dbus-string.c (_dbus_string_free): apply align offset
114 when freeing the string
115 (_dbus_string_steal_data): fix for align offset
116 (undo_alignment): new function
118 2003-02-26 Havoc Pennington <hp@redhat.com>
120 All kinds of audit fixes from Owen, plus initial attempt to
121 handle unaligned memory returned from malloc.
123 * dbus/dbus-string.c (_dbus_string_init): clamp max length to
124 leave room for align_offset and nul byte
125 (fixup_alignment): function to track an align_offset and
126 ensure real->str is aligned
127 (DBUS_GENERIC_STRING_PREAMBLE): len must be less than allocated,
128 to allow a nul byte plus align offset
129 (_dbus_string_lock): fix overflow issue
130 (_dbus_string_init_const_len): add assertions on sanity of len,
131 assign allocated to be ALLOCATION_PADDING larger than len
132 (set_length): fixup the overflow handling
133 (_dbus_string_get_data_len): fix overflow in assertion
134 (open_gap): detect overflow in size of gap to be opened
135 (_dbus_string_lengthen): add overflow check
136 (_dbus_string_align_length): fix overflow with _DBUS_ALIGN_VALUE
137 (_dbus_string_append): add overflow check
138 (_dbus_string_append_unichar): overflow
139 (_dbus_string_delete): fix overflow in assertion
140 (_dbus_string_copy_len): overflow in assertion
141 (_dbus_string_replace_len): overflows in assertions
142 (_dbus_string_find): change to implement in terms of
144 (_dbus_string_find_to): assorted fixage
145 (_dbus_string_equal_c_str): assert c_str != NULL,
146 fix logic so the function works
147 (_dbus_string_ends_with_c_str): fix overflow thingy
148 (_dbus_string_base64_encode): overflow fix
149 (_dbus_string_validate_ascii): overflow
150 (_dbus_string_validate_nul): overflow
152 2003-02-26 Havoc Pennington <hp@redhat.com>
154 * dbus/dbus-marshal.c (_dbus_marshal_test): fix to work with DISABLE_ASSERTS
156 2003-02-26 Alexander Larsson <alexl@redhat.com>
159 Set DBUS_GLIB_THREADS_LIBS for apps using gthread-2.0
161 * dbus/dbus-connection.c:
162 * dbus/dbus-connection.h:
163 Fix _dbus_connection_acquire_io_path and _dbus_connection_acquire_dispatch.
164 Add dbus_connection_set_wakeup_main_function and use it when queueing
165 incoming and outgoing messages.
168 * dbus/dbus-dataslot.c:
169 Threadsafe usage of DBusDataSlotAllocator
171 * dbus/dbus-message.c: (dbus_message_get_args_iter):
174 * dbus/dbus-server-unix.c:
178 Implement the new wakeup functions for glib.
181 * glib/test-thread-client.c:
182 * glib/test-thread-server.c:
183 * glib/test-thread.h:
184 Initial cut at some thread test code. Not really done yet.
186 2003-02-26 Havoc Pennington <hp@pobox.com>
188 * dbus/dbus-connection.c
189 (dbus_connection_send_message_with_reply_and_block): fix crash
190 where we ref'd the outgoing message instead of the returned reply
192 * dbus/dbus-transport-unix.c (do_authentication): check read watch
193 at the end of this function, so if we didn't need to read for
194 authentication, we reinstall it for receiving messages
196 * dbus/dbus-message.c (dbus_message_new_reply): allow replies to
197 a NULL sender for peer-to-peer case
199 * dbus/dbus-transport-unix.c (check_read_watch): handle
200 !authenticated case correctly
202 * glib/dbus-gmain.c: add support for DBusServer
204 * dbus/dbus-server.c: add data slot support
206 * glib/dbus-gmain.c (dbus_connection_setup_with_g_main): check
207 return values and handle errors
209 * dbus/dbus-dataslot.c: factor out the data slot stuff from
212 * Doxyfile.in (INPUT): add glib subdir
214 * glib/dbus-gmain.c (dbus_connection_setup_with_g_main): rename
215 setup_with_g_main instead of hookup_with_g_main; write docs
217 2003-02-24 Anders Carlsson <andersca@codefactory.se>
219 * dbus/dbus-marshal.c: (_dbus_marshal_validate_arg):
220 * dbus/dbus-message-builder.c: (_dbus_message_data_load):
221 * dbus/dbus-message.c: (dbus_message_append_boolean),
222 (dbus_message_append_boolean_array),
223 (dbus_message_get_args_valist), (_dbus_message_test):
224 * dbus/dbus-message.h:
225 * doc/dbus-specification.sgml:
226 Various fixes as pointed out by Havoc.
228 * test/data/invalid-messages/bad-boolean-array.message:
229 * test/data/invalid-messages/bad-boolean.message:
230 Add invalid boolean value test cases.
232 2003-02-24 Anders Carlsson <andersca@codefactory.se>
234 * dbus/dbus-internals.c: (_dbus_type_to_string):
235 * dbus/dbus-marshal.c: (_dbus_marshal_get_arg_end_pos),
236 (_dbus_marshal_validate_arg):
237 * dbus/dbus-message-builder.c: (_dbus_message_data_load):
238 * dbus/dbus-message.c: (dbus_message_append_args_valist),
239 (dbus_message_append_boolean), (dbus_message_append_boolean_array),
240 (dbus_message_get_args_valist), (dbus_message_iter_get_boolean),
241 (dbus_message_iter_get_int32), (dbus_message_iter_get_uint32),
242 (dbus_message_iter_get_double),
243 (dbus_message_iter_get_boolean_array), (message_iter_test):
244 * dbus/dbus-message.h:
245 * dbus/dbus-protocol.h:
246 * doc/dbus-specification.sgml:
247 * test/data/valid-messages/lots-of-arguments.message:
248 Add support for boolean and boolean array types.
250 2003-02-23 Havoc Pennington <hp@pobox.com>
252 * dbus/dbus-keyring.c: finish most of this implementation and
255 * dbus/dbus-errors.c (dbus_set_error_const, dbus_set_error): make
256 these barf if the error isn't cleared to NULL
258 * dbus/dbus-sysdeps.c (_dbus_delete_file): set error on failure
259 (_dbus_create_directory): new function
261 * dbus/dbus-errors.c (dbus_set_error): fix warning
263 * dbus/dbus-string.c (_dbus_string_hex_encode): new function
264 (_dbus_string_hex_decode): new function
265 (test_hex_roundtrip): test code
267 * dbus/dbus-sha.c (_dbus_sha_compute): use dbus_string_hex_encode
269 * dbus/dbus-md5.c (_dbus_md5_compute): use dbus_string_hex_encode
271 * dbus/dbus-sysdeps.c (_dbus_string_save_to_file): make this use
272 the save-to-temp/rename trick to atomically write the new file
273 (_dbus_string_parse_uint): new function
275 2003-02-22 Havoc Pennington <hp@pobox.com>
277 * test/Makefile.am (dist-hook): fix dist for test/data/sha-1
279 2003-02-22 Havoc Pennington <hp@pobox.com>
281 * dbus/dbus-message.c (dbus_message_iter_get_string_array):
282 (dbus_message_iter_get_byte_array): Fix up doxygen warnings
284 * dbus/dbus-sha.c: add implementation of SHA-1 algorithm
286 * dbus/test/data/sha-1: add US government test suite for SHA-1
288 2003-02-21 Anders Carlsson <andersca@codefactory.se>
290 * dbus/dbus-marshal.c: (_dbus_demarshal_string_array):
291 Make string arrays NULL-terminated.
293 * dbus/dbus-memory.c: (dbus_free_string_array):
294 * dbus/dbus-memory.h:
295 New function for freeing NULL-terminated string arrays.
297 * dbus/dbus-message-builder.c: (append_quoted_string),
298 (_dbus_message_data_load):
299 Add support for array types.
301 * dbus/dbus-message.c: (check_message_handling):
302 Add more types as test cases.
304 * dbus/dbus-sysdeps.c: (_dbus_string_parse_int),
305 (_dbus_string_parse_double):
306 Add the start offset to the end offset.
308 * test/data/valid-messages/lots-of-arguments.message:
309 New test message with lots of arguments.
311 2003-02-21 Anders Carlsson <andersca@codefactory.se>
313 * dbus/dbus-message.c: (dbus_message_append_nil),
314 (dbus_message_append_int32), (dbus_message_append_uint32),
315 (dbus_message_append_double), (dbus_message_append_string),
316 (dbus_message_append_int32_array),
317 (dbus_message_append_uint32_array),
318 (dbus_message_append_double_array),
319 (dbus_message_append_byte_array),
320 (dbus_message_append_string_array):
321 Fix all out-of-memory handling in these functions.
323 2003-02-21 Anders Carlsson <andersca@codefactory.se>
325 * dbus/dbus-message.c: (dbus_message_append_nil):
328 2003-02-21 Anders Carlsson <andersca@codefactory.se>
330 * dbus/dbus-message.c: (dbus_message_append_args_valist),
331 (dbus_message_append_nil), (dbus_message_append_int32_array),
332 (dbus_message_append_uint32_array),
333 (dbus_message_append_double_array),
334 (dbus_message_append_byte_array),
335 (dbus_message_append_string_array), (dbus_message_get_args_valist),
336 (dbus_message_iter_get_int32_array),
337 (dbus_message_iter_get_uint32_array),
338 (dbus_message_iter_get_double_array),
339 (dbus_message_iter_get_byte_array),
340 (dbus_message_iter_get_string_array):
342 * dbus/dbus-message.h:
343 Add functions for appending and getting arrays.
345 2003-02-21 Anders Carlsson <andersca@codefactory.se>
347 * dbus/dbus-mempool.c (_dbus_mem_pool_new): Make the
348 element size at least 8 bytes, fixes mempool tests on
351 2003-02-20 Alexander Larsson <alexl@redhat.com>
353 * dbus/dbus-transport-unix.c (unix_do_iteration):
354 Unlock the connection mutex during a blocking select call.
355 Add todo about how we need a way to wake up the select.
357 * dbus/dbus-connection-internal.h:
358 * dbus/dbus-connection.c:
359 Add _dbus_connection_lock and _dbus_connection_unlock.
361 2003-02-19 Havoc Pennington <hp@pobox.com>
363 * Doxyfile.in (PREDEFINED): put DOXYGEN_SHOULD_SKIP_THIS in
364 Doxyfile.in, not Doxyfile
366 * dbus/dbus-keyring.c: do some hacking on this
368 * dbus/dbus-sysdeps.c (_dbus_delete_file): new
370 * dbus/dbus-errors.c (dbus_set_error_const): do not call
372 (dbus_set_error): remove dbus_error_init, check for message ==
373 NULL *before* we sprintf into it, and add @todo about including
374 system headers in this file
376 * dbus/dbus-sysdeps.c (_dbus_create_file_exclusively): new
378 * dbus/dbus-errors.h (DBUS_ERROR_FAILED): add
380 * dbus/dbus-sysdeps.c (get_user_info): break this function out to
381 get various bits of user information based on either username
383 (_dbus_homedir_from_username): new function
385 2003-02-19 Anders Carlsson <andersca@codefactory.se>
388 Add check for nonposix getpwnam_r
390 * dbus/dbus-mempool.c: (_dbus_mem_pool_new):
391 Align the pool element size to a sizeof (void *) boundary.
393 * dbus/dbus-sysdeps.c: (_dbus_setenv), (_dbus_connect_unix_socket),
394 (_dbus_listen_unix_socket), (_dbus_credentials_from_username):
395 General Solaris fixes.
397 * test/data/valid-messages/simplest-manual.message:
398 Explicitly state that we want little-endian packing.
400 2003-02-19 Mikael Hallendal <micke@codefactory.se>
402 * dbus/dbus-server.c (dbus_server_listen): Support tcp: addresses.
404 * dbus/dbus-transport-unix.c (_dbus_transport_new_for_tcp_socket):
405 Added to create a transport connecting using a tcp/ip socket.
407 * dbus/dbus-sysdeps.c (_dbus_connect_tcp_socket): Added to connect
408 to a tcp socket at given host and port.
409 (_dbus_listen_tcp_socket): added to listen on tcp socket for given
412 * dbus/dbus-server.c (dbus_server_listen): Support tcp: addresses.
414 * dbus/dbus-server-unix.c (_dbus_server_new_for_tcp_socket):
415 Added to create a server listening on a TCP/IP socket.
417 2003-02-19 Havoc Pennington <hp@pobox.com>
419 Throughout: mop up all the Doxygen warnings and undocumented
422 * dbus/dbus-sysdeps.c (do_exec): do not use execvp, we don't want
425 * dbus/dbus-threads.c: move global mutex initializers to
426 dbus-internals.h, multiple prototypes was confusing doxygen
427 besides being kind of ugly
429 * Doxyfile (PREDEFINED): have Doxygen define
430 DOXYGEN_SHOULD_SKIP_THIS so we can exclude things from
431 docs with #ifndef DOXYGEN_SHOULD_SKIP_THIS
432 (do not abuse the feature! it's for stuff like the autogenerated
433 macros in dbus-md5.c, not just for things you don't feel like
436 2003-02-18 Havoc Pennington <hp@pobox.com>
438 * dbus/dbus-string.c (_dbus_string_zero): new function
440 * dbus/dbus-md5.c: include MD5 implementation by L. Peter Deutsch,
441 wrap it in some dbus-friendly API
443 * dbus/dbus-types.h: add 16-bit types
445 2003-02-18 Joe Shaw <joe@assbarn.com>
447 * dbus/dbus-auth.c (handle_server_data_stupid_test_mech): Just get
448 credentials from our currently running process.
449 (get_word): Fix a buglet where we were copying the entire length
450 instead of relative to our position.
452 * dbus/dbus-hash.c (_dbus_hash_test): Don't try to allocate the
453 keys on the stack... it's 640k of data.
455 * dbus/dbus-sysdeps.c (_dbus_read_credentials_unix_socket): Always
456 read the credentials byte off the socket, even if we don't have
458 (_dbus_poll): Implement poll() using select() for systems which
461 * glib/test-dbus-glib.c (main): Print out an error if no
462 parameters are given.
464 * test/data/auth/fallback.auth-script: Added. Tests that a client
465 can fallback to a secondary auth mechanism if the first fails.
467 2003-02-18 Havoc Pennington <hp@pobox.com>
471 2003-02-17 Havoc Pennington <hp@pobox.com>
473 * doc/dbus-specification.sgml: lots of cosmetic
474 cleanups/rearrangement, add assorted FIXME, change DBUS_ADDRESS
475 env variable to DBUS_BUS_ADDRESS, s/client/application/,
476 s/server/bus/ (except in authentication section). Add a section
477 "Message Bus Message Routing"
479 2003-02-17 Anders Carlsson <andersca@codefactory.se.>
485 2003-02-17 Anders Carlsson <andersca@codefactory.se>
487 * doc/dbus-specification.sgml:
488 Specification updates.
490 2003-02-17 Anders Carlsson <andersca@codefactory.se>
492 * bus/activation.c: (bus_activation_init), (child_setup),
493 (bus_activation_activate_service):
495 * bus/main.c: (main):
496 Set DBUS_ADDRESS environment variable.
498 * dbus/dbus-errors.c: (dbus_set_error):
499 Don't use va_copy since that's a C99 feature.
501 * dbus/dbus-sysdeps.c: (_dbus_setenv), (do_exec),
503 * dbus/dbus-sysdeps.h:
504 Add child_setup_func to _dbus_spawn_async.
506 * doc/dbus-specification.sgml:
507 Update specification.
509 * test/spawn-test.c: (setup_func), (main):
512 2003-02-17 Alexander Larsson <alexl@redhat.com>
514 * dbus/dbus-connection.c (_dbus_connection_handler_destroyed_locked):
517 2003-02-17 Anders Carlsson <andersca@codefactory.se>
521 * doc/dbus-test-plan.sgml:
522 Add test plan document.
527 2003-02-17 Anders Carlsson <andersca@codefactory.se>
529 * dbus/dbus-message.c: (decode_header_data),
530 (_dbus_message_loader_return_buffer):
531 Set the header padding amount when loading a message.
533 2003-02-16 Anders Carlsson <andersca@codefactory.se>
535 * bus/dispatch.c: (send_one_message):
536 Only send broadcast messages to registered connections.
538 * dbus/dbus-message.c: (dbus_message_name_is):
539 * dbus/dbus-message.h:
540 New convenience function.
542 * dbus/dbus-transport-debug.c: (do_reading):
543 Only dispatch one message per run.
546 * test/bus-test.c: (new_connection_callback), (die),
547 (test_hello_client1_handler), (test_hello_client2_handler),
548 (test_hello_replies), (main):
550 * test/bus-test-loop.[ch]:
553 2003-02-16 Havoc Pennington <hp@pobox.com>
555 * dbus/dbus-connection.c (dbus_connection_dispatch_message): fix
558 2003-02-16 Alexander Larsson <alexl@redhat.com>
560 * dbus/dbus-connection.c:
561 Implement sent_message_with_reply. (with_reply_and block is still
563 Made dispatch_message not lose message if OOM.
565 * dbus/dbus-errors.h:
566 Add NoReply error (for reply timeouts).
568 2003-02-16 Alexander Larsson <alexl@redhat.com>
570 * dbus/dbus-hash.c (_dbus_hash_table_unref):
571 Actually free keys and values when destroying hashtable.
573 2003-02-16 Anders Carlsson <andersca@codefactory.se>
575 * dbus/dbus-auth.c: (client_try_next_mechanism):
578 * dbus/dbus-threads.c: (dbus_condvar_wait_timeout):
579 Return TRUE if there's no thread implementation around.
581 * glib/dbus-gmain.c: (free_source),
582 (dbus_connection_hookup_with_g_main):
583 Make sure to remove the GSource when the connection is finalized.
585 2003-02-16 Anders Carlsson <andersca@codefactory.se>
587 * bus/dispatch.c: (bus_dispatch_message_handler):
588 * dbus/dbus-errors.h:
589 Return an error if someone tries to send a message to a service
592 2003-02-16 Anders Carlsson <andersca@codefactory.se>
594 * bus/activation.c: (load_directory), (bus_activation_init),
595 (bus_activation_activate_service):
598 (bus_driver_handle_activate_service), (bus_driver_handle_message):
599 More work on the activation handling.
601 * dbus/dbus-errors.h:
602 Add some error messages
604 * dbus/dbus-message.c: (dbus_message_new_error_reply):
605 * dbus/dbus-message.h:
606 New function that creates an error message.
608 * dbus/dbus-protocol.h:
609 Add ACTIVATE_SERVER message.
611 * dbus/dbus-server-unix.c: (unix_handle_watch),
612 (_dbus_server_new_for_domain_socket):
613 Call _dbus_fd_set_close_on_exec.
615 * dbus/dbus-sysdeps.c: (make_pipe), (do_exec),
616 (_dbus_spawn_async), (_dbus_disable_sigpipe),
617 (_dbus_fd_set_close_on_exec):
618 * dbus/dbus-sysdeps.h:
619 Add _dbus_fd_set_close_on exec function. Also add function that checks
620 that all open fds are set to close-on-exec and warns otherwise.
622 * dbus/dbus-transport-unix.c:
623 (_dbus_transport_new_for_domain_socket):
624 Call _dbus_fd_set_close_on_exec.
626 2003-02-16 Havoc Pennington <hp@pobox.com>
628 * dbus/dbus-connection.c (dbus_connection_set_change_sigpipe):
629 allow people to avoid setting SIGPIPE to SIG_IGN
630 (_dbus_connection_new_for_transport): disable SIGPIPE unless
631 we've been asked not to
633 2003-02-15 Anders Carlsson <andersca@codefactory.se>
635 * dbus/dbus-list.c: (_dbus_list_append_link),
636 (_dbus_list_prepend_link):
637 * dbus/dbus-memory.c: (dbus_malloc), (dbus_malloc0),
641 2003-02-15 Anders Carlsson <andersca@codefactory.se>
644 * bus/activation.c: (bus_activation_entry_free),
645 (add_desktop_file_entry), (load_directory), (bus_activation_init):
647 * bus/main.c: (main):
648 Add simple activation support, doesn't work yet though.
650 2003-02-15 Zack Rusin <zack@kde.org>
652 * qt/dbus-qthread.cpp: small casting fix
654 2003-02-15 Anders Carlsson <andersca@codefactory.se>
656 * dbus/dbus-errors.c: (dbus_set_error):
657 * dbus/dbus-errors.h:
658 Add a few errors and make dbus_set_error void.
660 * dbus/dbus-sysdeps.c:
661 (_dbus_errno_to_string), (close_and_invalidate), (make_pipe),
662 (write_err_and_exit), (read_ints), (do_exec), (_dbus_spawn_async):
663 * dbus/dbus-sysdeps.h:
664 Add _dbus_spawn_async.
666 * test/spawn-test.c: (main):
667 Test for _dbus_spawn_async.
669 2003-02-15 Anders Carlsson <andersca@codefactory.se>
671 * dbus/dbus-internals.h:
672 Fix build without tests.
674 * dbus/dbus-list.c: (alloc_link):
675 Fix a segfault when a malloc fails.
677 * dbus/dbus-memory.c: (initialize_malloc_debug), (dbus_malloc),
678 (dbus_malloc0), (dbus_realloc):
679 Add support for malloc debugging.
681 2003-02-15 Alexander Larsson <alexl@redhat.com>
683 * dbus/dbus-threads.c:
684 * dbus/dbus-threads.h:
685 Add condvars. Remove static mutext from API.
686 Implement static mutexes by initializing them from threads_init.
688 * glib/dbus-gthread.c:
689 * qt/dbus-qthread.cpp:
690 Update with the thread api changes.
695 Turn StaticMutex into normal mutex + init function.
696 Export new functions _dbus_list_alloc_link, _dbus_list_free_link,
697 _dbus_list_append_link, _dbus_list_prepend_link
700 * dbus/dbus-sysdeps.c:
701 * dbus/dbus-sysdeps.h:
702 New type dbus_atomic_t, and new functions _dbus_atomic_inc,
703 _dbus_atomic_dec. Only slow fallback implementation at the moment.
705 * dbus/dbus-protocol.h:
706 Add DBUS_MESSAGE_LOCAL_DISCONNECT define
708 * dbus/dbus-message.c:
709 Make ref/unref atomic.
712 * dbus/dbus-connection-internal.h:
713 * dbus/dbus-connection.c:
714 * dbus/dbus-connection.h:
716 Change _peek to _borrow,_return & _steal_borrowed.
717 Change disconnect callback to event.
718 Make dbus_connection_dispatch_messages reentrant.
720 * dbus/dbus-transport.c:
721 Don't ref the connection on calls to the transport
724 * dbus/dbus-message-handler.c:
728 Don't use peek_message anymore
731 * test/debug-thread.c:
732 * test/debug-thread.h:
733 Simple thread implementation that asserts() on deadlocks in
734 single-threaded code.
737 (main) Call debug_threads_init.
740 Use disconnect message instead of disconnect callback.
744 Don't call dbus_connection_set_disconnect_function. Instead export
745 bus_connection_disconnect.
748 Call bus_connection_disconnect when we get a disconnected message.
750 2003-02-15 Havoc Pennington <hp@pobox.com>
752 * dbus/dbus-message.c (dbus_message_new): fool around with the
755 2003-02-14 Havoc Pennington <hp@pobox.com>
757 * dbus/dbus-mempool.c: fail if the debug functions so indicate
759 * dbus/dbus-memory.c: fail if the debug functions indicate we
762 * dbus/dbus-internals.c (_dbus_set_fail_alloc_counter)
763 (_dbus_decrement_fail_alloc_counter): debug functions to
764 simulate memory allocation failures
766 2003-02-14 Havoc Pennington <hp@pobox.com>
768 * dbus/dbus-errors.h (struct DBusError): add a word of padding
771 2003-02-13 Anders Carlsson <andersca@codefactory.se>
773 * bus/driver.c: (bus_driver_handle_hello):
775 * bus/services.c: (bus_service_lookup):
776 Reorder message sending so we get a more sane order.
778 * test/bus-test.c: (message_handler):
781 2003-02-13 Anders Carlsson <andersca@codefactory.se>
783 * bus/driver.c: (bus_driver_send_service_deleted),
784 (bus_driver_send_service_created), (bus_driver_send_service_lost),
785 (bus_driver_send_service_acquired), (bus_driver_handle_hello),
786 (bus_driver_send_welcome_message),
787 (bus_driver_handle_list_services),
788 (bus_driver_handle_acquire_service),
789 (bus_driver_handle_service_exists):
790 * dbus/dbus-bus.c: (dbus_bus_register_client),
791 (dbus_bus_acquire_service), (dbus_bus_service_exists):
792 * dbus/dbus-errors.c: (dbus_result_to_string):
793 * dbus/dbus-errors.h:
794 * dbus/dbus-message.c: (dbus_message_append_args),
795 (dbus_message_append_args_valist), (dbus_message_get_args),
796 (dbus_message_get_args_valist), (dbus_message_get_args_iter),
797 (dbus_message_iter_get_arg_type), (dbus_message_iter_get_string),
798 (dbus_message_iter_get_byte_array),
799 (dbus_message_iter_get_string_array), (message_iter_test),
800 (check_message_handling), (_dbus_message_test):
801 * dbus/dbus-message.h:
802 * test/bus-test.c: (main):
803 Change fields to arguments in messages, so that they won't be
804 confused with header fields.
806 * glib/test-dbus-glib.c: (main):
807 Remove append_fields from hello message.
809 2003-02-13 Anders Carlsson <andersca@codefactory.se>
811 * dbus/dbus-errors.c:
812 * dbus/dbus-message.c:
813 * dbus/dbus-string.c:
816 2003-02-13 Anders Carlsson <andersca@codefactory.se>
818 * glib/dbus-gmain.c: (timeout_handler), (add_timeout),
820 Implement support for timeouts in dbus-glib.
822 2003-02-13 Anders Carlsson <andersca@codefactory.se>
824 * dbus/dbus-message-builder.c: (_dbus_message_data_load):
825 * dbus/dbus-message.c: (process_test_subdir):
826 * test/break-loader.c: (find_breaks_based_on):
827 Plug some memory leaks.
829 2003-02-13 Richard Hult <rhult@codefactory.se>
831 * bus/main.c: Fix build.
833 * dbus/dbus-errors.h:
834 * dbus/dbus-errors.c: Fix copyright for Anders.
836 2003-02-13 Anders Carlsson <andersca@codefactory.se>
841 * bus/connection.c: (bus_connection_foreach):
844 * bus/desktop-file.c: (grow_lines_in_section), (grow_sections),
845 (unescape_string), (new_section), (parse_section_start),
846 (parse_key_value), (report_error), (bus_desktop_file_load),
847 (bus_desktop_file_get_string):
848 * bus/desktop-file.h:
849 Use DBusError for error reporting.
851 * bus/dispatch.c: (send_one_message),
852 (bus_dispatch_message_handler):
853 * bus/driver.c: (bus_driver_send_service_deleted),
854 (bus_driver_send_service_created), (bus_driver_send_service_lost),
855 (bus_driver_send_service_acquired), (bus_driver_handle_hello),
856 (bus_driver_send_welcome_message),
857 (bus_driver_handle_list_services),
858 (bus_driver_handle_acquire_service),
859 (bus_driver_handle_service_exists):
860 * bus/loop.c: (bus_loop_run):
862 Use BUS_HANDLE_OOM instead of _DBUS_HANDLE_OOM.
864 * bus/utils.c: (bus_wait_for_memory):
866 New files with general utility functions.
868 * dbus/dbus-internals.h:
869 Remove _DBUS_HANDLE_OOM.
871 2003-02-13 Anders Carlsson <andersca@codefactory.se>
873 * dbus/dbus-errors.c: (dbus_result_to_string), (dbus_error_init),
874 (dbus_error_free), (dbus_set_error_const), (dbus_set_error):
875 * dbus/dbus-errors.h:
876 Add DBusError structure.
878 2003-02-13 Anders Carlsson <andersca@codefactory.se>
880 * test/data/valid-messages/standard-acquire-service.message:
881 * test/data/valid-messages/standard-hello.message:
882 * test/data/valid-messages/standard-list-services.message:
883 * test/data/valid-messages/standard-service-exists.message:
884 Add some standard messages.
886 2003-02-13 Anders Carlsson <andersca@codefactory.se>
888 * bus/driver.c: (bus_driver_send_welcome_message),
889 (bus_driver_handle_list_services),
890 (bus_driver_handle_acquire_service),
891 (bus_driver_handle_service_exists), (bus_driver_handle_message):
892 Update for API changes in libdbus.
894 * dbus/dbus-message.c: (dbus_message_new_reply):
895 * dbus/dbus-message.h:
896 Remove the name argument. The spec states that replies shouldn't
899 2003-02-13 Anders Carlsson <andersca@codefactory.se>
901 * bus/desktop-file.c: (parse_section_start), (parse_key_value),
902 (report_error), (bus_desktop_file_load), (lookup_section),
903 (lookup_line), (bus_desktop_file_get_raw),
904 (bus_desktop_file_get_string):
905 * bus/desktop-file.h:
906 Some fixes, and new functions for getting a key value from a section.
908 2003-02-13 Havoc Pennington <hp@pobox.com>
910 * test/data/auth/fail-after-n-attempts.auth-script: new test
912 * dbus/dbus-auth.c (send_rejected): shutdown_mech() when we
915 2003-02-13 Havoc Pennington <hp@pobox.com>
917 * dbus/dbus-auth.c (handle_server_data_external_mech): args to
918 dbus_credentials_match were backward
920 * dbus/dbus-auth-script.c (_dbus_auth_script_run): support
921 NO_CREDENTIALS and ROOT_CREDENTIALS
923 * dbus/dbus-auth.c (_dbus_auth_do_work): move get_state() routine
924 into here. Never process more commands after we've reached an
925 end state; store further data as unused bytes.
927 * test/data/auth/*: add more auth tests
929 * dbus/dbus-auth-script.c (_dbus_auth_script_run): support EXPECT
930 command to match exact string and EXPECT_UNUSED to match unused
933 * test/Makefile.am (dist-hook): fix to dist all the test stuff
935 2003-02-12 Havoc Pennington <hp@pobox.com>
937 * dbus/dbus-string.c (_dbus_string_pop_line): fix to also strip
938 \r off of popped lines
940 * dbus/dbus-auth.c (_dbus_auth_test): write code to run auth
943 * dbus/dbus-auth-script.c (_dbus_auth_script_run): when doing a
946 2003-02-12 Havoc Pennington <hp@pobox.com>
948 * dbus/Makefile.am: remove break-loader from the build, since it
951 * configure.in: add --enable-gcov to turn on coverage profiling
952 flags and disable optimization
954 2003-02-10 Havoc Pennington <hp@pobox.com>
956 * dbus/dbus-auth-script.c, dbus/dbus-auth-script.h: sync
957 initial cut at test framework for DBusAuth from laptop.
958 Doesn't quite work yet but it compiles and I need to get
959 it off the 266mhz laptop. ;-)
961 * dbus/dbus-server-debug.c (_dbus_server_debug_accept_transport):
962 fix a memleak in error case
964 2003-02-12 Anders Carlsson <andersca@codefactory.se>
967 * bus/desktop-file.c:
968 * bus/desktop-file.h:
969 Add a desktop file parser.
971 2003-02-11 Zack Rusin <zack@kde.org>
973 * qt/message.[h|cpp]: sample implementation
974 of the KDE wrapper for DBusMessage
976 2003-02-09 Zack Rusin <zack@kde.org>
978 * test/bus-test.c: make_it_compile
979 * doc/dbus-specification.sgml: minimal semantic fix
981 2003-02-06 Anders Carlsson <andersca@codefactory.se>
987 2003-02-06 Anders Carlsson <andersca@codefactory.se>
990 * dbus/dbus-break-loader.c:
992 * test/break-loader.c:
993 Move dbus-break-loader to test/ and rename it to break-loader.
995 2003-02-02 Havoc Pennington <hp@pobox.com>
997 * dbus/dbus-keyring.c, dbus/dbus-keyring.h: template files
998 for code to manage cookies in your home directory
1000 * dbus/dbus-sysdeps.c (_dbus_generate_random_bytes): new function
1002 * dbus/dbus-auth.c (get_state): impose a maximum number of tries
1003 to authenticate, then disconnect the client.
1005 2003-02-03 Alexander Larsson <alexl@redhat.com>
1007 * dbus/dbus-message.c (dbus_message_append_fields):
1010 2003-02-02 Anders Carlsson <andersca@codefactory.se>
1012 * doc/dbus-specification.sgml:
1013 Update address format section.
1015 2003-02-02 Anders Carlsson <andersca@codefactory.se>
1018 * test/bus-test.c: (get_time), (add_timeout), (remove_timeout),
1019 (message_handler), (new_connection_callback), (loop_quit),
1023 2003-02-02 Anders Carlsson <andersca@codefactory.se>
1025 * bus/driver.c: (bus_driver_handle_service_exists):
1026 Simplify the code a bit.
1028 * dbus/dbus-bus.c: (dbus_bus_service_exists):
1031 2003-02-02 Anders Carlsson <andersca@codefactory.se>
1034 Add libdbus-daemon.la and link to it.
1036 2003-02-01 James Willcox <jwillcox@gnome.org>
1038 * bus/driver.c: (bus_driver_handle_own_service):
1039 Actually include the service reply code in the message.
1041 2003-02-02 Anders Carlsson <andersca@codefactory.se>
1043 * bus/driver.c: (bus_driver_handle_service_exists):
1044 Don't unref the incoming message.
1046 2003-02-02 Anders Carlsson <andersca@codefactory.se>
1048 * dbus/dbus.h: Add dbus-address.h and dbus-bus.h
1050 2003-02-02 Anders Carlsson <andersca@codefactory.se>
1052 * dbus/dbus-server.c: (dbus_server_listen):
1053 * dbus/dbus-transport.c: (_dbus_transport_open):
1054 ifdef out the calls to the debug transport and server.
1056 2003-02-02 Alexander Larsson <alexl@redhat.com>
1058 * dbus/dbus-watch.c (dbus_watch_get_flags):
1059 Add note in the docs that ERROR or HANGUP won't be returned
1060 and are assumed always on.
1062 * glib/dbus-gmain.c (add_watch):
1063 Always add IO_ERR | IO_HUP
1065 * dbus/dbus-message.h:
1066 Add semicolon after dbus_message_iter_get_string_array().
1067 Makes qt code build again
1069 2003-02-01 Anders Carlsson <andersca@codefactory.se>
1071 * bus/driver.c: (create_unique_client_name),
1072 (bus_driver_handle_hello):
1073 Don't take a name, just use a numeric id to identify
1077 * dbus/dbus-bus.c: (dbus_bus_register_client),
1078 (dbus_bus_acquire_service), (dbus_bus_service_exists):
1080 Add new convenience functions for communicating with the bus.
1082 * dbus/dbus-message.h:
1084 * dbus/dbus-protocol.h:
1087 2003-02-01 Alexander Larsson <alexl@redhat.com>
1089 * dbus/dbus-message.c (dbus_message_append_fields):
1090 Add some more doc comments.
1092 2003-02-01 Havoc Pennington <hp@pobox.com>
1094 * dbus/dbus-break-loader.c (randomly_modify_length): change
1095 a 4-byte value in the message as if it were a length
1097 * dbus/dbus-sysdeps.c (_dbus_string_save_to_file): don't set
1098 execute bit on saved files
1100 2003-02-01 Havoc Pennington <hp@pobox.com>
1102 * dbus/dbus-break-loader.c (main): new program to find messages
1103 that break the loader.
1105 * dbus/dbus-sysdeps.c (_dbus_string_append_uint): new function
1106 * dbus/dbus-sysdeps.c (_dbus_string_save_to_file): new function
1108 * dbus/dbus-string.c (_dbus_string_set_byte): new
1110 2003-01-31 Havoc Pennington <hp@pobox.com>
1112 * dbus/dbus-message.c: refactor the test code to be more general,
1113 in preparation for writing a "randomly permute test cases to
1114 try to break the loader" program.
1116 2003-01-31 Havoc Pennington <hp@pobox.com>
1118 * doc/dbus-specification.sgml: work on the specification
1120 * dbus/dbus-message.c (_dbus_message_loader_return_buffer): check
1121 the protocol version of the message.
1123 * dbus/dbus-protocol.h: drop special _REPLY names, the spec
1124 no longer specifies that.
1125 (DBUS_SERVICE_REPLY_SERVICE_EXISTS): fix flags (1/2/4/8 not
1128 * dbus/dbus-marshal.c (_dbus_marshal_get_arg_end_pos): add missing
1129 "break" for DBUS_TYPE_NIL, remove @todo
1131 2003-01-31 Havoc Pennington <hp@pobox.com>
1133 * dbus/dbus-message.c (dbus_message_set_is_error_reply): rename
1134 just set_is_error/get_is_error as this is a commonly-used
1135 function, and write docs.
1137 2003-01-31 Anders Carlsson <andersca@codefactory.se>
1139 * dbus/dbus-address.c: (dbus_address_entry_free):
1140 Free key and value lists.
1142 * dbus/dbus-internals.c: (_dbus_type_to_string):
1143 Add the types we didn't have.
1145 * dbus/dbus-marshal.c: (_dbus_marshal_get_arg_end_pos),
1146 (_dbus_marshal_validate_arg):
1149 * dbus/dbus-message.c: (dbus_message_set_sender):
1150 Remove todo about being able to set sender to NULL.
1152 (dbus_message_set_is_error_reply),
1153 (dbus_message_get_is_error_reply):
1154 * dbus/dbus-message.h:
1157 * dbus/dbus-protocol.h:
1158 Add error reply flag.
1160 * test/data/valid-messages/opposite-endian.message:
1161 Add NIL type to test.
1163 2003-01-31 Havoc Pennington <hp@pobox.com>
1165 * doc/dbus-specification.sgml: fully specify the header. Add
1166 flags and major protocol version, and change header/body len to
1169 * dbus/dbus-message-builder.c (append_saved_length): append length
1172 * dbus/dbus-message.c (dbus_message_create_header): change header
1173 length and body length to unsigned. Add the new fields from the
1175 (_dbus_message_loader_return_buffer): unsigned header/body len
1177 2003-01-30 Havoc Pennington <hp@pobox.com>
1179 * dbus/dbus-auth.c: rework to use only REJECTED, no
1182 * doc/dbus-sasl-profile.txt: drop MECHANISMS and just
1183 use REJECTED, suggested by Mark McLoughlin
1185 2003-01-30 Havoc Pennington <hp@pobox.com>
1187 * dbus/dbus-server.c (dbus_server_listen): @todo about how we need
1188 a better way to report errors here. e.g. "unix address lacks
1189 path" or something. also "no such file" when the path doesn't
1192 * dbus/dbus-address.c (dbus_address_entries_free): add @todo about
1194 (dbus_parse_address): add @todo about documenting address format,
1195 and allowing , and ; to be escaped
1197 2003-01-30 Anders Carlsson <andersca@codefactory.se>
1200 Add dbus-address.[ch]
1202 * dbus/dbus-address.c: (dbus_address_entry_free),
1203 (dbus_address_entries_free), (create_entry),
1204 (dbus_address_entry_get_method), (dbus_address_entry_get_value),
1205 (dbus_parse_address), (_dbus_address_test):
1206 * dbus/dbus-address.h:
1207 New files for dealing with address parsing.
1209 * dbus/dbus-connection.c:
1210 Document timeout functions.
1212 * dbus/dbus-message.c:
1213 Document dbus_message_new_from_message.
1215 * dbus/dbus-server-debug.c:
1218 * dbus/dbus-server.c: (dbus_server_listen):
1219 Parse address and use correct server implementation.
1221 * dbus/dbus-string.c: (_dbus_string_find_to), (_dbus_string_test):
1222 * dbus/dbus-string.h:
1223 New function with test.
1225 * dbus/dbus-test.c: (dbus_internal_symbol_do_not_use_run_tests):
1229 * dbus/dbus-transport-debug.c:
1232 * dbus/dbus-transport.c: (_dbus_transport_open):
1233 Parse address and use correct transport implementation.
1235 2003-01-30 Havoc Pennington <hp@pobox.com>
1237 * dbus/dbus-message.c: use message->byte_order instead of
1238 DBUS_COMPILER_BYTE_ORDER throughout.
1239 (dbus_message_create_header): pad header to align the
1240 start of the body of the message to 8-byte boundary
1242 * dbus/dbus-marshal.h: make all the demarshalers take const
1243 DBusString arguments.
1245 * dbus/dbus-message.c (_dbus_message_loader_return_buffer):
1246 validate message args here, so we don't have to do slow validation
1247 later, and so we catch bad messages as they are incoming. Also add
1248 better checks on header_len and body_len. Also fill in
1251 * dbus/dbus-string.c (_dbus_string_validate_utf8): new (not
1252 implemented properly)
1253 (_dbus_string_validate_nul): new function to check all-nul
1255 * dbus/dbus-marshal.c (_dbus_marshal_get_field_end_pos): rename
1256 get_arg_end_pos and remove all validation
1257 (_dbus_marshal_validate_arg): actually do validation here.
1259 2003-01-29 Havoc Pennington <hp@pobox.com>
1261 * dbus/dbus-message.c (check_message_handling): fix assertion
1262 failure on set_client_serial
1264 2003-01-28 Havoc Pennington <hp@pobox.com>
1266 * dbus/dbus-server-debug.c: Add doc section comments
1268 * dbus/dbus-transport-debug.c: add doc section comments
1270 2003-01-28 Havoc Pennington <hp@redhat.com>
1272 * dbus/dbus-string.c (_dbus_string_base64_decode): append bytes in
1273 the reverse order from how I had it
1274 (_dbus_string_base64_encode): reverse encoding order. I was
1275 basically byteswapping everything during encoding.
1277 2003-01-28 Anders Carlsson <andersca@codefactory.se>
1279 * dbus/dbus-connection-internal.h:
1280 * dbus/dbus-connection.c: (_dbus_connection_add_timeout),
1281 (_dbus_connection_remove_timeout):
1282 Add functions for adding and removing timeouts.
1284 * dbus/dbus-message.c: (dbus_message_new_from_message):
1285 Add new function that takes a message and creates an exact
1286 copy of it, but with the refcount set to 1.
1287 (check_message_handling):
1290 * dbus/dbus-server-protected.h:
1291 * dbus/dbus-server.c: (_dbus_server_init_base),
1292 (_dbus_server_finalize_base), (_dbus_server_add_timeout),
1293 (dbus_server_set_timeout_functions):
1294 (_dbus_server_remove_timeout):
1295 New functions so that a server can add and remove timeouts.
1297 (dbus_server_listen):
1298 Add commented out call to dbus_server_debug_new.
1300 * dbus/dbus-timeout.c: (_dbus_timeout_new):
1301 Actually set the handler, doh.
1303 * dbus/dbus-transport.c: (_dbus_transport_open):
1304 Add commented out call to dbus_transport_debug_client_new.
1307 Add dbus-transport-debug.[ch] and dbus-server-debug.[ch]
1309 2003-01-28 Havoc Pennington <hp@pobox.com>
1311 * dbus/dbus-message.c (check_message_handling): function to check
1312 on the loaded message, iterates over it etc.
1314 2003-01-28 Havoc Pennington <hp@pobox.com>
1316 * test/Makefile.am (dist-hook): fix make distdir
1318 * dbus/Makefile.am (TESTS_ENVIRONMENT): fix make check
1320 2003-01-27 Havoc Pennington <hp@pobox.com>
1322 * dbus/dbus-mempool.c (time_for_size): replace printf with
1325 * dbus/dbus-message-builder.c (_dbus_message_data_load): allow
1326 empty lines; fix the SAVE_LENGTH stuff to be
1327 START_LENGTH/END_LENGTH so it actually works; couple other
1330 * test/Makefile.am (dist-hook): add dist-hook for .message files
1332 * dbus/dbus-string.c (DBUS_STRING_COPY_PREAMBLE): source of a copy
1333 can be constant or locked.
1334 (_dbus_string_free): allow freeing a const string as
1337 * dbus/dbus-sysdeps.c (_dbus_concat_dir_and_file): utility
1339 * dbus/dbus-test-main.c (main): take an argument which is the
1340 directory containing test data
1342 * dbus/dbus-message.c (_dbus_message_test): pass a test_data_dir
1343 argument to this and load all the messages in test/data/
1344 checking that they can be loaded or not loaded as appropriate.
1346 2003-01-27 Anders Carlsson <andersca@codefactory.se>
1348 * bus/dispatch.c: (bus_dispatch_message_handler):
1349 Dispatch messages sent to services.
1351 * bus/driver.c: (bus_driver_send_service_deleted),
1352 (bus_driver_send_service_created), (bus_driver_send_service_lost),
1353 (bus_driver_send_service_acquired):
1354 Add helper functions for sending service related messages.
1356 (bus_driver_send_welcome_message):
1357 Send HELLO_REPLY instead of WELCOME.
1359 (bus_driver_handle_list_services):
1360 Send LIST_SERVICES_REPLY instead of SERVICES.
1362 (bus_driver_handle_own_service),
1363 (bus_driver_handle_service_exists):
1364 New message handlers.
1366 (bus_driver_handle_message):
1367 Invoke new message handlers.
1369 (bus_driver_remove_connection):
1370 Don't remove any services here since that's done automatically
1371 by bus_service_remove_owner now.
1374 New function signatures.
1376 * bus/services.c: (bus_service_add_owner):
1377 Send ServiceAcquired message if we're the only primary owner.
1379 (bus_service_remove_owner):
1380 Send ServiceAcquired/ServiceLost messages.
1382 (bus_service_set_prohibit_replacement),
1383 (bus_service_get_prohibit_replacement):
1384 Functions for setting prohibit replacement.
1386 (bus_service_has_owner):
1387 New function that checks if a connection is in the owner queue of
1391 Add new function signatures.
1393 * dbus/dbus-list.c: (_dbus_list_test):
1394 Add tests for _dbus_list_remove_last and traversing the list backwards.
1397 Fix a typo in _dbus_list_get_prev_link, if we're at the first element we can't
1398 go any further, so return NULL then.
1400 * dbus/dbus-protocol.h:
1401 Add new messages, service flags and service replies.
1403 2003-01-26 Havoc Pennington <hp@pobox.com>
1405 * dbus/dbus-message-builder.c: implement, completely untested.
1407 * test/data/*: add data to be used in testing.
1408 ".message" files are our simple loadable text format.
1409 ".message-raw" will be binary dumps of messages.
1411 * dbus/dbus-string.c (_dbus_string_starts_with_c_str): new
1413 2003-01-26 Havoc Pennington <hp@pobox.com>
1415 * dbus/dbus-sysdeps.c (_dbus_file_get_contents): new function
1417 * dbus/dbus-errors.c (dbus_result_to_string): add
1420 * dbus/dbus-message-builder.c: new file, will contain code to load
1421 up messages from files. Not implemented yet.
1423 2003-01-26 Havoc Pennington <hp@pobox.com>
1425 * dbus/dbus-message.c (dbus_message_set_sender): support deleting
1426 the sender by setting to NULL
1428 2003-01-26 Havoc Pennington <hp@pobox.com>
1430 The unit tests pass, but otherwise untested. If it breaks, the
1431 tests should have been better. ;-)
1433 * bus/driver.c (bus_driver_handle_hello): return if we disconnect
1436 * dbus/dbus-message.c: redo everything so we maintain
1437 message->header as the only copy of the various fields.
1438 This avoids the possibility of out-of-memory in some cases,
1439 for example dbus_message_lock() can't run out of memory anymore,
1440 and avoids extra copying. Figured I may as well go ahead and do
1441 this since it was busted for dbus_message_lock to not return
1442 failure on OOM, and dbus_message_write_header was totally
1443 unchecked for OOM. Also fixed some random other bugs.
1445 * dbus/dbus-marshal.c (_dbus_marshal_get_field_end_pos): verify
1446 that strings are nul-terminated. Also, end_pos can be equal
1447 to string length just not greater than, I think.
1448 (_dbus_marshal_set_int32): new function
1449 (_dbus_marshal_set_uint32): new function
1450 (_dbus_marshal_set_string): new function
1452 * dbus/dbus-connection.c (_dbus_connection_new_for_transport): fix
1453 a warning, init timeout_list to NULL
1454 (dbus_connection_send_message): don't use uninitialized variable
1457 * dbus/dbus-string.c (_dbus_string_replace_len): new function
1459 2003-01-26 Anders Carlsson <andersca@codefactory.se>
1461 * bus/driver.c: (bus_driver_handle_hello),
1462 (bus_driver_send_welcome_message):
1465 2003-01-26 Anders Carlsson <andersca@codefactory.se>
1467 * dbus/dbus-auth.c: (process_auth), (_dbus_auth_unref):
1468 * dbus/dbus-connection.c: (_dbus_connection_new_for_transport),
1469 (dbus_connection_unref):
1470 * dbus/dbus-marshal.c: (_dbus_marshal_test):
1471 * dbus/dbus-message.c: (dbus_message_unref),
1474 (dbus_message_get_fields):
1475 Remove debugging printout.
1477 (_dbus_message_loader_return_buffer):
1478 Don't store the header string.
1480 (_dbus_message_test):
1483 2003-01-26 Richard Hult <rhult@codefactory.se>
1485 * glib/dbus-gmain.c (dbus_connection_dispatch): Traverse a copy of
1486 the file descriptor list, since it can change under us.
1488 2003-01-25 Anders Carlsson <andersca@codefactory.se>
1490 * glib/dbus-gmain.c: (dbus_connection_prepare),
1491 (dbus_connection_check), (dbus_connection_dispatch), (add_watch),
1492 (remove_watch), (dbus_connection_hookup_with_g_main):
1493 Rewrite the glib handling to use its own GSource instead of a
1494 GIOChannel so we can catch messages put in the queue while waiting
1497 2003-01-25 Anders Carlsson <andersca@codefactory.se>
1500 * bus/connection.c: (connection_disconnect_handler),
1501 (connection_watch_callback), (bus_connection_setup):
1502 * bus/dispatch.c: (send_one_message),
1503 (bus_dispatch_broadcast_message), (bus_dispatch_message_handler),
1504 (bus_dispatch_add_connection), (bus_dispatch_remove_connection):
1506 * bus/driver.c: (bus_driver_send_service_deleted),
1507 (bus_driver_send_service_created), (bus_driver_handle_hello),
1508 (bus_driver_send_welcome_message),
1509 (bus_driver_handle_list_services), (bus_driver_remove_connection),
1510 (bus_driver_handle_message):
1512 Refactor code, put the message dispatching in its own file. Use
1513 _DBUS_HANDLE_OOM. Also send ServiceDeleted messages when a client
1516 2003-01-25 Anders Carlsson <andersca@codefactory.se>
1518 * dbus/dbus-internals.h:
1519 Add _DBUS_HANDLE_OOM macro, it doesn't do anything currently.
1521 * dbus/dbus-message.c: (dbus_message_get_sender):
1522 * dbus/dbus-message.h:
1523 Implement dbus_message_get_sender.
1525 * dbus/dbus-protocol.h:
1526 Add message and service defines.
1528 2003-01-25 Anders Carlsson <andersca@codefactory.se>
1530 * dbus/dbus-connection.c: (dbus_connection_send_message):
1531 * dbus/dbus-message-internal.h:
1532 * dbus/dbus-message.c: (_dbus_message_get_client_serial),
1533 (dbus_message_write_header):
1534 Remove _dbus_messag_unlock and don't set the client serial on a
1535 message if one already exists.
1537 2003-01-24 Havoc Pennington <hp@pobox.com>
1539 * dbus/dbus-list.c (alloc_link): put a thread lock on the global
1542 * bus/driver.c (bus_driver_handle_list_services): fix a leak
1545 2003-01-25 Anders Carlsson <andersca@codefactory.se>
1547 * dbus/dbus-list.c: (alloc_link), (free_link):
1548 Use a memory pool for the links.
1550 2003-01-25 Anders Carlsson <andersca@codefactory.se>
1552 * bus/connection.c: (bus_connection_foreach):
1554 Add new bus_connection_foreach function.
1556 * bus/driver.c: (send_one_message), (bus_driver_broadcast_message):
1557 Add function that broadcasts a message to all clients.
1559 (bus_driver_send_service_created), (bus_driver_handle_hello),
1560 (bus_driver_send_welcome_message),
1561 (bus_driver_handle_list_services), (bus_driver_message_handler):
1562 Implement functions that take care of listing services, and notifying
1563 clients when new services are created.
1565 * bus/services.c: (bus_services_list):
1567 Add new function that returns an array of strings with the currently
1568 registered services.
1571 * glib/dbus-gmain.c:
1572 Update copyright year.
1574 2003-01-25 Anders Carlsson <andersca@codefactory.se>
1576 * dbus/dbus-connection.c: (dbus_connection_send_message):
1577 Unlock the message in case it was sent earlier.
1579 (dbus_connection_send_message_with_reply_and_block):
1580 Remove the reply message from the list.
1582 * dbus/dbus-marshal.c: (_dbus_demarshal_string_array):
1583 Set array_len and new_pos correctly.
1585 (_dbus_marshal_test):
1586 Remove debug output.
1588 * dbus/dbus-message-internal.h:
1589 * dbus/dbus-message.c: (_dbus_message_get_reply_serial):
1590 New function that returns the reply serial.
1592 (_dbus_message_unlock):
1593 New function that unlocks a message and resets its header.
1595 (dbus_message_append_string_array),
1596 (dbus_message_get_fields_valist),
1597 (dbus_message_iter_get_field_type),
1598 (dbus_message_iter_get_string_array),
1599 (dbus_message_get_fields),
1600 (dbus_message_append_fields_valist):
1601 Handle string arrays.
1603 (dbus_message_set_sender):
1604 Make this function public since the bus daemon needs it.
1606 (decode_header_data):
1607 Set the reply serial to -1 initially.
1609 * dbus/dbus-message.h:
1610 Add dbus_message_set_sender.
1612 2003-01-24 Havoc Pennington <hp@pobox.com>
1614 * doc/dbus-specification.sgml: add some stuff
1616 2003-01-22 Havoc Pennington <hp@pobox.com>
1618 * doc/dbus-specification.sgml: Start to document the protocol.
1620 2003-01-22 Havoc Pennington <hp@pobox.com>
1622 * dbus/dbus-connection.c
1623 (dbus_connection_send_message_with_reply_and_block): add some @todo
1625 * bus/driver.c (bus_driver_add_connection): add a FIXME about memleak
1627 2003-01-21 Havoc Pennington <hp@pobox.com>
1629 (patch untested because can't compile)
1631 * bus/driver.c (create_unique_client_name): make this function
1632 never recycle client names. Also, caller should initialize
1635 * dbus/dbus-sysdeps.c (_dbus_get_current_time): new function
1637 2003-01-21 Anders Carlsson <andersca@codefactory.se>
1639 * dbus/dbus-marshal.c: (_dbus_marshal_double),
1640 (_dbus_marshal_int32), (_dbus_marshal_uint32),
1641 (_dbus_marshal_int32_array), (_dbus_marshal_uint32_array),
1642 (_dbus_marshal_double_array), (_dbus_marshal_string_array),
1643 (_dbus_demarshal_int32_array), (_dbus_demarshal_uint32_array),
1644 (_dbus_demarshal_double_array), (_dbus_demarshal_string_array),
1645 (_dbus_marshal_get_field_end_pos), (_dbus_marshal_test):
1646 * dbus/dbus-marshal.h:
1647 * dbus/dbus-protocol.h:
1648 Add support for marshalling and demarshalling integer, double
1651 2003-01-21 Anders Carlsson <andersca@codefactory.se>
1656 * bus/connection.c: (connection_disconnect_handler):
1657 Remove the connection from the bus driver's list.
1659 (connection_watch_callback): Dispatch messages.
1661 (free_connection_data): Free connection name.
1663 (bus_connection_setup): Add connection to the bus driver's list.
1664 (bus_connection_remove_owned_service):
1665 (bus_connection_set_name), (bus_connection_get_name):
1666 Add functions for setting and getting the connection's name.
1669 Add function headers.
1671 * bus/driver.c: (create_unique_client_name),
1672 (bus_driver_handle_hello_message),
1673 (bus_driver_send_welcome_message), (bus_driver_message_handler),
1674 (bus_driver_add_connection), (bus_driver_remove_connection):
1677 * bus/services.c: (bus_service_free):
1679 New file that handles communication and registreation with the bus
1682 2003-01-21 Anders Carlsson <andersca@codefactory.se>
1684 * dbus/dbus-connection.c: (dbus_connection_send_message):
1685 Add a new client_serial parameter.
1687 (dbus_connection_send_message_with_reply):
1688 Remove a @todo since we've implemented the blocking function.
1690 (dbus_connection_send_message_with_reply_and_block):
1691 New function that sends a message and waits for a reply and
1692 then returns the reply.
1694 * dbus/dbus-connection.h:
1697 * dbus/dbus-errors.c: (dbus_result_to_string):
1698 * dbus/dbus-errors.h:
1699 Add new DBUS_RESULT.
1701 * dbus/dbus-message-internal.h:
1702 * dbus/dbus-message.c: (_dbus_message_get_reply_serial),
1703 (_dbus_message_set_sender), (dbus_message_write_header),
1704 (dbus_message_new_reply), (decode_header_data),
1705 (_dbus_message_loader_return_buffer), (_dbus_message_test):
1706 * dbus/dbus-message.h:
1707 Add new functions that set the reply serial and sender.
1708 Also marshal and demarshal them correctly and add test.
1710 * dbus/dbus-protocol.h:
1711 Add new DBUS_MESSAGE_TYPE_SENDER.
1714 * glib/dbus-gmain.c: (watch_callback), (free_callback_data),
1715 (add_watch), (remove_watch), (add_timeout), (remove_timeout),
1716 (dbus_connection_hookup_with_g_main):
1717 * glib/test-dbus-glib.c: (main):
1718 Rewrite to use GIOChannel and remove the GSource crack.
1720 * test/echo-client.c: (main):
1721 * test/watch.c: (check_messages):
1722 Update for changed APIs
1724 2003-01-19 Anders Carlsson <andersca@codefactory.se>
1726 * dbus/Makefile.am: Add dbus-timeout.[cħ]
1728 * dbus/dbus-connection.c: (_dbus_connection_new_for_transport):
1729 Create a DBusTimeoutList.
1730 (dbus_connection_set_timeout_functions): Add new function to
1731 set timeout callbacks
1733 * dbus/dbus-connection.h: Add public DBusTimeout API.
1735 * dbus/dbus-message.c: (dbus_message_get_service):
1736 * dbus/dbus-message.h: New function.
1738 * dbus/dbus-server.c: Fix small doc typo.
1740 * dbus/dbus-timeout.[ch]: New files for mainloop timeouts.
1742 2003-01-19 Anders Carlsson <andersca@codefactory.se>
1744 * dbus/dbus-string.c (_dbus_string_move_len): Don't delete all
1745 of the string, just as long as specified.
1747 2003-01-19 Havoc Pennington <hp@pobox.com>
1749 * dbus/dbus-connection.c (dbus_connection_get_is_authenticated):
1752 * dbus/dbus-server.c (dbus_server_set_max_connections)
1753 (dbus_server_get_max_connections, dbus_server_get_n_connections):
1754 keep track of current number of connections, and add API for
1755 setting a max (but haven't implemented enforcing the max yet)
1757 2003-01-18 Havoc Pennington <hp@pobox.com>
1759 * dbus/dbus-transport-unix.c (unix_do_iteration): only do the
1760 reading/writing if read_watch != NULL or write_watch != NULL.
1762 * dbus/dbus-message.c (_dbus_message_loader_return_buffer): fix
1763 the message loader code to actually load message->header and
1764 message->body into the newly-created message.
1766 * dbus/dbus-transport-unix.c (check_write_watch): fix a mem leak
1769 * dbus/dbus-connection.c (dbus_connection_set_max_message_size)
1770 (dbus_connection_get_max_message_size)
1771 (dbus_connection_set_max_live_messages_size)
1772 (dbus_connection_get_max_live_messages_size): implement some
1773 resource limitation functions
1775 * dbus/dbus-resources.c: new file implementing some of the
1776 resource limits stuff
1778 * dbus/dbus-message.c (dbus_message_iter_get_byte_array): add
1779 missing docs, add @todo to handle OOM etc.
1781 * dbus/dbus-marshal.c (_dbus_demarshal_byte_array): add missing
1784 2003-01-18 Havoc Pennington <hp@pobox.com>
1786 * dbus/dbus-connection.c (dbus_connection_unref): disconnect the
1787 connection if it hasn't been already.
1789 * dbus/dbus-connection.h: kill off the idea of an ErrorFunction,
1790 replace with DisconnectFunction.
1792 2003-01-18 Havoc Pennington <hp@pobox.com>
1794 Building --disable-verbose-mode --disable-asserts --disable-tests
1795 cuts the library from 112K to 45K or so
1797 * configure.in: check for varargs macro support,
1798 add --enable-verbose-mode, --enable-asserts.
1800 * dbus/dbus-internals.h (_dbus_assert): support
1802 (_dbus_verbose): support DBUS_ENABLE_VERBOSE_MODE
1804 2003-01-18 Havoc Pennington <hp@pobox.com>
1806 * dbus/dbus-test.c: include config.h so that tests actually run
1808 * dbus/dbus-string.c: add assertions that stuff is 8-byte aligned,
1809 so the failure mode when that assumption fails will be plenty
1812 2003-01-18 Havoc Pennington <hp@pobox.com>
1814 * configure.in: default --enable-tests to $USE_MAINTAINER_MODE
1816 * dbus/Makefile.am: fix it up so dubs-test-main.c is included in
1819 * test/Makefile.am: don't use special variable "TESTS" for echo-*
1820 since we don't want to use those in make check
1822 2003-01-15 Havoc Pennington <hp@redhat.com>
1828 2003-01-15 Havoc Pennington <hp@redhat.com>
1830 * test/Makefile.am: fix so that test source code ends up in the
1831 distribution on make distcheck
1833 2003-01-15 Havoc Pennington <hp@redhat.com>
1839 2003-01-15 Havoc Pennington <hp@redhat.com>
1841 * dbus/dbus-test.c (dbus_internal_symbol_do_not_use_run_tests):
1842 fix build when --disable-tests
1844 * Makefile.am (EXTRA_DIST): put HACKING in here
1846 * HACKING: document procedure for making a tarball release.
1848 2003-01-14 Anders Carlsson <andersca@codefactory.se>
1850 * bus/connection.c: (connection_error_handler),
1851 (bus_connection_setup):
1852 * bus/main.c: (main):
1853 Make sure that the DBusConnectionData struct is NULLed
1854 out to prevent a segfault.
1856 * dbus/dbus-errors.c: (dbus_result_to_string):
1857 * dbus/dbus-errors.h:
1858 * dbus/dbus-message.c: (dbus_message_get_fields),
1859 (dbus_message_get_fields_valist), (_dbus_message_test):
1860 * dbus/dbus-message.h:
1861 Make dbus_message_get_fields return a result code so we can
1862 track invalid fields as well as oom.
1864 2003-01-11 Havoc Pennington <hp@pobox.com>
1866 * configure.in: change --enable-test/--enable-ansi action-if-given
1867 to enable_foo=$enableval instead of enable_foo=yes
1869 2003-01-08 Havoc Pennington <hp@pobox.com>
1871 * dbus/dbus-string.c (_dbus_string_align_length): new function
1873 * dbus/dbus-test-main.c: move main() for test app here
1875 (dbus_internal_symbol_do_not_use_run_tests): we have to export a
1876 symbol to run tests, because dbus-test isn't in the main
1879 Code review nitpicks.
1881 * dbus/dbus-message.c (dbus_message_write_header): add newlines
1882 for people with narrow emacs ;-). Assert client_serial was filled
1883 in. Assert message->name != NULL.
1884 (dbus_message_append_fields): have "first_field_type" arg separate
1885 from va list, needed for C++ binding that also uses varargs IIRC
1886 and helps with type safety
1887 (dbus_message_new): add @todo about using DBusString to store
1888 service/name internally
1889 (dbus_message_new): don't leak ->service and ->name on OOM later
1891 (dbus_message_unref): free the service name
1892 (dbus_message_get_fields): same change to varargs
1893 i.e. first_field_type
1894 (_dbus_message_loader_return_buffer): assert that the message data
1895 is aligned (if not it's a bug in our code). Put in verbose griping
1896 about why we set corrupted = TRUE.
1897 (decode_header_data): add FIXME that char* is evil. Was going to
1898 add FIXME about evil locale-specific string.h strncmp, but just
1899 switched to wacky string-as-uint32 optimization. Move check for
1900 "no room for field name" above get_const_data_len() to avoid
1901 assertion failure in get_const_data_len if we have trailing 2
1902 bytes or the like. Check for service and name fields being
1903 provided twice. Don't leak service/name on error. Require field
1904 names to be aligned to 4 bytes.
1906 * dbus/dbus-marshal.c: move byte swap stuff to header
1907 (_dbus_pack_int32): uscore-prefix
1908 (_dbus_unpack_int32): uscore-prefix
1909 (_dbus_unpack_uint32): export
1910 (_dbus_demarshal_string): add @todo complaining about use of
1912 (_dbus_marshal_get_field_end_pos): add @todo about bad error
1913 handling allowing corrupt data to go unchecked
1915 2003-01-08 Havoc Pennington <hp@redhat.com>
1917 * dbus/dbus-transport-unix.c (unix_do_iteration): add read/write
1918 to the select() as needed for authentication. (should be using
1919 _dbus_poll() not select, but for another day)
1921 * dbus/dbus.h: include dbus/dbus-protocol.h
1923 2003-01-08 Anders Carlsson <andersca@codefactory.se>
1925 * dbus/Makefile.am (dbusinclude_HEADERS): Install
1928 2003-01-08 Anders Carlsson <andersca@codefactory.se>
1930 * dbus/dbus-internals.c: (_dbus_type_to_string):
1931 New function that returns a string describing a type.
1933 * dbus/dbus-marshal.c: (_dbus_demarshal_byte_array):
1934 * dbus/dbus-marshal.h:
1935 * dbus/dbus-message.c: (dbus_message_get_fields_valist),
1936 (dbus_message_iter_get_field_type), (dbus_message_iter_get_double),
1937 (dbus_message_iter_get_byte_array):
1938 * dbus/dbus-message.h:
1939 Add new convenience functions for appending and getting message fields.
1940 Also add demarshalling routines for byte arrays.
1942 2003-01-07 Anders Carlsson <andersca@codefactory.se>
1944 * dbus/dbus-connection-internal.h:
1945 * dbus/dbus-connection.c: (_dbus_connection_new_for_transport),
1946 (_dbus_connection_get_next_client_serial),
1947 (dbus_connection_send_message):
1948 * dbus/dbus-internals.h:
1949 * dbus/dbus-marshal.c: (unpack_uint32), (dbus_unpack_int32),
1950 (dbus_pack_int32), (_dbus_marshal_double), (_dbus_marshal_int32),
1951 (_dbus_marshal_uint32), (_dbus_demarshal_double),
1952 (_dbus_demarshal_int32), (_dbus_demarshal_uint32),
1953 (_dbus_demarshal_string), (_dbus_marshal_get_field_end_pos),
1954 (_dbus_verbose_bytes), (_dbus_marshal_test):
1955 * dbus/dbus-marshal.h:
1956 * dbus/dbus-message-internal.h:
1957 * dbus/dbus-message.c: (_dbus_message_set_client_serial),
1958 (dbus_message_write_header), (_dbus_message_lock),
1959 (dbus_message_new), (dbus_message_ref), (dbus_message_unref),
1960 (dbus_message_get_name), (dbus_message_append_int32),
1961 (dbus_message_append_uint32), (dbus_message_append_double),
1962 (dbus_message_append_string), (dbus_message_append_byte_array),
1963 (dbus_message_get_fields_iter), (dbus_message_iter_ref),
1964 (dbus_message_iter_unref), (dbus_message_iter_has_next),
1965 (dbus_message_iter_next), (dbus_message_iter_get_field_type),
1966 (dbus_message_iter_get_string), (dbus_message_iter_get_int32),
1967 (dbus_message_iter_get_uint32), (dbus_message_iter_get_double),
1968 (decode_header_data), (_dbus_message_loader_return_buffer),
1969 (message_iter_test), (_dbus_message_test):
1970 * dbus/dbus-message.h:
1971 * dbus/dbus-protocol.h:
1972 * dbus/dbus-test.c: (main):
1974 * glib/test-dbus-glib.c: (message_handler), (main):
1975 * test/echo-client.c: (main):
1976 * test/watch.c: (check_messages):
1977 Make messages sendable and receivable for real.
1979 2003-01-07 Anders Carlsson <andersca@codefactory.se>
1981 * dbus/dbus-marshal.c: (_dbus_marshal_double),
1982 (_dbus_marshal_string), (_dbus_marshal_byte_array):
1983 * dbus/dbus-message.c: (dbus_message_append_int32),
1984 (dbus_message_append_uint32), (dbus_message_append_double),
1985 (dbus_message_append_string), (dbus_message_append_byte_array):
1986 Handle OOM restoration.
1988 2003-01-07 Anders Carlsson <andersca@codefactory.se>
1990 * dbus/dbus-marshal.c: (_dbus_marshal_string),
1991 (_dbus_demarshal_string), (_dbus_marshal_test):
1992 * dbus/dbus-marshal.h:
1993 * dbus/dbus-message.c: (dbus_message_get_name),
1994 Document these functions.
1996 (dbus_message_append_int32), (dbus_message_append_uint32),
1997 (dbus_message_append_double), (dbus_message_append_string),
1998 (dbus_message_append_byte_array):
1999 * dbus/dbus-message.h:
2000 Add functions for adding message fields of different types.
2002 * dbus/dbus-protocol.h:
2003 Add the different types.
2005 2003-01-05 Havoc Pennington <hp@pobox.com>
2007 * bus/connection.c: implement routines for handling connections,
2008 first thing is keeping a list of owned services on each connection
2009 and setting up watches etc.
2011 * bus/services.c: implement a mapping from service names to lists
2014 * dbus/dbus-hash.c: add DBUS_HASH_POINTER
2016 * dbus/dbus-threads.c (dbus_static_mutex_lock): add functions
2017 to use static mutexes for global data
2019 * dbus/dbus-connection.c (dbus_connection_set_data): add new
2020 collection of functions to set/get application-specific data
2021 on the DBusConnection.
2023 2003-01-04 Havoc Pennington <hp@pobox.com>
2025 * dbus/dbus-sysdeps.c (_dbus_sleep_milliseconds): new function
2026 (_dbus_poll): new function
2028 * dbus/dbus-internals.h (_DBUS_STRUCT_OFFSET): new macro
2031 * bus/loop.c: initial code for the daemon main loop
2033 2003-01-04 Havoc Pennington <hp@pobox.com>
2035 * test/watch.c (error_handler): make it safe if the error handler
2036 is called multiple times (if we s/error handler/disconnect
2037 handler/ we should just guarantee it's called only once)
2039 * dbus/dbus-transport.c (_dbus_transport_disconnect): call the
2040 error handler on disconnect (it's quite possible we should
2041 just change the error handler to a "disconnect handler," I'm
2042 not sure we have any other meaningful errors)
2044 * configure.in: check for getpwnam_r
2046 * dbus/dbus-transport.c, dbus/dbus-transport-unix.c,
2047 dbus/dbus-auth.c: add credentials support, add EXTERNAL auth
2048 mechanism as in SASL spec, using socket credentials
2050 * dbus/dbus-sysdeps.c (_dbus_read_credentials_unix_socket): new function
2051 (_dbus_send_credentials_unix_socket): new function
2053 * dbus/dbus-sysdeps.c (_dbus_accept_unix_socket): rename just
2055 (_dbus_write): only check errno if <0 returned
2056 (_dbus_write_two): ditto
2058 2003-01-02 Anders Carlsson <andersca@codefactory.se>
2060 * dbus/dbus-marshal.c: (_dbus_marshal_utf8_string),
2061 (_dbus_marshal_byte_array), (_dbus_demarshal_utf8_string),
2062 (_dbus_marshal_test):
2063 * dbus/dbus-marshal.h:
2064 Add _dbus_marshal_byte_array and rename _dbus_marshal_string
2065 to _dbus_marshal_utf8_string. Also fix some tests.
2067 2002-12-28 Harri Porten <porten@kde.org>
2069 * configure.in: added check for C++ compiler and a very cheesy
2070 check for the Qt integration
2072 * Makefile.am (SUBDIRS): compile qt subdir if support is enabled
2074 * qt/Makefile.am: added
2076 * qt/.cvsignore: added
2078 * qt/dbus-qthread.cc, qt/dbus-qthread.cpp: renamed former to
2079 latter, added #ifdef QT_THREAD_SUPPORT guard.
2081 * dbus/Makefile.am: added missing headers for make dist
2083 2002-12-28 Kristian Rietveld <kris@gtk.org>
2085 * dbus/Makefile.am: fixup export-symbols-regex.
2087 2002-12-27 Anders Carlsson <andersca@codefactory.se>
2089 * acinclude.m4: Add this file and put the
2090 PKG_CHECK_MODULE macro in it.
2092 2002-12-27 Anders Carlsson <andersca@codefactory.se>
2094 * dbus/dbus-marshal.c: (_dbus_marshal_string),
2095 (_dbus_demarshal_double), (_dbus_demarshal_int32),
2096 (_dbus_demarshal_uint32), (_dbus_demarshal_string),
2097 (_dbus_marshal_test):
2098 Make the demarshalling routines align the pos argument.
2099 Add string marshalling tests and fix the obvious bugs
2102 2002-12-26 Havoc Pennington <hp@pobox.com>
2104 * dbus/dbus-auth.c: fixes fixes fixes
2106 * dbus/dbus-transport-unix.c: wire up support for
2107 encoding/decoding data on the wire
2109 * dbus/dbus-auth.c (_dbus_auth_encode_data)
2110 (_dbus_auth_decode_data): append to target string
2111 instead of nuking it.
2113 2002-12-26 Havoc Pennington <hp@pobox.com>
2115 * dbus/dbus-marshal.h (DBUS_COMPILER_BYTE_ORDER): #ifdef
2116 WORDS_BIGENDIAN then compiler byte order is DBUS_BIG_ENDIAN,
2119 * dbus/dbus-marshal.c: Add macros to do int swapping in-place and
2120 avoid swap_bytes() overhead (ignoring possible assembly stuff for
2121 now). Main point is because I wanted unpack_uint32 to implement
2123 (_dbus_verbose_bytes): new function
2125 * dbus/dbus-string.c (_dbus_string_validate_ascii): new function
2127 * dbus/dbus-message.c (_dbus_message_loader_get_is_corrupted): add
2128 mechanism to handle a corrupt message stream
2129 (_dbus_message_loader_new): fix preallocation to only prealloc,
2132 * dbus/dbus-string.c (_dbus_string_skip_blank): fix this function
2133 (_dbus_string_test): enhance tests for copy/move and fix the
2136 * dbus/dbus-transport-unix.c: Hold references in more places to
2137 avoid reentrancy problems
2139 * dbus/dbus-transport.c: ditto
2141 * dbus/dbus-connection.c (dbus_connection_dispatch_message): don't
2142 leak reference count in no-message case
2144 * test/watch.c (do_mainloop): handle adding/removing watches
2145 during iteration over the watches. Also, ref the connection/server
2146 stored on a watch, so we don't try to mangle a destroyed one.
2148 * dbus/dbus-transport-unix.c (do_authentication): perform
2151 * dbus/dbus-auth.c (get_state): add a state
2152 AUTHENTICATED_WITH_UNUSED_BYTES and return it if required
2153 (_dbus_auth_get_unused_bytes): append the unused bytes
2154 to the passed in string, rather than prepend
2156 * dbus/dbus-transport.c (_dbus_transport_init_base): create
2157 the auth conversation DBusAuth
2159 * dbus/dbus-transport-unix.c (_dbus_transport_new_for_fd)
2160 (_dbus_transport_new_for_domain_socket): when creating a
2161 transport, pass in whether it's a client-side or server-side
2162 transport so we know which DBusAuth to create
2164 2002-12-03 Havoc Pennington <hp@pobox.com>
2166 * dbus/dbus-transport-unix.c (unix_finalize): finalize base
2167 _after_ finalizing the derived members
2168 (unix_connection_set): unref watch if we fail to add it
2170 * dbus/dbus-connection.c (dbus_connection_unref): delete the
2171 transport first, so that the connection owned by the
2172 transport will be valid as the transport finalizes.
2174 * dbus/dbus-transport-unix.c (unix_finalize): free the write_watch
2175 if necessary, and remove watches from the connection.
2177 * dbus/dbus-watch.c (_dbus_watch_list_free): improve a comment
2179 2002-12-26 Anders Carlsson <andersca@codefactory.se>
2181 * dbus/dbus-marshal.c: (_dbus_marshal_string),
2182 (_dbus_demarshal_double), (_dbus_demarshal_int32),
2183 (_dbus_demarshal_uint32), (_dbus_demarshal_string),
2184 (_dbus_marshal_test):
2185 * dbus/dbus-marshal.h:
2186 Add string marshal functions and have the demarshal functions
2187 return the new position.
2189 2002-12-25 Havoc Pennington <hp@pobox.com>
2191 * doc/dbus-sasl-profile.txt: docs on the authentication protocol,
2192 it is a simple protocol that just maps directly to SASL.
2194 * dbus/dbus-auth.h, dbus/dbus-auth.c: authentication protocol
2195 initial implementation, not actually used yet.
2197 * dbus/dbus-string.c (_dbus_string_find): new function
2198 (_dbus_string_equal): new function
2199 (_dbus_string_base64_encode): new function
2200 (_dbus_string_base64_decode): new function
2202 2002-12-25 Anders Carlsson <andersca@codefactory.se>
2205 * dbus/dbus-marshal.c: (swap_bytes), (_dbus_marshal_double),
2206 (_dbus_marshal_int32), (_dbus_marshal_uint32),
2207 (_dbus_demarshal_double), (_dbus_demarshal_int32),
2208 (_dbus_demarshal_uint32), (_dbus_marshal_test):
2209 * dbus/dbus-marshal.h:
2210 * dbus/dbus-protocol.h:
2211 * dbus/dbus-test.c: (main):
2213 Add un-optimized marshalling/demarshalling routines.
2215 2002-12-25 Harri Porten <porten@kde.org>
2217 * qt/dbus-qt.h: adjusted ctor and getter to KDE/Qt conventions
2219 2002-12-24 Zack Rusin <zack@kde.org>
2221 * qt/dbus-qthread.cc: adding - integrates QMutex into Dbus
2222 * qt/dbus-qt.h: skeleton with two sample implemenatation of the
2225 2002-12-24 Havoc Pennington <hp@pobox.com>
2227 * glib/dbus-gthread.c: fix include
2229 * glib/dbus-glib.h: rename DBusMessageHandler for now.
2230 I think glib API needs to change, though, as you don't
2231 want to use DBusMessageFunction, you want to use the
2232 DBusMessageHandler object. Probably
2233 dbus_connection_open_with_g_main_loop()
2234 and dbus_connection_setup_g_main_loop() or something like that
2235 (but think of better names...) that just create a connection
2236 that has watch/timeout functions etc. already set up.
2238 * dbus/dbus-connection.c
2239 (dbus_connection_send_message_with_reply): new function just to
2240 show how the message handler helps us deal with replies.
2242 * dbus/dbus-list.c (_dbus_list_remove_last): new function
2244 * dbus/dbus-string.c (_dbus_string_test): free a string that
2247 * dbus/dbus-hash.c: use memory pools for the hash entries
2248 (rebuild_table): be more paranoid about overflow, and
2249 shrink table when we can
2250 (_dbus_hash_test): reduce number of sprintfs and write
2251 valid C89. Add tests for case where we grow and then
2252 shrink the hash table.
2254 * dbus/dbus-mempool.h, dbus/dbus-mempool.c: memory pools
2256 * dbus/dbus-connection.c (dbus_connection_register_handler)
2257 (dbus_connection_unregister_handler): new functions
2259 * dbus/dbus-message.c (dbus_message_get_name): new
2261 * dbus/dbus-list.c: fix docs typo
2263 * dbus/dbus-message-handler.h, dbus/dbus-message-handler.c:
2264 an object representing a handler for messages.
2266 2002-12-16 Anders Carlsson <andersca@codefactory.se>
2269 * glib/dbus-gthread.c: (dbus_gthread_init):
2270 Don't use the gdbus prefix for public functions.
2272 2002-12-16 Anders Carlsson <andersca@codefactory.se>
2276 Add GLib checks and fixup .pc files
2280 * glib/dbus-gmain.c: (gdbus_connection_prepare),
2281 (gdbus_connection_check), (gdbus_connection_dispatch),
2282 (gdbus_add_connection_watch), (gdbus_remove_connection_watch),
2283 (dbus_connection_gsource_new):
2284 * glib/dbus-gthread.c: (dbus_gmutex_new), (dbus_gmutex_free),
2285 (dbus_gmutex_lock), (dbus_gmutex_unlock), (dbus_gthread_init):
2286 * glib/test-dbus-glib.c: (message_handler), (main):
2289 2002-12-15 Harri Porten <porten@kde.org>
2291 * autogen.sh: check for libtoolize before attempting to use it
2293 * dbus/dbus-transport-unix.c: include <sys/time.h> for timeval
2296 * .cvsignore: ignore more stamp files
2298 * dbus/dbus-watch.c (_dbus_watch_list_new): fixed doc error
2300 * test/Makefile.am: added -I$(top_srcdir) to be able to compile
2301 without make install.
2303 2002-12-15 Havoc Pennington <hp@pobox.com>
2305 * dbus/dbus-threads.c: add thread stubs that a higher library
2306 layer can fill in. e.g. the GLib wrapper might fill them in with
2307 GThread stuff. We still need to use this thread API to
2308 thread-safe-ize the library.
2310 2002-12-12 Havoc Pennington <hp@pobox.com>
2312 * dbus/dbus-transport-unix.c, dbus/dbus-server-unix.c: use the
2313 below new interfaces and include fewer system headers.
2315 * dbus/dbus-sysdeps.c (_dbus_read): new function
2316 (_dbus_write): new function
2317 (_dbus_write_two): new function
2318 (_dbus_connect_unix_socket): new function
2319 (_dbus_listen_unix_socket): new function
2321 * dbus/dbus-message-internal.h: change interfaces to use
2324 2002-12-11 Havoc Pennington <hp@pobox.com>
2326 * dbus/dbus-types.h: add dbus_unichar
2328 * dbus/dbus-internals.c (_dbus_verbose): use _dbus_getenv
2330 * dbus/dbus-connection.c (dbus_connection_send_message): return
2333 * dbus/dbus-transport.c: include dbus-watch.h
2335 * dbus/dbus-connection.c: include dbus-message-internal.h
2337 * HACKING: add file with coding guidelines stuff.
2339 * dbus/dbus-string.h, dbus/dbus-string.c: Encapsulate all string
2340 handling here, for security purposes (as in vsftpd). Not actually
2341 using this class yet.
2343 * dbus/dbus-sysdeps.h, dbus/dbus-sysdeps.c: Encapsulate all
2344 system/libc usage here, as in vsftpd, for ease of auditing (and
2345 should also simplify portability). Haven't actually moved all the
2346 system/libc usage into here yet.
2348 2002-11-25 Havoc Pennington <hp@pobox.com>
2350 * dbus/dbus-internals.c (_dbus_verbose): fix to not
2351 always print the first verbose message.
2353 2002-11-24 Havoc Pennington <hp@pobox.com>
2355 * test/echo-client.c, test/echo-server.c: cheesy test
2358 * configure.in (AC_CHECK_FUNCS): check for writev
2360 * dbus/dbus-message.c (_dbus_message_get_network_data): new
2363 * dbus/dbus-list.c (_dbus_list_foreach): new function
2365 * dbus/dbus-internals.c (_dbus_verbose): new function
2367 * dbus/dbus-server.c, dbus/dbus-server.h: public object
2368 representing a server that listens for connections.
2370 * dbus/.cvsignore: create
2372 * dbus/dbus-errors.h, dbus/dbus-errors.c:
2373 public API for reporting errors
2375 * dbus/dbus-connection.h, dbus/dbus-connection.c:
2376 public object representing a connection that
2377 sends/receives messages. (Same object used for
2378 both client and server.)
2380 * dbus/dbus-transport.h, dbus/dbus-transport.c:
2381 Basic abstraction for different kinds of stream
2382 that we might read/write messages from.
2384 2002-11-23 Havoc Pennington <hp@pobox.com>
2386 * dbus/dbus-internals.h (_DBUS_INT_MAX): add _DBUS_INT_MIN
2389 * dbus/dbus-test.c (main): add list test, and include
2390 dbus-test.h as intended
2392 * dbus/dbus-hash.c (_dbus_hash_table_remove_string)
2393 (_dbus_hash_table_remove_int): return value indicates
2394 whether the entry existed to remove
2396 * dbus/dbus-list.c: add linked list utility class,
2399 * dbus/dbus-hash.c: add TODO item about shrinking the hash bucket
2402 2002-11-23 Havoc Pennington <hp@pobox.com>
2404 * Doxyfile.in (INCLUDE_FILE_PATTERNS): expand DBUS_BEGIN_DECLS/
2405 DBUS_END_DECLS to nothing, that should fix this once and for all
2407 * Doxyfile.in (JAVADOC_AUTOBRIEF): set to YES
2409 * dbus/dbus-message.c, dbus/dbus-hash.c:
2410 add some missing @brief
2412 2002-11-23 Havoc Pennington <hp@pobox.com>
2414 * dbus/dbus-message.h: put semicolons after DEBUG_BEGIN_DECLS
2415 to avoid confusing Doxygen
2417 * dbus/dbus-hash.c: @} not }@
2419 * dbus/dbus-message.c (struct DBusMessage): split out
2422 2002-11-23 Havoc Pennington <hp@pobox.com>
2424 * configure.in: pile on more warning flags if using gcc
2426 * Doxyfile.in (EXTRACT_STATIC): set to NO, so we don't have
2427 to document static functions
2429 * configure.in: add summary to end of configure so it
2430 looks nice and attractive
2432 * dbus/dbus-hash.c: finish implementation and write unit
2435 * configure.in: add --enable-tests to enable unit tests
2437 * dbus/dbus-test.c: test program to run unit tests
2438 for all files in dbus/*, initially runs a test for
2441 * dbus/dbus-internals.h: file to hold some internal utility stuff
2443 2002-11-22 Havoc Pennington <hp@redhat.com>
2445 * dbus/dbus-hash.c: copy in Tcl hash table, not yet
2446 "ported" away from Tcl
2448 * dbus/dbus-types.h: header for types such as dbus_bool_t
2450 2002-11-22 Havoc Pennington <hp@redhat.com>
2452 * dbus/dbus.h: fixups for doc warnings
2454 * Doxyfile.in (FILE_PATTERNS): we need to scan .h to pick up
2456 (QUIET): make it quiet so we can see warnings
2458 * dbus/dbus-memory.c: teach D-BUS to allocate and free memory
2460 2002-11-22 Havoc Pennington <hp@redhat.com>
2462 * Makefile.am: include "Doxyfile" target in all-local
2464 * configure.in: generate the Doxyfile
2466 * Doxyfile.in: move Doxyfile here, so we can use
2467 configure to generate a Doxyfile with the right
2470 2002-11-22 Havoc Pennington <hp@redhat.com>
2472 * dbus/dbus-message.c: move inline docs into .c file
2474 * Doxyfile (OUTPUT_DIRECTORY): move output to doc/api
2475 so all docs are under doc/
2476 (MAN_EXTENSION): generate man pages. Use extension
2477 ".3dbus" which matches ".3qt" on my system,
2478 I guess this is OK, I don't know really.
2479 (FILE_PATTERNS): look for .c files not .h, makes sense
2482 2002-11-22 Havoc Pennington <hp@pobox.com>
2484 * Makefile.am (SUBDIRS): rename subdir "server" to "bus"
2485 because any app can be a server, and any app can be a client,
2486 the bus is a special kind of server.
2488 Thu Nov 21 23:35:31 2002 Zack Rusin <zack@kde.org>
2490 * Doxyfile : adding. Still needs Makefile rules to be generated
2491 automatically (just run "doxygen" in the toplevel dir for now to
2494 * dbus/dbus-message.h : Adding sample docs (javadoc since
2495 resembles gtk-doc a little more)
2497 * dbus/dbus.h : Adding sample docs
2499 2002-11-21 Havoc Pennington <hp@redhat.com>
2501 * dbus/Makefile.am (INCLUDES): define DBUS_COMPILATION
2502 so we can allow ourselves to include files directly,
2503 instead of having to use dbus.h
2505 * dbus/dbus.h: fill in
2507 * dbus/dbus-message.h: sketch out a sample header file.
2508 Include griping if you include it directly instead of
2511 * dbus/dbus-macros.h: new file with macros for extern "C",
2512 TRUE/FALSE, NULL, etc.
2514 * doc/file-boilerplate.c: put include guards in here
2516 2002-11-21 Havoc Pennington <hp@redhat.com>
2518 * doc/file-boilerplate.c: include both AFL and GPL boilerplate.
2520 * COPYING: include the GPL as well, and license code
2521 under both AFL and GPL.
2523 2002-11-21 Havoc Pennington <hp@redhat.com>
2525 * acconfig.h: get rid of this
2527 * autogen.sh (run_configure): add --no-configure option
2529 * configure.in: remove AC_ARG_PROGRAM to make
2530 autoconf complain less. add AC_PREREQ.
2531 add AC_DEFINE third arg.
2533 2002-11-21 Anders Carlsson <andersca@codefactory.se>
2536 Fix references so we can distcheck.
2538 2002-11-21 Havoc Pennington <hp@redhat.com>
2540 * Initial module creation