1 2003-04-05 Havoc Pennington <hp@pobox.com>
3 * bus/bus.c (setup_server): fix this so dbus-daemon-1 doesn't
4 crash on startup. Need to get "try starting the daemon"
5 in the test suite I guess. ;-)
7 * dbus/dbus-server.h, dbus/dbus-server.c: remove the stuff that
8 tracked the number of open connections; it's better done in
9 application-specific code as you want it to span all servers etc.
11 2003-04-05 Havoc Pennington <hp@pobox.com>
13 * bus/Makefile.am (install-data-hook): add missing DESTDIR,
14 patch from Colin Walters
16 2003-04-05 Havoc Pennington <hp@pobox.com>
18 * doc/config-file.txt (Elements): fix docs of <auth> to reflect
19 reality; in fact multiple mechanisms are allowed.
21 * dbus/dbus-internals.c (_dbus_real_assert)
22 (_dbus_real_assert_not_reached): move guts of _dbus_assert() and
23 _dbus_assert_not_reached() into functions, so that they don't show
24 up in basic block counts for test coverage, and don't use up as
25 much disk space. Does mean slower execution speed though, so
26 assumes --disable-asserts is the normal production case.
28 2003-04-05 Havoc Pennington <hp@pobox.com>
30 * test/Makefile.am (dist-hook): also dist *.in files
36 2003-04-05 Havoc Pennington <hp@pobox.com>
38 * dbus/dbus-string.c: docs warning
40 * dbus/dbus-spawn.c: missing docs
42 * dbus/dbus-memory.c (struct ShutdownClosure): missing docs
44 2003-04-05 Havoc Pennington <hp@pobox.com>
46 * bus/loop.c (bus_loop_iterate): fix the timeout code, using
49 * dbus/dbus-spawn.c (_dbus_babysitter_unref): set sitter_pid
50 to -1 once we've reaped the babysitter
51 (_dbus_babysitter_handle_watch): do as much work as we can, not
54 * bus/activation.c: add code using DBusBabysitter so that we
55 handle it when a service fails to start up properly.
56 (bus_activation_service_created): don't remove the activation
57 entries as we go, just let them get removed when we free the pending
58 activation. Unref reply messages after sending them.
60 2003-04-05 Havoc Pennington <hp@pobox.com>
62 * test/decode-gcov.c (main): print per-directory stats in the report
64 * Makefile.am (coverage-report.txt): don't include test/* in gcov stats
66 2003-04-05 Havoc Pennington <hp@pobox.com>
68 * Makefile.am (coverage-report.txt): add target "coverage-report.txt"
70 * test/decode-gcov.c: hack up a little program to suck data
71 out of gcov files. Yes this is sort of silly.
73 * configure.in: define something in config.h and do an
74 AM_CONDITIONAL when gcov is enabled
76 2003-04-04 Havoc Pennington <hp@redhat.com>
78 * dbus/dbus-spawn.c, dbus/dbus-spawn.h: Change dbus_spawn to
79 return a "babysitter" object that is used to monitor the status of
80 the spawned process and reap it when required.
82 * test/test-segfault.c, test/test-exit.c,
83 test/test-sleep-forever.c: binaries that do various lame things,
84 used in the test suite.
86 * dbus/dbus-sysdeps.c: kill _dbus_errno_to_string()
88 2003-04-03 Havoc Pennington <hp@pobox.com>
90 * dbus/dbus-spawn.c: Move dbus-spawn into a separate file
91 in preparation for modifying it, dbus-sysdeps is getting
94 2003-04-03 Havoc Pennington <hp@redhat.com>
96 * bus/loop.h, bus/loop.c: make the mainloop an object so we can
99 * bus/*.[hc]: adapt to mainloop change
101 2003-04-03 Havoc Pennington <hp@redhat.com>
103 * bus/activation.c (load_directory): fix up memleaks
104 (bus_activation_entry_free): free the entry
106 * dbus/dbus-bus.c (dbus_bus_acquire_service): return an error if
107 we get one from the message bus; fix memleaks.
109 * dbus/dbus-message.c (dbus_set_error_from_message): new function
111 2003-04-03 Havoc Pennington <hp@pobox.com>
113 * bus/config-parser.c (bus_config_parser_unref): free
114 list of mechanisms, bug discovered by test suite enhancements
115 (putting system.conf and session.conf into suite)
117 * test/Makefile.am, test/test-service.c: add placeholder for a
118 test service that we'll activate as part of test suite. Doesn't
121 * dbus/dbus-sysdeps.c (_dbus_setenv): support unsetenv by
122 setting NULL value, and use system malloc not dbus_malloc()
123 when we have unavoidable memleakage.
125 * dbus/dbus-bus.c (dbus_bus_get): fix bug where bus type of 0
126 didn't work, and support DBUS_BUS_ACTIVATION.
128 * bus/activation.c (child_setup): pass our well-known bus type to
131 * bus/config-parser.c: support <type> to specify well-known type
133 * doc/dbus-specification.sgml: document the env variables to
134 locate well-known buses and find service activator
136 2003-04-02 Havoc Pennington <hp@redhat.com>
138 * test/Makefile.am (all-local): add a rule to copy tests to
139 builddir, so we can have generated tests. Use this to remove the
140 silly hack for testing system.conf and session.conf. Will use this
141 shortly to generate .service files pointing to test binaries.
143 2003-04-02 Havoc Pennington <hp@redhat.com>
145 * dbus/dbus-string.c (set_length): fix a bug - we allocated max of
146 current alloc and needed new length, not max of the doubled
147 allocation and needed new length. Also, when building tests,
148 don't do the double-allocation stuff, just realloc every time.
150 2003-04-02 Havoc Pennington <hp@redhat.com>
152 * dbus/dbus-sysdeps.c (_dbus_file_get_contents): include filenames
154 (_dbus_string_get_dirname): new
155 (_dbus_sysdeps_test): new
156 (_dbus_directory_open): include dirnames in error messages
158 * bus/config-parser.c: interpret <include> and <includedir> and
159 <servicedir> relative to config file location if the given
160 filename is not absolute.
162 * dbus/dbus-string.c (_dbus_string_find_byte_backward): new
164 2003-04-02 Havoc Pennington <hp@redhat.com>
166 * bus/connection.c (bus_transaction_send_error_reply): set sender
167 service for the error, and unref the reply on success
169 * bus/activation.c: convert to use BusTransaction so OOM can be
171 (bus_activation_service_created): set sender of the message
173 2003-04-01 Havoc Pennington <hp@redhat.com>
175 * bus/config-parser.c, bus/bus.c: implement <servicedir> and
176 <includedir> (at least mostly)
178 * dbus/dbus-sysdeps.c (_dbus_change_identity): set the group ID
179 first, then the user ID
181 2003-04-01 Havoc Pennington <hp@pobox.com>
183 * dbus/dbus-server.c (dbus_server_set_auth_mechanisms): new
186 * dbus/dbus-auth.c (_dbus_auth_set_mechanisms): new
188 * dbus/dbus-internals.c (_dbus_dup_string_array): new function
190 * dbus/dbus-sysdeps.c (_dbus_listen_unix_socket): chmod the
191 socket 0777, and unlink any existing socket.
193 * bus/bus.c (bus_context_new): change our UID/GID and fork if
194 the configuration file so specifies; set up auth mechanism
197 * bus/config-parser.c (bus_config_parser_content): add support
198 for <fork> option and fill in code for <auth>
200 * bus/system.conf.in: add <fork/> to default configuration,
201 and limit auth mechanisms to EXTERNAL
203 * doc/config-file.txt (Elements): add <fork>
205 * dbus/dbus-sysdeps.c (_dbus_become_daemon): new function
206 (_dbus_change_identity): new function
208 2003-03-31 Havoc Pennington <hp@redhat.com>
210 * dbus/dbus-sysdeps.c (_dbus_connect_unix_socket)
211 (_dbus_listen_unix_socket): fix off-by-one error in null
212 termination spotted by Nalin
214 2003-03-31 Havoc Pennington <hp@redhat.com>
216 * dbus/dbus-keyring.c (_dbus_keyring_new_homedir): allow setting
217 DBUS_TEST_HOMEDIR when tests are enabled, so we can test without
218 having a real home directory available.
220 2003-03-31 Havoc Pennington <hp@redhat.com>
222 * bus/Makefile.am (install-data-hook): create /var/run/dbus
224 * bus/messagebus.in: add init script for Red Hat /etc/init.d
226 * configure.in: add support for specifying a style of init script
229 2003-03-31 Havoc Pennington <hp@redhat.com>
231 Fix some annoying DBusString API and fix all affected code.
233 * dbus/dbus-string.c (_dbus_string_init): get rid of annoying
235 (_dbus_string_get_data): change to return string instead of using
237 (_dbus_string_get_const_data): ditto
238 (_dbus_string_get_data_len): ditto
239 (_dbus_string_get_const_data_len): ditto
241 2003-03-31 Havoc Pennington <hp@redhat.com>
243 * bus/main.c (main): fix up the command line arguments to be nicer
245 2003-03-31 Havoc Pennington <hp@redhat.com>
247 * dbus/Makefile.am (INCLUDES): use EXPANDED_LOCALSTATEDIR to
248 define DBUS_SYSTEM_BUS_PATH as we want to compile in the same
249 final location that lands in the config file
251 * bus/config-loader-expat.c (bus_config_load): fix type of
254 * doc/TODO: remove TODO item for dbus_bus_get()
256 * dbus/dbus-bus.c (bus_data_free): add missing lock/unlock
258 2003-03-31 Havoc Pennington <hp@pobox.com>
260 * dbus/dbus-transport-unix.c (_dbus_transport_new_for_domain_socket)
261 (_dbus_transport_new_for_tcp_socket): these didn't need the "server"
262 argument since they are always client side
264 * dbus/dbus-server.c (dbus_server_get_address): new function
266 * bus/main.c (main): take the configuration file as an argument.
268 * test/data/valid-config-files/debug-allow-all.conf: new file to
269 use with dispatch.c tests for example
271 * bus/test-main.c (main): require test data dir
273 * bus/bus.c (bus_context_new): change this to take a
274 configuration file name as argument
276 * doc/config-file.txt (Elements): add <servicedir>
278 * bus/system.conf, bus/session.conf: new files
280 * dbus/dbus-bus.c (dbus_bus_get): look for system bus on
281 well-known socket if none set
283 * configure.in: create system.conf and session.conf
285 2003-03-30 Havoc Pennington <hp@pobox.com>
287 * bus/config-parser.c: hacking
289 * dbus/dbus-memory.c: don't use DBusList for the list of stuff
290 to shut down, since it could cause weirdness with the DBusList
293 * dbus/dbus-list.c (_dbus_list_test): add tests for the
294 link-oriented stack routines
295 (alloc_link): free the mempool if the first alloc from it fails
297 * dbus/dbus-mempool.c (struct DBusMemBlock): fix alignment issue
299 * dbus/dbus-string.c (UNICODE_VALID): sync new version of this
301 (_dbus_string_skip_white): new
303 * doc/config-file.txt (Elements): add <includedir>
305 2003-03-28 Havoc Pennington <hp@pobox.com>
307 * dbus/dbus-string.c (_dbus_string_copy_data_len)
308 (_dbus_string_copy_data): new functions
310 2003-03-28 Anders Carlsson <andersca@codefactory.se>
312 * dbus/dbus-bus.c: (bus_data_free), (dbus_bus_get):
316 * dbus/dbus-memory.c:
319 2003-03-28 Havoc Pennington <hp@pobox.com>
321 * bus/test.c (bus_test_flush_bus): remove the sleep from here,
322 I think it may have just been superstition. Not sure.
324 * dbus/dbus-string.c (_dbus_string_base64_decode): catch some OOM
325 failures that were not being handled.
327 * dbus/dbus-auth.c (process_auth): fix a memleak in OOM handling
329 * dbus/dbus-memory.c: add ability to set number of mallocs in a
330 row that will fail on out-of-memory.
332 * dbus/dbus-internals.c (_dbus_test_oom_handling): convenience
333 function for testing out-of-memory handling.
335 * bus/config-loader-expat.c (memsuite): don't wrap the dbus
336 allocation functions, they do map exactly to the expat ones.
338 2003-03-27 Havoc Pennington <hp@redhat.com>
340 * bus/config-loader-libxml.c (bus_config_load): add another error
343 2003-03-26 Anders Carlsson <andersca@codefactory.se>
346 Add note about automatic service activation.
348 * doc/dbus-specification.sgml:
349 Rename the specification and clarify a few things.
351 2003-03-26 Anders Carlsson <andersca@codefactory.se>
354 * dbus/dbus-address.c:
356 * dbus/dbus-marshal.c:
357 * dbus/dbus-server-debug-pipe.c:
358 * dbus/dbus-transport-unix.c:
359 Fix documentation warnings.
361 2003-03-26 Havoc Pennington <hp@pobox.com>
363 * bus/test-main.c, dbus/dbus-test.c (main): check memleaks
364 after every test so it's quick and easy to see which leaked, and
365 so we test multiple dbus_shutdown() calls
367 * configure.in: change configure.in XML stuff to also support
370 * config-loader-libxml.c: some hacking
372 * config-loader-expat.c: some hacking
374 * config-parser.c: some hacking, plus tests
376 2003-03-25 Havoc Pennington <hp@redhat.com>
378 * throughout - add more _DBUS_ASSERT_ERROR_IS_CLEAR
380 * configure.in: add --with-xml option to specify XML library,
381 right now only libxml is supported.
383 * bus/config-loader-libxml.c, config-parser.c: sync some minor
384 nonworking code between home and work, still just stubs
386 2003-03-24 Havoc Pennington <hp@redhat.com>
388 * dbus/dbus-sysdeps.c (_dbus_set_fd_nonblocking): move to this
391 * dbus/dbus-errors.c (dbus_set_error, dbus_set_error_const): allow
392 NULL argument for "message" if the error is a well-known one,
393 fill in a generic message in this case.
395 * dbus/dbus-errors.h (DBusResultCode): Kill DBusResultCode in
398 * bus/test.c (bus_test_flush_bus): add
400 * bus/policy.c (bus_policy_test): test code stub
402 2003-03-24 Havoc Pennington <hp@pobox.com>
404 * bus/connection.c (bus_connections_setup_connection): set up
405 the "can this user connect" function, but it always returns
406 TRUE until we have a config file parser so we can have a config
407 file that allows connections.
409 2003-03-23 Havoc Pennington <hp@pobox.com>
411 * dbus/dbus-threads.c (dbus_mutex_new, dbus_condvar_new): with
412 DBUS_BUILD_TESTS, actually alloc/free a block of memory for
413 the mutex, so we can check for proper memory management
416 * dbus/dbus-dataslot.c: remove the mutex from
417 DBusDataSlotAllocator and lock it manually when using it,
418 to simplify fitting it into the global slots framework.
420 * dbus/dbus-threads.c (init_static_locks): rework how we're
421 handling global locks so they are easily shut down.
423 * bus/policy.c (bus_policy_append_rule): fix
425 * bus/test-main.c (main): check for memleaks
427 * dbus/dbus-test.c (dbus_internal_do_not_use_run_tests): make
428 test suite check for memleaks
430 * dbus/dbus-memory.c: add support in test mode for tracking
431 number of outstanding blocks
433 2003-03-23 Havoc Pennington <hp@pobox.com>
435 * bus/policy.c, bus/bus.c, bus/connection.c: implement allow/deny
438 * dbus/dbus-hash.h: add ULONG hash keys
440 * dbus/dbus-sysdeps.c (_dbus_get_groups): new
441 (_dbus_get_group_id): new function
443 2003-03-20 Havoc Pennington <hp@redhat.com>
445 * dbus/dbus-connection.c (dbus_connection_set_unix_user_function):
447 (dbus_connection_get_unix_user): new function
449 2003-03-20 Havoc Pennington <hp@pobox.com>
451 * bus/connection.c (bus_connection_send_oom_error): assert that
453 (connection_execute_transaction): ditto
454 (bus_connection_preallocate_oom_error): fix to set the sender, and
455 set recipient to the destination service, not the bus driver
457 * bus/policy.c: hacking
459 * dbus/dbus-message.c (dbus_message_service_is): new function
460 (dbus_message_sender_is): new
462 2003-03-19 Havoc Pennington <hp@redhat.com>
464 * bus/policy.c: start sketching code for policy restrictions on
465 what connections can do.
467 2003-03-18 Havoc Pennington <hp@redhat.com>
469 * doc/TODO: some notes on high-level todo items. Little nitpick
470 stuff is all in @todo, so no need to add it here.
472 * doc/config-file.txt: some notes on how config file might look
474 2003-03-18 Anders Carlsson <andersca@codefactory.se>
480 2003-03-17 Havoc Pennington <hp@redhat.com>
482 * dbus/dbus-internals.h: add gcc attributes so that
483 our printf-style functions warn on bad arguments to
486 * dbus/dbus-sysdeps.c (_dbus_connect_tcp_socket): fix printf
489 * dbus/dbus-message.c (_dbus_message_loader_queue_messages): fix
492 2003-03-17 Havoc Pennington <hp@redhat.com>
494 * bus/test-main.c (main): make it print something as it runs
495 so make check doesn't look stuck
497 * doc/negotiation.txt, doc/dbus-sasl-profile.txt: remove
498 from CVS, now obsolete
500 2003-03-17 Anders Carlsson <andersca@codefactory.se>
502 * bus/dispatch.c: (bus_dispatch):
503 Refetch the service name since it may have been reallocated
504 when dbus_message_set_sender was called.
506 * dbus/dbus-sysdeps.c: (_dbus_accept):
507 Add address and address length variables and use them to stop
508 valgrind from complaining.
510 2003-03-17 Havoc Pennington <hp@pobox.com>
512 All tests pass, no memleaks, no valgrind complaints.
514 * bus/test.c: refcount handler_slot
516 * bus/connection.c (bus_connections_new): refcount
519 * dbus/dbus-auth-script.c (_dbus_auth_script_run): delete unused
520 bytes so that auth scripts pass.
522 * bus/dispatch.c: init message_handler_slot so it gets allocated
525 * bus/dispatch.c (message_handler_slot_ref): fix memleak
527 * dbus/dbus-server-debug-pipe.c (_dbus_server_debug_pipe_new):
528 dealloc server_pipe_hash when no longer used for benefit of
531 * dbus/dbus-auth.c (process_command): memleak fix
533 * bus/dispatch.c (check_hello_message): memleak fix
535 2003-03-16 Havoc Pennington <hp@pobox.com>
537 * dbus/dbus-bus.c (ensure_bus_data): fix double-unref of the data slot
539 2003-03-17 Anders Carlsson <andersca@codefactory.se>
541 * bus/activation.c (bus_activation_activate_service): Append
542 the pending activation entry to the list of pending activations.
544 2003-03-16 Havoc Pennington <hp@pobox.com>
546 * bus/dispatch.c (bus_dispatch_test): remove double-unrefs of
549 * dbus/dbus-address.c (create_entry): fix OOM handling when
550 failing to alloc entry->method
552 2003-03-16 Havoc Pennington <hp@pobox.com>
554 * dbus/dbus-watch.c (_dbus_watch_new): handle failure to malloc
557 * dbus/dbus-server-debug-pipe.c (_dbus_transport_debug_pipe_new):
558 add some missing dbus_set_result
560 * bus/dispatch.c (bus_dispatch_add_connection): handle failure to
561 alloc the DBusMessageHandler
563 * dbus/dbus-transport.c (_dbus_transport_disconnect): don't ref
564 the transport here, since we call this from the finalizer; it
565 resulted in a double-finalize.
567 * dbus/dbus-transport.c (_dbus_transport_disconnect): fix a bug
568 where we tried to use transport->connection that was NULL,
569 happened when transport was disconnected early on due to OOM
571 * bus/*.c: adapt to handle OOM for watches/timeouts
573 * dbus/dbus-transport-unix.c: port to handle OOM during
576 * dbus/dbus-auth.c (_dbus_auth_get_unused_bytes): return a
577 reference to unused bytes instead of a copy
579 * dbus/dbus-server.c (dbus_server_handle_watch): return FALSE for
582 * dbus/dbus-connection.c (dbus_connection_handle_watch): return
585 * dbus/dbus-timeout.c (dbus_timeout_handle): return FALSE for out
588 2003-03-16 Anders Carlsson <andersca@codefactory.se>
590 * doc/dbus-specification.sgml:
591 Document reply message for ActivateService.
593 2003-03-16 Anders Carlsson <andersca@codefactory.se>
595 * bus/activation.c: (bus_pending_activation_entry_free),
596 (bus_pending_activation_free), (bus_activation_new),
597 (bus_activation_unref), (bus_activation_service_created),
598 (bus_activation_activate_service):
600 * bus/bus.c: (bus_context_new):
601 * bus/desktop-file.c: (new_section):
602 * bus/driver.c: (bus_driver_send_service_deleted),
603 (bus_driver_handle_activate_service):
604 * bus/services.c: (bus_registry_new), (bus_registry_ensure):
606 * dbus/dbus-connection.c:
607 (dbus_connection_send_with_reply_and_block):
608 * dbus/dbus-message.c: (dbus_message_append_args_valist):
609 * dbus/dbus-protocol.h:
610 Make activation work better. Now pending activations will be queued
611 and the daemon won't try to activate services that are already registered.
613 2003-03-16 Havoc Pennington <hp@pobox.com>
615 * dbus/dbus-bus.c (ensure_bus_data): handle failure to set
618 * dbus/dbus-memory.c (_dbus_initialize_malloc_debug): support
619 DBUS_MALLOC_BACKTRACES to print trace when failing an alloc
621 2003-03-16 Havoc Pennington <hp@pobox.com>
623 * dbus/dbus-string.c (_dbus_string_validate_utf8): oops, unbreak
624 this. always run the test suite before commit...
626 * bus/*: adapt to DBusConnection API changes
628 * glib/dbus-gmain.c: adapt to DBusConnection API changes,
629 requires renaming stuff to avoid dbus_connection_dispatch name
632 * dbus/dbus-transport.c (_dbus_transport_queue_messages): new
635 * dbus/dbus-message.c (_dbus_message_loader_queue_messages):
636 separate from _dbus_message_loader_return_buffer()
638 * dbus/dbus-connection.c (dbus_connection_get_n_messages): remove
639 this, because it's now always broken to use; the number of
640 messages in queue vs. the number still buffered by the message
641 loader is undefined/meaningless. Should use
642 dbus_connection_get_dispatch_state().
643 (dbus_connection_dispatch): rename from
644 dbus_connection_dispatch_message
646 2003-03-16 Havoc Pennington <hp@pobox.com>
648 * dbus/dbus-string.c (_dbus_string_validate_utf8): copy in a real
651 2003-03-16 Anders Carlsson <andersca@codefactory.se>
653 * dbus/dbus-connection.c:
654 (dbus_connection_send_with_reply_and_block):
655 Decrease connection->n_incoming when removing an entry
657 * dbus/dbus-dict.c: (dbus_dict_entry_free),
658 (dbus_dict_set_boolean_array), (dbus_dict_set_int32_array),
659 (dbus_dict_set_uint32_array), (dbus_dict_set_double_array),
660 (dbus_dict_set_byte_array), (dbus_dict_set_string_array),
661 (dbus_dict_get_boolean_array), (dbus_dict_get_double_array),
662 (dbus_dict_get_byte_array):
663 Handle NULL arrays and strings. Also add support for byte arrays.
665 * dbus/dbus-marshal.c: (_dbus_marshal_byte_array),
666 (_dbus_marshal_dict), (_dbus_demarshal_byte_array),
667 (_dbus_demarshal_int32_array), (_dbus_demarshal_uint32_array),
668 (_dbus_demarshal_double_array), (_dbus_demarshal_string_array),
669 (_dbus_demarshal_dict), (demarshal_and_validate_len),
670 (_dbus_marshal_validate_arg), (_dbus_marshal_test):
671 * dbus/dbus-marshal.h:
672 Add support for marshalling and demarshalling empty arrays and strings.
674 * dbus/dbus-message.c: (dbus_message_append_args_valist),
675 (dbus_message_append_string_array),
676 (dbus_message_iter_get_boolean),
677 (dbus_message_iter_get_boolean_array),
678 (dbus_message_iter_get_int32_array),
679 (dbus_message_iter_get_uint32_array),
680 (dbus_message_iter_get_double_array),
681 (dbus_message_iter_get_byte_array),
682 (dbus_message_iter_get_string_array), (dbus_message_iter_get_dict),
683 (check_message_handling):
684 Add support for getting empty arrays and dicts.
686 * dbus/dbus-string.c: (_dbus_string_validate_utf8):
687 Don't do any validation at all for now, that's better than just checking
690 * test/data/valid-messages/emptiness.message:
691 New test message with lots of empty arrays.
693 2003-03-16 Havoc Pennington <hp@pobox.com>
695 * dbus/dbus-connection.c
696 (_dbus_connection_queue_received_message_link): new function that
697 can't fail due to OOM
699 * dbus/dbus-message.c (_dbus_message_loader_pop_message_link):
700 new function pops a message together with a list link
703 * dbus/dbus-transport-unix.c (queue_messages): use new link-based
704 message queuing functions to avoid needing to alloc memory
706 2003-03-16 Havoc Pennington <hp@pobox.com>
708 Oops - test code was only testing failure of around 30 of the
709 mallocs in the test path, but it turns out there are 500+
710 mallocs. I believe this was due to misguided linking setup such
711 that there was one copy of dbus_malloc etc. in the daemon and one
712 in the shared lib, and only daemon mallocs were tested. In any
713 case, the test case now tests all 500+ mallocs, and doesn't pass
714 yet, though there are lots of fixes in this patch.
716 * dbus/dbus-connection.c (dbus_connection_dispatch_message): fix
717 this so that it doesn't need to allocate memory, since it
718 has no way of indicating failure due to OOM (and would be
721 * dbus/dbus-list.c (_dbus_list_pop_first_link): new function
723 * bus/Makefile.am: rearrange to create two self-contained
724 libraries, to avoid having libraries with overlapping symbols.
725 that was resulting in weirdness, e.g. I'm pretty sure there
726 were two copies of global static variables.
728 * dbus/dbus-internals.c: move the malloc debug stuff to
731 * dbus/dbus-list.c (free_link): free list mempool if it becomes
734 * dbus/dbus-memory.c (_dbus_disable_mem_pools): new function
736 * dbus/dbus-address.c (dbus_parse_address): free list nodes
739 * bus/dispatch.c (bus_dispatch_add_connection): free
740 message_handler_slot when no longer using it, so
741 memory leak checkers are happy for the test suite.
743 * dbus/dbus-server-debug-pipe.c (debug_finalize): free server name
745 * bus/bus.c (new_connection_callback): disconnect in here if
746 bus_connections_setup_connection fails.
748 * bus/connection.c (bus_connections_unref): fix to free the
750 (bus_connections_setup_connection): if this fails, don't
751 disconnect the connection, just be sure there are no side
754 * dbus/dbus-string.c (undo_alignment): unbreak this
756 * dbus/dbus-auth.c (_dbus_auth_unref): free some stuff we were
758 (_dbus_auth_new): fix the order in which we free strings
761 * bus/connection.c (bus_connection_disconnected): fix to
762 not send ServiceDeleted multiple times in case of memory
765 * dbus/dbus-bus.c (dbus_bus_get_base_service): new function to
766 get the base service name
767 (dbus_bus_register_client): don't return base service name,
768 instead store it on the DBusConnection and have an accessor
770 (dbus_bus_register_client): rename dbus_bus_register()
772 * bus/dispatch.c (check_hello_message): verify that other
773 connections on the bus also got the correct results, not
774 just the one sending hello
776 2003-03-15 Havoc Pennington <hp@pobox.com>
778 Make it pass the Hello handling test including all OOM codepaths.
779 Now to do other messages...
781 * bus/services.c (bus_service_remove_owner): fix crash when
782 removing owner from an empty list of owners
783 (bus_registry_ensure): don't leave service in the list of
784 a connection's owned services if we fail to put the service
787 * bus/connection.c (bus_connection_preallocate_oom_error): set
788 error flag on the OOM error.
790 * dbus/dbus-connection.c (_dbus_connection_new_for_transport):
791 handle _dbus_transport_set_connection failure
793 * dbus/dbus-transport-unix.c (_dbus_transport_new_for_fd): modify
794 to create watches up front and simply enable/disable them as
796 (unix_connection_set): this can now fail on OOM
798 * dbus/dbus-timeout.c, dbus/dbus-watch.c: add concept
799 of enabling/disabling a watch or timeout.
801 * bus/loop.c (bus_loop_iterate): don't touch disabled
804 * glib/dbus-gmain.c: adapt to enable/disable watches and timeouts
806 2003-03-15 Havoc Pennington <hp@pobox.com>
808 * bus/dispatch.c (bus_dispatch_test): OK, now finally actually
809 write useful test code, after all that futzing around ;-)
811 Test does not yet pass because we can't handle OOM in
812 _dbus_transport_messages_pending (basically,
813 dbus_connection_preallocate_send() does not prealloc the write
814 watch). To fix this, I think we need to add new stuff to
815 set_watch_functions, namely a SetEnabled function so we can alloc
816 the watch earlier, then enable it later.
818 * dbus/Makefile.am (libdbus_convenience_la_SOURCES): move
819 dbus-memory.c to the convenience lib
821 * bus/test.c: rename some static functions to keep them clearly
822 distinct from stuff in connection.c. Handle client disconnection.
824 2003-03-14 Havoc Pennington <hp@pobox.com>
826 * bus/dispatch.c (bus_dispatch_test): do test using debug-pipe
827 transport, tests more of the real codepath. Set up clients
828 with bus_setup_debug_client.
830 * bus/test.c (bus_setup_debug_client): function to set up debug
831 "clients" on the main loop
833 * dbus/dbus-transport.c (_dbus_transport_open): add debug-pipe
836 * dbus/dbus-server.c (dbus_server_listen): add debug-pipe
839 * dbus/dbus-server-debug.c: support a debug server based on pipes
841 * dbus/dbus-sysdeps.c (_dbus_full_duplex_pipe): new function
842 (_dbus_close): new function
844 * configure.in: check for socketpair
846 2003-03-14 Havoc Pennington <hp@redhat.com>
848 * dbus/dbus-memory.c: add a "detect buffer overwrites on free"
851 * dbus/dbus-transport-debug.c: rework this a good bit to be
852 less complicated. hopefully still works.
854 * dbus/dbus-server-debug.c (handle_new_client): remove timeout
857 * glib/dbus-gmain.c (timeout_handler): don't remove timeout
860 * dbus/dbus-message.c (dbus_message_copy): rename from
861 dbus_message_new_from_message, fix it up to copy
862 all the message fields, add test case
864 * bus/dispatch.c (bus_dispatch_test): add some more test code,
865 not quite passing yet
867 2003-03-14 Havoc Pennington <hp@pobox.com>
869 * bus/loop.c (bus_loop_iterate): add this so we can "run loop
870 until no work remains" in test code. (the large diff here
871 is just code movement, no actual changes)
873 * dbus/dbus-server-debug.c (DEFAULT_INTERVAL): change interval to
874 1, no point waiting around for test code.
875 (_dbus_server_debug_accept_transport): unref the timeout
876 after adding it (right?)
878 * dbus/dbus-transport-debug.c (DEFAULT_INTERVAL): ditto
880 2003-03-13 Havoc Pennington <hp@redhat.com>
882 * dbus/dbus-timeout.c (_dbus_timeout_list_set_functions): handle
885 * dbus/dbus-watch.c (_dbus_watch_list_set_functions): handle out
888 * dbus/dbus-connection.h: Make AddWatchFunction and
889 AddTimeoutFunction return a bool so they can fail on out-of-memory
891 * bus/bus.c (bus_context_new): set up timeout handlers
893 * bus/connection.c (bus_connections_setup_connection): set up
896 * glib/dbus-gmain.c: adapt to the fact that set_functions stuff
899 * bus/bus.c (bus_context_new): adapt to changes
901 * bus/connection.c: adapt to changes
903 * test/watch.c: adapt to DBusWatch changes
905 * bus/dispatch.c (bus_dispatch_test): started adding this but
908 2003-03-14 Anders Carlsson <andersca@codefactory.se>
910 * bus/dispatch.c (send_service_nonexistent_error): Fix typo.
912 2003-03-13 Havoc Pennington <hp@pobox.com>
914 * bus/test.c, bus/test.h, bus/Makefile.am, bus/test-main.c:
915 set up a test framework as for the library
917 2003-03-12 Havoc Pennington <hp@pobox.com>
919 Throughout: purge global variables, introduce BusActivation,
920 BusConnections, BusRegistry, etc. objects instead.
922 * bus/bus.h, bus/bus.c: introduce BusContext as a global
925 * test/Makefile.am (TEST_BINARIES): disable bus-test for now,
926 going to redo this a bit differently I think
928 2003-03-12 Havoc Pennington <hp@redhat.com>
930 Mega-patch that gets the message bus daemon initially handling
931 out-of-memory. Work still needed. Also lots of random
932 moving stuff to DBusError instead of ResultCode.
934 * dbus/dbus-list.c (_dbus_list_length_is_one): new function
936 * dbus/dbus-connection.c
937 (dbus_connection_send_with_reply_and_block): use DBusError
939 * dbus/dbus-bus.c: adapt to API changes, make it use DBusError not
942 * dbus/dbus-connection.c (dbus_connection_send): drop the result
943 code here, as the only failure possible is OOM.
945 * bus/connection.c (bus_connection_disconnect):
946 rename bus_connection_disconnected as it's a notification only
948 * bus/driver.c (bus_driver_handle_acquire_service): don't free
949 "name" on get_args failure, should be done by get_args;
950 don't disconnect client for bad args, just return an error.
951 (bus_driver_handle_service_exists): ditto
953 * bus/services.c (bus_services_list): NULL-terminate returned array
955 * bus/driver.c (bus_driver_send_service_lost)
956 (bus_driver_send_service_acquired): send messages from driver to a
957 specific client to the client's unique name, not to the broadcast
960 * dbus/dbus-message.c (decode_header_data): reject messages that
961 contain no name field
962 (_dbus_message_get_client_serial): rename to
963 dbus_message_get_serial and make public
964 (_dbus_message_set_serial): rename from set_client_serial
965 (_dbus_message_set_reply_serial): make public
966 (_dbus_message_get_reply_serial): make public
968 * bus/connection.c (bus_connection_foreach): allow stopping
969 iteration by returning FALSE from foreach function.
971 * dbus/dbus-connection.c (dbus_connection_send_preallocated)
972 (dbus_connection_free_preallocated_send)
973 (dbus_connection_preallocate_send): new API for sending a message
974 without possibility of malloc failure.
975 (dbus_connection_send_message): rename to just
976 dbus_connection_send (and same for whole function family)
978 * dbus/dbus-errors.c (dbus_error_free): make this reinit the error
980 * dbus/dbus-sysdeps.c (_dbus_exit): new function
982 * bus/activation.c: handle/return errors
984 * dbus/dbus-errors.h: add more DBUS_ERROR #define
986 * dbus/dbus-sysdeps.c (_dbus_directory_open) (_dbus_file_get_contents)
987 (_dbus_directory_get_next_file): use DBusError instead of DBusResultCode
988 (_dbus_result_from_errno): move to this file
990 2003-03-10 Anders Carlsson <andersca@codefactory.se>
992 * dbus/dbus-marshal.c:
993 (_dbus_marshal_set_string):
994 Take a length argument so we can marshal the correct string
997 (_dbus_marshal_dict), (_dbus_demarshal_dict),
998 (_dbus_marshal_get_arg_end_pos), (_dbus_marshal_validate_arg),
999 (_dbus_marshal_test):
1000 * dbus/dbus-marshal.h:
1001 Add support for marshalling and demarshalling dicts.
1003 * dbus/dbus-message-builder.c: (_dbus_message_data_load):
1004 Add support for TYPE DICT.
1006 * dbus/dbus-message.c: (set_string_field):
1007 Adjust header padding.
1009 (dbus_message_append_args_valist), (dbus_message_append_dict),
1010 (dbus_message_get_args_valist), (dbus_message_iter_get_arg_type),
1011 (dbus_message_iter_get_dict), (_dbus_message_loader_return_buffer),
1012 (check_message_handling), (check_have_valid_message):
1013 * dbus/dbus-message.h:
1014 Add functions for setting and getting dicts.
1016 * dbus/dbus-protocol.h:
1022 * doc/dbus-specification.sgml:
1023 Add information about how dicts are marshalled.
1025 * test/data/invalid-messages/dict-with-nil-value.message:
1026 * test/data/invalid-messages/too-short-dict.message:
1027 * test/data/valid-messages/dict-simple.message:
1028 * test/data/valid-messages/dict.message:
1029 Add sample messages containing dicts.
1031 2003-03-08 Anders Carlsson <andersca@codefactory.se>
1033 * dbus/dbus-dict.h: Add DBUS_END_DECLS.
1035 2003-03-07 Anders Carlsson <andersca@codefactory.se>
1038 * dbus/dbus-dict.c: (dbus_dict_entry_free), (dbus_dict_new),
1039 (dbus_dict_get_keys), (insert_entry), (dbus_dict_set_boolean),
1040 (dbus_dict_set_int32), (dbus_dict_set_uint32),
1041 (dbus_dict_set_double), (dbus_dict_set_string),
1042 (dbus_dict_set_boolean_array), (dbus_dict_set_int32_array),
1043 (dbus_dict_set_uint32_array), (dbus_dict_set_double_array),
1044 (dbus_dict_set_string_array), (_dbus_dict_test):
1046 Fix according to comments from Havoc.
1048 2003-03-06 Michael Meeks <michael@server.home>
1050 * configure.in: if we don't have kde-config, disable have_qt.
1052 2003-03-07 Anders Carlsson <andersca@codefactory.se>
1057 * dbus/dbus-dict.c: (dbus_dict_entry_free), (dbus_dict_new),
1058 (dbus_dict_ref), (dbus_dict_unref), (dbus_dict_contains),
1059 (dbus_dict_remove), (dbus_dict_get_value_type),
1060 (dbus_dict_get_keys), (dbus_dict_put_boolean),
1061 (dbus_dict_put_int32), (dbus_dict_put_uint32),
1062 (dbus_dict_put_double), (dbus_dict_put_string),
1063 (dbus_dict_put_boolean_array), (dbus_dict_put_int32_array),
1064 (dbus_dict_put_uint32_array), (dbus_dict_put_double_array),
1065 (dbus_dict_put_string_array), (dbus_dict_get_boolean),
1066 (dbus_dict_get_int32), (dbus_dict_get_uint32),
1067 (dbus_dict_get_double), (dbus_dict_get_string),
1068 (dbus_dict_get_boolean_array), (dbus_dict_get_int32_array),
1069 (dbus_dict_get_uint32_array), (dbus_dict_get_double_array),
1070 (dbus_dict_get_string_array), (_dbus_dict_test):
1072 Add DBusDict implementation
1074 * dbus/dbus-test.c: (dbus_internal_do_not_use_run_tests):
1078 2003-03-04 Havoc Pennington <hp@pobox.com>
1080 * test/data/auth/*: adapt to changes
1082 * dbus/dbus-auth-script.c (_dbus_auth_script_run): add
1083 USERID_BASE64 and change USERNAME_BASE64 to put in username not
1086 * dbus/dbus-keyring.c (_dbus_keyring_validate_context): prevent
1087 more stuff from being in a context name, to make the protocol
1088 simpler to deal with
1090 * dbus/dbus-errors.c (dbus_error_has_name): new function
1091 (dbus_error_is_set): new function
1093 * dbus/dbus-auth.c: replace DBUS_STUPID_TEST_MECH auth
1094 with DBUS_COOKIE_SHA1, implement DBUS_COOKIE_SHA1
1096 * dbus/dbus-connection.c (dbus_connection_flush): also read
1097 messages during a flush operation
1099 * dbus/Makefile.am: remove dbus-md5 since it isn't currently used.
1101 2003-03-05 Anders Carlsson <andersca@codefactory.se>
1103 * configure.in: Check for gethostbyname on Solaris.
1105 * dbus/dbus-transport.c: (_dbus_transport_open):
1106 Remove duplicate "tcp" entry.
1108 * doc/dbus-specification.sgml:
1109 Clarify some things.
1111 2003-03-05 Anders Carlsson <andersca@codefactory.se>
1113 * dbus/dbus-auth.c: (send_rejected), (process_test_subdir):
1114 * dbus/dbus-keyring.c: (_dbus_keyring_new_homedir),
1115 (_dbus_keyring_test):
1116 * dbus/dbus-md5.c: (_dbus_md5_compute):
1117 * dbus/dbus-sha.c: (_dbus_sha_compute):
1120 2003-03-05 Anders Carlsson <andersca@codefactory.se>
1122 * README: Add some things.
1124 2003-03-04 Anders Carlsson <andersca@codefactory.se>
1126 * dbus/dbus-message.c (dbus_message_append_args_valist): Add a break;
1127 after case DBUS_TYPE_BOOELAN.
1129 2003-03-02 Havoc Pennington <hp@pobox.com>
1131 * test/break-loader.c (randomly_set_extreme_ints): add test that
1132 sets really huge and small integers
1134 * dbus/dbus-marshal.c (_dbus_marshal_validate_arg): add check
1135 that length of boolean array fits in the string, and that
1136 string has room for boolean value in single-bool case.
1138 * dbus/dbus-message-builder.c (_dbus_message_data_load): add
1139 optional value to "ALIGN" command which is what to fill the
1142 * test/data/valid-messages/no-padding.message: add regression
1143 test for the message padding problem
1145 2003-03-02 Havoc Pennington <hp@pobox.com>
1147 * dbus/dbus-message.c (decode_header_data): fix to always init
1148 message_padding, from Benjamin Dauvergne
1150 2003-03-02 Havoc Pennington <hp@pobox.com>
1156 2003-03-01 Joe Shaw <joe@assbarn.com>
1158 * configure.in: Check for "struct cmsgcred" and try to access its
1159 members for BSD-like unices.
1161 * dbus/dbus-sysdeps.c (read_credentials_byte): Fold this back into
1162 _dbus_read_credentials_unix_socket().
1163 (_dbus_read_credentials_unix_socket): Use recvmsg() instead of
1164 read() for reading the credential byte off the unix socket. Use
1165 struct cmsgcred on systems that support it.
1167 2003-02-27 Alexander Larsson <alexl@redhat.com>
1171 Make gthreads-2.0 dependency optional. Don't build thread test if
1174 2003-02-27 Havoc Pennington <hp@pobox.com>
1176 * dbus/dbus-connection.c
1177 (dbus_connection_send_message_with_reply_and_block): fix doh!
1178 doh! doh! bug that resulted in never removing a reply from the
1179 queue, no wonder we called get_reply_serial so much ;-)
1181 * dbus/dbus-message.c (struct DBusMessage): cache reply serial
1182 and client serial instead of demarshaling them every time
1184 2003-02-27 Havoc Pennington <hp@pobox.com>
1186 * dbus/dbus-marshal.c (_dbus_demarshal_int32): rewrite to be much
1187 more inlined, using dbus-string-private.h, speeds things up
1190 * dbus/dbus-string.c (_dbus_string_free): apply align offset
1191 when freeing the string
1192 (_dbus_string_steal_data): fix for align offset
1193 (undo_alignment): new function
1195 2003-02-26 Havoc Pennington <hp@redhat.com>
1197 All kinds of audit fixes from Owen, plus initial attempt to
1198 handle unaligned memory returned from malloc.
1200 * dbus/dbus-string.c (_dbus_string_init): clamp max length to
1201 leave room for align_offset and nul byte
1202 (fixup_alignment): function to track an align_offset and
1203 ensure real->str is aligned
1204 (DBUS_GENERIC_STRING_PREAMBLE): len must be less than allocated,
1205 to allow a nul byte plus align offset
1206 (_dbus_string_lock): fix overflow issue
1207 (_dbus_string_init_const_len): add assertions on sanity of len,
1208 assign allocated to be ALLOCATION_PADDING larger than len
1209 (set_length): fixup the overflow handling
1210 (_dbus_string_get_data_len): fix overflow in assertion
1211 (open_gap): detect overflow in size of gap to be opened
1212 (_dbus_string_lengthen): add overflow check
1213 (_dbus_string_align_length): fix overflow with _DBUS_ALIGN_VALUE
1214 (_dbus_string_append): add overflow check
1215 (_dbus_string_append_unichar): overflow
1216 (_dbus_string_delete): fix overflow in assertion
1217 (_dbus_string_copy_len): overflow in assertion
1218 (_dbus_string_replace_len): overflows in assertions
1219 (_dbus_string_find): change to implement in terms of
1220 _dbus_string_find_to
1221 (_dbus_string_find_to): assorted fixage
1222 (_dbus_string_equal_c_str): assert c_str != NULL,
1223 fix logic so the function works
1224 (_dbus_string_ends_with_c_str): fix overflow thingy
1225 (_dbus_string_base64_encode): overflow fix
1226 (_dbus_string_validate_ascii): overflow
1227 (_dbus_string_validate_nul): overflow
1229 2003-02-26 Havoc Pennington <hp@redhat.com>
1231 * dbus/dbus-marshal.c (_dbus_marshal_test): fix to work with DISABLE_ASSERTS
1233 2003-02-26 Alexander Larsson <alexl@redhat.com>
1236 Set DBUS_GLIB_THREADS_LIBS for apps using gthread-2.0
1238 * dbus/dbus-connection.c:
1239 * dbus/dbus-connection.h:
1240 Fix _dbus_connection_acquire_io_path and _dbus_connection_acquire_dispatch.
1241 Add dbus_connection_set_wakeup_main_function and use it when queueing
1242 incoming and outgoing messages.
1245 * dbus/dbus-dataslot.c:
1246 Threadsafe usage of DBusDataSlotAllocator
1248 * dbus/dbus-message.c: (dbus_message_get_args_iter):
1251 * dbus/dbus-server-unix.c:
1254 * glib/dbus-gmain.c:
1255 Implement the new wakeup functions for glib.
1258 * glib/test-thread-client.c:
1259 * glib/test-thread-server.c:
1260 * glib/test-thread.h:
1261 Initial cut at some thread test code. Not really done yet.
1263 2003-02-26 Havoc Pennington <hp@pobox.com>
1265 * dbus/dbus-connection.c
1266 (dbus_connection_send_message_with_reply_and_block): fix crash
1267 where we ref'd the outgoing message instead of the returned reply
1269 * dbus/dbus-transport-unix.c (do_authentication): check read watch
1270 at the end of this function, so if we didn't need to read for
1271 authentication, we reinstall it for receiving messages
1273 * dbus/dbus-message.c (dbus_message_new_reply): allow replies to
1274 a NULL sender for peer-to-peer case
1276 * dbus/dbus-transport-unix.c (check_read_watch): handle
1277 !authenticated case correctly
1279 * glib/dbus-gmain.c: add support for DBusServer
1281 * dbus/dbus-server.c: add data slot support
1283 * glib/dbus-gmain.c (dbus_connection_setup_with_g_main): check
1284 return values and handle errors
1286 * dbus/dbus-dataslot.c: factor out the data slot stuff from
1289 * Doxyfile.in (INPUT): add glib subdir
1291 * glib/dbus-gmain.c (dbus_connection_setup_with_g_main): rename
1292 setup_with_g_main instead of hookup_with_g_main; write docs
1294 2003-02-24 Anders Carlsson <andersca@codefactory.se>
1296 * dbus/dbus-marshal.c: (_dbus_marshal_validate_arg):
1297 * dbus/dbus-message-builder.c: (_dbus_message_data_load):
1298 * dbus/dbus-message.c: (dbus_message_append_boolean),
1299 (dbus_message_append_boolean_array),
1300 (dbus_message_get_args_valist), (_dbus_message_test):
1301 * dbus/dbus-message.h:
1302 * doc/dbus-specification.sgml:
1303 Various fixes as pointed out by Havoc.
1305 * test/data/invalid-messages/bad-boolean-array.message:
1306 * test/data/invalid-messages/bad-boolean.message:
1307 Add invalid boolean value test cases.
1309 2003-02-24 Anders Carlsson <andersca@codefactory.se>
1311 * dbus/dbus-internals.c: (_dbus_type_to_string):
1312 * dbus/dbus-marshal.c: (_dbus_marshal_get_arg_end_pos),
1313 (_dbus_marshal_validate_arg):
1314 * dbus/dbus-message-builder.c: (_dbus_message_data_load):
1315 * dbus/dbus-message.c: (dbus_message_append_args_valist),
1316 (dbus_message_append_boolean), (dbus_message_append_boolean_array),
1317 (dbus_message_get_args_valist), (dbus_message_iter_get_boolean),
1318 (dbus_message_iter_get_int32), (dbus_message_iter_get_uint32),
1319 (dbus_message_iter_get_double),
1320 (dbus_message_iter_get_boolean_array), (message_iter_test):
1321 * dbus/dbus-message.h:
1322 * dbus/dbus-protocol.h:
1323 * doc/dbus-specification.sgml:
1324 * test/data/valid-messages/lots-of-arguments.message:
1325 Add support for boolean and boolean array types.
1327 2003-02-23 Havoc Pennington <hp@pobox.com>
1329 * dbus/dbus-keyring.c: finish most of this implementation and
1332 * dbus/dbus-errors.c (dbus_set_error_const, dbus_set_error): make
1333 these barf if the error isn't cleared to NULL
1335 * dbus/dbus-sysdeps.c (_dbus_delete_file): set error on failure
1336 (_dbus_create_directory): new function
1338 * dbus/dbus-errors.c (dbus_set_error): fix warning
1340 * dbus/dbus-string.c (_dbus_string_hex_encode): new function
1341 (_dbus_string_hex_decode): new function
1342 (test_hex_roundtrip): test code
1344 * dbus/dbus-sha.c (_dbus_sha_compute): use dbus_string_hex_encode
1346 * dbus/dbus-md5.c (_dbus_md5_compute): use dbus_string_hex_encode
1348 * dbus/dbus-sysdeps.c (_dbus_string_save_to_file): make this use
1349 the save-to-temp/rename trick to atomically write the new file
1350 (_dbus_string_parse_uint): new function
1352 2003-02-22 Havoc Pennington <hp@pobox.com>
1354 * test/Makefile.am (dist-hook): fix dist for test/data/sha-1
1356 2003-02-22 Havoc Pennington <hp@pobox.com>
1358 * dbus/dbus-message.c (dbus_message_iter_get_string_array):
1359 (dbus_message_iter_get_byte_array): Fix up doxygen warnings
1361 * dbus/dbus-sha.c: add implementation of SHA-1 algorithm
1363 * dbus/test/data/sha-1: add US government test suite for SHA-1
1365 2003-02-21 Anders Carlsson <andersca@codefactory.se>
1367 * dbus/dbus-marshal.c: (_dbus_demarshal_string_array):
1368 Make string arrays NULL-terminated.
1370 * dbus/dbus-memory.c: (dbus_free_string_array):
1371 * dbus/dbus-memory.h:
1372 New function for freeing NULL-terminated string arrays.
1374 * dbus/dbus-message-builder.c: (append_quoted_string),
1375 (_dbus_message_data_load):
1376 Add support for array types.
1378 * dbus/dbus-message.c: (check_message_handling):
1379 Add more types as test cases.
1381 * dbus/dbus-sysdeps.c: (_dbus_string_parse_int),
1382 (_dbus_string_parse_double):
1383 Add the start offset to the end offset.
1385 * test/data/valid-messages/lots-of-arguments.message:
1386 New test message with lots of arguments.
1388 2003-02-21 Anders Carlsson <andersca@codefactory.se>
1390 * dbus/dbus-message.c: (dbus_message_append_nil),
1391 (dbus_message_append_int32), (dbus_message_append_uint32),
1392 (dbus_message_append_double), (dbus_message_append_string),
1393 (dbus_message_append_int32_array),
1394 (dbus_message_append_uint32_array),
1395 (dbus_message_append_double_array),
1396 (dbus_message_append_byte_array),
1397 (dbus_message_append_string_array):
1398 Fix all out-of-memory handling in these functions.
1400 2003-02-21 Anders Carlsson <andersca@codefactory.se>
1402 * dbus/dbus-message.c: (dbus_message_append_nil):
1405 2003-02-21 Anders Carlsson <andersca@codefactory.se>
1407 * dbus/dbus-message.c: (dbus_message_append_args_valist),
1408 (dbus_message_append_nil), (dbus_message_append_int32_array),
1409 (dbus_message_append_uint32_array),
1410 (dbus_message_append_double_array),
1411 (dbus_message_append_byte_array),
1412 (dbus_message_append_string_array), (dbus_message_get_args_valist),
1413 (dbus_message_iter_get_int32_array),
1414 (dbus_message_iter_get_uint32_array),
1415 (dbus_message_iter_get_double_array),
1416 (dbus_message_iter_get_byte_array),
1417 (dbus_message_iter_get_string_array):
1419 * dbus/dbus-message.h:
1420 Add functions for appending and getting arrays.
1422 2003-02-21 Anders Carlsson <andersca@codefactory.se>
1424 * dbus/dbus-mempool.c (_dbus_mem_pool_new): Make the
1425 element size at least 8 bytes, fixes mempool tests on
1428 2003-02-20 Alexander Larsson <alexl@redhat.com>
1430 * dbus/dbus-transport-unix.c (unix_do_iteration):
1431 Unlock the connection mutex during a blocking select call.
1432 Add todo about how we need a way to wake up the select.
1434 * dbus/dbus-connection-internal.h:
1435 * dbus/dbus-connection.c:
1436 Add _dbus_connection_lock and _dbus_connection_unlock.
1438 2003-02-19 Havoc Pennington <hp@pobox.com>
1440 * Doxyfile.in (PREDEFINED): put DOXYGEN_SHOULD_SKIP_THIS in
1441 Doxyfile.in, not Doxyfile
1443 * dbus/dbus-keyring.c: do some hacking on this
1445 * dbus/dbus-sysdeps.c (_dbus_delete_file): new
1447 * dbus/dbus-errors.c (dbus_set_error_const): do not call
1449 (dbus_set_error): remove dbus_error_init, check for message ==
1450 NULL *before* we sprintf into it, and add @todo about including
1451 system headers in this file
1453 * dbus/dbus-sysdeps.c (_dbus_create_file_exclusively): new
1455 * dbus/dbus-errors.h (DBUS_ERROR_FAILED): add
1457 * dbus/dbus-sysdeps.c (get_user_info): break this function out to
1458 get various bits of user information based on either username
1460 (_dbus_homedir_from_username): new function
1462 2003-02-19 Anders Carlsson <andersca@codefactory.se>
1465 Add check for nonposix getpwnam_r
1467 * dbus/dbus-mempool.c: (_dbus_mem_pool_new):
1468 Align the pool element size to a sizeof (void *) boundary.
1470 * dbus/dbus-sysdeps.c: (_dbus_setenv), (_dbus_connect_unix_socket),
1471 (_dbus_listen_unix_socket), (_dbus_credentials_from_username):
1472 General Solaris fixes.
1474 * test/data/valid-messages/simplest-manual.message:
1475 Explicitly state that we want little-endian packing.
1477 2003-02-19 Mikael Hallendal <micke@codefactory.se>
1479 * dbus/dbus-server.c (dbus_server_listen): Support tcp: addresses.
1481 * dbus/dbus-transport-unix.c (_dbus_transport_new_for_tcp_socket):
1482 Added to create a transport connecting using a tcp/ip socket.
1484 * dbus/dbus-sysdeps.c (_dbus_connect_tcp_socket): Added to connect
1485 to a tcp socket at given host and port.
1486 (_dbus_listen_tcp_socket): added to listen on tcp socket for given
1489 * dbus/dbus-server.c (dbus_server_listen): Support tcp: addresses.
1491 * dbus/dbus-server-unix.c (_dbus_server_new_for_tcp_socket):
1492 Added to create a server listening on a TCP/IP socket.
1494 2003-02-19 Havoc Pennington <hp@pobox.com>
1496 Throughout: mop up all the Doxygen warnings and undocumented
1499 * dbus/dbus-sysdeps.c (do_exec): do not use execvp, we don't want
1500 to search any paths.
1502 * dbus/dbus-threads.c: move global mutex initializers to
1503 dbus-internals.h, multiple prototypes was confusing doxygen
1504 besides being kind of ugly
1506 * Doxyfile (PREDEFINED): have Doxygen define
1507 DOXYGEN_SHOULD_SKIP_THIS so we can exclude things from
1508 docs with #ifndef DOXYGEN_SHOULD_SKIP_THIS
1509 (do not abuse the feature! it's for stuff like the autogenerated
1510 macros in dbus-md5.c, not just for things you don't feel like
1513 2003-02-18 Havoc Pennington <hp@pobox.com>
1515 * dbus/dbus-string.c (_dbus_string_zero): new function
1517 * dbus/dbus-md5.c: include MD5 implementation by L. Peter Deutsch,
1518 wrap it in some dbus-friendly API
1520 * dbus/dbus-types.h: add 16-bit types
1522 2003-02-18 Joe Shaw <joe@assbarn.com>
1524 * dbus/dbus-auth.c (handle_server_data_stupid_test_mech): Just get
1525 credentials from our currently running process.
1526 (get_word): Fix a buglet where we were copying the entire length
1527 instead of relative to our position.
1529 * dbus/dbus-hash.c (_dbus_hash_test): Don't try to allocate the
1530 keys on the stack... it's 640k of data.
1532 * dbus/dbus-sysdeps.c (_dbus_read_credentials_unix_socket): Always
1533 read the credentials byte off the socket, even if we don't have
1535 (_dbus_poll): Implement poll() using select() for systems which
1538 * glib/test-dbus-glib.c (main): Print out an error if no
1539 parameters are given.
1541 * test/data/auth/fallback.auth-script: Added. Tests that a client
1542 can fallback to a secondary auth mechanism if the first fails.
1544 2003-02-18 Havoc Pennington <hp@pobox.com>
1548 2003-02-17 Havoc Pennington <hp@pobox.com>
1550 * doc/dbus-specification.sgml: lots of cosmetic
1551 cleanups/rearrangement, add assorted FIXME, change DBUS_ADDRESS
1552 env variable to DBUS_BUS_ADDRESS, s/client/application/,
1553 s/server/bus/ (except in authentication section). Add a section
1554 "Message Bus Message Routing"
1556 2003-02-17 Anders Carlsson <andersca@codefactory.se.>
1562 2003-02-17 Anders Carlsson <andersca@codefactory.se>
1564 * doc/dbus-specification.sgml:
1565 Specification updates.
1567 2003-02-17 Anders Carlsson <andersca@codefactory.se>
1569 * bus/activation.c: (bus_activation_init), (child_setup),
1570 (bus_activation_activate_service):
1572 * bus/main.c: (main):
1573 Set DBUS_ADDRESS environment variable.
1575 * dbus/dbus-errors.c: (dbus_set_error):
1576 Don't use va_copy since that's a C99 feature.
1578 * dbus/dbus-sysdeps.c: (_dbus_setenv), (do_exec),
1579 (_dbus_spawn_async):
1580 * dbus/dbus-sysdeps.h:
1581 Add child_setup_func to _dbus_spawn_async.
1583 * doc/dbus-specification.sgml:
1584 Update specification.
1586 * test/spawn-test.c: (setup_func), (main):
1589 2003-02-17 Alexander Larsson <alexl@redhat.com>
1591 * dbus/dbus-connection.c (_dbus_connection_handler_destroyed_locked):
1594 2003-02-17 Anders Carlsson <andersca@codefactory.se>
1598 * doc/dbus-test-plan.sgml:
1599 Add test plan document.
1604 2003-02-17 Anders Carlsson <andersca@codefactory.se>
1606 * dbus/dbus-message.c: (decode_header_data),
1607 (_dbus_message_loader_return_buffer):
1608 Set the header padding amount when loading a message.
1610 2003-02-16 Anders Carlsson <andersca@codefactory.se>
1612 * bus/dispatch.c: (send_one_message):
1613 Only send broadcast messages to registered connections.
1615 * dbus/dbus-message.c: (dbus_message_name_is):
1616 * dbus/dbus-message.h:
1617 New convenience function.
1619 * dbus/dbus-transport-debug.c: (do_reading):
1620 Only dispatch one message per run.
1623 * test/bus-test.c: (new_connection_callback), (die),
1624 (test_hello_client1_handler), (test_hello_client2_handler),
1625 (test_hello_replies), (main):
1627 * test/bus-test-loop.[ch]:
1630 2003-02-16 Havoc Pennington <hp@pobox.com>
1632 * dbus/dbus-connection.c (dbus_connection_dispatch_message): fix
1633 backward conditional
1635 2003-02-16 Alexander Larsson <alexl@redhat.com>
1637 * dbus/dbus-connection.c:
1638 Implement sent_message_with_reply. (with_reply_and block is still
1640 Made dispatch_message not lose message if OOM.
1642 * dbus/dbus-errors.h:
1643 Add NoReply error (for reply timeouts).
1645 2003-02-16 Alexander Larsson <alexl@redhat.com>
1647 * dbus/dbus-hash.c (_dbus_hash_table_unref):
1648 Actually free keys and values when destroying hashtable.
1650 2003-02-16 Anders Carlsson <andersca@codefactory.se>
1652 * dbus/dbus-auth.c: (client_try_next_mechanism):
1655 * dbus/dbus-threads.c: (dbus_condvar_wait_timeout):
1656 Return TRUE if there's no thread implementation around.
1658 * glib/dbus-gmain.c: (free_source),
1659 (dbus_connection_hookup_with_g_main):
1660 Make sure to remove the GSource when the connection is finalized.
1662 2003-02-16 Anders Carlsson <andersca@codefactory.se>
1664 * bus/dispatch.c: (bus_dispatch_message_handler):
1665 * dbus/dbus-errors.h:
1666 Return an error if someone tries to send a message to a service
1669 2003-02-16 Anders Carlsson <andersca@codefactory.se>
1671 * bus/activation.c: (load_directory), (bus_activation_init),
1672 (bus_activation_activate_service):
1675 (bus_driver_handle_activate_service), (bus_driver_handle_message):
1676 More work on the activation handling.
1678 * dbus/dbus-errors.h:
1679 Add some error messages
1681 * dbus/dbus-message.c: (dbus_message_new_error_reply):
1682 * dbus/dbus-message.h:
1683 New function that creates an error message.
1685 * dbus/dbus-protocol.h:
1686 Add ACTIVATE_SERVER message.
1688 * dbus/dbus-server-unix.c: (unix_handle_watch),
1689 (_dbus_server_new_for_domain_socket):
1690 Call _dbus_fd_set_close_on_exec.
1692 * dbus/dbus-sysdeps.c: (make_pipe), (do_exec),
1693 (_dbus_spawn_async), (_dbus_disable_sigpipe),
1694 (_dbus_fd_set_close_on_exec):
1695 * dbus/dbus-sysdeps.h:
1696 Add _dbus_fd_set_close_on exec function. Also add function that checks
1697 that all open fds are set to close-on-exec and warns otherwise.
1699 * dbus/dbus-transport-unix.c:
1700 (_dbus_transport_new_for_domain_socket):
1701 Call _dbus_fd_set_close_on_exec.
1703 2003-02-16 Havoc Pennington <hp@pobox.com>
1705 * dbus/dbus-connection.c (dbus_connection_set_change_sigpipe):
1706 allow people to avoid setting SIGPIPE to SIG_IGN
1707 (_dbus_connection_new_for_transport): disable SIGPIPE unless
1708 we've been asked not to
1710 2003-02-15 Anders Carlsson <andersca@codefactory.se>
1712 * dbus/dbus-list.c: (_dbus_list_append_link),
1713 (_dbus_list_prepend_link):
1714 * dbus/dbus-memory.c: (dbus_malloc), (dbus_malloc0),
1718 2003-02-15 Anders Carlsson <andersca@codefactory.se>
1721 * bus/activation.c: (bus_activation_entry_free),
1722 (add_desktop_file_entry), (load_directory), (bus_activation_init):
1724 * bus/main.c: (main):
1725 Add simple activation support, doesn't work yet though.
1727 2003-02-15 Zack Rusin <zack@kde.org>
1729 * qt/dbus-qthread.cpp: small casting fix
1731 2003-02-15 Anders Carlsson <andersca@codefactory.se>
1733 * dbus/dbus-errors.c: (dbus_set_error):
1734 * dbus/dbus-errors.h:
1735 Add a few errors and make dbus_set_error void.
1737 * dbus/dbus-sysdeps.c:
1738 (_dbus_errno_to_string), (close_and_invalidate), (make_pipe),
1739 (write_err_and_exit), (read_ints), (do_exec), (_dbus_spawn_async):
1740 * dbus/dbus-sysdeps.h:
1741 Add _dbus_spawn_async.
1743 * test/spawn-test.c: (main):
1744 Test for _dbus_spawn_async.
1746 2003-02-15 Anders Carlsson <andersca@codefactory.se>
1748 * dbus/dbus-internals.h:
1749 Fix build without tests.
1751 * dbus/dbus-list.c: (alloc_link):
1752 Fix a segfault when a malloc fails.
1754 * dbus/dbus-memory.c: (initialize_malloc_debug), (dbus_malloc),
1755 (dbus_malloc0), (dbus_realloc):
1756 Add support for malloc debugging.
1758 2003-02-15 Alexander Larsson <alexl@redhat.com>
1760 * dbus/dbus-threads.c:
1761 * dbus/dbus-threads.h:
1762 Add condvars. Remove static mutext from API.
1763 Implement static mutexes by initializing them from threads_init.
1765 * glib/dbus-gthread.c:
1766 * qt/dbus-qthread.cpp:
1767 Update with the thread api changes.
1772 Turn StaticMutex into normal mutex + init function.
1773 Export new functions _dbus_list_alloc_link, _dbus_list_free_link,
1774 _dbus_list_append_link, _dbus_list_prepend_link
1777 * dbus/dbus-sysdeps.c:
1778 * dbus/dbus-sysdeps.h:
1779 New type dbus_atomic_t, and new functions _dbus_atomic_inc,
1780 _dbus_atomic_dec. Only slow fallback implementation at the moment.
1782 * dbus/dbus-protocol.h:
1783 Add DBUS_MESSAGE_LOCAL_DISCONNECT define
1785 * dbus/dbus-message.c:
1786 Make ref/unref atomic.
1789 * dbus/dbus-connection-internal.h:
1790 * dbus/dbus-connection.c:
1791 * dbus/dbus-connection.h:
1793 Change _peek to _borrow,_return & _steal_borrowed.
1794 Change disconnect callback to event.
1795 Make dbus_connection_dispatch_messages reentrant.
1797 * dbus/dbus-transport.c:
1798 Don't ref the connection on calls to the transport
1801 * dbus/dbus-message-handler.c:
1804 * glib/dbus-gmain.c:
1805 Don't use peek_message anymore
1808 * test/debug-thread.c:
1809 * test/debug-thread.h:
1810 Simple thread implementation that asserts() on deadlocks in
1811 single-threaded code.
1814 (main) Call debug_threads_init.
1817 Use disconnect message instead of disconnect callback.
1821 Don't call dbus_connection_set_disconnect_function. Instead export
1822 bus_connection_disconnect.
1825 Call bus_connection_disconnect when we get a disconnected message.
1827 2003-02-15 Havoc Pennington <hp@pobox.com>
1829 * dbus/dbus-message.c (dbus_message_new): fool around with the
1832 2003-02-14 Havoc Pennington <hp@pobox.com>
1834 * dbus/dbus-mempool.c: fail if the debug functions so indicate
1836 * dbus/dbus-memory.c: fail if the debug functions indicate we
1839 * dbus/dbus-internals.c (_dbus_set_fail_alloc_counter)
1840 (_dbus_decrement_fail_alloc_counter): debug functions to
1841 simulate memory allocation failures
1843 2003-02-14 Havoc Pennington <hp@pobox.com>
1845 * dbus/dbus-errors.h (struct DBusError): add a word of padding
1848 2003-02-13 Anders Carlsson <andersca@codefactory.se>
1850 * bus/driver.c: (bus_driver_handle_hello):
1852 * bus/services.c: (bus_service_lookup):
1853 Reorder message sending so we get a more sane order.
1855 * test/bus-test.c: (message_handler):
1858 2003-02-13 Anders Carlsson <andersca@codefactory.se>
1860 * bus/driver.c: (bus_driver_send_service_deleted),
1861 (bus_driver_send_service_created), (bus_driver_send_service_lost),
1862 (bus_driver_send_service_acquired), (bus_driver_handle_hello),
1863 (bus_driver_send_welcome_message),
1864 (bus_driver_handle_list_services),
1865 (bus_driver_handle_acquire_service),
1866 (bus_driver_handle_service_exists):
1867 * dbus/dbus-bus.c: (dbus_bus_register_client),
1868 (dbus_bus_acquire_service), (dbus_bus_service_exists):
1869 * dbus/dbus-errors.c: (dbus_result_to_string):
1870 * dbus/dbus-errors.h:
1871 * dbus/dbus-message.c: (dbus_message_append_args),
1872 (dbus_message_append_args_valist), (dbus_message_get_args),
1873 (dbus_message_get_args_valist), (dbus_message_get_args_iter),
1874 (dbus_message_iter_get_arg_type), (dbus_message_iter_get_string),
1875 (dbus_message_iter_get_byte_array),
1876 (dbus_message_iter_get_string_array), (message_iter_test),
1877 (check_message_handling), (_dbus_message_test):
1878 * dbus/dbus-message.h:
1879 * test/bus-test.c: (main):
1880 Change fields to arguments in messages, so that they won't be
1881 confused with header fields.
1883 * glib/test-dbus-glib.c: (main):
1884 Remove append_fields from hello message.
1886 2003-02-13 Anders Carlsson <andersca@codefactory.se>
1888 * dbus/dbus-errors.c:
1889 * dbus/dbus-message.c:
1890 * dbus/dbus-string.c:
1891 Documentation fixes.
1893 2003-02-13 Anders Carlsson <andersca@codefactory.se>
1895 * glib/dbus-gmain.c: (timeout_handler), (add_timeout),
1897 Implement support for timeouts in dbus-glib.
1899 2003-02-13 Anders Carlsson <andersca@codefactory.se>
1901 * dbus/dbus-message-builder.c: (_dbus_message_data_load):
1902 * dbus/dbus-message.c: (process_test_subdir):
1903 * test/break-loader.c: (find_breaks_based_on):
1904 Plug some memory leaks.
1906 2003-02-13 Richard Hult <rhult@codefactory.se>
1908 * bus/main.c: Fix build.
1910 * dbus/dbus-errors.h:
1911 * dbus/dbus-errors.c: Fix copyright for Anders.
1913 2003-02-13 Anders Carlsson <andersca@codefactory.se>
1918 * bus/connection.c: (bus_connection_foreach):
1921 * bus/desktop-file.c: (grow_lines_in_section), (grow_sections),
1922 (unescape_string), (new_section), (parse_section_start),
1923 (parse_key_value), (report_error), (bus_desktop_file_load),
1924 (bus_desktop_file_get_string):
1925 * bus/desktop-file.h:
1926 Use DBusError for error reporting.
1928 * bus/dispatch.c: (send_one_message),
1929 (bus_dispatch_message_handler):
1930 * bus/driver.c: (bus_driver_send_service_deleted),
1931 (bus_driver_send_service_created), (bus_driver_send_service_lost),
1932 (bus_driver_send_service_acquired), (bus_driver_handle_hello),
1933 (bus_driver_send_welcome_message),
1934 (bus_driver_handle_list_services),
1935 (bus_driver_handle_acquire_service),
1936 (bus_driver_handle_service_exists):
1937 * bus/loop.c: (bus_loop_run):
1939 Use BUS_HANDLE_OOM instead of _DBUS_HANDLE_OOM.
1941 * bus/utils.c: (bus_wait_for_memory):
1943 New files with general utility functions.
1945 * dbus/dbus-internals.h:
1946 Remove _DBUS_HANDLE_OOM.
1948 2003-02-13 Anders Carlsson <andersca@codefactory.se>
1950 * dbus/dbus-errors.c: (dbus_result_to_string), (dbus_error_init),
1951 (dbus_error_free), (dbus_set_error_const), (dbus_set_error):
1952 * dbus/dbus-errors.h:
1953 Add DBusError structure.
1955 2003-02-13 Anders Carlsson <andersca@codefactory.se>
1957 * test/data/valid-messages/standard-acquire-service.message:
1958 * test/data/valid-messages/standard-hello.message:
1959 * test/data/valid-messages/standard-list-services.message:
1960 * test/data/valid-messages/standard-service-exists.message:
1961 Add some standard messages.
1963 2003-02-13 Anders Carlsson <andersca@codefactory.se>
1965 * bus/driver.c: (bus_driver_send_welcome_message),
1966 (bus_driver_handle_list_services),
1967 (bus_driver_handle_acquire_service),
1968 (bus_driver_handle_service_exists), (bus_driver_handle_message):
1969 Update for API changes in libdbus.
1971 * dbus/dbus-message.c: (dbus_message_new_reply):
1972 * dbus/dbus-message.h:
1973 Remove the name argument. The spec states that replies shouldn't
1976 2003-02-13 Anders Carlsson <andersca@codefactory.se>
1978 * bus/desktop-file.c: (parse_section_start), (parse_key_value),
1979 (report_error), (bus_desktop_file_load), (lookup_section),
1980 (lookup_line), (bus_desktop_file_get_raw),
1981 (bus_desktop_file_get_string):
1982 * bus/desktop-file.h:
1983 Some fixes, and new functions for getting a key value from a section.
1985 2003-02-13 Havoc Pennington <hp@pobox.com>
1987 * test/data/auth/fail-after-n-attempts.auth-script: new test
1989 * dbus/dbus-auth.c (send_rejected): shutdown_mech() when we
1992 2003-02-13 Havoc Pennington <hp@pobox.com>
1994 * dbus/dbus-auth.c (handle_server_data_external_mech): args to
1995 dbus_credentials_match were backward
1997 * dbus/dbus-auth-script.c (_dbus_auth_script_run): support
1998 NO_CREDENTIALS and ROOT_CREDENTIALS
2000 * dbus/dbus-auth.c (_dbus_auth_do_work): move get_state() routine
2001 into here. Never process more commands after we've reached an
2002 end state; store further data as unused bytes.
2004 * test/data/auth/*: add more auth tests
2006 * dbus/dbus-auth-script.c (_dbus_auth_script_run): support EXPECT
2007 command to match exact string and EXPECT_UNUSED to match unused
2010 * test/Makefile.am (dist-hook): fix to dist all the test stuff
2012 2003-02-12 Havoc Pennington <hp@pobox.com>
2014 * dbus/dbus-string.c (_dbus_string_pop_line): fix to also strip
2015 \r off of popped lines
2017 * dbus/dbus-auth.c (_dbus_auth_test): write code to run auth
2020 * dbus/dbus-auth-script.c (_dbus_auth_script_run): when doing a
2023 2003-02-12 Havoc Pennington <hp@pobox.com>
2025 * dbus/Makefile.am: remove break-loader from the build, since it
2028 * configure.in: add --enable-gcov to turn on coverage profiling
2029 flags and disable optimization
2031 2003-02-10 Havoc Pennington <hp@pobox.com>
2033 * dbus/dbus-auth-script.c, dbus/dbus-auth-script.h: sync
2034 initial cut at test framework for DBusAuth from laptop.
2035 Doesn't quite work yet but it compiles and I need to get
2036 it off the 266mhz laptop. ;-)
2038 * dbus/dbus-server-debug.c (_dbus_server_debug_accept_transport):
2039 fix a memleak in error case
2041 2003-02-12 Anders Carlsson <andersca@codefactory.se>
2044 * bus/desktop-file.c:
2045 * bus/desktop-file.h:
2046 Add a desktop file parser.
2048 2003-02-11 Zack Rusin <zack@kde.org>
2050 * qt/message.[h|cpp]: sample implementation
2051 of the KDE wrapper for DBusMessage
2053 2003-02-09 Zack Rusin <zack@kde.org>
2055 * test/bus-test.c: make_it_compile
2056 * doc/dbus-specification.sgml: minimal semantic fix
2058 2003-02-06 Anders Carlsson <andersca@codefactory.se>
2064 2003-02-06 Anders Carlsson <andersca@codefactory.se>
2067 * dbus/dbus-break-loader.c:
2069 * test/break-loader.c:
2070 Move dbus-break-loader to test/ and rename it to break-loader.
2072 2003-02-02 Havoc Pennington <hp@pobox.com>
2074 * dbus/dbus-keyring.c, dbus/dbus-keyring.h: template files
2075 for code to manage cookies in your home directory
2077 * dbus/dbus-sysdeps.c (_dbus_generate_random_bytes): new function
2079 * dbus/dbus-auth.c (get_state): impose a maximum number of tries
2080 to authenticate, then disconnect the client.
2082 2003-02-03 Alexander Larsson <alexl@redhat.com>
2084 * dbus/dbus-message.c (dbus_message_append_fields):
2087 2003-02-02 Anders Carlsson <andersca@codefactory.se>
2089 * doc/dbus-specification.sgml:
2090 Update address format section.
2092 2003-02-02 Anders Carlsson <andersca@codefactory.se>
2095 * test/bus-test.c: (get_time), (add_timeout), (remove_timeout),
2096 (message_handler), (new_connection_callback), (loop_quit),
2100 2003-02-02 Anders Carlsson <andersca@codefactory.se>
2102 * bus/driver.c: (bus_driver_handle_service_exists):
2103 Simplify the code a bit.
2105 * dbus/dbus-bus.c: (dbus_bus_service_exists):
2108 2003-02-02 Anders Carlsson <andersca@codefactory.se>
2111 Add libdbus-daemon.la and link to it.
2113 2003-02-01 James Willcox <jwillcox@gnome.org>
2115 * bus/driver.c: (bus_driver_handle_own_service):
2116 Actually include the service reply code in the message.
2118 2003-02-02 Anders Carlsson <andersca@codefactory.se>
2120 * bus/driver.c: (bus_driver_handle_service_exists):
2121 Don't unref the incoming message.
2123 2003-02-02 Anders Carlsson <andersca@codefactory.se>
2125 * dbus/dbus.h: Add dbus-address.h and dbus-bus.h
2127 2003-02-02 Anders Carlsson <andersca@codefactory.se>
2129 * dbus/dbus-server.c: (dbus_server_listen):
2130 * dbus/dbus-transport.c: (_dbus_transport_open):
2131 ifdef out the calls to the debug transport and server.
2133 2003-02-02 Alexander Larsson <alexl@redhat.com>
2135 * dbus/dbus-watch.c (dbus_watch_get_flags):
2136 Add note in the docs that ERROR or HANGUP won't be returned
2137 and are assumed always on.
2139 * glib/dbus-gmain.c (add_watch):
2140 Always add IO_ERR | IO_HUP
2142 * dbus/dbus-message.h:
2143 Add semicolon after dbus_message_iter_get_string_array().
2144 Makes qt code build again
2146 2003-02-01 Anders Carlsson <andersca@codefactory.se>
2148 * bus/driver.c: (create_unique_client_name),
2149 (bus_driver_handle_hello):
2150 Don't take a name, just use a numeric id to identify
2154 * dbus/dbus-bus.c: (dbus_bus_register_client),
2155 (dbus_bus_acquire_service), (dbus_bus_service_exists):
2157 Add new convenience functions for communicating with the bus.
2159 * dbus/dbus-message.h:
2161 * dbus/dbus-protocol.h:
2164 2003-02-01 Alexander Larsson <alexl@redhat.com>
2166 * dbus/dbus-message.c (dbus_message_append_fields):
2167 Add some more doc comments.
2169 2003-02-01 Havoc Pennington <hp@pobox.com>
2171 * dbus/dbus-break-loader.c (randomly_modify_length): change
2172 a 4-byte value in the message as if it were a length
2174 * dbus/dbus-sysdeps.c (_dbus_string_save_to_file): don't set
2175 execute bit on saved files
2177 2003-02-01 Havoc Pennington <hp@pobox.com>
2179 * dbus/dbus-break-loader.c (main): new program to find messages
2180 that break the loader.
2182 * dbus/dbus-sysdeps.c (_dbus_string_append_uint): new function
2183 * dbus/dbus-sysdeps.c (_dbus_string_save_to_file): new function
2185 * dbus/dbus-string.c (_dbus_string_set_byte): new
2187 2003-01-31 Havoc Pennington <hp@pobox.com>
2189 * dbus/dbus-message.c: refactor the test code to be more general,
2190 in preparation for writing a "randomly permute test cases to
2191 try to break the loader" program.
2193 2003-01-31 Havoc Pennington <hp@pobox.com>
2195 * doc/dbus-specification.sgml: work on the specification
2197 * dbus/dbus-message.c (_dbus_message_loader_return_buffer): check
2198 the protocol version of the message.
2200 * dbus/dbus-protocol.h: drop special _REPLY names, the spec
2201 no longer specifies that.
2202 (DBUS_SERVICE_REPLY_SERVICE_EXISTS): fix flags (1/2/4/8 not
2205 * dbus/dbus-marshal.c (_dbus_marshal_get_arg_end_pos): add missing
2206 "break" for DBUS_TYPE_NIL, remove @todo
2208 2003-01-31 Havoc Pennington <hp@pobox.com>
2210 * dbus/dbus-message.c (dbus_message_set_is_error_reply): rename
2211 just set_is_error/get_is_error as this is a commonly-used
2212 function, and write docs.
2214 2003-01-31 Anders Carlsson <andersca@codefactory.se>
2216 * dbus/dbus-address.c: (dbus_address_entry_free):
2217 Free key and value lists.
2219 * dbus/dbus-internals.c: (_dbus_type_to_string):
2220 Add the types we didn't have.
2222 * dbus/dbus-marshal.c: (_dbus_marshal_get_arg_end_pos),
2223 (_dbus_marshal_validate_arg):
2226 * dbus/dbus-message.c: (dbus_message_set_sender):
2227 Remove todo about being able to set sender to NULL.
2229 (dbus_message_set_is_error_reply),
2230 (dbus_message_get_is_error_reply):
2231 * dbus/dbus-message.h:
2234 * dbus/dbus-protocol.h:
2235 Add error reply flag.
2237 * test/data/valid-messages/opposite-endian.message:
2238 Add NIL type to test.
2240 2003-01-31 Havoc Pennington <hp@pobox.com>
2242 * doc/dbus-specification.sgml: fully specify the header. Add
2243 flags and major protocol version, and change header/body len to
2246 * dbus/dbus-message-builder.c (append_saved_length): append length
2249 * dbus/dbus-message.c (dbus_message_create_header): change header
2250 length and body length to unsigned. Add the new fields from the
2252 (_dbus_message_loader_return_buffer): unsigned header/body len
2254 2003-01-30 Havoc Pennington <hp@pobox.com>
2256 * dbus/dbus-auth.c: rework to use only REJECTED, no
2259 * doc/dbus-sasl-profile.txt: drop MECHANISMS and just
2260 use REJECTED, suggested by Mark McLoughlin
2262 2003-01-30 Havoc Pennington <hp@pobox.com>
2264 * dbus/dbus-server.c (dbus_server_listen): @todo about how we need
2265 a better way to report errors here. e.g. "unix address lacks
2266 path" or something. also "no such file" when the path doesn't
2269 * dbus/dbus-address.c (dbus_address_entries_free): add @todo about
2271 (dbus_parse_address): add @todo about documenting address format,
2272 and allowing , and ; to be escaped
2274 2003-01-30 Anders Carlsson <andersca@codefactory.se>
2277 Add dbus-address.[ch]
2279 * dbus/dbus-address.c: (dbus_address_entry_free),
2280 (dbus_address_entries_free), (create_entry),
2281 (dbus_address_entry_get_method), (dbus_address_entry_get_value),
2282 (dbus_parse_address), (_dbus_address_test):
2283 * dbus/dbus-address.h:
2284 New files for dealing with address parsing.
2286 * dbus/dbus-connection.c:
2287 Document timeout functions.
2289 * dbus/dbus-message.c:
2290 Document dbus_message_new_from_message.
2292 * dbus/dbus-server-debug.c:
2295 * dbus/dbus-server.c: (dbus_server_listen):
2296 Parse address and use correct server implementation.
2298 * dbus/dbus-string.c: (_dbus_string_find_to), (_dbus_string_test):
2299 * dbus/dbus-string.h:
2300 New function with test.
2302 * dbus/dbus-test.c: (dbus_internal_symbol_do_not_use_run_tests):
2306 * dbus/dbus-transport-debug.c:
2309 * dbus/dbus-transport.c: (_dbus_transport_open):
2310 Parse address and use correct transport implementation.
2312 2003-01-30 Havoc Pennington <hp@pobox.com>
2314 * dbus/dbus-message.c: use message->byte_order instead of
2315 DBUS_COMPILER_BYTE_ORDER throughout.
2316 (dbus_message_create_header): pad header to align the
2317 start of the body of the message to 8-byte boundary
2319 * dbus/dbus-marshal.h: make all the demarshalers take const
2320 DBusString arguments.
2322 * dbus/dbus-message.c (_dbus_message_loader_return_buffer):
2323 validate message args here, so we don't have to do slow validation
2324 later, and so we catch bad messages as they are incoming. Also add
2325 better checks on header_len and body_len. Also fill in
2328 * dbus/dbus-string.c (_dbus_string_validate_utf8): new (not
2329 implemented properly)
2330 (_dbus_string_validate_nul): new function to check all-nul
2332 * dbus/dbus-marshal.c (_dbus_marshal_get_field_end_pos): rename
2333 get_arg_end_pos and remove all validation
2334 (_dbus_marshal_validate_arg): actually do validation here.
2336 2003-01-29 Havoc Pennington <hp@pobox.com>
2338 * dbus/dbus-message.c (check_message_handling): fix assertion
2339 failure on set_client_serial
2341 2003-01-28 Havoc Pennington <hp@pobox.com>
2343 * dbus/dbus-server-debug.c: Add doc section comments
2345 * dbus/dbus-transport-debug.c: add doc section comments
2347 2003-01-28 Havoc Pennington <hp@redhat.com>
2349 * dbus/dbus-string.c (_dbus_string_base64_decode): append bytes in
2350 the reverse order from how I had it
2351 (_dbus_string_base64_encode): reverse encoding order. I was
2352 basically byteswapping everything during encoding.
2354 2003-01-28 Anders Carlsson <andersca@codefactory.se>
2356 * dbus/dbus-connection-internal.h:
2357 * dbus/dbus-connection.c: (_dbus_connection_add_timeout),
2358 (_dbus_connection_remove_timeout):
2359 Add functions for adding and removing timeouts.
2361 * dbus/dbus-message.c: (dbus_message_new_from_message):
2362 Add new function that takes a message and creates an exact
2363 copy of it, but with the refcount set to 1.
2364 (check_message_handling):
2367 * dbus/dbus-server-protected.h:
2368 * dbus/dbus-server.c: (_dbus_server_init_base),
2369 (_dbus_server_finalize_base), (_dbus_server_add_timeout),
2370 (dbus_server_set_timeout_functions):
2371 (_dbus_server_remove_timeout):
2372 New functions so that a server can add and remove timeouts.
2374 (dbus_server_listen):
2375 Add commented out call to dbus_server_debug_new.
2377 * dbus/dbus-timeout.c: (_dbus_timeout_new):
2378 Actually set the handler, doh.
2380 * dbus/dbus-transport.c: (_dbus_transport_open):
2381 Add commented out call to dbus_transport_debug_client_new.
2384 Add dbus-transport-debug.[ch] and dbus-server-debug.[ch]
2386 2003-01-28 Havoc Pennington <hp@pobox.com>
2388 * dbus/dbus-message.c (check_message_handling): function to check
2389 on the loaded message, iterates over it etc.
2391 2003-01-28 Havoc Pennington <hp@pobox.com>
2393 * test/Makefile.am (dist-hook): fix make distdir
2395 * dbus/Makefile.am (TESTS_ENVIRONMENT): fix make check
2397 2003-01-27 Havoc Pennington <hp@pobox.com>
2399 * dbus/dbus-mempool.c (time_for_size): replace printf with
2402 * dbus/dbus-message-builder.c (_dbus_message_data_load): allow
2403 empty lines; fix the SAVE_LENGTH stuff to be
2404 START_LENGTH/END_LENGTH so it actually works; couple other
2407 * test/Makefile.am (dist-hook): add dist-hook for .message files
2409 * dbus/dbus-string.c (DBUS_STRING_COPY_PREAMBLE): source of a copy
2410 can be constant or locked.
2411 (_dbus_string_free): allow freeing a const string as
2414 * dbus/dbus-sysdeps.c (_dbus_concat_dir_and_file): utility
2416 * dbus/dbus-test-main.c (main): take an argument which is the
2417 directory containing test data
2419 * dbus/dbus-message.c (_dbus_message_test): pass a test_data_dir
2420 argument to this and load all the messages in test/data/
2421 checking that they can be loaded or not loaded as appropriate.
2423 2003-01-27 Anders Carlsson <andersca@codefactory.se>
2425 * bus/dispatch.c: (bus_dispatch_message_handler):
2426 Dispatch messages sent to services.
2428 * bus/driver.c: (bus_driver_send_service_deleted),
2429 (bus_driver_send_service_created), (bus_driver_send_service_lost),
2430 (bus_driver_send_service_acquired):
2431 Add helper functions for sending service related messages.
2433 (bus_driver_send_welcome_message):
2434 Send HELLO_REPLY instead of WELCOME.
2436 (bus_driver_handle_list_services):
2437 Send LIST_SERVICES_REPLY instead of SERVICES.
2439 (bus_driver_handle_own_service),
2440 (bus_driver_handle_service_exists):
2441 New message handlers.
2443 (bus_driver_handle_message):
2444 Invoke new message handlers.
2446 (bus_driver_remove_connection):
2447 Don't remove any services here since that's done automatically
2448 by bus_service_remove_owner now.
2451 New function signatures.
2453 * bus/services.c: (bus_service_add_owner):
2454 Send ServiceAcquired message if we're the only primary owner.
2456 (bus_service_remove_owner):
2457 Send ServiceAcquired/ServiceLost messages.
2459 (bus_service_set_prohibit_replacement),
2460 (bus_service_get_prohibit_replacement):
2461 Functions for setting prohibit replacement.
2463 (bus_service_has_owner):
2464 New function that checks if a connection is in the owner queue of
2468 Add new function signatures.
2470 * dbus/dbus-list.c: (_dbus_list_test):
2471 Add tests for _dbus_list_remove_last and traversing the list backwards.
2474 Fix a typo in _dbus_list_get_prev_link, if we're at the first element we can't
2475 go any further, so return NULL then.
2477 * dbus/dbus-protocol.h:
2478 Add new messages, service flags and service replies.
2480 2003-01-26 Havoc Pennington <hp@pobox.com>
2482 * dbus/dbus-message-builder.c: implement, completely untested.
2484 * test/data/*: add data to be used in testing.
2485 ".message" files are our simple loadable text format.
2486 ".message-raw" will be binary dumps of messages.
2488 * dbus/dbus-string.c (_dbus_string_starts_with_c_str): new
2490 2003-01-26 Havoc Pennington <hp@pobox.com>
2492 * dbus/dbus-sysdeps.c (_dbus_file_get_contents): new function
2494 * dbus/dbus-errors.c (dbus_result_to_string): add
2497 * dbus/dbus-message-builder.c: new file, will contain code to load
2498 up messages from files. Not implemented yet.
2500 2003-01-26 Havoc Pennington <hp@pobox.com>
2502 * dbus/dbus-message.c (dbus_message_set_sender): support deleting
2503 the sender by setting to NULL
2505 2003-01-26 Havoc Pennington <hp@pobox.com>
2507 The unit tests pass, but otherwise untested. If it breaks, the
2508 tests should have been better. ;-)
2510 * bus/driver.c (bus_driver_handle_hello): return if we disconnect
2513 * dbus/dbus-message.c: redo everything so we maintain
2514 message->header as the only copy of the various fields.
2515 This avoids the possibility of out-of-memory in some cases,
2516 for example dbus_message_lock() can't run out of memory anymore,
2517 and avoids extra copying. Figured I may as well go ahead and do
2518 this since it was busted for dbus_message_lock to not return
2519 failure on OOM, and dbus_message_write_header was totally
2520 unchecked for OOM. Also fixed some random other bugs.
2522 * dbus/dbus-marshal.c (_dbus_marshal_get_field_end_pos): verify
2523 that strings are nul-terminated. Also, end_pos can be equal
2524 to string length just not greater than, I think.
2525 (_dbus_marshal_set_int32): new function
2526 (_dbus_marshal_set_uint32): new function
2527 (_dbus_marshal_set_string): new function
2529 * dbus/dbus-connection.c (_dbus_connection_new_for_transport): fix
2530 a warning, init timeout_list to NULL
2531 (dbus_connection_send_message): don't use uninitialized variable
2534 * dbus/dbus-string.c (_dbus_string_replace_len): new function
2536 2003-01-26 Anders Carlsson <andersca@codefactory.se>
2538 * bus/driver.c: (bus_driver_handle_hello),
2539 (bus_driver_send_welcome_message):
2542 2003-01-26 Anders Carlsson <andersca@codefactory.se>
2544 * dbus/dbus-auth.c: (process_auth), (_dbus_auth_unref):
2545 * dbus/dbus-connection.c: (_dbus_connection_new_for_transport),
2546 (dbus_connection_unref):
2547 * dbus/dbus-marshal.c: (_dbus_marshal_test):
2548 * dbus/dbus-message.c: (dbus_message_unref),
2551 (dbus_message_get_fields):
2552 Remove debugging printout.
2554 (_dbus_message_loader_return_buffer):
2555 Don't store the header string.
2557 (_dbus_message_test):
2560 2003-01-26 Richard Hult <rhult@codefactory.se>
2562 * glib/dbus-gmain.c (dbus_connection_dispatch): Traverse a copy of
2563 the file descriptor list, since it can change under us.
2565 2003-01-25 Anders Carlsson <andersca@codefactory.se>
2567 * glib/dbus-gmain.c: (dbus_connection_prepare),
2568 (dbus_connection_check), (dbus_connection_dispatch), (add_watch),
2569 (remove_watch), (dbus_connection_hookup_with_g_main):
2570 Rewrite the glib handling to use its own GSource instead of a
2571 GIOChannel so we can catch messages put in the queue while waiting
2574 2003-01-25 Anders Carlsson <andersca@codefactory.se>
2577 * bus/connection.c: (connection_disconnect_handler),
2578 (connection_watch_callback), (bus_connection_setup):
2579 * bus/dispatch.c: (send_one_message),
2580 (bus_dispatch_broadcast_message), (bus_dispatch_message_handler),
2581 (bus_dispatch_add_connection), (bus_dispatch_remove_connection):
2583 * bus/driver.c: (bus_driver_send_service_deleted),
2584 (bus_driver_send_service_created), (bus_driver_handle_hello),
2585 (bus_driver_send_welcome_message),
2586 (bus_driver_handle_list_services), (bus_driver_remove_connection),
2587 (bus_driver_handle_message):
2589 Refactor code, put the message dispatching in its own file. Use
2590 _DBUS_HANDLE_OOM. Also send ServiceDeleted messages when a client
2593 2003-01-25 Anders Carlsson <andersca@codefactory.se>
2595 * dbus/dbus-internals.h:
2596 Add _DBUS_HANDLE_OOM macro, it doesn't do anything currently.
2598 * dbus/dbus-message.c: (dbus_message_get_sender):
2599 * dbus/dbus-message.h:
2600 Implement dbus_message_get_sender.
2602 * dbus/dbus-protocol.h:
2603 Add message and service defines.
2605 2003-01-25 Anders Carlsson <andersca@codefactory.se>
2607 * dbus/dbus-connection.c: (dbus_connection_send_message):
2608 * dbus/dbus-message-internal.h:
2609 * dbus/dbus-message.c: (_dbus_message_get_client_serial),
2610 (dbus_message_write_header):
2611 Remove _dbus_messag_unlock and don't set the client serial on a
2612 message if one already exists.
2614 2003-01-24 Havoc Pennington <hp@pobox.com>
2616 * dbus/dbus-list.c (alloc_link): put a thread lock on the global
2619 * bus/driver.c (bus_driver_handle_list_services): fix a leak
2622 2003-01-25 Anders Carlsson <andersca@codefactory.se>
2624 * dbus/dbus-list.c: (alloc_link), (free_link):
2625 Use a memory pool for the links.
2627 2003-01-25 Anders Carlsson <andersca@codefactory.se>
2629 * bus/connection.c: (bus_connection_foreach):
2631 Add new bus_connection_foreach function.
2633 * bus/driver.c: (send_one_message), (bus_driver_broadcast_message):
2634 Add function that broadcasts a message to all clients.
2636 (bus_driver_send_service_created), (bus_driver_handle_hello),
2637 (bus_driver_send_welcome_message),
2638 (bus_driver_handle_list_services), (bus_driver_message_handler):
2639 Implement functions that take care of listing services, and notifying
2640 clients when new services are created.
2642 * bus/services.c: (bus_services_list):
2644 Add new function that returns an array of strings with the currently
2645 registered services.
2648 * glib/dbus-gmain.c:
2649 Update copyright year.
2651 2003-01-25 Anders Carlsson <andersca@codefactory.se>
2653 * dbus/dbus-connection.c: (dbus_connection_send_message):
2654 Unlock the message in case it was sent earlier.
2656 (dbus_connection_send_message_with_reply_and_block):
2657 Remove the reply message from the list.
2659 * dbus/dbus-marshal.c: (_dbus_demarshal_string_array):
2660 Set array_len and new_pos correctly.
2662 (_dbus_marshal_test):
2663 Remove debug output.
2665 * dbus/dbus-message-internal.h:
2666 * dbus/dbus-message.c: (_dbus_message_get_reply_serial):
2667 New function that returns the reply serial.
2669 (_dbus_message_unlock):
2670 New function that unlocks a message and resets its header.
2672 (dbus_message_append_string_array),
2673 (dbus_message_get_fields_valist),
2674 (dbus_message_iter_get_field_type),
2675 (dbus_message_iter_get_string_array),
2676 (dbus_message_get_fields),
2677 (dbus_message_append_fields_valist):
2678 Handle string arrays.
2680 (dbus_message_set_sender):
2681 Make this function public since the bus daemon needs it.
2683 (decode_header_data):
2684 Set the reply serial to -1 initially.
2686 * dbus/dbus-message.h:
2687 Add dbus_message_set_sender.
2689 2003-01-24 Havoc Pennington <hp@pobox.com>
2691 * doc/dbus-specification.sgml: add some stuff
2693 2003-01-22 Havoc Pennington <hp@pobox.com>
2695 * doc/dbus-specification.sgml: Start to document the protocol.
2697 2003-01-22 Havoc Pennington <hp@pobox.com>
2699 * dbus/dbus-connection.c
2700 (dbus_connection_send_message_with_reply_and_block): add some @todo
2702 * bus/driver.c (bus_driver_add_connection): add a FIXME about memleak
2704 2003-01-21 Havoc Pennington <hp@pobox.com>
2706 (patch untested because can't compile)
2708 * bus/driver.c (create_unique_client_name): make this function
2709 never recycle client names. Also, caller should initialize
2712 * dbus/dbus-sysdeps.c (_dbus_get_current_time): new function
2714 2003-01-21 Anders Carlsson <andersca@codefactory.se>
2716 * dbus/dbus-marshal.c: (_dbus_marshal_double),
2717 (_dbus_marshal_int32), (_dbus_marshal_uint32),
2718 (_dbus_marshal_int32_array), (_dbus_marshal_uint32_array),
2719 (_dbus_marshal_double_array), (_dbus_marshal_string_array),
2720 (_dbus_demarshal_int32_array), (_dbus_demarshal_uint32_array),
2721 (_dbus_demarshal_double_array), (_dbus_demarshal_string_array),
2722 (_dbus_marshal_get_field_end_pos), (_dbus_marshal_test):
2723 * dbus/dbus-marshal.h:
2724 * dbus/dbus-protocol.h:
2725 Add support for marshalling and demarshalling integer, double
2728 2003-01-21 Anders Carlsson <andersca@codefactory.se>
2733 * bus/connection.c: (connection_disconnect_handler):
2734 Remove the connection from the bus driver's list.
2736 (connection_watch_callback): Dispatch messages.
2738 (free_connection_data): Free connection name.
2740 (bus_connection_setup): Add connection to the bus driver's list.
2741 (bus_connection_remove_owned_service):
2742 (bus_connection_set_name), (bus_connection_get_name):
2743 Add functions for setting and getting the connection's name.
2746 Add function headers.
2748 * bus/driver.c: (create_unique_client_name),
2749 (bus_driver_handle_hello_message),
2750 (bus_driver_send_welcome_message), (bus_driver_message_handler),
2751 (bus_driver_add_connection), (bus_driver_remove_connection):
2754 * bus/services.c: (bus_service_free):
2756 New file that handles communication and registreation with the bus
2759 2003-01-21 Anders Carlsson <andersca@codefactory.se>
2761 * dbus/dbus-connection.c: (dbus_connection_send_message):
2762 Add a new client_serial parameter.
2764 (dbus_connection_send_message_with_reply):
2765 Remove a @todo since we've implemented the blocking function.
2767 (dbus_connection_send_message_with_reply_and_block):
2768 New function that sends a message and waits for a reply and
2769 then returns the reply.
2771 * dbus/dbus-connection.h:
2774 * dbus/dbus-errors.c: (dbus_result_to_string):
2775 * dbus/dbus-errors.h:
2776 Add new DBUS_RESULT.
2778 * dbus/dbus-message-internal.h:
2779 * dbus/dbus-message.c: (_dbus_message_get_reply_serial),
2780 (_dbus_message_set_sender), (dbus_message_write_header),
2781 (dbus_message_new_reply), (decode_header_data),
2782 (_dbus_message_loader_return_buffer), (_dbus_message_test):
2783 * dbus/dbus-message.h:
2784 Add new functions that set the reply serial and sender.
2785 Also marshal and demarshal them correctly and add test.
2787 * dbus/dbus-protocol.h:
2788 Add new DBUS_MESSAGE_TYPE_SENDER.
2791 * glib/dbus-gmain.c: (watch_callback), (free_callback_data),
2792 (add_watch), (remove_watch), (add_timeout), (remove_timeout),
2793 (dbus_connection_hookup_with_g_main):
2794 * glib/test-dbus-glib.c: (main):
2795 Rewrite to use GIOChannel and remove the GSource crack.
2797 * test/echo-client.c: (main):
2798 * test/watch.c: (check_messages):
2799 Update for changed APIs
2801 2003-01-19 Anders Carlsson <andersca@codefactory.se>
2803 * dbus/Makefile.am: Add dbus-timeout.[cħ]
2805 * dbus/dbus-connection.c: (_dbus_connection_new_for_transport):
2806 Create a DBusTimeoutList.
2807 (dbus_connection_set_timeout_functions): Add new function to
2808 set timeout callbacks
2810 * dbus/dbus-connection.h: Add public DBusTimeout API.
2812 * dbus/dbus-message.c: (dbus_message_get_service):
2813 * dbus/dbus-message.h: New function.
2815 * dbus/dbus-server.c: Fix small doc typo.
2817 * dbus/dbus-timeout.[ch]: New files for mainloop timeouts.
2819 2003-01-19 Anders Carlsson <andersca@codefactory.se>
2821 * dbus/dbus-string.c (_dbus_string_move_len): Don't delete all
2822 of the string, just as long as specified.
2824 2003-01-19 Havoc Pennington <hp@pobox.com>
2826 * dbus/dbus-connection.c (dbus_connection_get_is_authenticated):
2829 * dbus/dbus-server.c (dbus_server_set_max_connections)
2830 (dbus_server_get_max_connections, dbus_server_get_n_connections):
2831 keep track of current number of connections, and add API for
2832 setting a max (but haven't implemented enforcing the max yet)
2834 2003-01-18 Havoc Pennington <hp@pobox.com>
2836 * dbus/dbus-transport-unix.c (unix_do_iteration): only do the
2837 reading/writing if read_watch != NULL or write_watch != NULL.
2839 * dbus/dbus-message.c (_dbus_message_loader_return_buffer): fix
2840 the message loader code to actually load message->header and
2841 message->body into the newly-created message.
2843 * dbus/dbus-transport-unix.c (check_write_watch): fix a mem leak
2846 * dbus/dbus-connection.c (dbus_connection_set_max_message_size)
2847 (dbus_connection_get_max_message_size)
2848 (dbus_connection_set_max_live_messages_size)
2849 (dbus_connection_get_max_live_messages_size): implement some
2850 resource limitation functions
2852 * dbus/dbus-resources.c: new file implementing some of the
2853 resource limits stuff
2855 * dbus/dbus-message.c (dbus_message_iter_get_byte_array): add
2856 missing docs, add @todo to handle OOM etc.
2858 * dbus/dbus-marshal.c (_dbus_demarshal_byte_array): add missing
2861 2003-01-18 Havoc Pennington <hp@pobox.com>
2863 * dbus/dbus-connection.c (dbus_connection_unref): disconnect the
2864 connection if it hasn't been already.
2866 * dbus/dbus-connection.h: kill off the idea of an ErrorFunction,
2867 replace with DisconnectFunction.
2869 2003-01-18 Havoc Pennington <hp@pobox.com>
2871 Building --disable-verbose-mode --disable-asserts --disable-tests
2872 cuts the library from 112K to 45K or so
2874 * configure.in: check for varargs macro support,
2875 add --enable-verbose-mode, --enable-asserts.
2877 * dbus/dbus-internals.h (_dbus_assert): support
2879 (_dbus_verbose): support DBUS_ENABLE_VERBOSE_MODE
2881 2003-01-18 Havoc Pennington <hp@pobox.com>
2883 * dbus/dbus-test.c: include config.h so that tests actually run
2885 * dbus/dbus-string.c: add assertions that stuff is 8-byte aligned,
2886 so the failure mode when that assumption fails will be plenty
2889 2003-01-18 Havoc Pennington <hp@pobox.com>
2891 * configure.in: default --enable-tests to $USE_MAINTAINER_MODE
2893 * dbus/Makefile.am: fix it up so dubs-test-main.c is included in
2896 * test/Makefile.am: don't use special variable "TESTS" for echo-*
2897 since we don't want to use those in make check
2899 2003-01-15 Havoc Pennington <hp@redhat.com>
2905 2003-01-15 Havoc Pennington <hp@redhat.com>
2907 * test/Makefile.am: fix so that test source code ends up in the
2908 distribution on make distcheck
2910 2003-01-15 Havoc Pennington <hp@redhat.com>
2916 2003-01-15 Havoc Pennington <hp@redhat.com>
2918 * dbus/dbus-test.c (dbus_internal_symbol_do_not_use_run_tests):
2919 fix build when --disable-tests
2921 * Makefile.am (EXTRA_DIST): put HACKING in here
2923 * HACKING: document procedure for making a tarball release.
2925 2003-01-14 Anders Carlsson <andersca@codefactory.se>
2927 * bus/connection.c: (connection_error_handler),
2928 (bus_connection_setup):
2929 * bus/main.c: (main):
2930 Make sure that the DBusConnectionData struct is NULLed
2931 out to prevent a segfault.
2933 * dbus/dbus-errors.c: (dbus_result_to_string):
2934 * dbus/dbus-errors.h:
2935 * dbus/dbus-message.c: (dbus_message_get_fields),
2936 (dbus_message_get_fields_valist), (_dbus_message_test):
2937 * dbus/dbus-message.h:
2938 Make dbus_message_get_fields return a result code so we can
2939 track invalid fields as well as oom.
2941 2003-01-11 Havoc Pennington <hp@pobox.com>
2943 * configure.in: change --enable-test/--enable-ansi action-if-given
2944 to enable_foo=$enableval instead of enable_foo=yes
2946 2003-01-08 Havoc Pennington <hp@pobox.com>
2948 * dbus/dbus-string.c (_dbus_string_align_length): new function
2950 * dbus/dbus-test-main.c: move main() for test app here
2952 (dbus_internal_symbol_do_not_use_run_tests): we have to export a
2953 symbol to run tests, because dbus-test isn't in the main
2956 Code review nitpicks.
2958 * dbus/dbus-message.c (dbus_message_write_header): add newlines
2959 for people with narrow emacs ;-). Assert client_serial was filled
2960 in. Assert message->name != NULL.
2961 (dbus_message_append_fields): have "first_field_type" arg separate
2962 from va list, needed for C++ binding that also uses varargs IIRC
2963 and helps with type safety
2964 (dbus_message_new): add @todo about using DBusString to store
2965 service/name internally
2966 (dbus_message_new): don't leak ->service and ->name on OOM later
2968 (dbus_message_unref): free the service name
2969 (dbus_message_get_fields): same change to varargs
2970 i.e. first_field_type
2971 (_dbus_message_loader_return_buffer): assert that the message data
2972 is aligned (if not it's a bug in our code). Put in verbose griping
2973 about why we set corrupted = TRUE.
2974 (decode_header_data): add FIXME that char* is evil. Was going to
2975 add FIXME about evil locale-specific string.h strncmp, but just
2976 switched to wacky string-as-uint32 optimization. Move check for
2977 "no room for field name" above get_const_data_len() to avoid
2978 assertion failure in get_const_data_len if we have trailing 2
2979 bytes or the like. Check for service and name fields being
2980 provided twice. Don't leak service/name on error. Require field
2981 names to be aligned to 4 bytes.
2983 * dbus/dbus-marshal.c: move byte swap stuff to header
2984 (_dbus_pack_int32): uscore-prefix
2985 (_dbus_unpack_int32): uscore-prefix
2986 (_dbus_unpack_uint32): export
2987 (_dbus_demarshal_string): add @todo complaining about use of
2989 (_dbus_marshal_get_field_end_pos): add @todo about bad error
2990 handling allowing corrupt data to go unchecked
2992 2003-01-08 Havoc Pennington <hp@redhat.com>
2994 * dbus/dbus-transport-unix.c (unix_do_iteration): add read/write
2995 to the select() as needed for authentication. (should be using
2996 _dbus_poll() not select, but for another day)
2998 * dbus/dbus.h: include dbus/dbus-protocol.h
3000 2003-01-08 Anders Carlsson <andersca@codefactory.se>
3002 * dbus/Makefile.am (dbusinclude_HEADERS): Install
3005 2003-01-08 Anders Carlsson <andersca@codefactory.se>
3007 * dbus/dbus-internals.c: (_dbus_type_to_string):
3008 New function that returns a string describing a type.
3010 * dbus/dbus-marshal.c: (_dbus_demarshal_byte_array):
3011 * dbus/dbus-marshal.h:
3012 * dbus/dbus-message.c: (dbus_message_get_fields_valist),
3013 (dbus_message_iter_get_field_type), (dbus_message_iter_get_double),
3014 (dbus_message_iter_get_byte_array):
3015 * dbus/dbus-message.h:
3016 Add new convenience functions for appending and getting message fields.
3017 Also add demarshalling routines for byte arrays.
3019 2003-01-07 Anders Carlsson <andersca@codefactory.se>
3021 * dbus/dbus-connection-internal.h:
3022 * dbus/dbus-connection.c: (_dbus_connection_new_for_transport),
3023 (_dbus_connection_get_next_client_serial),
3024 (dbus_connection_send_message):
3025 * dbus/dbus-internals.h:
3026 * dbus/dbus-marshal.c: (unpack_uint32), (dbus_unpack_int32),
3027 (dbus_pack_int32), (_dbus_marshal_double), (_dbus_marshal_int32),
3028 (_dbus_marshal_uint32), (_dbus_demarshal_double),
3029 (_dbus_demarshal_int32), (_dbus_demarshal_uint32),
3030 (_dbus_demarshal_string), (_dbus_marshal_get_field_end_pos),
3031 (_dbus_verbose_bytes), (_dbus_marshal_test):
3032 * dbus/dbus-marshal.h:
3033 * dbus/dbus-message-internal.h:
3034 * dbus/dbus-message.c: (_dbus_message_set_client_serial),
3035 (dbus_message_write_header), (_dbus_message_lock),
3036 (dbus_message_new), (dbus_message_ref), (dbus_message_unref),
3037 (dbus_message_get_name), (dbus_message_append_int32),
3038 (dbus_message_append_uint32), (dbus_message_append_double),
3039 (dbus_message_append_string), (dbus_message_append_byte_array),
3040 (dbus_message_get_fields_iter), (dbus_message_iter_ref),
3041 (dbus_message_iter_unref), (dbus_message_iter_has_next),
3042 (dbus_message_iter_next), (dbus_message_iter_get_field_type),
3043 (dbus_message_iter_get_string), (dbus_message_iter_get_int32),
3044 (dbus_message_iter_get_uint32), (dbus_message_iter_get_double),
3045 (decode_header_data), (_dbus_message_loader_return_buffer),
3046 (message_iter_test), (_dbus_message_test):
3047 * dbus/dbus-message.h:
3048 * dbus/dbus-protocol.h:
3049 * dbus/dbus-test.c: (main):
3051 * glib/test-dbus-glib.c: (message_handler), (main):
3052 * test/echo-client.c: (main):
3053 * test/watch.c: (check_messages):
3054 Make messages sendable and receivable for real.
3056 2003-01-07 Anders Carlsson <andersca@codefactory.se>
3058 * dbus/dbus-marshal.c: (_dbus_marshal_double),
3059 (_dbus_marshal_string), (_dbus_marshal_byte_array):
3060 * dbus/dbus-message.c: (dbus_message_append_int32),
3061 (dbus_message_append_uint32), (dbus_message_append_double),
3062 (dbus_message_append_string), (dbus_message_append_byte_array):
3063 Handle OOM restoration.
3065 2003-01-07 Anders Carlsson <andersca@codefactory.se>
3067 * dbus/dbus-marshal.c: (_dbus_marshal_string),
3068 (_dbus_demarshal_string), (_dbus_marshal_test):
3069 * dbus/dbus-marshal.h:
3070 * dbus/dbus-message.c: (dbus_message_get_name),
3071 Document these functions.
3073 (dbus_message_append_int32), (dbus_message_append_uint32),
3074 (dbus_message_append_double), (dbus_message_append_string),
3075 (dbus_message_append_byte_array):
3076 * dbus/dbus-message.h:
3077 Add functions for adding message fields of different types.
3079 * dbus/dbus-protocol.h:
3080 Add the different types.
3082 2003-01-05 Havoc Pennington <hp@pobox.com>
3084 * bus/connection.c: implement routines for handling connections,
3085 first thing is keeping a list of owned services on each connection
3086 and setting up watches etc.
3088 * bus/services.c: implement a mapping from service names to lists
3091 * dbus/dbus-hash.c: add DBUS_HASH_POINTER
3093 * dbus/dbus-threads.c (dbus_static_mutex_lock): add functions
3094 to use static mutexes for global data
3096 * dbus/dbus-connection.c (dbus_connection_set_data): add new
3097 collection of functions to set/get application-specific data
3098 on the DBusConnection.
3100 2003-01-04 Havoc Pennington <hp@pobox.com>
3102 * dbus/dbus-sysdeps.c (_dbus_sleep_milliseconds): new function
3103 (_dbus_poll): new function
3105 * dbus/dbus-internals.h (_DBUS_STRUCT_OFFSET): new macro
3108 * bus/loop.c: initial code for the daemon main loop
3110 2003-01-04 Havoc Pennington <hp@pobox.com>
3112 * test/watch.c (error_handler): make it safe if the error handler
3113 is called multiple times (if we s/error handler/disconnect
3114 handler/ we should just guarantee it's called only once)
3116 * dbus/dbus-transport.c (_dbus_transport_disconnect): call the
3117 error handler on disconnect (it's quite possible we should
3118 just change the error handler to a "disconnect handler," I'm
3119 not sure we have any other meaningful errors)
3121 * configure.in: check for getpwnam_r
3123 * dbus/dbus-transport.c, dbus/dbus-transport-unix.c,
3124 dbus/dbus-auth.c: add credentials support, add EXTERNAL auth
3125 mechanism as in SASL spec, using socket credentials
3127 * dbus/dbus-sysdeps.c (_dbus_read_credentials_unix_socket): new function
3128 (_dbus_send_credentials_unix_socket): new function
3130 * dbus/dbus-sysdeps.c (_dbus_accept_unix_socket): rename just
3132 (_dbus_write): only check errno if <0 returned
3133 (_dbus_write_two): ditto
3135 2003-01-02 Anders Carlsson <andersca@codefactory.se>
3137 * dbus/dbus-marshal.c: (_dbus_marshal_utf8_string),
3138 (_dbus_marshal_byte_array), (_dbus_demarshal_utf8_string),
3139 (_dbus_marshal_test):
3140 * dbus/dbus-marshal.h:
3141 Add _dbus_marshal_byte_array and rename _dbus_marshal_string
3142 to _dbus_marshal_utf8_string. Also fix some tests.
3144 2002-12-28 Harri Porten <porten@kde.org>
3146 * configure.in: added check for C++ compiler and a very cheesy
3147 check for the Qt integration
3149 * Makefile.am (SUBDIRS): compile qt subdir if support is enabled
3151 * qt/Makefile.am: added
3153 * qt/.cvsignore: added
3155 * qt/dbus-qthread.cc, qt/dbus-qthread.cpp: renamed former to
3156 latter, added #ifdef QT_THREAD_SUPPORT guard.
3158 * dbus/Makefile.am: added missing headers for make dist
3160 2002-12-28 Kristian Rietveld <kris@gtk.org>
3162 * dbus/Makefile.am: fixup export-symbols-regex.
3164 2002-12-27 Anders Carlsson <andersca@codefactory.se>
3166 * acinclude.m4: Add this file and put the
3167 PKG_CHECK_MODULE macro in it.
3169 2002-12-27 Anders Carlsson <andersca@codefactory.se>
3171 * dbus/dbus-marshal.c: (_dbus_marshal_string),
3172 (_dbus_demarshal_double), (_dbus_demarshal_int32),
3173 (_dbus_demarshal_uint32), (_dbus_demarshal_string),
3174 (_dbus_marshal_test):
3175 Make the demarshalling routines align the pos argument.
3176 Add string marshalling tests and fix the obvious bugs
3179 2002-12-26 Havoc Pennington <hp@pobox.com>
3181 * dbus/dbus-auth.c: fixes fixes fixes
3183 * dbus/dbus-transport-unix.c: wire up support for
3184 encoding/decoding data on the wire
3186 * dbus/dbus-auth.c (_dbus_auth_encode_data)
3187 (_dbus_auth_decode_data): append to target string
3188 instead of nuking it.
3190 2002-12-26 Havoc Pennington <hp@pobox.com>
3192 * dbus/dbus-marshal.h (DBUS_COMPILER_BYTE_ORDER): #ifdef
3193 WORDS_BIGENDIAN then compiler byte order is DBUS_BIG_ENDIAN,
3196 * dbus/dbus-marshal.c: Add macros to do int swapping in-place and
3197 avoid swap_bytes() overhead (ignoring possible assembly stuff for
3198 now). Main point is because I wanted unpack_uint32 to implement
3200 (_dbus_verbose_bytes): new function
3202 * dbus/dbus-string.c (_dbus_string_validate_ascii): new function
3204 * dbus/dbus-message.c (_dbus_message_loader_get_is_corrupted): add
3205 mechanism to handle a corrupt message stream
3206 (_dbus_message_loader_new): fix preallocation to only prealloc,
3209 * dbus/dbus-string.c (_dbus_string_skip_blank): fix this function
3210 (_dbus_string_test): enhance tests for copy/move and fix the
3213 * dbus/dbus-transport-unix.c: Hold references in more places to
3214 avoid reentrancy problems
3216 * dbus/dbus-transport.c: ditto
3218 * dbus/dbus-connection.c (dbus_connection_dispatch_message): don't
3219 leak reference count in no-message case
3221 * test/watch.c (do_mainloop): handle adding/removing watches
3222 during iteration over the watches. Also, ref the connection/server
3223 stored on a watch, so we don't try to mangle a destroyed one.
3225 * dbus/dbus-transport-unix.c (do_authentication): perform
3228 * dbus/dbus-auth.c (get_state): add a state
3229 AUTHENTICATED_WITH_UNUSED_BYTES and return it if required
3230 (_dbus_auth_get_unused_bytes): append the unused bytes
3231 to the passed in string, rather than prepend
3233 * dbus/dbus-transport.c (_dbus_transport_init_base): create
3234 the auth conversation DBusAuth
3236 * dbus/dbus-transport-unix.c (_dbus_transport_new_for_fd)
3237 (_dbus_transport_new_for_domain_socket): when creating a
3238 transport, pass in whether it's a client-side or server-side
3239 transport so we know which DBusAuth to create
3241 2002-12-03 Havoc Pennington <hp@pobox.com>
3243 * dbus/dbus-transport-unix.c (unix_finalize): finalize base
3244 _after_ finalizing the derived members
3245 (unix_connection_set): unref watch if we fail to add it
3247 * dbus/dbus-connection.c (dbus_connection_unref): delete the
3248 transport first, so that the connection owned by the
3249 transport will be valid as the transport finalizes.
3251 * dbus/dbus-transport-unix.c (unix_finalize): free the write_watch
3252 if necessary, and remove watches from the connection.
3254 * dbus/dbus-watch.c (_dbus_watch_list_free): improve a comment
3256 2002-12-26 Anders Carlsson <andersca@codefactory.se>
3258 * dbus/dbus-marshal.c: (_dbus_marshal_string),
3259 (_dbus_demarshal_double), (_dbus_demarshal_int32),
3260 (_dbus_demarshal_uint32), (_dbus_demarshal_string),
3261 (_dbus_marshal_test):
3262 * dbus/dbus-marshal.h:
3263 Add string marshal functions and have the demarshal functions
3264 return the new position.
3266 2002-12-25 Havoc Pennington <hp@pobox.com>
3268 * doc/dbus-sasl-profile.txt: docs on the authentication protocol,
3269 it is a simple protocol that just maps directly to SASL.
3271 * dbus/dbus-auth.h, dbus/dbus-auth.c: authentication protocol
3272 initial implementation, not actually used yet.
3274 * dbus/dbus-string.c (_dbus_string_find): new function
3275 (_dbus_string_equal): new function
3276 (_dbus_string_base64_encode): new function
3277 (_dbus_string_base64_decode): new function
3279 2002-12-25 Anders Carlsson <andersca@codefactory.se>
3282 * dbus/dbus-marshal.c: (swap_bytes), (_dbus_marshal_double),
3283 (_dbus_marshal_int32), (_dbus_marshal_uint32),
3284 (_dbus_demarshal_double), (_dbus_demarshal_int32),
3285 (_dbus_demarshal_uint32), (_dbus_marshal_test):
3286 * dbus/dbus-marshal.h:
3287 * dbus/dbus-protocol.h:
3288 * dbus/dbus-test.c: (main):
3290 Add un-optimized marshalling/demarshalling routines.
3292 2002-12-25 Harri Porten <porten@kde.org>
3294 * qt/dbus-qt.h: adjusted ctor and getter to KDE/Qt conventions
3296 2002-12-24 Zack Rusin <zack@kde.org>
3298 * qt/dbus-qthread.cc: adding - integrates QMutex into Dbus
3299 * qt/dbus-qt.h: skeleton with two sample implemenatation of the
3302 2002-12-24 Havoc Pennington <hp@pobox.com>
3304 * glib/dbus-gthread.c: fix include
3306 * glib/dbus-glib.h: rename DBusMessageHandler for now.
3307 I think glib API needs to change, though, as you don't
3308 want to use DBusMessageFunction, you want to use the
3309 DBusMessageHandler object. Probably
3310 dbus_connection_open_with_g_main_loop()
3311 and dbus_connection_setup_g_main_loop() or something like that
3312 (but think of better names...) that just create a connection
3313 that has watch/timeout functions etc. already set up.
3315 * dbus/dbus-connection.c
3316 (dbus_connection_send_message_with_reply): new function just to
3317 show how the message handler helps us deal with replies.
3319 * dbus/dbus-list.c (_dbus_list_remove_last): new function
3321 * dbus/dbus-string.c (_dbus_string_test): free a string that
3324 * dbus/dbus-hash.c: use memory pools for the hash entries
3325 (rebuild_table): be more paranoid about overflow, and
3326 shrink table when we can
3327 (_dbus_hash_test): reduce number of sprintfs and write
3328 valid C89. Add tests for case where we grow and then
3329 shrink the hash table.
3331 * dbus/dbus-mempool.h, dbus/dbus-mempool.c: memory pools
3333 * dbus/dbus-connection.c (dbus_connection_register_handler)
3334 (dbus_connection_unregister_handler): new functions
3336 * dbus/dbus-message.c (dbus_message_get_name): new
3338 * dbus/dbus-list.c: fix docs typo
3340 * dbus/dbus-message-handler.h, dbus/dbus-message-handler.c:
3341 an object representing a handler for messages.
3343 2002-12-16 Anders Carlsson <andersca@codefactory.se>
3346 * glib/dbus-gthread.c: (dbus_gthread_init):
3347 Don't use the gdbus prefix for public functions.
3349 2002-12-16 Anders Carlsson <andersca@codefactory.se>
3353 Add GLib checks and fixup .pc files
3357 * glib/dbus-gmain.c: (gdbus_connection_prepare),
3358 (gdbus_connection_check), (gdbus_connection_dispatch),
3359 (gdbus_add_connection_watch), (gdbus_remove_connection_watch),
3360 (dbus_connection_gsource_new):
3361 * glib/dbus-gthread.c: (dbus_gmutex_new), (dbus_gmutex_free),
3362 (dbus_gmutex_lock), (dbus_gmutex_unlock), (dbus_gthread_init):
3363 * glib/test-dbus-glib.c: (message_handler), (main):
3366 2002-12-15 Harri Porten <porten@kde.org>
3368 * autogen.sh: check for libtoolize before attempting to use it
3370 * dbus/dbus-transport-unix.c: include <sys/time.h> for timeval
3373 * .cvsignore: ignore more stamp files
3375 * dbus/dbus-watch.c (_dbus_watch_list_new): fixed doc error
3377 * test/Makefile.am: added -I$(top_srcdir) to be able to compile
3378 without make install.
3380 2002-12-15 Havoc Pennington <hp@pobox.com>
3382 * dbus/dbus-threads.c: add thread stubs that a higher library
3383 layer can fill in. e.g. the GLib wrapper might fill them in with
3384 GThread stuff. We still need to use this thread API to
3385 thread-safe-ize the library.
3387 2002-12-12 Havoc Pennington <hp@pobox.com>
3389 * dbus/dbus-transport-unix.c, dbus/dbus-server-unix.c: use the
3390 below new interfaces and include fewer system headers.
3392 * dbus/dbus-sysdeps.c (_dbus_read): new function
3393 (_dbus_write): new function
3394 (_dbus_write_two): new function
3395 (_dbus_connect_unix_socket): new function
3396 (_dbus_listen_unix_socket): new function
3398 * dbus/dbus-message-internal.h: change interfaces to use
3401 2002-12-11 Havoc Pennington <hp@pobox.com>
3403 * dbus/dbus-types.h: add dbus_unichar
3405 * dbus/dbus-internals.c (_dbus_verbose): use _dbus_getenv
3407 * dbus/dbus-connection.c (dbus_connection_send_message): return
3410 * dbus/dbus-transport.c: include dbus-watch.h
3412 * dbus/dbus-connection.c: include dbus-message-internal.h
3414 * HACKING: add file with coding guidelines stuff.
3416 * dbus/dbus-string.h, dbus/dbus-string.c: Encapsulate all string
3417 handling here, for security purposes (as in vsftpd). Not actually
3418 using this class yet.
3420 * dbus/dbus-sysdeps.h, dbus/dbus-sysdeps.c: Encapsulate all
3421 system/libc usage here, as in vsftpd, for ease of auditing (and
3422 should also simplify portability). Haven't actually moved all the
3423 system/libc usage into here yet.
3425 2002-11-25 Havoc Pennington <hp@pobox.com>
3427 * dbus/dbus-internals.c (_dbus_verbose): fix to not
3428 always print the first verbose message.
3430 2002-11-24 Havoc Pennington <hp@pobox.com>
3432 * test/echo-client.c, test/echo-server.c: cheesy test
3435 * configure.in (AC_CHECK_FUNCS): check for writev
3437 * dbus/dbus-message.c (_dbus_message_get_network_data): new
3440 * dbus/dbus-list.c (_dbus_list_foreach): new function
3442 * dbus/dbus-internals.c (_dbus_verbose): new function
3444 * dbus/dbus-server.c, dbus/dbus-server.h: public object
3445 representing a server that listens for connections.
3447 * dbus/.cvsignore: create
3449 * dbus/dbus-errors.h, dbus/dbus-errors.c:
3450 public API for reporting errors
3452 * dbus/dbus-connection.h, dbus/dbus-connection.c:
3453 public object representing a connection that
3454 sends/receives messages. (Same object used for
3455 both client and server.)
3457 * dbus/dbus-transport.h, dbus/dbus-transport.c:
3458 Basic abstraction for different kinds of stream
3459 that we might read/write messages from.
3461 2002-11-23 Havoc Pennington <hp@pobox.com>
3463 * dbus/dbus-internals.h (_DBUS_INT_MAX): add _DBUS_INT_MIN
3466 * dbus/dbus-test.c (main): add list test, and include
3467 dbus-test.h as intended
3469 * dbus/dbus-hash.c (_dbus_hash_table_remove_string)
3470 (_dbus_hash_table_remove_int): return value indicates
3471 whether the entry existed to remove
3473 * dbus/dbus-list.c: add linked list utility class,
3476 * dbus/dbus-hash.c: add TODO item about shrinking the hash bucket
3479 2002-11-23 Havoc Pennington <hp@pobox.com>
3481 * Doxyfile.in (INCLUDE_FILE_PATTERNS): expand DBUS_BEGIN_DECLS/
3482 DBUS_END_DECLS to nothing, that should fix this once and for all
3484 * Doxyfile.in (JAVADOC_AUTOBRIEF): set to YES
3486 * dbus/dbus-message.c, dbus/dbus-hash.c:
3487 add some missing @brief
3489 2002-11-23 Havoc Pennington <hp@pobox.com>
3491 * dbus/dbus-message.h: put semicolons after DEBUG_BEGIN_DECLS
3492 to avoid confusing Doxygen
3494 * dbus/dbus-hash.c: @} not }@
3496 * dbus/dbus-message.c (struct DBusMessage): split out
3499 2002-11-23 Havoc Pennington <hp@pobox.com>
3501 * configure.in: pile on more warning flags if using gcc
3503 * Doxyfile.in (EXTRACT_STATIC): set to NO, so we don't have
3504 to document static functions
3506 * configure.in: add summary to end of configure so it
3507 looks nice and attractive
3509 * dbus/dbus-hash.c: finish implementation and write unit
3512 * configure.in: add --enable-tests to enable unit tests
3514 * dbus/dbus-test.c: test program to run unit tests
3515 for all files in dbus/*, initially runs a test for
3518 * dbus/dbus-internals.h: file to hold some internal utility stuff
3520 2002-11-22 Havoc Pennington <hp@redhat.com>
3522 * dbus/dbus-hash.c: copy in Tcl hash table, not yet
3523 "ported" away from Tcl
3525 * dbus/dbus-types.h: header for types such as dbus_bool_t
3527 2002-11-22 Havoc Pennington <hp@redhat.com>
3529 * dbus/dbus.h: fixups for doc warnings
3531 * Doxyfile.in (FILE_PATTERNS): we need to scan .h to pick up
3533 (QUIET): make it quiet so we can see warnings
3535 * dbus/dbus-memory.c: teach D-BUS to allocate and free memory
3537 2002-11-22 Havoc Pennington <hp@redhat.com>
3539 * Makefile.am: include "Doxyfile" target in all-local
3541 * configure.in: generate the Doxyfile
3543 * Doxyfile.in: move Doxyfile here, so we can use
3544 configure to generate a Doxyfile with the right
3547 2002-11-22 Havoc Pennington <hp@redhat.com>
3549 * dbus/dbus-message.c: move inline docs into .c file
3551 * Doxyfile (OUTPUT_DIRECTORY): move output to doc/api
3552 so all docs are under doc/
3553 (MAN_EXTENSION): generate man pages. Use extension
3554 ".3dbus" which matches ".3qt" on my system,
3555 I guess this is OK, I don't know really.
3556 (FILE_PATTERNS): look for .c files not .h, makes sense
3559 2002-11-22 Havoc Pennington <hp@pobox.com>
3561 * Makefile.am (SUBDIRS): rename subdir "server" to "bus"
3562 because any app can be a server, and any app can be a client,
3563 the bus is a special kind of server.
3565 Thu Nov 21 23:35:31 2002 Zack Rusin <zack@kde.org>
3567 * Doxyfile : adding. Still needs Makefile rules to be generated
3568 automatically (just run "doxygen" in the toplevel dir for now to
3571 * dbus/dbus-message.h : Adding sample docs (javadoc since
3572 resembles gtk-doc a little more)
3574 * dbus/dbus.h : Adding sample docs
3576 2002-11-21 Havoc Pennington <hp@redhat.com>
3578 * dbus/Makefile.am (INCLUDES): define DBUS_COMPILATION
3579 so we can allow ourselves to include files directly,
3580 instead of having to use dbus.h
3582 * dbus/dbus.h: fill in
3584 * dbus/dbus-message.h: sketch out a sample header file.
3585 Include griping if you include it directly instead of
3588 * dbus/dbus-macros.h: new file with macros for extern "C",
3589 TRUE/FALSE, NULL, etc.
3591 * doc/file-boilerplate.c: put include guards in here
3593 2002-11-21 Havoc Pennington <hp@redhat.com>
3595 * doc/file-boilerplate.c: include both AFL and GPL boilerplate.
3597 * COPYING: include the GPL as well, and license code
3598 under both AFL and GPL.
3600 2002-11-21 Havoc Pennington <hp@redhat.com>
3602 * acconfig.h: get rid of this
3604 * autogen.sh (run_configure): add --no-configure option
3606 * configure.in: remove AC_ARG_PROGRAM to make
3607 autoconf complain less. add AC_PREREQ.
3608 add AC_DEFINE third arg.
3610 2002-11-21 Anders Carlsson <andersca@codefactory.se>
3613 Fix references so we can distcheck.
3615 2002-11-21 Havoc Pennington <hp@redhat.com>
3617 * Initial module creation