1 2003-04-06 Havoc Pennington <hp@pobox.com>
3 * bus/bus.c (bus_context_new): print the address in here, rather
4 than in main(), because we need to do it before forking the daemon
6 * bus/dispatch.c (send_service_nonexistent_error): set the sender
7 on the service nonexistent error
9 * bus/driver.c (bus_driver_handle_acquire_service): set the
10 sender on the AcquireService reply
12 * test/data/valid-config-files/debug-allow-all.conf.in: Make test
13 server also listen on a UNIX socket so services can connect to it.
15 2003-04-06 Havoc Pennington <hp@pobox.com>
17 * dbus/dbus-threads.c: Redo how the fake debug mutexes are done
18 so it detects deadlocks and also we actually init threads when
21 2003-04-06 Havoc Pennington <hp@pobox.com>
23 * dbus/dbus-server-unix.c (_dbus_server_new_for_domain_socket):
24 save the domain socket name, and unlink it when we disconnect the
25 server. Means that at least when we exit normally, we won't leave
26 a bunch of junk in /tmp
28 * dbus/dbus-transport-unix.c
29 (_dbus_transport_new_for_domain_socket): code cleanup (nicer
30 memory management). (I was making a real change here but then
33 2003-04-06 Havoc Pennington <hp@pobox.com>
35 * bus/bus.c (bus_context_new): fix wrong handling of
36 server_data_slot_unref() in the error case.
38 * dbus/dbus-internals.h (_dbus_assert): change so it passes
39 "(condition) != 0" to _dbus_real_assert so that
40 "_dbus_assert (pointer)" doesn't cause a warning
42 * bus/main.c (main): accept --print-address option to print out
43 the message bus address
45 * dbus/dbus-sysdeps.c (_dbus_generate_random_ascii): export this
47 * dbus/dbus-transport.c (_dbus_transport_open): special error for
48 "tmpdir" option to unix: address on client side
50 * dbus/dbus-server.c (dbus_server_listen): handle "tmpdir" option
53 * configure.in (TEST_SOCKET_DIR): locate a temporary directory
54 we can use to create sockets in the test suite.
56 * bus/main.c (signal_handler): on SIGTERM, exit the daemon
57 cleanly. To be used for testing.
59 * dbus/dbus-spawn.c (babysit): use _dbus_set_signal_handler()
61 * dbus/dbus-sysdeps.c (_dbus_set_signal_handler): new
63 * dbus/dbus-server-debug-pipe.c (_dbus_transport_debug_pipe_new):
64 handle trying to call this when there's no servers active
66 2003-04-05 Havoc Pennington <hp@pobox.com>
72 2003-04-05 Havoc Pennington <hp@pobox.com>
74 * bus/bus.c (setup_server): fix this so dbus-daemon-1 doesn't
75 crash on startup. Need to get "try starting the daemon"
76 in the test suite I guess. ;-)
78 * dbus/dbus-server.h, dbus/dbus-server.c: remove the stuff that
79 tracked the number of open connections; it's better done in
80 application-specific code as you want it to span all servers etc.
82 2003-04-05 Havoc Pennington <hp@pobox.com>
84 * bus/Makefile.am (install-data-hook): add missing DESTDIR,
85 patch from Colin Walters
87 2003-04-05 Havoc Pennington <hp@pobox.com>
89 * doc/config-file.txt (Elements): fix docs of <auth> to reflect
90 reality; in fact multiple mechanisms are allowed.
92 * dbus/dbus-internals.c (_dbus_real_assert)
93 (_dbus_real_assert_not_reached): move guts of _dbus_assert() and
94 _dbus_assert_not_reached() into functions, so that they don't show
95 up in basic block counts for test coverage, and don't use up as
96 much disk space. Does mean slower execution speed though, so
97 assumes --disable-asserts is the normal production case.
99 2003-04-05 Havoc Pennington <hp@pobox.com>
101 * test/Makefile.am (dist-hook): also dist *.in files
107 2003-04-05 Havoc Pennington <hp@pobox.com>
109 * dbus/dbus-string.c: docs warning
111 * dbus/dbus-spawn.c: missing docs
113 * dbus/dbus-memory.c (struct ShutdownClosure): missing docs
115 2003-04-05 Havoc Pennington <hp@pobox.com>
117 * bus/loop.c (bus_loop_iterate): fix the timeout code, using
120 * dbus/dbus-spawn.c (_dbus_babysitter_unref): set sitter_pid
121 to -1 once we've reaped the babysitter
122 (_dbus_babysitter_handle_watch): do as much work as we can, not
125 * bus/activation.c: add code using DBusBabysitter so that we
126 handle it when a service fails to start up properly.
127 (bus_activation_service_created): don't remove the activation
128 entries as we go, just let them get removed when we free the pending
129 activation. Unref reply messages after sending them.
131 2003-04-05 Havoc Pennington <hp@pobox.com>
133 * test/decode-gcov.c (main): print per-directory stats in the report
135 * Makefile.am (coverage-report.txt): don't include test/* in gcov stats
137 2003-04-05 Havoc Pennington <hp@pobox.com>
139 * Makefile.am (coverage-report.txt): add target "coverage-report.txt"
141 * test/decode-gcov.c: hack up a little program to suck data
142 out of gcov files. Yes this is sort of silly.
144 * configure.in: define something in config.h and do an
145 AM_CONDITIONAL when gcov is enabled
147 2003-04-04 Havoc Pennington <hp@redhat.com>
149 * dbus/dbus-spawn.c, dbus/dbus-spawn.h: Change dbus_spawn to
150 return a "babysitter" object that is used to monitor the status of
151 the spawned process and reap it when required.
153 * test/test-segfault.c, test/test-exit.c,
154 test/test-sleep-forever.c: binaries that do various lame things,
155 used in the test suite.
157 * dbus/dbus-sysdeps.c: kill _dbus_errno_to_string()
159 2003-04-03 Havoc Pennington <hp@pobox.com>
161 * dbus/dbus-spawn.c: Move dbus-spawn into a separate file
162 in preparation for modifying it, dbus-sysdeps is getting
165 2003-04-03 Havoc Pennington <hp@redhat.com>
167 * bus/loop.h, bus/loop.c: make the mainloop an object so we can
170 * bus/*.[hc]: adapt to mainloop change
172 2003-04-03 Havoc Pennington <hp@redhat.com>
174 * bus/activation.c (load_directory): fix up memleaks
175 (bus_activation_entry_free): free the entry
177 * dbus/dbus-bus.c (dbus_bus_acquire_service): return an error if
178 we get one from the message bus; fix memleaks.
180 * dbus/dbus-message.c (dbus_set_error_from_message): new function
182 2003-04-03 Havoc Pennington <hp@pobox.com>
184 * bus/config-parser.c (bus_config_parser_unref): free
185 list of mechanisms, bug discovered by test suite enhancements
186 (putting system.conf and session.conf into suite)
188 * test/Makefile.am, test/test-service.c: add placeholder for a
189 test service that we'll activate as part of test suite. Doesn't
192 * dbus/dbus-sysdeps.c (_dbus_setenv): support unsetenv by
193 setting NULL value, and use system malloc not dbus_malloc()
194 when we have unavoidable memleakage.
196 * dbus/dbus-bus.c (dbus_bus_get): fix bug where bus type of 0
197 didn't work, and support DBUS_BUS_ACTIVATION.
199 * bus/activation.c (child_setup): pass our well-known bus type to
202 * bus/config-parser.c: support <type> to specify well-known type
204 * doc/dbus-specification.sgml: document the env variables to
205 locate well-known buses and find service activator
207 2003-04-02 Havoc Pennington <hp@redhat.com>
209 * test/Makefile.am (all-local): add a rule to copy tests to
210 builddir, so we can have generated tests. Use this to remove the
211 silly hack for testing system.conf and session.conf. Will use this
212 shortly to generate .service files pointing to test binaries.
214 2003-04-02 Havoc Pennington <hp@redhat.com>
216 * dbus/dbus-string.c (set_length): fix a bug - we allocated max of
217 current alloc and needed new length, not max of the doubled
218 allocation and needed new length. Also, when building tests,
219 don't do the double-allocation stuff, just realloc every time.
221 2003-04-02 Havoc Pennington <hp@redhat.com>
223 * dbus/dbus-sysdeps.c (_dbus_file_get_contents): include filenames
225 (_dbus_string_get_dirname): new
226 (_dbus_sysdeps_test): new
227 (_dbus_directory_open): include dirnames in error messages
229 * bus/config-parser.c: interpret <include> and <includedir> and
230 <servicedir> relative to config file location if the given
231 filename is not absolute.
233 * dbus/dbus-string.c (_dbus_string_find_byte_backward): new
235 2003-04-02 Havoc Pennington <hp@redhat.com>
237 * bus/connection.c (bus_transaction_send_error_reply): set sender
238 service for the error, and unref the reply on success
240 * bus/activation.c: convert to use BusTransaction so OOM can be
242 (bus_activation_service_created): set sender of the message
244 2003-04-01 Havoc Pennington <hp@redhat.com>
246 * bus/config-parser.c, bus/bus.c: implement <servicedir> and
247 <includedir> (at least mostly)
249 * dbus/dbus-sysdeps.c (_dbus_change_identity): set the group ID
250 first, then the user ID
252 2003-04-01 Havoc Pennington <hp@pobox.com>
254 * dbus/dbus-server.c (dbus_server_set_auth_mechanisms): new
257 * dbus/dbus-auth.c (_dbus_auth_set_mechanisms): new
259 * dbus/dbus-internals.c (_dbus_dup_string_array): new function
261 * dbus/dbus-sysdeps.c (_dbus_listen_unix_socket): chmod the
262 socket 0777, and unlink any existing socket.
264 * bus/bus.c (bus_context_new): change our UID/GID and fork if
265 the configuration file so specifies; set up auth mechanism
268 * bus/config-parser.c (bus_config_parser_content): add support
269 for <fork> option and fill in code for <auth>
271 * bus/system.conf.in: add <fork/> to default configuration,
272 and limit auth mechanisms to EXTERNAL
274 * doc/config-file.txt (Elements): add <fork>
276 * dbus/dbus-sysdeps.c (_dbus_become_daemon): new function
277 (_dbus_change_identity): new function
279 2003-03-31 Havoc Pennington <hp@redhat.com>
281 * dbus/dbus-sysdeps.c (_dbus_connect_unix_socket)
282 (_dbus_listen_unix_socket): fix off-by-one error in null
283 termination spotted by Nalin
285 2003-03-31 Havoc Pennington <hp@redhat.com>
287 * dbus/dbus-keyring.c (_dbus_keyring_new_homedir): allow setting
288 DBUS_TEST_HOMEDIR when tests are enabled, so we can test without
289 having a real home directory available.
291 2003-03-31 Havoc Pennington <hp@redhat.com>
293 * bus/Makefile.am (install-data-hook): create /var/run/dbus
295 * bus/messagebus.in: add init script for Red Hat /etc/init.d
297 * configure.in: add support for specifying a style of init script
300 2003-03-31 Havoc Pennington <hp@redhat.com>
302 Fix some annoying DBusString API and fix all affected code.
304 * dbus/dbus-string.c (_dbus_string_init): get rid of annoying
306 (_dbus_string_get_data): change to return string instead of using
308 (_dbus_string_get_const_data): ditto
309 (_dbus_string_get_data_len): ditto
310 (_dbus_string_get_const_data_len): ditto
312 2003-03-31 Havoc Pennington <hp@redhat.com>
314 * bus/main.c (main): fix up the command line arguments to be nicer
316 2003-03-31 Havoc Pennington <hp@redhat.com>
318 * dbus/Makefile.am (INCLUDES): use EXPANDED_LOCALSTATEDIR to
319 define DBUS_SYSTEM_BUS_PATH as we want to compile in the same
320 final location that lands in the config file
322 * bus/config-loader-expat.c (bus_config_load): fix type of
325 * doc/TODO: remove TODO item for dbus_bus_get()
327 * dbus/dbus-bus.c (bus_data_free): add missing lock/unlock
329 2003-03-31 Havoc Pennington <hp@pobox.com>
331 * dbus/dbus-transport-unix.c (_dbus_transport_new_for_domain_socket)
332 (_dbus_transport_new_for_tcp_socket): these didn't need the "server"
333 argument since they are always client side
335 * dbus/dbus-server.c (dbus_server_get_address): new function
337 * bus/main.c (main): take the configuration file as an argument.
339 * test/data/valid-config-files/debug-allow-all.conf: new file to
340 use with dispatch.c tests for example
342 * bus/test-main.c (main): require test data dir
344 * bus/bus.c (bus_context_new): change this to take a
345 configuration file name as argument
347 * doc/config-file.txt (Elements): add <servicedir>
349 * bus/system.conf, bus/session.conf: new files
351 * dbus/dbus-bus.c (dbus_bus_get): look for system bus on
352 well-known socket if none set
354 * configure.in: create system.conf and session.conf
356 2003-03-30 Havoc Pennington <hp@pobox.com>
358 * bus/config-parser.c: hacking
360 * dbus/dbus-memory.c: don't use DBusList for the list of stuff
361 to shut down, since it could cause weirdness with the DBusList
364 * dbus/dbus-list.c (_dbus_list_test): add tests for the
365 link-oriented stack routines
366 (alloc_link): free the mempool if the first alloc from it fails
368 * dbus/dbus-mempool.c (struct DBusMemBlock): fix alignment issue
370 * dbus/dbus-string.c (UNICODE_VALID): sync new version of this
372 (_dbus_string_skip_white): new
374 * doc/config-file.txt (Elements): add <includedir>
376 2003-03-28 Havoc Pennington <hp@pobox.com>
378 * dbus/dbus-string.c (_dbus_string_copy_data_len)
379 (_dbus_string_copy_data): new functions
381 2003-03-28 Anders Carlsson <andersca@codefactory.se>
383 * dbus/dbus-bus.c: (bus_data_free), (dbus_bus_get):
387 * dbus/dbus-memory.c:
390 2003-03-28 Havoc Pennington <hp@pobox.com>
392 * bus/test.c (bus_test_flush_bus): remove the sleep from here,
393 I think it may have just been superstition. Not sure.
395 * dbus/dbus-string.c (_dbus_string_base64_decode): catch some OOM
396 failures that were not being handled.
398 * dbus/dbus-auth.c (process_auth): fix a memleak in OOM handling
400 * dbus/dbus-memory.c: add ability to set number of mallocs in a
401 row that will fail on out-of-memory.
403 * dbus/dbus-internals.c (_dbus_test_oom_handling): convenience
404 function for testing out-of-memory handling.
406 * bus/config-loader-expat.c (memsuite): don't wrap the dbus
407 allocation functions, they do map exactly to the expat ones.
409 2003-03-27 Havoc Pennington <hp@redhat.com>
411 * bus/config-loader-libxml.c (bus_config_load): add another error
414 2003-03-26 Anders Carlsson <andersca@codefactory.se>
417 Add note about automatic service activation.
419 * doc/dbus-specification.sgml:
420 Rename the specification and clarify a few things.
422 2003-03-26 Anders Carlsson <andersca@codefactory.se>
425 * dbus/dbus-address.c:
427 * dbus/dbus-marshal.c:
428 * dbus/dbus-server-debug-pipe.c:
429 * dbus/dbus-transport-unix.c:
430 Fix documentation warnings.
432 2003-03-26 Havoc Pennington <hp@pobox.com>
434 * bus/test-main.c, dbus/dbus-test.c (main): check memleaks
435 after every test so it's quick and easy to see which leaked, and
436 so we test multiple dbus_shutdown() calls
438 * configure.in: change configure.in XML stuff to also support
441 * config-loader-libxml.c: some hacking
443 * config-loader-expat.c: some hacking
445 * config-parser.c: some hacking, plus tests
447 2003-03-25 Havoc Pennington <hp@redhat.com>
449 * throughout - add more _DBUS_ASSERT_ERROR_IS_CLEAR
451 * configure.in: add --with-xml option to specify XML library,
452 right now only libxml is supported.
454 * bus/config-loader-libxml.c, config-parser.c: sync some minor
455 nonworking code between home and work, still just stubs
457 2003-03-24 Havoc Pennington <hp@redhat.com>
459 * dbus/dbus-sysdeps.c (_dbus_set_fd_nonblocking): move to this
462 * dbus/dbus-errors.c (dbus_set_error, dbus_set_error_const): allow
463 NULL argument for "message" if the error is a well-known one,
464 fill in a generic message in this case.
466 * dbus/dbus-errors.h (DBusResultCode): Kill DBusResultCode in
469 * bus/test.c (bus_test_flush_bus): add
471 * bus/policy.c (bus_policy_test): test code stub
473 2003-03-24 Havoc Pennington <hp@pobox.com>
475 * bus/connection.c (bus_connections_setup_connection): set up
476 the "can this user connect" function, but it always returns
477 TRUE until we have a config file parser so we can have a config
478 file that allows connections.
480 2003-03-23 Havoc Pennington <hp@pobox.com>
482 * dbus/dbus-threads.c (dbus_mutex_new, dbus_condvar_new): with
483 DBUS_BUILD_TESTS, actually alloc/free a block of memory for
484 the mutex, so we can check for proper memory management
487 * dbus/dbus-dataslot.c: remove the mutex from
488 DBusDataSlotAllocator and lock it manually when using it,
489 to simplify fitting it into the global slots framework.
491 * dbus/dbus-threads.c (init_static_locks): rework how we're
492 handling global locks so they are easily shut down.
494 * bus/policy.c (bus_policy_append_rule): fix
496 * bus/test-main.c (main): check for memleaks
498 * dbus/dbus-test.c (dbus_internal_do_not_use_run_tests): make
499 test suite check for memleaks
501 * dbus/dbus-memory.c: add support in test mode for tracking
502 number of outstanding blocks
504 2003-03-23 Havoc Pennington <hp@pobox.com>
506 * bus/policy.c, bus/bus.c, bus/connection.c: implement allow/deny
509 * dbus/dbus-hash.h: add ULONG hash keys
511 * dbus/dbus-sysdeps.c (_dbus_get_groups): new
512 (_dbus_get_group_id): new function
514 2003-03-20 Havoc Pennington <hp@redhat.com>
516 * dbus/dbus-connection.c (dbus_connection_set_unix_user_function):
518 (dbus_connection_get_unix_user): new function
520 2003-03-20 Havoc Pennington <hp@pobox.com>
522 * bus/connection.c (bus_connection_send_oom_error): assert that
524 (connection_execute_transaction): ditto
525 (bus_connection_preallocate_oom_error): fix to set the sender, and
526 set recipient to the destination service, not the bus driver
528 * bus/policy.c: hacking
530 * dbus/dbus-message.c (dbus_message_service_is): new function
531 (dbus_message_sender_is): new
533 2003-03-19 Havoc Pennington <hp@redhat.com>
535 * bus/policy.c: start sketching code for policy restrictions on
536 what connections can do.
538 2003-03-18 Havoc Pennington <hp@redhat.com>
540 * doc/TODO: some notes on high-level todo items. Little nitpick
541 stuff is all in @todo, so no need to add it here.
543 * doc/config-file.txt: some notes on how config file might look
545 2003-03-18 Anders Carlsson <andersca@codefactory.se>
551 2003-03-17 Havoc Pennington <hp@redhat.com>
553 * dbus/dbus-internals.h: add gcc attributes so that
554 our printf-style functions warn on bad arguments to
557 * dbus/dbus-sysdeps.c (_dbus_connect_tcp_socket): fix printf
560 * dbus/dbus-message.c (_dbus_message_loader_queue_messages): fix
563 2003-03-17 Havoc Pennington <hp@redhat.com>
565 * bus/test-main.c (main): make it print something as it runs
566 so make check doesn't look stuck
568 * doc/negotiation.txt, doc/dbus-sasl-profile.txt: remove
569 from CVS, now obsolete
571 2003-03-17 Anders Carlsson <andersca@codefactory.se>
573 * bus/dispatch.c: (bus_dispatch):
574 Refetch the service name since it may have been reallocated
575 when dbus_message_set_sender was called.
577 * dbus/dbus-sysdeps.c: (_dbus_accept):
578 Add address and address length variables and use them to stop
579 valgrind from complaining.
581 2003-03-17 Havoc Pennington <hp@pobox.com>
583 All tests pass, no memleaks, no valgrind complaints.
585 * bus/test.c: refcount handler_slot
587 * bus/connection.c (bus_connections_new): refcount
590 * dbus/dbus-auth-script.c (_dbus_auth_script_run): delete unused
591 bytes so that auth scripts pass.
593 * bus/dispatch.c: init message_handler_slot so it gets allocated
596 * bus/dispatch.c (message_handler_slot_ref): fix memleak
598 * dbus/dbus-server-debug-pipe.c (_dbus_server_debug_pipe_new):
599 dealloc server_pipe_hash when no longer used for benefit of
602 * dbus/dbus-auth.c (process_command): memleak fix
604 * bus/dispatch.c (check_hello_message): memleak fix
606 2003-03-16 Havoc Pennington <hp@pobox.com>
608 * dbus/dbus-bus.c (ensure_bus_data): fix double-unref of the data slot
610 2003-03-17 Anders Carlsson <andersca@codefactory.se>
612 * bus/activation.c (bus_activation_activate_service): Append
613 the pending activation entry to the list of pending activations.
615 2003-03-16 Havoc Pennington <hp@pobox.com>
617 * bus/dispatch.c (bus_dispatch_test): remove double-unrefs of
620 * dbus/dbus-address.c (create_entry): fix OOM handling when
621 failing to alloc entry->method
623 2003-03-16 Havoc Pennington <hp@pobox.com>
625 * dbus/dbus-watch.c (_dbus_watch_new): handle failure to malloc
628 * dbus/dbus-server-debug-pipe.c (_dbus_transport_debug_pipe_new):
629 add some missing dbus_set_result
631 * bus/dispatch.c (bus_dispatch_add_connection): handle failure to
632 alloc the DBusMessageHandler
634 * dbus/dbus-transport.c (_dbus_transport_disconnect): don't ref
635 the transport here, since we call this from the finalizer; it
636 resulted in a double-finalize.
638 * dbus/dbus-transport.c (_dbus_transport_disconnect): fix a bug
639 where we tried to use transport->connection that was NULL,
640 happened when transport was disconnected early on due to OOM
642 * bus/*.c: adapt to handle OOM for watches/timeouts
644 * dbus/dbus-transport-unix.c: port to handle OOM during
647 * dbus/dbus-auth.c (_dbus_auth_get_unused_bytes): return a
648 reference to unused bytes instead of a copy
650 * dbus/dbus-server.c (dbus_server_handle_watch): return FALSE for
653 * dbus/dbus-connection.c (dbus_connection_handle_watch): return
656 * dbus/dbus-timeout.c (dbus_timeout_handle): return FALSE for out
659 2003-03-16 Anders Carlsson <andersca@codefactory.se>
661 * doc/dbus-specification.sgml:
662 Document reply message for ActivateService.
664 2003-03-16 Anders Carlsson <andersca@codefactory.se>
666 * bus/activation.c: (bus_pending_activation_entry_free),
667 (bus_pending_activation_free), (bus_activation_new),
668 (bus_activation_unref), (bus_activation_service_created),
669 (bus_activation_activate_service):
671 * bus/bus.c: (bus_context_new):
672 * bus/desktop-file.c: (new_section):
673 * bus/driver.c: (bus_driver_send_service_deleted),
674 (bus_driver_handle_activate_service):
675 * bus/services.c: (bus_registry_new), (bus_registry_ensure):
677 * dbus/dbus-connection.c:
678 (dbus_connection_send_with_reply_and_block):
679 * dbus/dbus-message.c: (dbus_message_append_args_valist):
680 * dbus/dbus-protocol.h:
681 Make activation work better. Now pending activations will be queued
682 and the daemon won't try to activate services that are already registered.
684 2003-03-16 Havoc Pennington <hp@pobox.com>
686 * dbus/dbus-bus.c (ensure_bus_data): handle failure to set
689 * dbus/dbus-memory.c (_dbus_initialize_malloc_debug): support
690 DBUS_MALLOC_BACKTRACES to print trace when failing an alloc
692 2003-03-16 Havoc Pennington <hp@pobox.com>
694 * dbus/dbus-string.c (_dbus_string_validate_utf8): oops, unbreak
695 this. always run the test suite before commit...
697 * bus/*: adapt to DBusConnection API changes
699 * glib/dbus-gmain.c: adapt to DBusConnection API changes,
700 requires renaming stuff to avoid dbus_connection_dispatch name
703 * dbus/dbus-transport.c (_dbus_transport_queue_messages): new
706 * dbus/dbus-message.c (_dbus_message_loader_queue_messages):
707 separate from _dbus_message_loader_return_buffer()
709 * dbus/dbus-connection.c (dbus_connection_get_n_messages): remove
710 this, because it's now always broken to use; the number of
711 messages in queue vs. the number still buffered by the message
712 loader is undefined/meaningless. Should use
713 dbus_connection_get_dispatch_state().
714 (dbus_connection_dispatch): rename from
715 dbus_connection_dispatch_message
717 2003-03-16 Havoc Pennington <hp@pobox.com>
719 * dbus/dbus-string.c (_dbus_string_validate_utf8): copy in a real
722 2003-03-16 Anders Carlsson <andersca@codefactory.se>
724 * dbus/dbus-connection.c:
725 (dbus_connection_send_with_reply_and_block):
726 Decrease connection->n_incoming when removing an entry
728 * dbus/dbus-dict.c: (dbus_dict_entry_free),
729 (dbus_dict_set_boolean_array), (dbus_dict_set_int32_array),
730 (dbus_dict_set_uint32_array), (dbus_dict_set_double_array),
731 (dbus_dict_set_byte_array), (dbus_dict_set_string_array),
732 (dbus_dict_get_boolean_array), (dbus_dict_get_double_array),
733 (dbus_dict_get_byte_array):
734 Handle NULL arrays and strings. Also add support for byte arrays.
736 * dbus/dbus-marshal.c: (_dbus_marshal_byte_array),
737 (_dbus_marshal_dict), (_dbus_demarshal_byte_array),
738 (_dbus_demarshal_int32_array), (_dbus_demarshal_uint32_array),
739 (_dbus_demarshal_double_array), (_dbus_demarshal_string_array),
740 (_dbus_demarshal_dict), (demarshal_and_validate_len),
741 (_dbus_marshal_validate_arg), (_dbus_marshal_test):
742 * dbus/dbus-marshal.h:
743 Add support for marshalling and demarshalling empty arrays and strings.
745 * dbus/dbus-message.c: (dbus_message_append_args_valist),
746 (dbus_message_append_string_array),
747 (dbus_message_iter_get_boolean),
748 (dbus_message_iter_get_boolean_array),
749 (dbus_message_iter_get_int32_array),
750 (dbus_message_iter_get_uint32_array),
751 (dbus_message_iter_get_double_array),
752 (dbus_message_iter_get_byte_array),
753 (dbus_message_iter_get_string_array), (dbus_message_iter_get_dict),
754 (check_message_handling):
755 Add support for getting empty arrays and dicts.
757 * dbus/dbus-string.c: (_dbus_string_validate_utf8):
758 Don't do any validation at all for now, that's better than just checking
761 * test/data/valid-messages/emptiness.message:
762 New test message with lots of empty arrays.
764 2003-03-16 Havoc Pennington <hp@pobox.com>
766 * dbus/dbus-connection.c
767 (_dbus_connection_queue_received_message_link): new function that
768 can't fail due to OOM
770 * dbus/dbus-message.c (_dbus_message_loader_pop_message_link):
771 new function pops a message together with a list link
774 * dbus/dbus-transport-unix.c (queue_messages): use new link-based
775 message queuing functions to avoid needing to alloc memory
777 2003-03-16 Havoc Pennington <hp@pobox.com>
779 Oops - test code was only testing failure of around 30 of the
780 mallocs in the test path, but it turns out there are 500+
781 mallocs. I believe this was due to misguided linking setup such
782 that there was one copy of dbus_malloc etc. in the daemon and one
783 in the shared lib, and only daemon mallocs were tested. In any
784 case, the test case now tests all 500+ mallocs, and doesn't pass
785 yet, though there are lots of fixes in this patch.
787 * dbus/dbus-connection.c (dbus_connection_dispatch_message): fix
788 this so that it doesn't need to allocate memory, since it
789 has no way of indicating failure due to OOM (and would be
792 * dbus/dbus-list.c (_dbus_list_pop_first_link): new function
794 * bus/Makefile.am: rearrange to create two self-contained
795 libraries, to avoid having libraries with overlapping symbols.
796 that was resulting in weirdness, e.g. I'm pretty sure there
797 were two copies of global static variables.
799 * dbus/dbus-internals.c: move the malloc debug stuff to
802 * dbus/dbus-list.c (free_link): free list mempool if it becomes
805 * dbus/dbus-memory.c (_dbus_disable_mem_pools): new function
807 * dbus/dbus-address.c (dbus_parse_address): free list nodes
810 * bus/dispatch.c (bus_dispatch_add_connection): free
811 message_handler_slot when no longer using it, so
812 memory leak checkers are happy for the test suite.
814 * dbus/dbus-server-debug-pipe.c (debug_finalize): free server name
816 * bus/bus.c (new_connection_callback): disconnect in here if
817 bus_connections_setup_connection fails.
819 * bus/connection.c (bus_connections_unref): fix to free the
821 (bus_connections_setup_connection): if this fails, don't
822 disconnect the connection, just be sure there are no side
825 * dbus/dbus-string.c (undo_alignment): unbreak this
827 * dbus/dbus-auth.c (_dbus_auth_unref): free some stuff we were
829 (_dbus_auth_new): fix the order in which we free strings
832 * bus/connection.c (bus_connection_disconnected): fix to
833 not send ServiceDeleted multiple times in case of memory
836 * dbus/dbus-bus.c (dbus_bus_get_base_service): new function to
837 get the base service name
838 (dbus_bus_register_client): don't return base service name,
839 instead store it on the DBusConnection and have an accessor
841 (dbus_bus_register_client): rename dbus_bus_register()
843 * bus/dispatch.c (check_hello_message): verify that other
844 connections on the bus also got the correct results, not
845 just the one sending hello
847 2003-03-15 Havoc Pennington <hp@pobox.com>
849 Make it pass the Hello handling test including all OOM codepaths.
850 Now to do other messages...
852 * bus/services.c (bus_service_remove_owner): fix crash when
853 removing owner from an empty list of owners
854 (bus_registry_ensure): don't leave service in the list of
855 a connection's owned services if we fail to put the service
858 * bus/connection.c (bus_connection_preallocate_oom_error): set
859 error flag on the OOM error.
861 * dbus/dbus-connection.c (_dbus_connection_new_for_transport):
862 handle _dbus_transport_set_connection failure
864 * dbus/dbus-transport-unix.c (_dbus_transport_new_for_fd): modify
865 to create watches up front and simply enable/disable them as
867 (unix_connection_set): this can now fail on OOM
869 * dbus/dbus-timeout.c, dbus/dbus-watch.c: add concept
870 of enabling/disabling a watch or timeout.
872 * bus/loop.c (bus_loop_iterate): don't touch disabled
875 * glib/dbus-gmain.c: adapt to enable/disable watches and timeouts
877 2003-03-15 Havoc Pennington <hp@pobox.com>
879 * bus/dispatch.c (bus_dispatch_test): OK, now finally actually
880 write useful test code, after all that futzing around ;-)
882 Test does not yet pass because we can't handle OOM in
883 _dbus_transport_messages_pending (basically,
884 dbus_connection_preallocate_send() does not prealloc the write
885 watch). To fix this, I think we need to add new stuff to
886 set_watch_functions, namely a SetEnabled function so we can alloc
887 the watch earlier, then enable it later.
889 * dbus/Makefile.am (libdbus_convenience_la_SOURCES): move
890 dbus-memory.c to the convenience lib
892 * bus/test.c: rename some static functions to keep them clearly
893 distinct from stuff in connection.c. Handle client disconnection.
895 2003-03-14 Havoc Pennington <hp@pobox.com>
897 * bus/dispatch.c (bus_dispatch_test): do test using debug-pipe
898 transport, tests more of the real codepath. Set up clients
899 with bus_setup_debug_client.
901 * bus/test.c (bus_setup_debug_client): function to set up debug
902 "clients" on the main loop
904 * dbus/dbus-transport.c (_dbus_transport_open): add debug-pipe
907 * dbus/dbus-server.c (dbus_server_listen): add debug-pipe
910 * dbus/dbus-server-debug.c: support a debug server based on pipes
912 * dbus/dbus-sysdeps.c (_dbus_full_duplex_pipe): new function
913 (_dbus_close): new function
915 * configure.in: check for socketpair
917 2003-03-14 Havoc Pennington <hp@redhat.com>
919 * dbus/dbus-memory.c: add a "detect buffer overwrites on free"
922 * dbus/dbus-transport-debug.c: rework this a good bit to be
923 less complicated. hopefully still works.
925 * dbus/dbus-server-debug.c (handle_new_client): remove timeout
928 * glib/dbus-gmain.c (timeout_handler): don't remove timeout
931 * dbus/dbus-message.c (dbus_message_copy): rename from
932 dbus_message_new_from_message, fix it up to copy
933 all the message fields, add test case
935 * bus/dispatch.c (bus_dispatch_test): add some more test code,
936 not quite passing yet
938 2003-03-14 Havoc Pennington <hp@pobox.com>
940 * bus/loop.c (bus_loop_iterate): add this so we can "run loop
941 until no work remains" in test code. (the large diff here
942 is just code movement, no actual changes)
944 * dbus/dbus-server-debug.c (DEFAULT_INTERVAL): change interval to
945 1, no point waiting around for test code.
946 (_dbus_server_debug_accept_transport): unref the timeout
947 after adding it (right?)
949 * dbus/dbus-transport-debug.c (DEFAULT_INTERVAL): ditto
951 2003-03-13 Havoc Pennington <hp@redhat.com>
953 * dbus/dbus-timeout.c (_dbus_timeout_list_set_functions): handle
956 * dbus/dbus-watch.c (_dbus_watch_list_set_functions): handle out
959 * dbus/dbus-connection.h: Make AddWatchFunction and
960 AddTimeoutFunction return a bool so they can fail on out-of-memory
962 * bus/bus.c (bus_context_new): set up timeout handlers
964 * bus/connection.c (bus_connections_setup_connection): set up
967 * glib/dbus-gmain.c: adapt to the fact that set_functions stuff
970 * bus/bus.c (bus_context_new): adapt to changes
972 * bus/connection.c: adapt to changes
974 * test/watch.c: adapt to DBusWatch changes
976 * bus/dispatch.c (bus_dispatch_test): started adding this but
979 2003-03-14 Anders Carlsson <andersca@codefactory.se>
981 * bus/dispatch.c (send_service_nonexistent_error): Fix typo.
983 2003-03-13 Havoc Pennington <hp@pobox.com>
985 * bus/test.c, bus/test.h, bus/Makefile.am, bus/test-main.c:
986 set up a test framework as for the library
988 2003-03-12 Havoc Pennington <hp@pobox.com>
990 Throughout: purge global variables, introduce BusActivation,
991 BusConnections, BusRegistry, etc. objects instead.
993 * bus/bus.h, bus/bus.c: introduce BusContext as a global
996 * test/Makefile.am (TEST_BINARIES): disable bus-test for now,
997 going to redo this a bit differently I think
999 2003-03-12 Havoc Pennington <hp@redhat.com>
1001 Mega-patch that gets the message bus daemon initially handling
1002 out-of-memory. Work still needed. Also lots of random
1003 moving stuff to DBusError instead of ResultCode.
1005 * dbus/dbus-list.c (_dbus_list_length_is_one): new function
1007 * dbus/dbus-connection.c
1008 (dbus_connection_send_with_reply_and_block): use DBusError
1010 * dbus/dbus-bus.c: adapt to API changes, make it use DBusError not
1013 * dbus/dbus-connection.c (dbus_connection_send): drop the result
1014 code here, as the only failure possible is OOM.
1016 * bus/connection.c (bus_connection_disconnect):
1017 rename bus_connection_disconnected as it's a notification only
1019 * bus/driver.c (bus_driver_handle_acquire_service): don't free
1020 "name" on get_args failure, should be done by get_args;
1021 don't disconnect client for bad args, just return an error.
1022 (bus_driver_handle_service_exists): ditto
1024 * bus/services.c (bus_services_list): NULL-terminate returned array
1026 * bus/driver.c (bus_driver_send_service_lost)
1027 (bus_driver_send_service_acquired): send messages from driver to a
1028 specific client to the client's unique name, not to the broadcast
1031 * dbus/dbus-message.c (decode_header_data): reject messages that
1032 contain no name field
1033 (_dbus_message_get_client_serial): rename to
1034 dbus_message_get_serial and make public
1035 (_dbus_message_set_serial): rename from set_client_serial
1036 (_dbus_message_set_reply_serial): make public
1037 (_dbus_message_get_reply_serial): make public
1039 * bus/connection.c (bus_connection_foreach): allow stopping
1040 iteration by returning FALSE from foreach function.
1042 * dbus/dbus-connection.c (dbus_connection_send_preallocated)
1043 (dbus_connection_free_preallocated_send)
1044 (dbus_connection_preallocate_send): new API for sending a message
1045 without possibility of malloc failure.
1046 (dbus_connection_send_message): rename to just
1047 dbus_connection_send (and same for whole function family)
1049 * dbus/dbus-errors.c (dbus_error_free): make this reinit the error
1051 * dbus/dbus-sysdeps.c (_dbus_exit): new function
1053 * bus/activation.c: handle/return errors
1055 * dbus/dbus-errors.h: add more DBUS_ERROR #define
1057 * dbus/dbus-sysdeps.c (_dbus_directory_open) (_dbus_file_get_contents)
1058 (_dbus_directory_get_next_file): use DBusError instead of DBusResultCode
1059 (_dbus_result_from_errno): move to this file
1061 2003-03-10 Anders Carlsson <andersca@codefactory.se>
1063 * dbus/dbus-marshal.c:
1064 (_dbus_marshal_set_string):
1065 Take a length argument so we can marshal the correct string
1068 (_dbus_marshal_dict), (_dbus_demarshal_dict),
1069 (_dbus_marshal_get_arg_end_pos), (_dbus_marshal_validate_arg),
1070 (_dbus_marshal_test):
1071 * dbus/dbus-marshal.h:
1072 Add support for marshalling and demarshalling dicts.
1074 * dbus/dbus-message-builder.c: (_dbus_message_data_load):
1075 Add support for TYPE DICT.
1077 * dbus/dbus-message.c: (set_string_field):
1078 Adjust header padding.
1080 (dbus_message_append_args_valist), (dbus_message_append_dict),
1081 (dbus_message_get_args_valist), (dbus_message_iter_get_arg_type),
1082 (dbus_message_iter_get_dict), (_dbus_message_loader_return_buffer),
1083 (check_message_handling), (check_have_valid_message):
1084 * dbus/dbus-message.h:
1085 Add functions for setting and getting dicts.
1087 * dbus/dbus-protocol.h:
1093 * doc/dbus-specification.sgml:
1094 Add information about how dicts are marshalled.
1096 * test/data/invalid-messages/dict-with-nil-value.message:
1097 * test/data/invalid-messages/too-short-dict.message:
1098 * test/data/valid-messages/dict-simple.message:
1099 * test/data/valid-messages/dict.message:
1100 Add sample messages containing dicts.
1102 2003-03-08 Anders Carlsson <andersca@codefactory.se>
1104 * dbus/dbus-dict.h: Add DBUS_END_DECLS.
1106 2003-03-07 Anders Carlsson <andersca@codefactory.se>
1109 * dbus/dbus-dict.c: (dbus_dict_entry_free), (dbus_dict_new),
1110 (dbus_dict_get_keys), (insert_entry), (dbus_dict_set_boolean),
1111 (dbus_dict_set_int32), (dbus_dict_set_uint32),
1112 (dbus_dict_set_double), (dbus_dict_set_string),
1113 (dbus_dict_set_boolean_array), (dbus_dict_set_int32_array),
1114 (dbus_dict_set_uint32_array), (dbus_dict_set_double_array),
1115 (dbus_dict_set_string_array), (_dbus_dict_test):
1117 Fix according to comments from Havoc.
1119 2003-03-06 Michael Meeks <michael@server.home>
1121 * configure.in: if we don't have kde-config, disable have_qt.
1123 2003-03-07 Anders Carlsson <andersca@codefactory.se>
1128 * dbus/dbus-dict.c: (dbus_dict_entry_free), (dbus_dict_new),
1129 (dbus_dict_ref), (dbus_dict_unref), (dbus_dict_contains),
1130 (dbus_dict_remove), (dbus_dict_get_value_type),
1131 (dbus_dict_get_keys), (dbus_dict_put_boolean),
1132 (dbus_dict_put_int32), (dbus_dict_put_uint32),
1133 (dbus_dict_put_double), (dbus_dict_put_string),
1134 (dbus_dict_put_boolean_array), (dbus_dict_put_int32_array),
1135 (dbus_dict_put_uint32_array), (dbus_dict_put_double_array),
1136 (dbus_dict_put_string_array), (dbus_dict_get_boolean),
1137 (dbus_dict_get_int32), (dbus_dict_get_uint32),
1138 (dbus_dict_get_double), (dbus_dict_get_string),
1139 (dbus_dict_get_boolean_array), (dbus_dict_get_int32_array),
1140 (dbus_dict_get_uint32_array), (dbus_dict_get_double_array),
1141 (dbus_dict_get_string_array), (_dbus_dict_test):
1143 Add DBusDict implementation
1145 * dbus/dbus-test.c: (dbus_internal_do_not_use_run_tests):
1149 2003-03-04 Havoc Pennington <hp@pobox.com>
1151 * test/data/auth/*: adapt to changes
1153 * dbus/dbus-auth-script.c (_dbus_auth_script_run): add
1154 USERID_BASE64 and change USERNAME_BASE64 to put in username not
1157 * dbus/dbus-keyring.c (_dbus_keyring_validate_context): prevent
1158 more stuff from being in a context name, to make the protocol
1159 simpler to deal with
1161 * dbus/dbus-errors.c (dbus_error_has_name): new function
1162 (dbus_error_is_set): new function
1164 * dbus/dbus-auth.c: replace DBUS_STUPID_TEST_MECH auth
1165 with DBUS_COOKIE_SHA1, implement DBUS_COOKIE_SHA1
1167 * dbus/dbus-connection.c (dbus_connection_flush): also read
1168 messages during a flush operation
1170 * dbus/Makefile.am: remove dbus-md5 since it isn't currently used.
1172 2003-03-05 Anders Carlsson <andersca@codefactory.se>
1174 * configure.in: Check for gethostbyname on Solaris.
1176 * dbus/dbus-transport.c: (_dbus_transport_open):
1177 Remove duplicate "tcp" entry.
1179 * doc/dbus-specification.sgml:
1180 Clarify some things.
1182 2003-03-05 Anders Carlsson <andersca@codefactory.se>
1184 * dbus/dbus-auth.c: (send_rejected), (process_test_subdir):
1185 * dbus/dbus-keyring.c: (_dbus_keyring_new_homedir),
1186 (_dbus_keyring_test):
1187 * dbus/dbus-md5.c: (_dbus_md5_compute):
1188 * dbus/dbus-sha.c: (_dbus_sha_compute):
1191 2003-03-05 Anders Carlsson <andersca@codefactory.se>
1193 * README: Add some things.
1195 2003-03-04 Anders Carlsson <andersca@codefactory.se>
1197 * dbus/dbus-message.c (dbus_message_append_args_valist): Add a break;
1198 after case DBUS_TYPE_BOOELAN.
1200 2003-03-02 Havoc Pennington <hp@pobox.com>
1202 * test/break-loader.c (randomly_set_extreme_ints): add test that
1203 sets really huge and small integers
1205 * dbus/dbus-marshal.c (_dbus_marshal_validate_arg): add check
1206 that length of boolean array fits in the string, and that
1207 string has room for boolean value in single-bool case.
1209 * dbus/dbus-message-builder.c (_dbus_message_data_load): add
1210 optional value to "ALIGN" command which is what to fill the
1213 * test/data/valid-messages/no-padding.message: add regression
1214 test for the message padding problem
1216 2003-03-02 Havoc Pennington <hp@pobox.com>
1218 * dbus/dbus-message.c (decode_header_data): fix to always init
1219 message_padding, from Benjamin Dauvergne
1221 2003-03-02 Havoc Pennington <hp@pobox.com>
1227 2003-03-01 Joe Shaw <joe@assbarn.com>
1229 * configure.in: Check for "struct cmsgcred" and try to access its
1230 members for BSD-like unices.
1232 * dbus/dbus-sysdeps.c (read_credentials_byte): Fold this back into
1233 _dbus_read_credentials_unix_socket().
1234 (_dbus_read_credentials_unix_socket): Use recvmsg() instead of
1235 read() for reading the credential byte off the unix socket. Use
1236 struct cmsgcred on systems that support it.
1238 2003-02-27 Alexander Larsson <alexl@redhat.com>
1242 Make gthreads-2.0 dependency optional. Don't build thread test if
1245 2003-02-27 Havoc Pennington <hp@pobox.com>
1247 * dbus/dbus-connection.c
1248 (dbus_connection_send_message_with_reply_and_block): fix doh!
1249 doh! doh! bug that resulted in never removing a reply from the
1250 queue, no wonder we called get_reply_serial so much ;-)
1252 * dbus/dbus-message.c (struct DBusMessage): cache reply serial
1253 and client serial instead of demarshaling them every time
1255 2003-02-27 Havoc Pennington <hp@pobox.com>
1257 * dbus/dbus-marshal.c (_dbus_demarshal_int32): rewrite to be much
1258 more inlined, using dbus-string-private.h, speeds things up
1261 * dbus/dbus-string.c (_dbus_string_free): apply align offset
1262 when freeing the string
1263 (_dbus_string_steal_data): fix for align offset
1264 (undo_alignment): new function
1266 2003-02-26 Havoc Pennington <hp@redhat.com>
1268 All kinds of audit fixes from Owen, plus initial attempt to
1269 handle unaligned memory returned from malloc.
1271 * dbus/dbus-string.c (_dbus_string_init): clamp max length to
1272 leave room for align_offset and nul byte
1273 (fixup_alignment): function to track an align_offset and
1274 ensure real->str is aligned
1275 (DBUS_GENERIC_STRING_PREAMBLE): len must be less than allocated,
1276 to allow a nul byte plus align offset
1277 (_dbus_string_lock): fix overflow issue
1278 (_dbus_string_init_const_len): add assertions on sanity of len,
1279 assign allocated to be ALLOCATION_PADDING larger than len
1280 (set_length): fixup the overflow handling
1281 (_dbus_string_get_data_len): fix overflow in assertion
1282 (open_gap): detect overflow in size of gap to be opened
1283 (_dbus_string_lengthen): add overflow check
1284 (_dbus_string_align_length): fix overflow with _DBUS_ALIGN_VALUE
1285 (_dbus_string_append): add overflow check
1286 (_dbus_string_append_unichar): overflow
1287 (_dbus_string_delete): fix overflow in assertion
1288 (_dbus_string_copy_len): overflow in assertion
1289 (_dbus_string_replace_len): overflows in assertions
1290 (_dbus_string_find): change to implement in terms of
1291 _dbus_string_find_to
1292 (_dbus_string_find_to): assorted fixage
1293 (_dbus_string_equal_c_str): assert c_str != NULL,
1294 fix logic so the function works
1295 (_dbus_string_ends_with_c_str): fix overflow thingy
1296 (_dbus_string_base64_encode): overflow fix
1297 (_dbus_string_validate_ascii): overflow
1298 (_dbus_string_validate_nul): overflow
1300 2003-02-26 Havoc Pennington <hp@redhat.com>
1302 * dbus/dbus-marshal.c (_dbus_marshal_test): fix to work with DISABLE_ASSERTS
1304 2003-02-26 Alexander Larsson <alexl@redhat.com>
1307 Set DBUS_GLIB_THREADS_LIBS for apps using gthread-2.0
1309 * dbus/dbus-connection.c:
1310 * dbus/dbus-connection.h:
1311 Fix _dbus_connection_acquire_io_path and _dbus_connection_acquire_dispatch.
1312 Add dbus_connection_set_wakeup_main_function and use it when queueing
1313 incoming and outgoing messages.
1316 * dbus/dbus-dataslot.c:
1317 Threadsafe usage of DBusDataSlotAllocator
1319 * dbus/dbus-message.c: (dbus_message_get_args_iter):
1322 * dbus/dbus-server-unix.c:
1325 * glib/dbus-gmain.c:
1326 Implement the new wakeup functions for glib.
1329 * glib/test-thread-client.c:
1330 * glib/test-thread-server.c:
1331 * glib/test-thread.h:
1332 Initial cut at some thread test code. Not really done yet.
1334 2003-02-26 Havoc Pennington <hp@pobox.com>
1336 * dbus/dbus-connection.c
1337 (dbus_connection_send_message_with_reply_and_block): fix crash
1338 where we ref'd the outgoing message instead of the returned reply
1340 * dbus/dbus-transport-unix.c (do_authentication): check read watch
1341 at the end of this function, so if we didn't need to read for
1342 authentication, we reinstall it for receiving messages
1344 * dbus/dbus-message.c (dbus_message_new_reply): allow replies to
1345 a NULL sender for peer-to-peer case
1347 * dbus/dbus-transport-unix.c (check_read_watch): handle
1348 !authenticated case correctly
1350 * glib/dbus-gmain.c: add support for DBusServer
1352 * dbus/dbus-server.c: add data slot support
1354 * glib/dbus-gmain.c (dbus_connection_setup_with_g_main): check
1355 return values and handle errors
1357 * dbus/dbus-dataslot.c: factor out the data slot stuff from
1360 * Doxyfile.in (INPUT): add glib subdir
1362 * glib/dbus-gmain.c (dbus_connection_setup_with_g_main): rename
1363 setup_with_g_main instead of hookup_with_g_main; write docs
1365 2003-02-24 Anders Carlsson <andersca@codefactory.se>
1367 * dbus/dbus-marshal.c: (_dbus_marshal_validate_arg):
1368 * dbus/dbus-message-builder.c: (_dbus_message_data_load):
1369 * dbus/dbus-message.c: (dbus_message_append_boolean),
1370 (dbus_message_append_boolean_array),
1371 (dbus_message_get_args_valist), (_dbus_message_test):
1372 * dbus/dbus-message.h:
1373 * doc/dbus-specification.sgml:
1374 Various fixes as pointed out by Havoc.
1376 * test/data/invalid-messages/bad-boolean-array.message:
1377 * test/data/invalid-messages/bad-boolean.message:
1378 Add invalid boolean value test cases.
1380 2003-02-24 Anders Carlsson <andersca@codefactory.se>
1382 * dbus/dbus-internals.c: (_dbus_type_to_string):
1383 * dbus/dbus-marshal.c: (_dbus_marshal_get_arg_end_pos),
1384 (_dbus_marshal_validate_arg):
1385 * dbus/dbus-message-builder.c: (_dbus_message_data_load):
1386 * dbus/dbus-message.c: (dbus_message_append_args_valist),
1387 (dbus_message_append_boolean), (dbus_message_append_boolean_array),
1388 (dbus_message_get_args_valist), (dbus_message_iter_get_boolean),
1389 (dbus_message_iter_get_int32), (dbus_message_iter_get_uint32),
1390 (dbus_message_iter_get_double),
1391 (dbus_message_iter_get_boolean_array), (message_iter_test):
1392 * dbus/dbus-message.h:
1393 * dbus/dbus-protocol.h:
1394 * doc/dbus-specification.sgml:
1395 * test/data/valid-messages/lots-of-arguments.message:
1396 Add support for boolean and boolean array types.
1398 2003-02-23 Havoc Pennington <hp@pobox.com>
1400 * dbus/dbus-keyring.c: finish most of this implementation and
1403 * dbus/dbus-errors.c (dbus_set_error_const, dbus_set_error): make
1404 these barf if the error isn't cleared to NULL
1406 * dbus/dbus-sysdeps.c (_dbus_delete_file): set error on failure
1407 (_dbus_create_directory): new function
1409 * dbus/dbus-errors.c (dbus_set_error): fix warning
1411 * dbus/dbus-string.c (_dbus_string_hex_encode): new function
1412 (_dbus_string_hex_decode): new function
1413 (test_hex_roundtrip): test code
1415 * dbus/dbus-sha.c (_dbus_sha_compute): use dbus_string_hex_encode
1417 * dbus/dbus-md5.c (_dbus_md5_compute): use dbus_string_hex_encode
1419 * dbus/dbus-sysdeps.c (_dbus_string_save_to_file): make this use
1420 the save-to-temp/rename trick to atomically write the new file
1421 (_dbus_string_parse_uint): new function
1423 2003-02-22 Havoc Pennington <hp@pobox.com>
1425 * test/Makefile.am (dist-hook): fix dist for test/data/sha-1
1427 2003-02-22 Havoc Pennington <hp@pobox.com>
1429 * dbus/dbus-message.c (dbus_message_iter_get_string_array):
1430 (dbus_message_iter_get_byte_array): Fix up doxygen warnings
1432 * dbus/dbus-sha.c: add implementation of SHA-1 algorithm
1434 * dbus/test/data/sha-1: add US government test suite for SHA-1
1436 2003-02-21 Anders Carlsson <andersca@codefactory.se>
1438 * dbus/dbus-marshal.c: (_dbus_demarshal_string_array):
1439 Make string arrays NULL-terminated.
1441 * dbus/dbus-memory.c: (dbus_free_string_array):
1442 * dbus/dbus-memory.h:
1443 New function for freeing NULL-terminated string arrays.
1445 * dbus/dbus-message-builder.c: (append_quoted_string),
1446 (_dbus_message_data_load):
1447 Add support for array types.
1449 * dbus/dbus-message.c: (check_message_handling):
1450 Add more types as test cases.
1452 * dbus/dbus-sysdeps.c: (_dbus_string_parse_int),
1453 (_dbus_string_parse_double):
1454 Add the start offset to the end offset.
1456 * test/data/valid-messages/lots-of-arguments.message:
1457 New test message with lots of arguments.
1459 2003-02-21 Anders Carlsson <andersca@codefactory.se>
1461 * dbus/dbus-message.c: (dbus_message_append_nil),
1462 (dbus_message_append_int32), (dbus_message_append_uint32),
1463 (dbus_message_append_double), (dbus_message_append_string),
1464 (dbus_message_append_int32_array),
1465 (dbus_message_append_uint32_array),
1466 (dbus_message_append_double_array),
1467 (dbus_message_append_byte_array),
1468 (dbus_message_append_string_array):
1469 Fix all out-of-memory handling in these functions.
1471 2003-02-21 Anders Carlsson <andersca@codefactory.se>
1473 * dbus/dbus-message.c: (dbus_message_append_nil):
1476 2003-02-21 Anders Carlsson <andersca@codefactory.se>
1478 * dbus/dbus-message.c: (dbus_message_append_args_valist),
1479 (dbus_message_append_nil), (dbus_message_append_int32_array),
1480 (dbus_message_append_uint32_array),
1481 (dbus_message_append_double_array),
1482 (dbus_message_append_byte_array),
1483 (dbus_message_append_string_array), (dbus_message_get_args_valist),
1484 (dbus_message_iter_get_int32_array),
1485 (dbus_message_iter_get_uint32_array),
1486 (dbus_message_iter_get_double_array),
1487 (dbus_message_iter_get_byte_array),
1488 (dbus_message_iter_get_string_array):
1490 * dbus/dbus-message.h:
1491 Add functions for appending and getting arrays.
1493 2003-02-21 Anders Carlsson <andersca@codefactory.se>
1495 * dbus/dbus-mempool.c (_dbus_mem_pool_new): Make the
1496 element size at least 8 bytes, fixes mempool tests on
1499 2003-02-20 Alexander Larsson <alexl@redhat.com>
1501 * dbus/dbus-transport-unix.c (unix_do_iteration):
1502 Unlock the connection mutex during a blocking select call.
1503 Add todo about how we need a way to wake up the select.
1505 * dbus/dbus-connection-internal.h:
1506 * dbus/dbus-connection.c:
1507 Add _dbus_connection_lock and _dbus_connection_unlock.
1509 2003-02-19 Havoc Pennington <hp@pobox.com>
1511 * Doxyfile.in (PREDEFINED): put DOXYGEN_SHOULD_SKIP_THIS in
1512 Doxyfile.in, not Doxyfile
1514 * dbus/dbus-keyring.c: do some hacking on this
1516 * dbus/dbus-sysdeps.c (_dbus_delete_file): new
1518 * dbus/dbus-errors.c (dbus_set_error_const): do not call
1520 (dbus_set_error): remove dbus_error_init, check for message ==
1521 NULL *before* we sprintf into it, and add @todo about including
1522 system headers in this file
1524 * dbus/dbus-sysdeps.c (_dbus_create_file_exclusively): new
1526 * dbus/dbus-errors.h (DBUS_ERROR_FAILED): add
1528 * dbus/dbus-sysdeps.c (get_user_info): break this function out to
1529 get various bits of user information based on either username
1531 (_dbus_homedir_from_username): new function
1533 2003-02-19 Anders Carlsson <andersca@codefactory.se>
1536 Add check for nonposix getpwnam_r
1538 * dbus/dbus-mempool.c: (_dbus_mem_pool_new):
1539 Align the pool element size to a sizeof (void *) boundary.
1541 * dbus/dbus-sysdeps.c: (_dbus_setenv), (_dbus_connect_unix_socket),
1542 (_dbus_listen_unix_socket), (_dbus_credentials_from_username):
1543 General Solaris fixes.
1545 * test/data/valid-messages/simplest-manual.message:
1546 Explicitly state that we want little-endian packing.
1548 2003-02-19 Mikael Hallendal <micke@codefactory.se>
1550 * dbus/dbus-server.c (dbus_server_listen): Support tcp: addresses.
1552 * dbus/dbus-transport-unix.c (_dbus_transport_new_for_tcp_socket):
1553 Added to create a transport connecting using a tcp/ip socket.
1555 * dbus/dbus-sysdeps.c (_dbus_connect_tcp_socket): Added to connect
1556 to a tcp socket at given host and port.
1557 (_dbus_listen_tcp_socket): added to listen on tcp socket for given
1560 * dbus/dbus-server.c (dbus_server_listen): Support tcp: addresses.
1562 * dbus/dbus-server-unix.c (_dbus_server_new_for_tcp_socket):
1563 Added to create a server listening on a TCP/IP socket.
1565 2003-02-19 Havoc Pennington <hp@pobox.com>
1567 Throughout: mop up all the Doxygen warnings and undocumented
1570 * dbus/dbus-sysdeps.c (do_exec): do not use execvp, we don't want
1571 to search any paths.
1573 * dbus/dbus-threads.c: move global mutex initializers to
1574 dbus-internals.h, multiple prototypes was confusing doxygen
1575 besides being kind of ugly
1577 * Doxyfile (PREDEFINED): have Doxygen define
1578 DOXYGEN_SHOULD_SKIP_THIS so we can exclude things from
1579 docs with #ifndef DOXYGEN_SHOULD_SKIP_THIS
1580 (do not abuse the feature! it's for stuff like the autogenerated
1581 macros in dbus-md5.c, not just for things you don't feel like
1584 2003-02-18 Havoc Pennington <hp@pobox.com>
1586 * dbus/dbus-string.c (_dbus_string_zero): new function
1588 * dbus/dbus-md5.c: include MD5 implementation by L. Peter Deutsch,
1589 wrap it in some dbus-friendly API
1591 * dbus/dbus-types.h: add 16-bit types
1593 2003-02-18 Joe Shaw <joe@assbarn.com>
1595 * dbus/dbus-auth.c (handle_server_data_stupid_test_mech): Just get
1596 credentials from our currently running process.
1597 (get_word): Fix a buglet where we were copying the entire length
1598 instead of relative to our position.
1600 * dbus/dbus-hash.c (_dbus_hash_test): Don't try to allocate the
1601 keys on the stack... it's 640k of data.
1603 * dbus/dbus-sysdeps.c (_dbus_read_credentials_unix_socket): Always
1604 read the credentials byte off the socket, even if we don't have
1606 (_dbus_poll): Implement poll() using select() for systems which
1609 * glib/test-dbus-glib.c (main): Print out an error if no
1610 parameters are given.
1612 * test/data/auth/fallback.auth-script: Added. Tests that a client
1613 can fallback to a secondary auth mechanism if the first fails.
1615 2003-02-18 Havoc Pennington <hp@pobox.com>
1619 2003-02-17 Havoc Pennington <hp@pobox.com>
1621 * doc/dbus-specification.sgml: lots of cosmetic
1622 cleanups/rearrangement, add assorted FIXME, change DBUS_ADDRESS
1623 env variable to DBUS_BUS_ADDRESS, s/client/application/,
1624 s/server/bus/ (except in authentication section). Add a section
1625 "Message Bus Message Routing"
1627 2003-02-17 Anders Carlsson <andersca@codefactory.se.>
1633 2003-02-17 Anders Carlsson <andersca@codefactory.se>
1635 * doc/dbus-specification.sgml:
1636 Specification updates.
1638 2003-02-17 Anders Carlsson <andersca@codefactory.se>
1640 * bus/activation.c: (bus_activation_init), (child_setup),
1641 (bus_activation_activate_service):
1643 * bus/main.c: (main):
1644 Set DBUS_ADDRESS environment variable.
1646 * dbus/dbus-errors.c: (dbus_set_error):
1647 Don't use va_copy since that's a C99 feature.
1649 * dbus/dbus-sysdeps.c: (_dbus_setenv), (do_exec),
1650 (_dbus_spawn_async):
1651 * dbus/dbus-sysdeps.h:
1652 Add child_setup_func to _dbus_spawn_async.
1654 * doc/dbus-specification.sgml:
1655 Update specification.
1657 * test/spawn-test.c: (setup_func), (main):
1660 2003-02-17 Alexander Larsson <alexl@redhat.com>
1662 * dbus/dbus-connection.c (_dbus_connection_handler_destroyed_locked):
1665 2003-02-17 Anders Carlsson <andersca@codefactory.se>
1669 * doc/dbus-test-plan.sgml:
1670 Add test plan document.
1675 2003-02-17 Anders Carlsson <andersca@codefactory.se>
1677 * dbus/dbus-message.c: (decode_header_data),
1678 (_dbus_message_loader_return_buffer):
1679 Set the header padding amount when loading a message.
1681 2003-02-16 Anders Carlsson <andersca@codefactory.se>
1683 * bus/dispatch.c: (send_one_message):
1684 Only send broadcast messages to registered connections.
1686 * dbus/dbus-message.c: (dbus_message_name_is):
1687 * dbus/dbus-message.h:
1688 New convenience function.
1690 * dbus/dbus-transport-debug.c: (do_reading):
1691 Only dispatch one message per run.
1694 * test/bus-test.c: (new_connection_callback), (die),
1695 (test_hello_client1_handler), (test_hello_client2_handler),
1696 (test_hello_replies), (main):
1698 * test/bus-test-loop.[ch]:
1701 2003-02-16 Havoc Pennington <hp@pobox.com>
1703 * dbus/dbus-connection.c (dbus_connection_dispatch_message): fix
1704 backward conditional
1706 2003-02-16 Alexander Larsson <alexl@redhat.com>
1708 * dbus/dbus-connection.c:
1709 Implement sent_message_with_reply. (with_reply_and block is still
1711 Made dispatch_message not lose message if OOM.
1713 * dbus/dbus-errors.h:
1714 Add NoReply error (for reply timeouts).
1716 2003-02-16 Alexander Larsson <alexl@redhat.com>
1718 * dbus/dbus-hash.c (_dbus_hash_table_unref):
1719 Actually free keys and values when destroying hashtable.
1721 2003-02-16 Anders Carlsson <andersca@codefactory.se>
1723 * dbus/dbus-auth.c: (client_try_next_mechanism):
1726 * dbus/dbus-threads.c: (dbus_condvar_wait_timeout):
1727 Return TRUE if there's no thread implementation around.
1729 * glib/dbus-gmain.c: (free_source),
1730 (dbus_connection_hookup_with_g_main):
1731 Make sure to remove the GSource when the connection is finalized.
1733 2003-02-16 Anders Carlsson <andersca@codefactory.se>
1735 * bus/dispatch.c: (bus_dispatch_message_handler):
1736 * dbus/dbus-errors.h:
1737 Return an error if someone tries to send a message to a service
1740 2003-02-16 Anders Carlsson <andersca@codefactory.se>
1742 * bus/activation.c: (load_directory), (bus_activation_init),
1743 (bus_activation_activate_service):
1746 (bus_driver_handle_activate_service), (bus_driver_handle_message):
1747 More work on the activation handling.
1749 * dbus/dbus-errors.h:
1750 Add some error messages
1752 * dbus/dbus-message.c: (dbus_message_new_error_reply):
1753 * dbus/dbus-message.h:
1754 New function that creates an error message.
1756 * dbus/dbus-protocol.h:
1757 Add ACTIVATE_SERVER message.
1759 * dbus/dbus-server-unix.c: (unix_handle_watch),
1760 (_dbus_server_new_for_domain_socket):
1761 Call _dbus_fd_set_close_on_exec.
1763 * dbus/dbus-sysdeps.c: (make_pipe), (do_exec),
1764 (_dbus_spawn_async), (_dbus_disable_sigpipe),
1765 (_dbus_fd_set_close_on_exec):
1766 * dbus/dbus-sysdeps.h:
1767 Add _dbus_fd_set_close_on exec function. Also add function that checks
1768 that all open fds are set to close-on-exec and warns otherwise.
1770 * dbus/dbus-transport-unix.c:
1771 (_dbus_transport_new_for_domain_socket):
1772 Call _dbus_fd_set_close_on_exec.
1774 2003-02-16 Havoc Pennington <hp@pobox.com>
1776 * dbus/dbus-connection.c (dbus_connection_set_change_sigpipe):
1777 allow people to avoid setting SIGPIPE to SIG_IGN
1778 (_dbus_connection_new_for_transport): disable SIGPIPE unless
1779 we've been asked not to
1781 2003-02-15 Anders Carlsson <andersca@codefactory.se>
1783 * dbus/dbus-list.c: (_dbus_list_append_link),
1784 (_dbus_list_prepend_link):
1785 * dbus/dbus-memory.c: (dbus_malloc), (dbus_malloc0),
1789 2003-02-15 Anders Carlsson <andersca@codefactory.se>
1792 * bus/activation.c: (bus_activation_entry_free),
1793 (add_desktop_file_entry), (load_directory), (bus_activation_init):
1795 * bus/main.c: (main):
1796 Add simple activation support, doesn't work yet though.
1798 2003-02-15 Zack Rusin <zack@kde.org>
1800 * qt/dbus-qthread.cpp: small casting fix
1802 2003-02-15 Anders Carlsson <andersca@codefactory.se>
1804 * dbus/dbus-errors.c: (dbus_set_error):
1805 * dbus/dbus-errors.h:
1806 Add a few errors and make dbus_set_error void.
1808 * dbus/dbus-sysdeps.c:
1809 (_dbus_errno_to_string), (close_and_invalidate), (make_pipe),
1810 (write_err_and_exit), (read_ints), (do_exec), (_dbus_spawn_async):
1811 * dbus/dbus-sysdeps.h:
1812 Add _dbus_spawn_async.
1814 * test/spawn-test.c: (main):
1815 Test for _dbus_spawn_async.
1817 2003-02-15 Anders Carlsson <andersca@codefactory.se>
1819 * dbus/dbus-internals.h:
1820 Fix build without tests.
1822 * dbus/dbus-list.c: (alloc_link):
1823 Fix a segfault when a malloc fails.
1825 * dbus/dbus-memory.c: (initialize_malloc_debug), (dbus_malloc),
1826 (dbus_malloc0), (dbus_realloc):
1827 Add support for malloc debugging.
1829 2003-02-15 Alexander Larsson <alexl@redhat.com>
1831 * dbus/dbus-threads.c:
1832 * dbus/dbus-threads.h:
1833 Add condvars. Remove static mutext from API.
1834 Implement static mutexes by initializing them from threads_init.
1836 * glib/dbus-gthread.c:
1837 * qt/dbus-qthread.cpp:
1838 Update with the thread api changes.
1843 Turn StaticMutex into normal mutex + init function.
1844 Export new functions _dbus_list_alloc_link, _dbus_list_free_link,
1845 _dbus_list_append_link, _dbus_list_prepend_link
1848 * dbus/dbus-sysdeps.c:
1849 * dbus/dbus-sysdeps.h:
1850 New type dbus_atomic_t, and new functions _dbus_atomic_inc,
1851 _dbus_atomic_dec. Only slow fallback implementation at the moment.
1853 * dbus/dbus-protocol.h:
1854 Add DBUS_MESSAGE_LOCAL_DISCONNECT define
1856 * dbus/dbus-message.c:
1857 Make ref/unref atomic.
1860 * dbus/dbus-connection-internal.h:
1861 * dbus/dbus-connection.c:
1862 * dbus/dbus-connection.h:
1864 Change _peek to _borrow,_return & _steal_borrowed.
1865 Change disconnect callback to event.
1866 Make dbus_connection_dispatch_messages reentrant.
1868 * dbus/dbus-transport.c:
1869 Don't ref the connection on calls to the transport
1872 * dbus/dbus-message-handler.c:
1875 * glib/dbus-gmain.c:
1876 Don't use peek_message anymore
1879 * test/debug-thread.c:
1880 * test/debug-thread.h:
1881 Simple thread implementation that asserts() on deadlocks in
1882 single-threaded code.
1885 (main) Call debug_threads_init.
1888 Use disconnect message instead of disconnect callback.
1892 Don't call dbus_connection_set_disconnect_function. Instead export
1893 bus_connection_disconnect.
1896 Call bus_connection_disconnect when we get a disconnected message.
1898 2003-02-15 Havoc Pennington <hp@pobox.com>
1900 * dbus/dbus-message.c (dbus_message_new): fool around with the
1903 2003-02-14 Havoc Pennington <hp@pobox.com>
1905 * dbus/dbus-mempool.c: fail if the debug functions so indicate
1907 * dbus/dbus-memory.c: fail if the debug functions indicate we
1910 * dbus/dbus-internals.c (_dbus_set_fail_alloc_counter)
1911 (_dbus_decrement_fail_alloc_counter): debug functions to
1912 simulate memory allocation failures
1914 2003-02-14 Havoc Pennington <hp@pobox.com>
1916 * dbus/dbus-errors.h (struct DBusError): add a word of padding
1919 2003-02-13 Anders Carlsson <andersca@codefactory.se>
1921 * bus/driver.c: (bus_driver_handle_hello):
1923 * bus/services.c: (bus_service_lookup):
1924 Reorder message sending so we get a more sane order.
1926 * test/bus-test.c: (message_handler):
1929 2003-02-13 Anders Carlsson <andersca@codefactory.se>
1931 * bus/driver.c: (bus_driver_send_service_deleted),
1932 (bus_driver_send_service_created), (bus_driver_send_service_lost),
1933 (bus_driver_send_service_acquired), (bus_driver_handle_hello),
1934 (bus_driver_send_welcome_message),
1935 (bus_driver_handle_list_services),
1936 (bus_driver_handle_acquire_service),
1937 (bus_driver_handle_service_exists):
1938 * dbus/dbus-bus.c: (dbus_bus_register_client),
1939 (dbus_bus_acquire_service), (dbus_bus_service_exists):
1940 * dbus/dbus-errors.c: (dbus_result_to_string):
1941 * dbus/dbus-errors.h:
1942 * dbus/dbus-message.c: (dbus_message_append_args),
1943 (dbus_message_append_args_valist), (dbus_message_get_args),
1944 (dbus_message_get_args_valist), (dbus_message_get_args_iter),
1945 (dbus_message_iter_get_arg_type), (dbus_message_iter_get_string),
1946 (dbus_message_iter_get_byte_array),
1947 (dbus_message_iter_get_string_array), (message_iter_test),
1948 (check_message_handling), (_dbus_message_test):
1949 * dbus/dbus-message.h:
1950 * test/bus-test.c: (main):
1951 Change fields to arguments in messages, so that they won't be
1952 confused with header fields.
1954 * glib/test-dbus-glib.c: (main):
1955 Remove append_fields from hello message.
1957 2003-02-13 Anders Carlsson <andersca@codefactory.se>
1959 * dbus/dbus-errors.c:
1960 * dbus/dbus-message.c:
1961 * dbus/dbus-string.c:
1962 Documentation fixes.
1964 2003-02-13 Anders Carlsson <andersca@codefactory.se>
1966 * glib/dbus-gmain.c: (timeout_handler), (add_timeout),
1968 Implement support for timeouts in dbus-glib.
1970 2003-02-13 Anders Carlsson <andersca@codefactory.se>
1972 * dbus/dbus-message-builder.c: (_dbus_message_data_load):
1973 * dbus/dbus-message.c: (process_test_subdir):
1974 * test/break-loader.c: (find_breaks_based_on):
1975 Plug some memory leaks.
1977 2003-02-13 Richard Hult <rhult@codefactory.se>
1979 * bus/main.c: Fix build.
1981 * dbus/dbus-errors.h:
1982 * dbus/dbus-errors.c: Fix copyright for Anders.
1984 2003-02-13 Anders Carlsson <andersca@codefactory.se>
1989 * bus/connection.c: (bus_connection_foreach):
1992 * bus/desktop-file.c: (grow_lines_in_section), (grow_sections),
1993 (unescape_string), (new_section), (parse_section_start),
1994 (parse_key_value), (report_error), (bus_desktop_file_load),
1995 (bus_desktop_file_get_string):
1996 * bus/desktop-file.h:
1997 Use DBusError for error reporting.
1999 * bus/dispatch.c: (send_one_message),
2000 (bus_dispatch_message_handler):
2001 * bus/driver.c: (bus_driver_send_service_deleted),
2002 (bus_driver_send_service_created), (bus_driver_send_service_lost),
2003 (bus_driver_send_service_acquired), (bus_driver_handle_hello),
2004 (bus_driver_send_welcome_message),
2005 (bus_driver_handle_list_services),
2006 (bus_driver_handle_acquire_service),
2007 (bus_driver_handle_service_exists):
2008 * bus/loop.c: (bus_loop_run):
2010 Use BUS_HANDLE_OOM instead of _DBUS_HANDLE_OOM.
2012 * bus/utils.c: (bus_wait_for_memory):
2014 New files with general utility functions.
2016 * dbus/dbus-internals.h:
2017 Remove _DBUS_HANDLE_OOM.
2019 2003-02-13 Anders Carlsson <andersca@codefactory.se>
2021 * dbus/dbus-errors.c: (dbus_result_to_string), (dbus_error_init),
2022 (dbus_error_free), (dbus_set_error_const), (dbus_set_error):
2023 * dbus/dbus-errors.h:
2024 Add DBusError structure.
2026 2003-02-13 Anders Carlsson <andersca@codefactory.se>
2028 * test/data/valid-messages/standard-acquire-service.message:
2029 * test/data/valid-messages/standard-hello.message:
2030 * test/data/valid-messages/standard-list-services.message:
2031 * test/data/valid-messages/standard-service-exists.message:
2032 Add some standard messages.
2034 2003-02-13 Anders Carlsson <andersca@codefactory.se>
2036 * bus/driver.c: (bus_driver_send_welcome_message),
2037 (bus_driver_handle_list_services),
2038 (bus_driver_handle_acquire_service),
2039 (bus_driver_handle_service_exists), (bus_driver_handle_message):
2040 Update for API changes in libdbus.
2042 * dbus/dbus-message.c: (dbus_message_new_reply):
2043 * dbus/dbus-message.h:
2044 Remove the name argument. The spec states that replies shouldn't
2047 2003-02-13 Anders Carlsson <andersca@codefactory.se>
2049 * bus/desktop-file.c: (parse_section_start), (parse_key_value),
2050 (report_error), (bus_desktop_file_load), (lookup_section),
2051 (lookup_line), (bus_desktop_file_get_raw),
2052 (bus_desktop_file_get_string):
2053 * bus/desktop-file.h:
2054 Some fixes, and new functions for getting a key value from a section.
2056 2003-02-13 Havoc Pennington <hp@pobox.com>
2058 * test/data/auth/fail-after-n-attempts.auth-script: new test
2060 * dbus/dbus-auth.c (send_rejected): shutdown_mech() when we
2063 2003-02-13 Havoc Pennington <hp@pobox.com>
2065 * dbus/dbus-auth.c (handle_server_data_external_mech): args to
2066 dbus_credentials_match were backward
2068 * dbus/dbus-auth-script.c (_dbus_auth_script_run): support
2069 NO_CREDENTIALS and ROOT_CREDENTIALS
2071 * dbus/dbus-auth.c (_dbus_auth_do_work): move get_state() routine
2072 into here. Never process more commands after we've reached an
2073 end state; store further data as unused bytes.
2075 * test/data/auth/*: add more auth tests
2077 * dbus/dbus-auth-script.c (_dbus_auth_script_run): support EXPECT
2078 command to match exact string and EXPECT_UNUSED to match unused
2081 * test/Makefile.am (dist-hook): fix to dist all the test stuff
2083 2003-02-12 Havoc Pennington <hp@pobox.com>
2085 * dbus/dbus-string.c (_dbus_string_pop_line): fix to also strip
2086 \r off of popped lines
2088 * dbus/dbus-auth.c (_dbus_auth_test): write code to run auth
2091 * dbus/dbus-auth-script.c (_dbus_auth_script_run): when doing a
2094 2003-02-12 Havoc Pennington <hp@pobox.com>
2096 * dbus/Makefile.am: remove break-loader from the build, since it
2099 * configure.in: add --enable-gcov to turn on coverage profiling
2100 flags and disable optimization
2102 2003-02-10 Havoc Pennington <hp@pobox.com>
2104 * dbus/dbus-auth-script.c, dbus/dbus-auth-script.h: sync
2105 initial cut at test framework for DBusAuth from laptop.
2106 Doesn't quite work yet but it compiles and I need to get
2107 it off the 266mhz laptop. ;-)
2109 * dbus/dbus-server-debug.c (_dbus_server_debug_accept_transport):
2110 fix a memleak in error case
2112 2003-02-12 Anders Carlsson <andersca@codefactory.se>
2115 * bus/desktop-file.c:
2116 * bus/desktop-file.h:
2117 Add a desktop file parser.
2119 2003-02-11 Zack Rusin <zack@kde.org>
2121 * qt/message.[h|cpp]: sample implementation
2122 of the KDE wrapper for DBusMessage
2124 2003-02-09 Zack Rusin <zack@kde.org>
2126 * test/bus-test.c: make_it_compile
2127 * doc/dbus-specification.sgml: minimal semantic fix
2129 2003-02-06 Anders Carlsson <andersca@codefactory.se>
2135 2003-02-06 Anders Carlsson <andersca@codefactory.se>
2138 * dbus/dbus-break-loader.c:
2140 * test/break-loader.c:
2141 Move dbus-break-loader to test/ and rename it to break-loader.
2143 2003-02-02 Havoc Pennington <hp@pobox.com>
2145 * dbus/dbus-keyring.c, dbus/dbus-keyring.h: template files
2146 for code to manage cookies in your home directory
2148 * dbus/dbus-sysdeps.c (_dbus_generate_random_bytes): new function
2150 * dbus/dbus-auth.c (get_state): impose a maximum number of tries
2151 to authenticate, then disconnect the client.
2153 2003-02-03 Alexander Larsson <alexl@redhat.com>
2155 * dbus/dbus-message.c (dbus_message_append_fields):
2158 2003-02-02 Anders Carlsson <andersca@codefactory.se>
2160 * doc/dbus-specification.sgml:
2161 Update address format section.
2163 2003-02-02 Anders Carlsson <andersca@codefactory.se>
2166 * test/bus-test.c: (get_time), (add_timeout), (remove_timeout),
2167 (message_handler), (new_connection_callback), (loop_quit),
2171 2003-02-02 Anders Carlsson <andersca@codefactory.se>
2173 * bus/driver.c: (bus_driver_handle_service_exists):
2174 Simplify the code a bit.
2176 * dbus/dbus-bus.c: (dbus_bus_service_exists):
2179 2003-02-02 Anders Carlsson <andersca@codefactory.se>
2182 Add libdbus-daemon.la and link to it.
2184 2003-02-01 James Willcox <jwillcox@gnome.org>
2186 * bus/driver.c: (bus_driver_handle_own_service):
2187 Actually include the service reply code in the message.
2189 2003-02-02 Anders Carlsson <andersca@codefactory.se>
2191 * bus/driver.c: (bus_driver_handle_service_exists):
2192 Don't unref the incoming message.
2194 2003-02-02 Anders Carlsson <andersca@codefactory.se>
2196 * dbus/dbus.h: Add dbus-address.h and dbus-bus.h
2198 2003-02-02 Anders Carlsson <andersca@codefactory.se>
2200 * dbus/dbus-server.c: (dbus_server_listen):
2201 * dbus/dbus-transport.c: (_dbus_transport_open):
2202 ifdef out the calls to the debug transport and server.
2204 2003-02-02 Alexander Larsson <alexl@redhat.com>
2206 * dbus/dbus-watch.c (dbus_watch_get_flags):
2207 Add note in the docs that ERROR or HANGUP won't be returned
2208 and are assumed always on.
2210 * glib/dbus-gmain.c (add_watch):
2211 Always add IO_ERR | IO_HUP
2213 * dbus/dbus-message.h:
2214 Add semicolon after dbus_message_iter_get_string_array().
2215 Makes qt code build again
2217 2003-02-01 Anders Carlsson <andersca@codefactory.se>
2219 * bus/driver.c: (create_unique_client_name),
2220 (bus_driver_handle_hello):
2221 Don't take a name, just use a numeric id to identify
2225 * dbus/dbus-bus.c: (dbus_bus_register_client),
2226 (dbus_bus_acquire_service), (dbus_bus_service_exists):
2228 Add new convenience functions for communicating with the bus.
2230 * dbus/dbus-message.h:
2232 * dbus/dbus-protocol.h:
2235 2003-02-01 Alexander Larsson <alexl@redhat.com>
2237 * dbus/dbus-message.c (dbus_message_append_fields):
2238 Add some more doc comments.
2240 2003-02-01 Havoc Pennington <hp@pobox.com>
2242 * dbus/dbus-break-loader.c (randomly_modify_length): change
2243 a 4-byte value in the message as if it were a length
2245 * dbus/dbus-sysdeps.c (_dbus_string_save_to_file): don't set
2246 execute bit on saved files
2248 2003-02-01 Havoc Pennington <hp@pobox.com>
2250 * dbus/dbus-break-loader.c (main): new program to find messages
2251 that break the loader.
2253 * dbus/dbus-sysdeps.c (_dbus_string_append_uint): new function
2254 * dbus/dbus-sysdeps.c (_dbus_string_save_to_file): new function
2256 * dbus/dbus-string.c (_dbus_string_set_byte): new
2258 2003-01-31 Havoc Pennington <hp@pobox.com>
2260 * dbus/dbus-message.c: refactor the test code to be more general,
2261 in preparation for writing a "randomly permute test cases to
2262 try to break the loader" program.
2264 2003-01-31 Havoc Pennington <hp@pobox.com>
2266 * doc/dbus-specification.sgml: work on the specification
2268 * dbus/dbus-message.c (_dbus_message_loader_return_buffer): check
2269 the protocol version of the message.
2271 * dbus/dbus-protocol.h: drop special _REPLY names, the spec
2272 no longer specifies that.
2273 (DBUS_SERVICE_REPLY_SERVICE_EXISTS): fix flags (1/2/4/8 not
2276 * dbus/dbus-marshal.c (_dbus_marshal_get_arg_end_pos): add missing
2277 "break" for DBUS_TYPE_NIL, remove @todo
2279 2003-01-31 Havoc Pennington <hp@pobox.com>
2281 * dbus/dbus-message.c (dbus_message_set_is_error_reply): rename
2282 just set_is_error/get_is_error as this is a commonly-used
2283 function, and write docs.
2285 2003-01-31 Anders Carlsson <andersca@codefactory.se>
2287 * dbus/dbus-address.c: (dbus_address_entry_free):
2288 Free key and value lists.
2290 * dbus/dbus-internals.c: (_dbus_type_to_string):
2291 Add the types we didn't have.
2293 * dbus/dbus-marshal.c: (_dbus_marshal_get_arg_end_pos),
2294 (_dbus_marshal_validate_arg):
2297 * dbus/dbus-message.c: (dbus_message_set_sender):
2298 Remove todo about being able to set sender to NULL.
2300 (dbus_message_set_is_error_reply),
2301 (dbus_message_get_is_error_reply):
2302 * dbus/dbus-message.h:
2305 * dbus/dbus-protocol.h:
2306 Add error reply flag.
2308 * test/data/valid-messages/opposite-endian.message:
2309 Add NIL type to test.
2311 2003-01-31 Havoc Pennington <hp@pobox.com>
2313 * doc/dbus-specification.sgml: fully specify the header. Add
2314 flags and major protocol version, and change header/body len to
2317 * dbus/dbus-message-builder.c (append_saved_length): append length
2320 * dbus/dbus-message.c (dbus_message_create_header): change header
2321 length and body length to unsigned. Add the new fields from the
2323 (_dbus_message_loader_return_buffer): unsigned header/body len
2325 2003-01-30 Havoc Pennington <hp@pobox.com>
2327 * dbus/dbus-auth.c: rework to use only REJECTED, no
2330 * doc/dbus-sasl-profile.txt: drop MECHANISMS and just
2331 use REJECTED, suggested by Mark McLoughlin
2333 2003-01-30 Havoc Pennington <hp@pobox.com>
2335 * dbus/dbus-server.c (dbus_server_listen): @todo about how we need
2336 a better way to report errors here. e.g. "unix address lacks
2337 path" or something. also "no such file" when the path doesn't
2340 * dbus/dbus-address.c (dbus_address_entries_free): add @todo about
2342 (dbus_parse_address): add @todo about documenting address format,
2343 and allowing , and ; to be escaped
2345 2003-01-30 Anders Carlsson <andersca@codefactory.se>
2348 Add dbus-address.[ch]
2350 * dbus/dbus-address.c: (dbus_address_entry_free),
2351 (dbus_address_entries_free), (create_entry),
2352 (dbus_address_entry_get_method), (dbus_address_entry_get_value),
2353 (dbus_parse_address), (_dbus_address_test):
2354 * dbus/dbus-address.h:
2355 New files for dealing with address parsing.
2357 * dbus/dbus-connection.c:
2358 Document timeout functions.
2360 * dbus/dbus-message.c:
2361 Document dbus_message_new_from_message.
2363 * dbus/dbus-server-debug.c:
2366 * dbus/dbus-server.c: (dbus_server_listen):
2367 Parse address and use correct server implementation.
2369 * dbus/dbus-string.c: (_dbus_string_find_to), (_dbus_string_test):
2370 * dbus/dbus-string.h:
2371 New function with test.
2373 * dbus/dbus-test.c: (dbus_internal_symbol_do_not_use_run_tests):
2377 * dbus/dbus-transport-debug.c:
2380 * dbus/dbus-transport.c: (_dbus_transport_open):
2381 Parse address and use correct transport implementation.
2383 2003-01-30 Havoc Pennington <hp@pobox.com>
2385 * dbus/dbus-message.c: use message->byte_order instead of
2386 DBUS_COMPILER_BYTE_ORDER throughout.
2387 (dbus_message_create_header): pad header to align the
2388 start of the body of the message to 8-byte boundary
2390 * dbus/dbus-marshal.h: make all the demarshalers take const
2391 DBusString arguments.
2393 * dbus/dbus-message.c (_dbus_message_loader_return_buffer):
2394 validate message args here, so we don't have to do slow validation
2395 later, and so we catch bad messages as they are incoming. Also add
2396 better checks on header_len and body_len. Also fill in
2399 * dbus/dbus-string.c (_dbus_string_validate_utf8): new (not
2400 implemented properly)
2401 (_dbus_string_validate_nul): new function to check all-nul
2403 * dbus/dbus-marshal.c (_dbus_marshal_get_field_end_pos): rename
2404 get_arg_end_pos and remove all validation
2405 (_dbus_marshal_validate_arg): actually do validation here.
2407 2003-01-29 Havoc Pennington <hp@pobox.com>
2409 * dbus/dbus-message.c (check_message_handling): fix assertion
2410 failure on set_client_serial
2412 2003-01-28 Havoc Pennington <hp@pobox.com>
2414 * dbus/dbus-server-debug.c: Add doc section comments
2416 * dbus/dbus-transport-debug.c: add doc section comments
2418 2003-01-28 Havoc Pennington <hp@redhat.com>
2420 * dbus/dbus-string.c (_dbus_string_base64_decode): append bytes in
2421 the reverse order from how I had it
2422 (_dbus_string_base64_encode): reverse encoding order. I was
2423 basically byteswapping everything during encoding.
2425 2003-01-28 Anders Carlsson <andersca@codefactory.se>
2427 * dbus/dbus-connection-internal.h:
2428 * dbus/dbus-connection.c: (_dbus_connection_add_timeout),
2429 (_dbus_connection_remove_timeout):
2430 Add functions for adding and removing timeouts.
2432 * dbus/dbus-message.c: (dbus_message_new_from_message):
2433 Add new function that takes a message and creates an exact
2434 copy of it, but with the refcount set to 1.
2435 (check_message_handling):
2438 * dbus/dbus-server-protected.h:
2439 * dbus/dbus-server.c: (_dbus_server_init_base),
2440 (_dbus_server_finalize_base), (_dbus_server_add_timeout),
2441 (dbus_server_set_timeout_functions):
2442 (_dbus_server_remove_timeout):
2443 New functions so that a server can add and remove timeouts.
2445 (dbus_server_listen):
2446 Add commented out call to dbus_server_debug_new.
2448 * dbus/dbus-timeout.c: (_dbus_timeout_new):
2449 Actually set the handler, doh.
2451 * dbus/dbus-transport.c: (_dbus_transport_open):
2452 Add commented out call to dbus_transport_debug_client_new.
2455 Add dbus-transport-debug.[ch] and dbus-server-debug.[ch]
2457 2003-01-28 Havoc Pennington <hp@pobox.com>
2459 * dbus/dbus-message.c (check_message_handling): function to check
2460 on the loaded message, iterates over it etc.
2462 2003-01-28 Havoc Pennington <hp@pobox.com>
2464 * test/Makefile.am (dist-hook): fix make distdir
2466 * dbus/Makefile.am (TESTS_ENVIRONMENT): fix make check
2468 2003-01-27 Havoc Pennington <hp@pobox.com>
2470 * dbus/dbus-mempool.c (time_for_size): replace printf with
2473 * dbus/dbus-message-builder.c (_dbus_message_data_load): allow
2474 empty lines; fix the SAVE_LENGTH stuff to be
2475 START_LENGTH/END_LENGTH so it actually works; couple other
2478 * test/Makefile.am (dist-hook): add dist-hook for .message files
2480 * dbus/dbus-string.c (DBUS_STRING_COPY_PREAMBLE): source of a copy
2481 can be constant or locked.
2482 (_dbus_string_free): allow freeing a const string as
2485 * dbus/dbus-sysdeps.c (_dbus_concat_dir_and_file): utility
2487 * dbus/dbus-test-main.c (main): take an argument which is the
2488 directory containing test data
2490 * dbus/dbus-message.c (_dbus_message_test): pass a test_data_dir
2491 argument to this and load all the messages in test/data/
2492 checking that they can be loaded or not loaded as appropriate.
2494 2003-01-27 Anders Carlsson <andersca@codefactory.se>
2496 * bus/dispatch.c: (bus_dispatch_message_handler):
2497 Dispatch messages sent to services.
2499 * bus/driver.c: (bus_driver_send_service_deleted),
2500 (bus_driver_send_service_created), (bus_driver_send_service_lost),
2501 (bus_driver_send_service_acquired):
2502 Add helper functions for sending service related messages.
2504 (bus_driver_send_welcome_message):
2505 Send HELLO_REPLY instead of WELCOME.
2507 (bus_driver_handle_list_services):
2508 Send LIST_SERVICES_REPLY instead of SERVICES.
2510 (bus_driver_handle_own_service),
2511 (bus_driver_handle_service_exists):
2512 New message handlers.
2514 (bus_driver_handle_message):
2515 Invoke new message handlers.
2517 (bus_driver_remove_connection):
2518 Don't remove any services here since that's done automatically
2519 by bus_service_remove_owner now.
2522 New function signatures.
2524 * bus/services.c: (bus_service_add_owner):
2525 Send ServiceAcquired message if we're the only primary owner.
2527 (bus_service_remove_owner):
2528 Send ServiceAcquired/ServiceLost messages.
2530 (bus_service_set_prohibit_replacement),
2531 (bus_service_get_prohibit_replacement):
2532 Functions for setting prohibit replacement.
2534 (bus_service_has_owner):
2535 New function that checks if a connection is in the owner queue of
2539 Add new function signatures.
2541 * dbus/dbus-list.c: (_dbus_list_test):
2542 Add tests for _dbus_list_remove_last and traversing the list backwards.
2545 Fix a typo in _dbus_list_get_prev_link, if we're at the first element we can't
2546 go any further, so return NULL then.
2548 * dbus/dbus-protocol.h:
2549 Add new messages, service flags and service replies.
2551 2003-01-26 Havoc Pennington <hp@pobox.com>
2553 * dbus/dbus-message-builder.c: implement, completely untested.
2555 * test/data/*: add data to be used in testing.
2556 ".message" files are our simple loadable text format.
2557 ".message-raw" will be binary dumps of messages.
2559 * dbus/dbus-string.c (_dbus_string_starts_with_c_str): new
2561 2003-01-26 Havoc Pennington <hp@pobox.com>
2563 * dbus/dbus-sysdeps.c (_dbus_file_get_contents): new function
2565 * dbus/dbus-errors.c (dbus_result_to_string): add
2568 * dbus/dbus-message-builder.c: new file, will contain code to load
2569 up messages from files. Not implemented yet.
2571 2003-01-26 Havoc Pennington <hp@pobox.com>
2573 * dbus/dbus-message.c (dbus_message_set_sender): support deleting
2574 the sender by setting to NULL
2576 2003-01-26 Havoc Pennington <hp@pobox.com>
2578 The unit tests pass, but otherwise untested. If it breaks, the
2579 tests should have been better. ;-)
2581 * bus/driver.c (bus_driver_handle_hello): return if we disconnect
2584 * dbus/dbus-message.c: redo everything so we maintain
2585 message->header as the only copy of the various fields.
2586 This avoids the possibility of out-of-memory in some cases,
2587 for example dbus_message_lock() can't run out of memory anymore,
2588 and avoids extra copying. Figured I may as well go ahead and do
2589 this since it was busted for dbus_message_lock to not return
2590 failure on OOM, and dbus_message_write_header was totally
2591 unchecked for OOM. Also fixed some random other bugs.
2593 * dbus/dbus-marshal.c (_dbus_marshal_get_field_end_pos): verify
2594 that strings are nul-terminated. Also, end_pos can be equal
2595 to string length just not greater than, I think.
2596 (_dbus_marshal_set_int32): new function
2597 (_dbus_marshal_set_uint32): new function
2598 (_dbus_marshal_set_string): new function
2600 * dbus/dbus-connection.c (_dbus_connection_new_for_transport): fix
2601 a warning, init timeout_list to NULL
2602 (dbus_connection_send_message): don't use uninitialized variable
2605 * dbus/dbus-string.c (_dbus_string_replace_len): new function
2607 2003-01-26 Anders Carlsson <andersca@codefactory.se>
2609 * bus/driver.c: (bus_driver_handle_hello),
2610 (bus_driver_send_welcome_message):
2613 2003-01-26 Anders Carlsson <andersca@codefactory.se>
2615 * dbus/dbus-auth.c: (process_auth), (_dbus_auth_unref):
2616 * dbus/dbus-connection.c: (_dbus_connection_new_for_transport),
2617 (dbus_connection_unref):
2618 * dbus/dbus-marshal.c: (_dbus_marshal_test):
2619 * dbus/dbus-message.c: (dbus_message_unref),
2622 (dbus_message_get_fields):
2623 Remove debugging printout.
2625 (_dbus_message_loader_return_buffer):
2626 Don't store the header string.
2628 (_dbus_message_test):
2631 2003-01-26 Richard Hult <rhult@codefactory.se>
2633 * glib/dbus-gmain.c (dbus_connection_dispatch): Traverse a copy of
2634 the file descriptor list, since it can change under us.
2636 2003-01-25 Anders Carlsson <andersca@codefactory.se>
2638 * glib/dbus-gmain.c: (dbus_connection_prepare),
2639 (dbus_connection_check), (dbus_connection_dispatch), (add_watch),
2640 (remove_watch), (dbus_connection_hookup_with_g_main):
2641 Rewrite the glib handling to use its own GSource instead of a
2642 GIOChannel so we can catch messages put in the queue while waiting
2645 2003-01-25 Anders Carlsson <andersca@codefactory.se>
2648 * bus/connection.c: (connection_disconnect_handler),
2649 (connection_watch_callback), (bus_connection_setup):
2650 * bus/dispatch.c: (send_one_message),
2651 (bus_dispatch_broadcast_message), (bus_dispatch_message_handler),
2652 (bus_dispatch_add_connection), (bus_dispatch_remove_connection):
2654 * bus/driver.c: (bus_driver_send_service_deleted),
2655 (bus_driver_send_service_created), (bus_driver_handle_hello),
2656 (bus_driver_send_welcome_message),
2657 (bus_driver_handle_list_services), (bus_driver_remove_connection),
2658 (bus_driver_handle_message):
2660 Refactor code, put the message dispatching in its own file. Use
2661 _DBUS_HANDLE_OOM. Also send ServiceDeleted messages when a client
2664 2003-01-25 Anders Carlsson <andersca@codefactory.se>
2666 * dbus/dbus-internals.h:
2667 Add _DBUS_HANDLE_OOM macro, it doesn't do anything currently.
2669 * dbus/dbus-message.c: (dbus_message_get_sender):
2670 * dbus/dbus-message.h:
2671 Implement dbus_message_get_sender.
2673 * dbus/dbus-protocol.h:
2674 Add message and service defines.
2676 2003-01-25 Anders Carlsson <andersca@codefactory.se>
2678 * dbus/dbus-connection.c: (dbus_connection_send_message):
2679 * dbus/dbus-message-internal.h:
2680 * dbus/dbus-message.c: (_dbus_message_get_client_serial),
2681 (dbus_message_write_header):
2682 Remove _dbus_messag_unlock and don't set the client serial on a
2683 message if one already exists.
2685 2003-01-24 Havoc Pennington <hp@pobox.com>
2687 * dbus/dbus-list.c (alloc_link): put a thread lock on the global
2690 * bus/driver.c (bus_driver_handle_list_services): fix a leak
2693 2003-01-25 Anders Carlsson <andersca@codefactory.se>
2695 * dbus/dbus-list.c: (alloc_link), (free_link):
2696 Use a memory pool for the links.
2698 2003-01-25 Anders Carlsson <andersca@codefactory.se>
2700 * bus/connection.c: (bus_connection_foreach):
2702 Add new bus_connection_foreach function.
2704 * bus/driver.c: (send_one_message), (bus_driver_broadcast_message):
2705 Add function that broadcasts a message to all clients.
2707 (bus_driver_send_service_created), (bus_driver_handle_hello),
2708 (bus_driver_send_welcome_message),
2709 (bus_driver_handle_list_services), (bus_driver_message_handler):
2710 Implement functions that take care of listing services, and notifying
2711 clients when new services are created.
2713 * bus/services.c: (bus_services_list):
2715 Add new function that returns an array of strings with the currently
2716 registered services.
2719 * glib/dbus-gmain.c:
2720 Update copyright year.
2722 2003-01-25 Anders Carlsson <andersca@codefactory.se>
2724 * dbus/dbus-connection.c: (dbus_connection_send_message):
2725 Unlock the message in case it was sent earlier.
2727 (dbus_connection_send_message_with_reply_and_block):
2728 Remove the reply message from the list.
2730 * dbus/dbus-marshal.c: (_dbus_demarshal_string_array):
2731 Set array_len and new_pos correctly.
2733 (_dbus_marshal_test):
2734 Remove debug output.
2736 * dbus/dbus-message-internal.h:
2737 * dbus/dbus-message.c: (_dbus_message_get_reply_serial):
2738 New function that returns the reply serial.
2740 (_dbus_message_unlock):
2741 New function that unlocks a message and resets its header.
2743 (dbus_message_append_string_array),
2744 (dbus_message_get_fields_valist),
2745 (dbus_message_iter_get_field_type),
2746 (dbus_message_iter_get_string_array),
2747 (dbus_message_get_fields),
2748 (dbus_message_append_fields_valist):
2749 Handle string arrays.
2751 (dbus_message_set_sender):
2752 Make this function public since the bus daemon needs it.
2754 (decode_header_data):
2755 Set the reply serial to -1 initially.
2757 * dbus/dbus-message.h:
2758 Add dbus_message_set_sender.
2760 2003-01-24 Havoc Pennington <hp@pobox.com>
2762 * doc/dbus-specification.sgml: add some stuff
2764 2003-01-22 Havoc Pennington <hp@pobox.com>
2766 * doc/dbus-specification.sgml: Start to document the protocol.
2768 2003-01-22 Havoc Pennington <hp@pobox.com>
2770 * dbus/dbus-connection.c
2771 (dbus_connection_send_message_with_reply_and_block): add some @todo
2773 * bus/driver.c (bus_driver_add_connection): add a FIXME about memleak
2775 2003-01-21 Havoc Pennington <hp@pobox.com>
2777 (patch untested because can't compile)
2779 * bus/driver.c (create_unique_client_name): make this function
2780 never recycle client names. Also, caller should initialize
2783 * dbus/dbus-sysdeps.c (_dbus_get_current_time): new function
2785 2003-01-21 Anders Carlsson <andersca@codefactory.se>
2787 * dbus/dbus-marshal.c: (_dbus_marshal_double),
2788 (_dbus_marshal_int32), (_dbus_marshal_uint32),
2789 (_dbus_marshal_int32_array), (_dbus_marshal_uint32_array),
2790 (_dbus_marshal_double_array), (_dbus_marshal_string_array),
2791 (_dbus_demarshal_int32_array), (_dbus_demarshal_uint32_array),
2792 (_dbus_demarshal_double_array), (_dbus_demarshal_string_array),
2793 (_dbus_marshal_get_field_end_pos), (_dbus_marshal_test):
2794 * dbus/dbus-marshal.h:
2795 * dbus/dbus-protocol.h:
2796 Add support for marshalling and demarshalling integer, double
2799 2003-01-21 Anders Carlsson <andersca@codefactory.se>
2804 * bus/connection.c: (connection_disconnect_handler):
2805 Remove the connection from the bus driver's list.
2807 (connection_watch_callback): Dispatch messages.
2809 (free_connection_data): Free connection name.
2811 (bus_connection_setup): Add connection to the bus driver's list.
2812 (bus_connection_remove_owned_service):
2813 (bus_connection_set_name), (bus_connection_get_name):
2814 Add functions for setting and getting the connection's name.
2817 Add function headers.
2819 * bus/driver.c: (create_unique_client_name),
2820 (bus_driver_handle_hello_message),
2821 (bus_driver_send_welcome_message), (bus_driver_message_handler),
2822 (bus_driver_add_connection), (bus_driver_remove_connection):
2825 * bus/services.c: (bus_service_free):
2827 New file that handles communication and registreation with the bus
2830 2003-01-21 Anders Carlsson <andersca@codefactory.se>
2832 * dbus/dbus-connection.c: (dbus_connection_send_message):
2833 Add a new client_serial parameter.
2835 (dbus_connection_send_message_with_reply):
2836 Remove a @todo since we've implemented the blocking function.
2838 (dbus_connection_send_message_with_reply_and_block):
2839 New function that sends a message and waits for a reply and
2840 then returns the reply.
2842 * dbus/dbus-connection.h:
2845 * dbus/dbus-errors.c: (dbus_result_to_string):
2846 * dbus/dbus-errors.h:
2847 Add new DBUS_RESULT.
2849 * dbus/dbus-message-internal.h:
2850 * dbus/dbus-message.c: (_dbus_message_get_reply_serial),
2851 (_dbus_message_set_sender), (dbus_message_write_header),
2852 (dbus_message_new_reply), (decode_header_data),
2853 (_dbus_message_loader_return_buffer), (_dbus_message_test):
2854 * dbus/dbus-message.h:
2855 Add new functions that set the reply serial and sender.
2856 Also marshal and demarshal them correctly and add test.
2858 * dbus/dbus-protocol.h:
2859 Add new DBUS_MESSAGE_TYPE_SENDER.
2862 * glib/dbus-gmain.c: (watch_callback), (free_callback_data),
2863 (add_watch), (remove_watch), (add_timeout), (remove_timeout),
2864 (dbus_connection_hookup_with_g_main):
2865 * glib/test-dbus-glib.c: (main):
2866 Rewrite to use GIOChannel and remove the GSource crack.
2868 * test/echo-client.c: (main):
2869 * test/watch.c: (check_messages):
2870 Update for changed APIs
2872 2003-01-19 Anders Carlsson <andersca@codefactory.se>
2874 * dbus/Makefile.am: Add dbus-timeout.[cħ]
2876 * dbus/dbus-connection.c: (_dbus_connection_new_for_transport):
2877 Create a DBusTimeoutList.
2878 (dbus_connection_set_timeout_functions): Add new function to
2879 set timeout callbacks
2881 * dbus/dbus-connection.h: Add public DBusTimeout API.
2883 * dbus/dbus-message.c: (dbus_message_get_service):
2884 * dbus/dbus-message.h: New function.
2886 * dbus/dbus-server.c: Fix small doc typo.
2888 * dbus/dbus-timeout.[ch]: New files for mainloop timeouts.
2890 2003-01-19 Anders Carlsson <andersca@codefactory.se>
2892 * dbus/dbus-string.c (_dbus_string_move_len): Don't delete all
2893 of the string, just as long as specified.
2895 2003-01-19 Havoc Pennington <hp@pobox.com>
2897 * dbus/dbus-connection.c (dbus_connection_get_is_authenticated):
2900 * dbus/dbus-server.c (dbus_server_set_max_connections)
2901 (dbus_server_get_max_connections, dbus_server_get_n_connections):
2902 keep track of current number of connections, and add API for
2903 setting a max (but haven't implemented enforcing the max yet)
2905 2003-01-18 Havoc Pennington <hp@pobox.com>
2907 * dbus/dbus-transport-unix.c (unix_do_iteration): only do the
2908 reading/writing if read_watch != NULL or write_watch != NULL.
2910 * dbus/dbus-message.c (_dbus_message_loader_return_buffer): fix
2911 the message loader code to actually load message->header and
2912 message->body into the newly-created message.
2914 * dbus/dbus-transport-unix.c (check_write_watch): fix a mem leak
2917 * dbus/dbus-connection.c (dbus_connection_set_max_message_size)
2918 (dbus_connection_get_max_message_size)
2919 (dbus_connection_set_max_live_messages_size)
2920 (dbus_connection_get_max_live_messages_size): implement some
2921 resource limitation functions
2923 * dbus/dbus-resources.c: new file implementing some of the
2924 resource limits stuff
2926 * dbus/dbus-message.c (dbus_message_iter_get_byte_array): add
2927 missing docs, add @todo to handle OOM etc.
2929 * dbus/dbus-marshal.c (_dbus_demarshal_byte_array): add missing
2932 2003-01-18 Havoc Pennington <hp@pobox.com>
2934 * dbus/dbus-connection.c (dbus_connection_unref): disconnect the
2935 connection if it hasn't been already.
2937 * dbus/dbus-connection.h: kill off the idea of an ErrorFunction,
2938 replace with DisconnectFunction.
2940 2003-01-18 Havoc Pennington <hp@pobox.com>
2942 Building --disable-verbose-mode --disable-asserts --disable-tests
2943 cuts the library from 112K to 45K or so
2945 * configure.in: check for varargs macro support,
2946 add --enable-verbose-mode, --enable-asserts.
2948 * dbus/dbus-internals.h (_dbus_assert): support
2950 (_dbus_verbose): support DBUS_ENABLE_VERBOSE_MODE
2952 2003-01-18 Havoc Pennington <hp@pobox.com>
2954 * dbus/dbus-test.c: include config.h so that tests actually run
2956 * dbus/dbus-string.c: add assertions that stuff is 8-byte aligned,
2957 so the failure mode when that assumption fails will be plenty
2960 2003-01-18 Havoc Pennington <hp@pobox.com>
2962 * configure.in: default --enable-tests to $USE_MAINTAINER_MODE
2964 * dbus/Makefile.am: fix it up so dubs-test-main.c is included in
2967 * test/Makefile.am: don't use special variable "TESTS" for echo-*
2968 since we don't want to use those in make check
2970 2003-01-15 Havoc Pennington <hp@redhat.com>
2976 2003-01-15 Havoc Pennington <hp@redhat.com>
2978 * test/Makefile.am: fix so that test source code ends up in the
2979 distribution on make distcheck
2981 2003-01-15 Havoc Pennington <hp@redhat.com>
2987 2003-01-15 Havoc Pennington <hp@redhat.com>
2989 * dbus/dbus-test.c (dbus_internal_symbol_do_not_use_run_tests):
2990 fix build when --disable-tests
2992 * Makefile.am (EXTRA_DIST): put HACKING in here
2994 * HACKING: document procedure for making a tarball release.
2996 2003-01-14 Anders Carlsson <andersca@codefactory.se>
2998 * bus/connection.c: (connection_error_handler),
2999 (bus_connection_setup):
3000 * bus/main.c: (main):
3001 Make sure that the DBusConnectionData struct is NULLed
3002 out to prevent a segfault.
3004 * dbus/dbus-errors.c: (dbus_result_to_string):
3005 * dbus/dbus-errors.h:
3006 * dbus/dbus-message.c: (dbus_message_get_fields),
3007 (dbus_message_get_fields_valist), (_dbus_message_test):
3008 * dbus/dbus-message.h:
3009 Make dbus_message_get_fields return a result code so we can
3010 track invalid fields as well as oom.
3012 2003-01-11 Havoc Pennington <hp@pobox.com>
3014 * configure.in: change --enable-test/--enable-ansi action-if-given
3015 to enable_foo=$enableval instead of enable_foo=yes
3017 2003-01-08 Havoc Pennington <hp@pobox.com>
3019 * dbus/dbus-string.c (_dbus_string_align_length): new function
3021 * dbus/dbus-test-main.c: move main() for test app here
3023 (dbus_internal_symbol_do_not_use_run_tests): we have to export a
3024 symbol to run tests, because dbus-test isn't in the main
3027 Code review nitpicks.
3029 * dbus/dbus-message.c (dbus_message_write_header): add newlines
3030 for people with narrow emacs ;-). Assert client_serial was filled
3031 in. Assert message->name != NULL.
3032 (dbus_message_append_fields): have "first_field_type" arg separate
3033 from va list, needed for C++ binding that also uses varargs IIRC
3034 and helps with type safety
3035 (dbus_message_new): add @todo about using DBusString to store
3036 service/name internally
3037 (dbus_message_new): don't leak ->service and ->name on OOM later
3039 (dbus_message_unref): free the service name
3040 (dbus_message_get_fields): same change to varargs
3041 i.e. first_field_type
3042 (_dbus_message_loader_return_buffer): assert that the message data
3043 is aligned (if not it's a bug in our code). Put in verbose griping
3044 about why we set corrupted = TRUE.
3045 (decode_header_data): add FIXME that char* is evil. Was going to
3046 add FIXME about evil locale-specific string.h strncmp, but just
3047 switched to wacky string-as-uint32 optimization. Move check for
3048 "no room for field name" above get_const_data_len() to avoid
3049 assertion failure in get_const_data_len if we have trailing 2
3050 bytes or the like. Check for service and name fields being
3051 provided twice. Don't leak service/name on error. Require field
3052 names to be aligned to 4 bytes.
3054 * dbus/dbus-marshal.c: move byte swap stuff to header
3055 (_dbus_pack_int32): uscore-prefix
3056 (_dbus_unpack_int32): uscore-prefix
3057 (_dbus_unpack_uint32): export
3058 (_dbus_demarshal_string): add @todo complaining about use of
3060 (_dbus_marshal_get_field_end_pos): add @todo about bad error
3061 handling allowing corrupt data to go unchecked
3063 2003-01-08 Havoc Pennington <hp@redhat.com>
3065 * dbus/dbus-transport-unix.c (unix_do_iteration): add read/write
3066 to the select() as needed for authentication. (should be using
3067 _dbus_poll() not select, but for another day)
3069 * dbus/dbus.h: include dbus/dbus-protocol.h
3071 2003-01-08 Anders Carlsson <andersca@codefactory.se>
3073 * dbus/Makefile.am (dbusinclude_HEADERS): Install
3076 2003-01-08 Anders Carlsson <andersca@codefactory.se>
3078 * dbus/dbus-internals.c: (_dbus_type_to_string):
3079 New function that returns a string describing a type.
3081 * dbus/dbus-marshal.c: (_dbus_demarshal_byte_array):
3082 * dbus/dbus-marshal.h:
3083 * dbus/dbus-message.c: (dbus_message_get_fields_valist),
3084 (dbus_message_iter_get_field_type), (dbus_message_iter_get_double),
3085 (dbus_message_iter_get_byte_array):
3086 * dbus/dbus-message.h:
3087 Add new convenience functions for appending and getting message fields.
3088 Also add demarshalling routines for byte arrays.
3090 2003-01-07 Anders Carlsson <andersca@codefactory.se>
3092 * dbus/dbus-connection-internal.h:
3093 * dbus/dbus-connection.c: (_dbus_connection_new_for_transport),
3094 (_dbus_connection_get_next_client_serial),
3095 (dbus_connection_send_message):
3096 * dbus/dbus-internals.h:
3097 * dbus/dbus-marshal.c: (unpack_uint32), (dbus_unpack_int32),
3098 (dbus_pack_int32), (_dbus_marshal_double), (_dbus_marshal_int32),
3099 (_dbus_marshal_uint32), (_dbus_demarshal_double),
3100 (_dbus_demarshal_int32), (_dbus_demarshal_uint32),
3101 (_dbus_demarshal_string), (_dbus_marshal_get_field_end_pos),
3102 (_dbus_verbose_bytes), (_dbus_marshal_test):
3103 * dbus/dbus-marshal.h:
3104 * dbus/dbus-message-internal.h:
3105 * dbus/dbus-message.c: (_dbus_message_set_client_serial),
3106 (dbus_message_write_header), (_dbus_message_lock),
3107 (dbus_message_new), (dbus_message_ref), (dbus_message_unref),
3108 (dbus_message_get_name), (dbus_message_append_int32),
3109 (dbus_message_append_uint32), (dbus_message_append_double),
3110 (dbus_message_append_string), (dbus_message_append_byte_array),
3111 (dbus_message_get_fields_iter), (dbus_message_iter_ref),
3112 (dbus_message_iter_unref), (dbus_message_iter_has_next),
3113 (dbus_message_iter_next), (dbus_message_iter_get_field_type),
3114 (dbus_message_iter_get_string), (dbus_message_iter_get_int32),
3115 (dbus_message_iter_get_uint32), (dbus_message_iter_get_double),
3116 (decode_header_data), (_dbus_message_loader_return_buffer),
3117 (message_iter_test), (_dbus_message_test):
3118 * dbus/dbus-message.h:
3119 * dbus/dbus-protocol.h:
3120 * dbus/dbus-test.c: (main):
3122 * glib/test-dbus-glib.c: (message_handler), (main):
3123 * test/echo-client.c: (main):
3124 * test/watch.c: (check_messages):
3125 Make messages sendable and receivable for real.
3127 2003-01-07 Anders Carlsson <andersca@codefactory.se>
3129 * dbus/dbus-marshal.c: (_dbus_marshal_double),
3130 (_dbus_marshal_string), (_dbus_marshal_byte_array):
3131 * dbus/dbus-message.c: (dbus_message_append_int32),
3132 (dbus_message_append_uint32), (dbus_message_append_double),
3133 (dbus_message_append_string), (dbus_message_append_byte_array):
3134 Handle OOM restoration.
3136 2003-01-07 Anders Carlsson <andersca@codefactory.se>
3138 * dbus/dbus-marshal.c: (_dbus_marshal_string),
3139 (_dbus_demarshal_string), (_dbus_marshal_test):
3140 * dbus/dbus-marshal.h:
3141 * dbus/dbus-message.c: (dbus_message_get_name),
3142 Document these functions.
3144 (dbus_message_append_int32), (dbus_message_append_uint32),
3145 (dbus_message_append_double), (dbus_message_append_string),
3146 (dbus_message_append_byte_array):
3147 * dbus/dbus-message.h:
3148 Add functions for adding message fields of different types.
3150 * dbus/dbus-protocol.h:
3151 Add the different types.
3153 2003-01-05 Havoc Pennington <hp@pobox.com>
3155 * bus/connection.c: implement routines for handling connections,
3156 first thing is keeping a list of owned services on each connection
3157 and setting up watches etc.
3159 * bus/services.c: implement a mapping from service names to lists
3162 * dbus/dbus-hash.c: add DBUS_HASH_POINTER
3164 * dbus/dbus-threads.c (dbus_static_mutex_lock): add functions
3165 to use static mutexes for global data
3167 * dbus/dbus-connection.c (dbus_connection_set_data): add new
3168 collection of functions to set/get application-specific data
3169 on the DBusConnection.
3171 2003-01-04 Havoc Pennington <hp@pobox.com>
3173 * dbus/dbus-sysdeps.c (_dbus_sleep_milliseconds): new function
3174 (_dbus_poll): new function
3176 * dbus/dbus-internals.h (_DBUS_STRUCT_OFFSET): new macro
3179 * bus/loop.c: initial code for the daemon main loop
3181 2003-01-04 Havoc Pennington <hp@pobox.com>
3183 * test/watch.c (error_handler): make it safe if the error handler
3184 is called multiple times (if we s/error handler/disconnect
3185 handler/ we should just guarantee it's called only once)
3187 * dbus/dbus-transport.c (_dbus_transport_disconnect): call the
3188 error handler on disconnect (it's quite possible we should
3189 just change the error handler to a "disconnect handler," I'm
3190 not sure we have any other meaningful errors)
3192 * configure.in: check for getpwnam_r
3194 * dbus/dbus-transport.c, dbus/dbus-transport-unix.c,
3195 dbus/dbus-auth.c: add credentials support, add EXTERNAL auth
3196 mechanism as in SASL spec, using socket credentials
3198 * dbus/dbus-sysdeps.c (_dbus_read_credentials_unix_socket): new function
3199 (_dbus_send_credentials_unix_socket): new function
3201 * dbus/dbus-sysdeps.c (_dbus_accept_unix_socket): rename just
3203 (_dbus_write): only check errno if <0 returned
3204 (_dbus_write_two): ditto
3206 2003-01-02 Anders Carlsson <andersca@codefactory.se>
3208 * dbus/dbus-marshal.c: (_dbus_marshal_utf8_string),
3209 (_dbus_marshal_byte_array), (_dbus_demarshal_utf8_string),
3210 (_dbus_marshal_test):
3211 * dbus/dbus-marshal.h:
3212 Add _dbus_marshal_byte_array and rename _dbus_marshal_string
3213 to _dbus_marshal_utf8_string. Also fix some tests.
3215 2002-12-28 Harri Porten <porten@kde.org>
3217 * configure.in: added check for C++ compiler and a very cheesy
3218 check for the Qt integration
3220 * Makefile.am (SUBDIRS): compile qt subdir if support is enabled
3222 * qt/Makefile.am: added
3224 * qt/.cvsignore: added
3226 * qt/dbus-qthread.cc, qt/dbus-qthread.cpp: renamed former to
3227 latter, added #ifdef QT_THREAD_SUPPORT guard.
3229 * dbus/Makefile.am: added missing headers for make dist
3231 2002-12-28 Kristian Rietveld <kris@gtk.org>
3233 * dbus/Makefile.am: fixup export-symbols-regex.
3235 2002-12-27 Anders Carlsson <andersca@codefactory.se>
3237 * acinclude.m4: Add this file and put the
3238 PKG_CHECK_MODULE macro in it.
3240 2002-12-27 Anders Carlsson <andersca@codefactory.se>
3242 * dbus/dbus-marshal.c: (_dbus_marshal_string),
3243 (_dbus_demarshal_double), (_dbus_demarshal_int32),
3244 (_dbus_demarshal_uint32), (_dbus_demarshal_string),
3245 (_dbus_marshal_test):
3246 Make the demarshalling routines align the pos argument.
3247 Add string marshalling tests and fix the obvious bugs
3250 2002-12-26 Havoc Pennington <hp@pobox.com>
3252 * dbus/dbus-auth.c: fixes fixes fixes
3254 * dbus/dbus-transport-unix.c: wire up support for
3255 encoding/decoding data on the wire
3257 * dbus/dbus-auth.c (_dbus_auth_encode_data)
3258 (_dbus_auth_decode_data): append to target string
3259 instead of nuking it.
3261 2002-12-26 Havoc Pennington <hp@pobox.com>
3263 * dbus/dbus-marshal.h (DBUS_COMPILER_BYTE_ORDER): #ifdef
3264 WORDS_BIGENDIAN then compiler byte order is DBUS_BIG_ENDIAN,
3267 * dbus/dbus-marshal.c: Add macros to do int swapping in-place and
3268 avoid swap_bytes() overhead (ignoring possible assembly stuff for
3269 now). Main point is because I wanted unpack_uint32 to implement
3271 (_dbus_verbose_bytes): new function
3273 * dbus/dbus-string.c (_dbus_string_validate_ascii): new function
3275 * dbus/dbus-message.c (_dbus_message_loader_get_is_corrupted): add
3276 mechanism to handle a corrupt message stream
3277 (_dbus_message_loader_new): fix preallocation to only prealloc,
3280 * dbus/dbus-string.c (_dbus_string_skip_blank): fix this function
3281 (_dbus_string_test): enhance tests for copy/move and fix the
3284 * dbus/dbus-transport-unix.c: Hold references in more places to
3285 avoid reentrancy problems
3287 * dbus/dbus-transport.c: ditto
3289 * dbus/dbus-connection.c (dbus_connection_dispatch_message): don't
3290 leak reference count in no-message case
3292 * test/watch.c (do_mainloop): handle adding/removing watches
3293 during iteration over the watches. Also, ref the connection/server
3294 stored on a watch, so we don't try to mangle a destroyed one.
3296 * dbus/dbus-transport-unix.c (do_authentication): perform
3299 * dbus/dbus-auth.c (get_state): add a state
3300 AUTHENTICATED_WITH_UNUSED_BYTES and return it if required
3301 (_dbus_auth_get_unused_bytes): append the unused bytes
3302 to the passed in string, rather than prepend
3304 * dbus/dbus-transport.c (_dbus_transport_init_base): create
3305 the auth conversation DBusAuth
3307 * dbus/dbus-transport-unix.c (_dbus_transport_new_for_fd)
3308 (_dbus_transport_new_for_domain_socket): when creating a
3309 transport, pass in whether it's a client-side or server-side
3310 transport so we know which DBusAuth to create
3312 2002-12-03 Havoc Pennington <hp@pobox.com>
3314 * dbus/dbus-transport-unix.c (unix_finalize): finalize base
3315 _after_ finalizing the derived members
3316 (unix_connection_set): unref watch if we fail to add it
3318 * dbus/dbus-connection.c (dbus_connection_unref): delete the
3319 transport first, so that the connection owned by the
3320 transport will be valid as the transport finalizes.
3322 * dbus/dbus-transport-unix.c (unix_finalize): free the write_watch
3323 if necessary, and remove watches from the connection.
3325 * dbus/dbus-watch.c (_dbus_watch_list_free): improve a comment
3327 2002-12-26 Anders Carlsson <andersca@codefactory.se>
3329 * dbus/dbus-marshal.c: (_dbus_marshal_string),
3330 (_dbus_demarshal_double), (_dbus_demarshal_int32),
3331 (_dbus_demarshal_uint32), (_dbus_demarshal_string),
3332 (_dbus_marshal_test):
3333 * dbus/dbus-marshal.h:
3334 Add string marshal functions and have the demarshal functions
3335 return the new position.
3337 2002-12-25 Havoc Pennington <hp@pobox.com>
3339 * doc/dbus-sasl-profile.txt: docs on the authentication protocol,
3340 it is a simple protocol that just maps directly to SASL.
3342 * dbus/dbus-auth.h, dbus/dbus-auth.c: authentication protocol
3343 initial implementation, not actually used yet.
3345 * dbus/dbus-string.c (_dbus_string_find): new function
3346 (_dbus_string_equal): new function
3347 (_dbus_string_base64_encode): new function
3348 (_dbus_string_base64_decode): new function
3350 2002-12-25 Anders Carlsson <andersca@codefactory.se>
3353 * dbus/dbus-marshal.c: (swap_bytes), (_dbus_marshal_double),
3354 (_dbus_marshal_int32), (_dbus_marshal_uint32),
3355 (_dbus_demarshal_double), (_dbus_demarshal_int32),
3356 (_dbus_demarshal_uint32), (_dbus_marshal_test):
3357 * dbus/dbus-marshal.h:
3358 * dbus/dbus-protocol.h:
3359 * dbus/dbus-test.c: (main):
3361 Add un-optimized marshalling/demarshalling routines.
3363 2002-12-25 Harri Porten <porten@kde.org>
3365 * qt/dbus-qt.h: adjusted ctor and getter to KDE/Qt conventions
3367 2002-12-24 Zack Rusin <zack@kde.org>
3369 * qt/dbus-qthread.cc: adding - integrates QMutex into Dbus
3370 * qt/dbus-qt.h: skeleton with two sample implemenatation of the
3373 2002-12-24 Havoc Pennington <hp@pobox.com>
3375 * glib/dbus-gthread.c: fix include
3377 * glib/dbus-glib.h: rename DBusMessageHandler for now.
3378 I think glib API needs to change, though, as you don't
3379 want to use DBusMessageFunction, you want to use the
3380 DBusMessageHandler object. Probably
3381 dbus_connection_open_with_g_main_loop()
3382 and dbus_connection_setup_g_main_loop() or something like that
3383 (but think of better names...) that just create a connection
3384 that has watch/timeout functions etc. already set up.
3386 * dbus/dbus-connection.c
3387 (dbus_connection_send_message_with_reply): new function just to
3388 show how the message handler helps us deal with replies.
3390 * dbus/dbus-list.c (_dbus_list_remove_last): new function
3392 * dbus/dbus-string.c (_dbus_string_test): free a string that
3395 * dbus/dbus-hash.c: use memory pools for the hash entries
3396 (rebuild_table): be more paranoid about overflow, and
3397 shrink table when we can
3398 (_dbus_hash_test): reduce number of sprintfs and write
3399 valid C89. Add tests for case where we grow and then
3400 shrink the hash table.
3402 * dbus/dbus-mempool.h, dbus/dbus-mempool.c: memory pools
3404 * dbus/dbus-connection.c (dbus_connection_register_handler)
3405 (dbus_connection_unregister_handler): new functions
3407 * dbus/dbus-message.c (dbus_message_get_name): new
3409 * dbus/dbus-list.c: fix docs typo
3411 * dbus/dbus-message-handler.h, dbus/dbus-message-handler.c:
3412 an object representing a handler for messages.
3414 2002-12-16 Anders Carlsson <andersca@codefactory.se>
3417 * glib/dbus-gthread.c: (dbus_gthread_init):
3418 Don't use the gdbus prefix for public functions.
3420 2002-12-16 Anders Carlsson <andersca@codefactory.se>
3424 Add GLib checks and fixup .pc files
3428 * glib/dbus-gmain.c: (gdbus_connection_prepare),
3429 (gdbus_connection_check), (gdbus_connection_dispatch),
3430 (gdbus_add_connection_watch), (gdbus_remove_connection_watch),
3431 (dbus_connection_gsource_new):
3432 * glib/dbus-gthread.c: (dbus_gmutex_new), (dbus_gmutex_free),
3433 (dbus_gmutex_lock), (dbus_gmutex_unlock), (dbus_gthread_init):
3434 * glib/test-dbus-glib.c: (message_handler), (main):
3437 2002-12-15 Harri Porten <porten@kde.org>
3439 * autogen.sh: check for libtoolize before attempting to use it
3441 * dbus/dbus-transport-unix.c: include <sys/time.h> for timeval
3444 * .cvsignore: ignore more stamp files
3446 * dbus/dbus-watch.c (_dbus_watch_list_new): fixed doc error
3448 * test/Makefile.am: added -I$(top_srcdir) to be able to compile
3449 without make install.
3451 2002-12-15 Havoc Pennington <hp@pobox.com>
3453 * dbus/dbus-threads.c: add thread stubs that a higher library
3454 layer can fill in. e.g. the GLib wrapper might fill them in with
3455 GThread stuff. We still need to use this thread API to
3456 thread-safe-ize the library.
3458 2002-12-12 Havoc Pennington <hp@pobox.com>
3460 * dbus/dbus-transport-unix.c, dbus/dbus-server-unix.c: use the
3461 below new interfaces and include fewer system headers.
3463 * dbus/dbus-sysdeps.c (_dbus_read): new function
3464 (_dbus_write): new function
3465 (_dbus_write_two): new function
3466 (_dbus_connect_unix_socket): new function
3467 (_dbus_listen_unix_socket): new function
3469 * dbus/dbus-message-internal.h: change interfaces to use
3472 2002-12-11 Havoc Pennington <hp@pobox.com>
3474 * dbus/dbus-types.h: add dbus_unichar
3476 * dbus/dbus-internals.c (_dbus_verbose): use _dbus_getenv
3478 * dbus/dbus-connection.c (dbus_connection_send_message): return
3481 * dbus/dbus-transport.c: include dbus-watch.h
3483 * dbus/dbus-connection.c: include dbus-message-internal.h
3485 * HACKING: add file with coding guidelines stuff.
3487 * dbus/dbus-string.h, dbus/dbus-string.c: Encapsulate all string
3488 handling here, for security purposes (as in vsftpd). Not actually
3489 using this class yet.
3491 * dbus/dbus-sysdeps.h, dbus/dbus-sysdeps.c: Encapsulate all
3492 system/libc usage here, as in vsftpd, for ease of auditing (and
3493 should also simplify portability). Haven't actually moved all the
3494 system/libc usage into here yet.
3496 2002-11-25 Havoc Pennington <hp@pobox.com>
3498 * dbus/dbus-internals.c (_dbus_verbose): fix to not
3499 always print the first verbose message.
3501 2002-11-24 Havoc Pennington <hp@pobox.com>
3503 * test/echo-client.c, test/echo-server.c: cheesy test
3506 * configure.in (AC_CHECK_FUNCS): check for writev
3508 * dbus/dbus-message.c (_dbus_message_get_network_data): new
3511 * dbus/dbus-list.c (_dbus_list_foreach): new function
3513 * dbus/dbus-internals.c (_dbus_verbose): new function
3515 * dbus/dbus-server.c, dbus/dbus-server.h: public object
3516 representing a server that listens for connections.
3518 * dbus/.cvsignore: create
3520 * dbus/dbus-errors.h, dbus/dbus-errors.c:
3521 public API for reporting errors
3523 * dbus/dbus-connection.h, dbus/dbus-connection.c:
3524 public object representing a connection that
3525 sends/receives messages. (Same object used for
3526 both client and server.)
3528 * dbus/dbus-transport.h, dbus/dbus-transport.c:
3529 Basic abstraction for different kinds of stream
3530 that we might read/write messages from.
3532 2002-11-23 Havoc Pennington <hp@pobox.com>
3534 * dbus/dbus-internals.h (_DBUS_INT_MAX): add _DBUS_INT_MIN
3537 * dbus/dbus-test.c (main): add list test, and include
3538 dbus-test.h as intended
3540 * dbus/dbus-hash.c (_dbus_hash_table_remove_string)
3541 (_dbus_hash_table_remove_int): return value indicates
3542 whether the entry existed to remove
3544 * dbus/dbus-list.c: add linked list utility class,
3547 * dbus/dbus-hash.c: add TODO item about shrinking the hash bucket
3550 2002-11-23 Havoc Pennington <hp@pobox.com>
3552 * Doxyfile.in (INCLUDE_FILE_PATTERNS): expand DBUS_BEGIN_DECLS/
3553 DBUS_END_DECLS to nothing, that should fix this once and for all
3555 * Doxyfile.in (JAVADOC_AUTOBRIEF): set to YES
3557 * dbus/dbus-message.c, dbus/dbus-hash.c:
3558 add some missing @brief
3560 2002-11-23 Havoc Pennington <hp@pobox.com>
3562 * dbus/dbus-message.h: put semicolons after DEBUG_BEGIN_DECLS
3563 to avoid confusing Doxygen
3565 * dbus/dbus-hash.c: @} not }@
3567 * dbus/dbus-message.c (struct DBusMessage): split out
3570 2002-11-23 Havoc Pennington <hp@pobox.com>
3572 * configure.in: pile on more warning flags if using gcc
3574 * Doxyfile.in (EXTRACT_STATIC): set to NO, so we don't have
3575 to document static functions
3577 * configure.in: add summary to end of configure so it
3578 looks nice and attractive
3580 * dbus/dbus-hash.c: finish implementation and write unit
3583 * configure.in: add --enable-tests to enable unit tests
3585 * dbus/dbus-test.c: test program to run unit tests
3586 for all files in dbus/*, initially runs a test for
3589 * dbus/dbus-internals.h: file to hold some internal utility stuff
3591 2002-11-22 Havoc Pennington <hp@redhat.com>
3593 * dbus/dbus-hash.c: copy in Tcl hash table, not yet
3594 "ported" away from Tcl
3596 * dbus/dbus-types.h: header for types such as dbus_bool_t
3598 2002-11-22 Havoc Pennington <hp@redhat.com>
3600 * dbus/dbus.h: fixups for doc warnings
3602 * Doxyfile.in (FILE_PATTERNS): we need to scan .h to pick up
3604 (QUIET): make it quiet so we can see warnings
3606 * dbus/dbus-memory.c: teach D-BUS to allocate and free memory
3608 2002-11-22 Havoc Pennington <hp@redhat.com>
3610 * Makefile.am: include "Doxyfile" target in all-local
3612 * configure.in: generate the Doxyfile
3614 * Doxyfile.in: move Doxyfile here, so we can use
3615 configure to generate a Doxyfile with the right
3618 2002-11-22 Havoc Pennington <hp@redhat.com>
3620 * dbus/dbus-message.c: move inline docs into .c file
3622 * Doxyfile (OUTPUT_DIRECTORY): move output to doc/api
3623 so all docs are under doc/
3624 (MAN_EXTENSION): generate man pages. Use extension
3625 ".3dbus" which matches ".3qt" on my system,
3626 I guess this is OK, I don't know really.
3627 (FILE_PATTERNS): look for .c files not .h, makes sense
3630 2002-11-22 Havoc Pennington <hp@pobox.com>
3632 * Makefile.am (SUBDIRS): rename subdir "server" to "bus"
3633 because any app can be a server, and any app can be a client,
3634 the bus is a special kind of server.
3636 Thu Nov 21 23:35:31 2002 Zack Rusin <zack@kde.org>
3638 * Doxyfile : adding. Still needs Makefile rules to be generated
3639 automatically (just run "doxygen" in the toplevel dir for now to
3642 * dbus/dbus-message.h : Adding sample docs (javadoc since
3643 resembles gtk-doc a little more)
3645 * dbus/dbus.h : Adding sample docs
3647 2002-11-21 Havoc Pennington <hp@redhat.com>
3649 * dbus/Makefile.am (INCLUDES): define DBUS_COMPILATION
3650 so we can allow ourselves to include files directly,
3651 instead of having to use dbus.h
3653 * dbus/dbus.h: fill in
3655 * dbus/dbus-message.h: sketch out a sample header file.
3656 Include griping if you include it directly instead of
3659 * dbus/dbus-macros.h: new file with macros for extern "C",
3660 TRUE/FALSE, NULL, etc.
3662 * doc/file-boilerplate.c: put include guards in here
3664 2002-11-21 Havoc Pennington <hp@redhat.com>
3666 * doc/file-boilerplate.c: include both AFL and GPL boilerplate.
3668 * COPYING: include the GPL as well, and license code
3669 under both AFL and GPL.
3671 2002-11-21 Havoc Pennington <hp@redhat.com>
3673 * acconfig.h: get rid of this
3675 * autogen.sh (run_configure): add --no-configure option
3677 * configure.in: remove AC_ARG_PROGRAM to make
3678 autoconf complain less. add AC_PREREQ.
3679 add AC_DEFINE third arg.
3681 2002-11-21 Anders Carlsson <andersca@codefactory.se>
3684 Fix references so we can distcheck.
3686 2002-11-21 Havoc Pennington <hp@redhat.com>
3688 * Initial module creation