1 2003-04-06 Havoc Pennington <hp@pobox.com>
3 * dbus/Makefile.am: split lists of sources into stuff that goes in
4 the library, util functions that go in the lib and are also used
5 elsewhere, and util functions that are used in tests/daemon but
8 * dbus/dbus-mainloop.h, dbus/dbus-mainloop.c: move bus/loop.[hc]
9 here so it can be used in test binaries also
11 2003-04-06 Havoc Pennington <hp@pobox.com>
13 * dbus/dbus-sysdeps.c (_dbus_become_daemon): write the pidfile
14 here in the parent process, so we can return an error if it
15 fails. Also, move some of the code into the child so the parent
16 is less hosed if we fail midway through.
18 * bus/bus.c (bus_context_new): move pidfile detection further up
19 in the function, before we start overwriting sockets and such.
21 * bus/messagebus.in: adjust this a bit, not sure if it will work.
23 * configure.in: add --with-system-pid-file and --with-system-socket
25 2003-04-06 Colin Walters <walters@verbum.org>
27 * configure.in (DBUS_SYSTEM_PID_FILE): New variable.
29 * bus/system.conf.in: Declare a pidfile.
31 * bus/bus.c (bus_context_new): Test for an existing pid file, and
32 create one (if appropriate).
34 * bus/config-parser.c (enum ElementType) [ELEMENT_PIDFILE]: New.
35 (struct BusConfigParser) [pidfile]: New.
36 (element_type_to_name, merge_included, start_busconfig_child)
37 (bus_config_parser_end_element, bus_config_parser_content): Handle it.
38 (bus_config_parser_unref): Free it.
39 (bus_config_parser_get_pidfile): New function.
41 * bus/config-parser.h (_dbus_write_pid_file): Prototype.
43 * dbus/dbus-errors.h (DBUS_ERROR_PIDFILE_EXISTS): New error.
45 * dbus/dbus-sysdeps.c (_dbus_write_pid_file): New function.
47 * dbus/dbus-sysdeps.h: Prototype it.
49 2003-04-06 Havoc Pennington <hp@pobox.com>
51 * bus/bus.c (bus_context_new): print the address in here, rather
52 than in main(), because we need to do it before forking the daemon
54 * bus/dispatch.c (send_service_nonexistent_error): set the sender
55 on the service nonexistent error
57 * bus/driver.c (bus_driver_handle_acquire_service): set the
58 sender on the AcquireService reply
60 * test/data/valid-config-files/debug-allow-all.conf.in: Make test
61 server also listen on a UNIX socket so services can connect to it.
63 2003-04-06 Havoc Pennington <hp@pobox.com>
65 * dbus/dbus-threads.c: Redo how the fake debug mutexes are done
66 so it detects deadlocks and also we actually init threads when
69 2003-04-06 Havoc Pennington <hp@pobox.com>
71 * dbus/dbus-server-unix.c (_dbus_server_new_for_domain_socket):
72 save the domain socket name, and unlink it when we disconnect the
73 server. Means that at least when we exit normally, we won't leave
74 a bunch of junk in /tmp
76 * dbus/dbus-transport-unix.c
77 (_dbus_transport_new_for_domain_socket): code cleanup (nicer
78 memory management). (I was making a real change here but then
81 2003-04-06 Havoc Pennington <hp@pobox.com>
83 * bus/bus.c (bus_context_new): fix wrong handling of
84 server_data_slot_unref() in the error case.
86 * dbus/dbus-internals.h (_dbus_assert): change so it passes
87 "(condition) != 0" to _dbus_real_assert so that
88 "_dbus_assert (pointer)" doesn't cause a warning
90 * bus/main.c (main): accept --print-address option to print out
91 the message bus address
93 * dbus/dbus-sysdeps.c (_dbus_generate_random_ascii): export this
95 * dbus/dbus-transport.c (_dbus_transport_open): special error for
96 "tmpdir" option to unix: address on client side
98 * dbus/dbus-server.c (dbus_server_listen): handle "tmpdir" option
101 * configure.in (TEST_SOCKET_DIR): locate a temporary directory
102 we can use to create sockets in the test suite.
104 * bus/main.c (signal_handler): on SIGTERM, exit the daemon
105 cleanly. To be used for testing.
107 * dbus/dbus-spawn.c (babysit): use _dbus_set_signal_handler()
109 * dbus/dbus-sysdeps.c (_dbus_set_signal_handler): new
111 * dbus/dbus-server-debug-pipe.c (_dbus_transport_debug_pipe_new):
112 handle trying to call this when there's no servers active
114 2003-04-05 Havoc Pennington <hp@pobox.com>
120 2003-04-05 Havoc Pennington <hp@pobox.com>
122 * bus/bus.c (setup_server): fix this so dbus-daemon-1 doesn't
123 crash on startup. Need to get "try starting the daemon"
124 in the test suite I guess. ;-)
126 * dbus/dbus-server.h, dbus/dbus-server.c: remove the stuff that
127 tracked the number of open connections; it's better done in
128 application-specific code as you want it to span all servers etc.
130 2003-04-05 Havoc Pennington <hp@pobox.com>
132 * bus/Makefile.am (install-data-hook): add missing DESTDIR,
133 patch from Colin Walters
135 2003-04-05 Havoc Pennington <hp@pobox.com>
137 * doc/config-file.txt (Elements): fix docs of <auth> to reflect
138 reality; in fact multiple mechanisms are allowed.
140 * dbus/dbus-internals.c (_dbus_real_assert)
141 (_dbus_real_assert_not_reached): move guts of _dbus_assert() and
142 _dbus_assert_not_reached() into functions, so that they don't show
143 up in basic block counts for test coverage, and don't use up as
144 much disk space. Does mean slower execution speed though, so
145 assumes --disable-asserts is the normal production case.
147 2003-04-05 Havoc Pennington <hp@pobox.com>
149 * test/Makefile.am (dist-hook): also dist *.in files
155 2003-04-05 Havoc Pennington <hp@pobox.com>
157 * dbus/dbus-string.c: docs warning
159 * dbus/dbus-spawn.c: missing docs
161 * dbus/dbus-memory.c (struct ShutdownClosure): missing docs
163 2003-04-05 Havoc Pennington <hp@pobox.com>
165 * bus/loop.c (bus_loop_iterate): fix the timeout code, using
168 * dbus/dbus-spawn.c (_dbus_babysitter_unref): set sitter_pid
169 to -1 once we've reaped the babysitter
170 (_dbus_babysitter_handle_watch): do as much work as we can, not
173 * bus/activation.c: add code using DBusBabysitter so that we
174 handle it when a service fails to start up properly.
175 (bus_activation_service_created): don't remove the activation
176 entries as we go, just let them get removed when we free the pending
177 activation. Unref reply messages after sending them.
179 2003-04-05 Havoc Pennington <hp@pobox.com>
181 * test/decode-gcov.c (main): print per-directory stats in the report
183 * Makefile.am (coverage-report.txt): don't include test/* in gcov stats
185 2003-04-05 Havoc Pennington <hp@pobox.com>
187 * Makefile.am (coverage-report.txt): add target "coverage-report.txt"
189 * test/decode-gcov.c: hack up a little program to suck data
190 out of gcov files. Yes this is sort of silly.
192 * configure.in: define something in config.h and do an
193 AM_CONDITIONAL when gcov is enabled
195 2003-04-04 Havoc Pennington <hp@redhat.com>
197 * dbus/dbus-spawn.c, dbus/dbus-spawn.h: Change dbus_spawn to
198 return a "babysitter" object that is used to monitor the status of
199 the spawned process and reap it when required.
201 * test/test-segfault.c, test/test-exit.c,
202 test/test-sleep-forever.c: binaries that do various lame things,
203 used in the test suite.
205 * dbus/dbus-sysdeps.c: kill _dbus_errno_to_string()
207 2003-04-03 Havoc Pennington <hp@pobox.com>
209 * dbus/dbus-spawn.c: Move dbus-spawn into a separate file
210 in preparation for modifying it, dbus-sysdeps is getting
213 2003-04-03 Havoc Pennington <hp@redhat.com>
215 * bus/loop.h, bus/loop.c: make the mainloop an object so we can
218 * bus/*.[hc]: adapt to mainloop change
220 2003-04-03 Havoc Pennington <hp@redhat.com>
222 * bus/activation.c (load_directory): fix up memleaks
223 (bus_activation_entry_free): free the entry
225 * dbus/dbus-bus.c (dbus_bus_acquire_service): return an error if
226 we get one from the message bus; fix memleaks.
228 * dbus/dbus-message.c (dbus_set_error_from_message): new function
230 2003-04-03 Havoc Pennington <hp@pobox.com>
232 * bus/config-parser.c (bus_config_parser_unref): free
233 list of mechanisms, bug discovered by test suite enhancements
234 (putting system.conf and session.conf into suite)
236 * test/Makefile.am, test/test-service.c: add placeholder for a
237 test service that we'll activate as part of test suite. Doesn't
240 * dbus/dbus-sysdeps.c (_dbus_setenv): support unsetenv by
241 setting NULL value, and use system malloc not dbus_malloc()
242 when we have unavoidable memleakage.
244 * dbus/dbus-bus.c (dbus_bus_get): fix bug where bus type of 0
245 didn't work, and support DBUS_BUS_ACTIVATION.
247 * bus/activation.c (child_setup): pass our well-known bus type to
250 * bus/config-parser.c: support <type> to specify well-known type
252 * doc/dbus-specification.sgml: document the env variables to
253 locate well-known buses and find service activator
255 2003-04-02 Havoc Pennington <hp@redhat.com>
257 * test/Makefile.am (all-local): add a rule to copy tests to
258 builddir, so we can have generated tests. Use this to remove the
259 silly hack for testing system.conf and session.conf. Will use this
260 shortly to generate .service files pointing to test binaries.
262 2003-04-02 Havoc Pennington <hp@redhat.com>
264 * dbus/dbus-string.c (set_length): fix a bug - we allocated max of
265 current alloc and needed new length, not max of the doubled
266 allocation and needed new length. Also, when building tests,
267 don't do the double-allocation stuff, just realloc every time.
269 2003-04-02 Havoc Pennington <hp@redhat.com>
271 * dbus/dbus-sysdeps.c (_dbus_file_get_contents): include filenames
273 (_dbus_string_get_dirname): new
274 (_dbus_sysdeps_test): new
275 (_dbus_directory_open): include dirnames in error messages
277 * bus/config-parser.c: interpret <include> and <includedir> and
278 <servicedir> relative to config file location if the given
279 filename is not absolute.
281 * dbus/dbus-string.c (_dbus_string_find_byte_backward): new
283 2003-04-02 Havoc Pennington <hp@redhat.com>
285 * bus/connection.c (bus_transaction_send_error_reply): set sender
286 service for the error, and unref the reply on success
288 * bus/activation.c: convert to use BusTransaction so OOM can be
290 (bus_activation_service_created): set sender of the message
292 2003-04-01 Havoc Pennington <hp@redhat.com>
294 * bus/config-parser.c, bus/bus.c: implement <servicedir> and
295 <includedir> (at least mostly)
297 * dbus/dbus-sysdeps.c (_dbus_change_identity): set the group ID
298 first, then the user ID
300 2003-04-01 Havoc Pennington <hp@pobox.com>
302 * dbus/dbus-server.c (dbus_server_set_auth_mechanisms): new
305 * dbus/dbus-auth.c (_dbus_auth_set_mechanisms): new
307 * dbus/dbus-internals.c (_dbus_dup_string_array): new function
309 * dbus/dbus-sysdeps.c (_dbus_listen_unix_socket): chmod the
310 socket 0777, and unlink any existing socket.
312 * bus/bus.c (bus_context_new): change our UID/GID and fork if
313 the configuration file so specifies; set up auth mechanism
316 * bus/config-parser.c (bus_config_parser_content): add support
317 for <fork> option and fill in code for <auth>
319 * bus/system.conf.in: add <fork/> to default configuration,
320 and limit auth mechanisms to EXTERNAL
322 * doc/config-file.txt (Elements): add <fork>
324 * dbus/dbus-sysdeps.c (_dbus_become_daemon): new function
325 (_dbus_change_identity): new function
327 2003-03-31 Havoc Pennington <hp@redhat.com>
329 * dbus/dbus-sysdeps.c (_dbus_connect_unix_socket)
330 (_dbus_listen_unix_socket): fix off-by-one error in null
331 termination spotted by Nalin
333 2003-03-31 Havoc Pennington <hp@redhat.com>
335 * dbus/dbus-keyring.c (_dbus_keyring_new_homedir): allow setting
336 DBUS_TEST_HOMEDIR when tests are enabled, so we can test without
337 having a real home directory available.
339 2003-03-31 Havoc Pennington <hp@redhat.com>
341 * bus/Makefile.am (install-data-hook): create /var/run/dbus
343 * bus/messagebus.in: add init script for Red Hat /etc/init.d
345 * configure.in: add support for specifying a style of init script
348 2003-03-31 Havoc Pennington <hp@redhat.com>
350 Fix some annoying DBusString API and fix all affected code.
352 * dbus/dbus-string.c (_dbus_string_init): get rid of annoying
354 (_dbus_string_get_data): change to return string instead of using
356 (_dbus_string_get_const_data): ditto
357 (_dbus_string_get_data_len): ditto
358 (_dbus_string_get_const_data_len): ditto
360 2003-03-31 Havoc Pennington <hp@redhat.com>
362 * bus/main.c (main): fix up the command line arguments to be nicer
364 2003-03-31 Havoc Pennington <hp@redhat.com>
366 * dbus/Makefile.am (INCLUDES): use EXPANDED_LOCALSTATEDIR to
367 define DBUS_SYSTEM_BUS_PATH as we want to compile in the same
368 final location that lands in the config file
370 * bus/config-loader-expat.c (bus_config_load): fix type of
373 * doc/TODO: remove TODO item for dbus_bus_get()
375 * dbus/dbus-bus.c (bus_data_free): add missing lock/unlock
377 2003-03-31 Havoc Pennington <hp@pobox.com>
379 * dbus/dbus-transport-unix.c (_dbus_transport_new_for_domain_socket)
380 (_dbus_transport_new_for_tcp_socket): these didn't need the "server"
381 argument since they are always client side
383 * dbus/dbus-server.c (dbus_server_get_address): new function
385 * bus/main.c (main): take the configuration file as an argument.
387 * test/data/valid-config-files/debug-allow-all.conf: new file to
388 use with dispatch.c tests for example
390 * bus/test-main.c (main): require test data dir
392 * bus/bus.c (bus_context_new): change this to take a
393 configuration file name as argument
395 * doc/config-file.txt (Elements): add <servicedir>
397 * bus/system.conf, bus/session.conf: new files
399 * dbus/dbus-bus.c (dbus_bus_get): look for system bus on
400 well-known socket if none set
402 * configure.in: create system.conf and session.conf
404 2003-03-30 Havoc Pennington <hp@pobox.com>
406 * bus/config-parser.c: hacking
408 * dbus/dbus-memory.c: don't use DBusList for the list of stuff
409 to shut down, since it could cause weirdness with the DBusList
412 * dbus/dbus-list.c (_dbus_list_test): add tests for the
413 link-oriented stack routines
414 (alloc_link): free the mempool if the first alloc from it fails
416 * dbus/dbus-mempool.c (struct DBusMemBlock): fix alignment issue
418 * dbus/dbus-string.c (UNICODE_VALID): sync new version of this
420 (_dbus_string_skip_white): new
422 * doc/config-file.txt (Elements): add <includedir>
424 2003-03-28 Havoc Pennington <hp@pobox.com>
426 * dbus/dbus-string.c (_dbus_string_copy_data_len)
427 (_dbus_string_copy_data): new functions
429 2003-03-28 Anders Carlsson <andersca@codefactory.se>
431 * dbus/dbus-bus.c: (bus_data_free), (dbus_bus_get):
435 * dbus/dbus-memory.c:
438 2003-03-28 Havoc Pennington <hp@pobox.com>
440 * bus/test.c (bus_test_flush_bus): remove the sleep from here,
441 I think it may have just been superstition. Not sure.
443 * dbus/dbus-string.c (_dbus_string_base64_decode): catch some OOM
444 failures that were not being handled.
446 * dbus/dbus-auth.c (process_auth): fix a memleak in OOM handling
448 * dbus/dbus-memory.c: add ability to set number of mallocs in a
449 row that will fail on out-of-memory.
451 * dbus/dbus-internals.c (_dbus_test_oom_handling): convenience
452 function for testing out-of-memory handling.
454 * bus/config-loader-expat.c (memsuite): don't wrap the dbus
455 allocation functions, they do map exactly to the expat ones.
457 2003-03-27 Havoc Pennington <hp@redhat.com>
459 * bus/config-loader-libxml.c (bus_config_load): add another error
462 2003-03-26 Anders Carlsson <andersca@codefactory.se>
465 Add note about automatic service activation.
467 * doc/dbus-specification.sgml:
468 Rename the specification and clarify a few things.
470 2003-03-26 Anders Carlsson <andersca@codefactory.se>
473 * dbus/dbus-address.c:
475 * dbus/dbus-marshal.c:
476 * dbus/dbus-server-debug-pipe.c:
477 * dbus/dbus-transport-unix.c:
478 Fix documentation warnings.
480 2003-03-26 Havoc Pennington <hp@pobox.com>
482 * bus/test-main.c, dbus/dbus-test.c (main): check memleaks
483 after every test so it's quick and easy to see which leaked, and
484 so we test multiple dbus_shutdown() calls
486 * configure.in: change configure.in XML stuff to also support
489 * config-loader-libxml.c: some hacking
491 * config-loader-expat.c: some hacking
493 * config-parser.c: some hacking, plus tests
495 2003-03-25 Havoc Pennington <hp@redhat.com>
497 * throughout - add more _DBUS_ASSERT_ERROR_IS_CLEAR
499 * configure.in: add --with-xml option to specify XML library,
500 right now only libxml is supported.
502 * bus/config-loader-libxml.c, config-parser.c: sync some minor
503 nonworking code between home and work, still just stubs
505 2003-03-24 Havoc Pennington <hp@redhat.com>
507 * dbus/dbus-sysdeps.c (_dbus_set_fd_nonblocking): move to this
510 * dbus/dbus-errors.c (dbus_set_error, dbus_set_error_const): allow
511 NULL argument for "message" if the error is a well-known one,
512 fill in a generic message in this case.
514 * dbus/dbus-errors.h (DBusResultCode): Kill DBusResultCode in
517 * bus/test.c (bus_test_flush_bus): add
519 * bus/policy.c (bus_policy_test): test code stub
521 2003-03-24 Havoc Pennington <hp@pobox.com>
523 * bus/connection.c (bus_connections_setup_connection): set up
524 the "can this user connect" function, but it always returns
525 TRUE until we have a config file parser so we can have a config
526 file that allows connections.
528 2003-03-23 Havoc Pennington <hp@pobox.com>
530 * dbus/dbus-threads.c (dbus_mutex_new, dbus_condvar_new): with
531 DBUS_BUILD_TESTS, actually alloc/free a block of memory for
532 the mutex, so we can check for proper memory management
535 * dbus/dbus-dataslot.c: remove the mutex from
536 DBusDataSlotAllocator and lock it manually when using it,
537 to simplify fitting it into the global slots framework.
539 * dbus/dbus-threads.c (init_static_locks): rework how we're
540 handling global locks so they are easily shut down.
542 * bus/policy.c (bus_policy_append_rule): fix
544 * bus/test-main.c (main): check for memleaks
546 * dbus/dbus-test.c (dbus_internal_do_not_use_run_tests): make
547 test suite check for memleaks
549 * dbus/dbus-memory.c: add support in test mode for tracking
550 number of outstanding blocks
552 2003-03-23 Havoc Pennington <hp@pobox.com>
554 * bus/policy.c, bus/bus.c, bus/connection.c: implement allow/deny
557 * dbus/dbus-hash.h: add ULONG hash keys
559 * dbus/dbus-sysdeps.c (_dbus_get_groups): new
560 (_dbus_get_group_id): new function
562 2003-03-20 Havoc Pennington <hp@redhat.com>
564 * dbus/dbus-connection.c (dbus_connection_set_unix_user_function):
566 (dbus_connection_get_unix_user): new function
568 2003-03-20 Havoc Pennington <hp@pobox.com>
570 * bus/connection.c (bus_connection_send_oom_error): assert that
572 (connection_execute_transaction): ditto
573 (bus_connection_preallocate_oom_error): fix to set the sender, and
574 set recipient to the destination service, not the bus driver
576 * bus/policy.c: hacking
578 * dbus/dbus-message.c (dbus_message_service_is): new function
579 (dbus_message_sender_is): new
581 2003-03-19 Havoc Pennington <hp@redhat.com>
583 * bus/policy.c: start sketching code for policy restrictions on
584 what connections can do.
586 2003-03-18 Havoc Pennington <hp@redhat.com>
588 * doc/TODO: some notes on high-level todo items. Little nitpick
589 stuff is all in @todo, so no need to add it here.
591 * doc/config-file.txt: some notes on how config file might look
593 2003-03-18 Anders Carlsson <andersca@codefactory.se>
599 2003-03-17 Havoc Pennington <hp@redhat.com>
601 * dbus/dbus-internals.h: add gcc attributes so that
602 our printf-style functions warn on bad arguments to
605 * dbus/dbus-sysdeps.c (_dbus_connect_tcp_socket): fix printf
608 * dbus/dbus-message.c (_dbus_message_loader_queue_messages): fix
611 2003-03-17 Havoc Pennington <hp@redhat.com>
613 * bus/test-main.c (main): make it print something as it runs
614 so make check doesn't look stuck
616 * doc/negotiation.txt, doc/dbus-sasl-profile.txt: remove
617 from CVS, now obsolete
619 2003-03-17 Anders Carlsson <andersca@codefactory.se>
621 * bus/dispatch.c: (bus_dispatch):
622 Refetch the service name since it may have been reallocated
623 when dbus_message_set_sender was called.
625 * dbus/dbus-sysdeps.c: (_dbus_accept):
626 Add address and address length variables and use them to stop
627 valgrind from complaining.
629 2003-03-17 Havoc Pennington <hp@pobox.com>
631 All tests pass, no memleaks, no valgrind complaints.
633 * bus/test.c: refcount handler_slot
635 * bus/connection.c (bus_connections_new): refcount
638 * dbus/dbus-auth-script.c (_dbus_auth_script_run): delete unused
639 bytes so that auth scripts pass.
641 * bus/dispatch.c: init message_handler_slot so it gets allocated
644 * bus/dispatch.c (message_handler_slot_ref): fix memleak
646 * dbus/dbus-server-debug-pipe.c (_dbus_server_debug_pipe_new):
647 dealloc server_pipe_hash when no longer used for benefit of
650 * dbus/dbus-auth.c (process_command): memleak fix
652 * bus/dispatch.c (check_hello_message): memleak fix
654 2003-03-16 Havoc Pennington <hp@pobox.com>
656 * dbus/dbus-bus.c (ensure_bus_data): fix double-unref of the data slot
658 2003-03-17 Anders Carlsson <andersca@codefactory.se>
660 * bus/activation.c (bus_activation_activate_service): Append
661 the pending activation entry to the list of pending activations.
663 2003-03-16 Havoc Pennington <hp@pobox.com>
665 * bus/dispatch.c (bus_dispatch_test): remove double-unrefs of
668 * dbus/dbus-address.c (create_entry): fix OOM handling when
669 failing to alloc entry->method
671 2003-03-16 Havoc Pennington <hp@pobox.com>
673 * dbus/dbus-watch.c (_dbus_watch_new): handle failure to malloc
676 * dbus/dbus-server-debug-pipe.c (_dbus_transport_debug_pipe_new):
677 add some missing dbus_set_result
679 * bus/dispatch.c (bus_dispatch_add_connection): handle failure to
680 alloc the DBusMessageHandler
682 * dbus/dbus-transport.c (_dbus_transport_disconnect): don't ref
683 the transport here, since we call this from the finalizer; it
684 resulted in a double-finalize.
686 * dbus/dbus-transport.c (_dbus_transport_disconnect): fix a bug
687 where we tried to use transport->connection that was NULL,
688 happened when transport was disconnected early on due to OOM
690 * bus/*.c: adapt to handle OOM for watches/timeouts
692 * dbus/dbus-transport-unix.c: port to handle OOM during
695 * dbus/dbus-auth.c (_dbus_auth_get_unused_bytes): return a
696 reference to unused bytes instead of a copy
698 * dbus/dbus-server.c (dbus_server_handle_watch): return FALSE for
701 * dbus/dbus-connection.c (dbus_connection_handle_watch): return
704 * dbus/dbus-timeout.c (dbus_timeout_handle): return FALSE for out
707 2003-03-16 Anders Carlsson <andersca@codefactory.se>
709 * doc/dbus-specification.sgml:
710 Document reply message for ActivateService.
712 2003-03-16 Anders Carlsson <andersca@codefactory.se>
714 * bus/activation.c: (bus_pending_activation_entry_free),
715 (bus_pending_activation_free), (bus_activation_new),
716 (bus_activation_unref), (bus_activation_service_created),
717 (bus_activation_activate_service):
719 * bus/bus.c: (bus_context_new):
720 * bus/desktop-file.c: (new_section):
721 * bus/driver.c: (bus_driver_send_service_deleted),
722 (bus_driver_handle_activate_service):
723 * bus/services.c: (bus_registry_new), (bus_registry_ensure):
725 * dbus/dbus-connection.c:
726 (dbus_connection_send_with_reply_and_block):
727 * dbus/dbus-message.c: (dbus_message_append_args_valist):
728 * dbus/dbus-protocol.h:
729 Make activation work better. Now pending activations will be queued
730 and the daemon won't try to activate services that are already registered.
732 2003-03-16 Havoc Pennington <hp@pobox.com>
734 * dbus/dbus-bus.c (ensure_bus_data): handle failure to set
737 * dbus/dbus-memory.c (_dbus_initialize_malloc_debug): support
738 DBUS_MALLOC_BACKTRACES to print trace when failing an alloc
740 2003-03-16 Havoc Pennington <hp@pobox.com>
742 * dbus/dbus-string.c (_dbus_string_validate_utf8): oops, unbreak
743 this. always run the test suite before commit...
745 * bus/*: adapt to DBusConnection API changes
747 * glib/dbus-gmain.c: adapt to DBusConnection API changes,
748 requires renaming stuff to avoid dbus_connection_dispatch name
751 * dbus/dbus-transport.c (_dbus_transport_queue_messages): new
754 * dbus/dbus-message.c (_dbus_message_loader_queue_messages):
755 separate from _dbus_message_loader_return_buffer()
757 * dbus/dbus-connection.c (dbus_connection_get_n_messages): remove
758 this, because it's now always broken to use; the number of
759 messages in queue vs. the number still buffered by the message
760 loader is undefined/meaningless. Should use
761 dbus_connection_get_dispatch_state().
762 (dbus_connection_dispatch): rename from
763 dbus_connection_dispatch_message
765 2003-03-16 Havoc Pennington <hp@pobox.com>
767 * dbus/dbus-string.c (_dbus_string_validate_utf8): copy in a real
770 2003-03-16 Anders Carlsson <andersca@codefactory.se>
772 * dbus/dbus-connection.c:
773 (dbus_connection_send_with_reply_and_block):
774 Decrease connection->n_incoming when removing an entry
776 * dbus/dbus-dict.c: (dbus_dict_entry_free),
777 (dbus_dict_set_boolean_array), (dbus_dict_set_int32_array),
778 (dbus_dict_set_uint32_array), (dbus_dict_set_double_array),
779 (dbus_dict_set_byte_array), (dbus_dict_set_string_array),
780 (dbus_dict_get_boolean_array), (dbus_dict_get_double_array),
781 (dbus_dict_get_byte_array):
782 Handle NULL arrays and strings. Also add support for byte arrays.
784 * dbus/dbus-marshal.c: (_dbus_marshal_byte_array),
785 (_dbus_marshal_dict), (_dbus_demarshal_byte_array),
786 (_dbus_demarshal_int32_array), (_dbus_demarshal_uint32_array),
787 (_dbus_demarshal_double_array), (_dbus_demarshal_string_array),
788 (_dbus_demarshal_dict), (demarshal_and_validate_len),
789 (_dbus_marshal_validate_arg), (_dbus_marshal_test):
790 * dbus/dbus-marshal.h:
791 Add support for marshalling and demarshalling empty arrays and strings.
793 * dbus/dbus-message.c: (dbus_message_append_args_valist),
794 (dbus_message_append_string_array),
795 (dbus_message_iter_get_boolean),
796 (dbus_message_iter_get_boolean_array),
797 (dbus_message_iter_get_int32_array),
798 (dbus_message_iter_get_uint32_array),
799 (dbus_message_iter_get_double_array),
800 (dbus_message_iter_get_byte_array),
801 (dbus_message_iter_get_string_array), (dbus_message_iter_get_dict),
802 (check_message_handling):
803 Add support for getting empty arrays and dicts.
805 * dbus/dbus-string.c: (_dbus_string_validate_utf8):
806 Don't do any validation at all for now, that's better than just checking
809 * test/data/valid-messages/emptiness.message:
810 New test message with lots of empty arrays.
812 2003-03-16 Havoc Pennington <hp@pobox.com>
814 * dbus/dbus-connection.c
815 (_dbus_connection_queue_received_message_link): new function that
816 can't fail due to OOM
818 * dbus/dbus-message.c (_dbus_message_loader_pop_message_link):
819 new function pops a message together with a list link
822 * dbus/dbus-transport-unix.c (queue_messages): use new link-based
823 message queuing functions to avoid needing to alloc memory
825 2003-03-16 Havoc Pennington <hp@pobox.com>
827 Oops - test code was only testing failure of around 30 of the
828 mallocs in the test path, but it turns out there are 500+
829 mallocs. I believe this was due to misguided linking setup such
830 that there was one copy of dbus_malloc etc. in the daemon and one
831 in the shared lib, and only daemon mallocs were tested. In any
832 case, the test case now tests all 500+ mallocs, and doesn't pass
833 yet, though there are lots of fixes in this patch.
835 * dbus/dbus-connection.c (dbus_connection_dispatch_message): fix
836 this so that it doesn't need to allocate memory, since it
837 has no way of indicating failure due to OOM (and would be
840 * dbus/dbus-list.c (_dbus_list_pop_first_link): new function
842 * bus/Makefile.am: rearrange to create two self-contained
843 libraries, to avoid having libraries with overlapping symbols.
844 that was resulting in weirdness, e.g. I'm pretty sure there
845 were two copies of global static variables.
847 * dbus/dbus-internals.c: move the malloc debug stuff to
850 * dbus/dbus-list.c (free_link): free list mempool if it becomes
853 * dbus/dbus-memory.c (_dbus_disable_mem_pools): new function
855 * dbus/dbus-address.c (dbus_parse_address): free list nodes
858 * bus/dispatch.c (bus_dispatch_add_connection): free
859 message_handler_slot when no longer using it, so
860 memory leak checkers are happy for the test suite.
862 * dbus/dbus-server-debug-pipe.c (debug_finalize): free server name
864 * bus/bus.c (new_connection_callback): disconnect in here if
865 bus_connections_setup_connection fails.
867 * bus/connection.c (bus_connections_unref): fix to free the
869 (bus_connections_setup_connection): if this fails, don't
870 disconnect the connection, just be sure there are no side
873 * dbus/dbus-string.c (undo_alignment): unbreak this
875 * dbus/dbus-auth.c (_dbus_auth_unref): free some stuff we were
877 (_dbus_auth_new): fix the order in which we free strings
880 * bus/connection.c (bus_connection_disconnected): fix to
881 not send ServiceDeleted multiple times in case of memory
884 * dbus/dbus-bus.c (dbus_bus_get_base_service): new function to
885 get the base service name
886 (dbus_bus_register_client): don't return base service name,
887 instead store it on the DBusConnection and have an accessor
889 (dbus_bus_register_client): rename dbus_bus_register()
891 * bus/dispatch.c (check_hello_message): verify that other
892 connections on the bus also got the correct results, not
893 just the one sending hello
895 2003-03-15 Havoc Pennington <hp@pobox.com>
897 Make it pass the Hello handling test including all OOM codepaths.
898 Now to do other messages...
900 * bus/services.c (bus_service_remove_owner): fix crash when
901 removing owner from an empty list of owners
902 (bus_registry_ensure): don't leave service in the list of
903 a connection's owned services if we fail to put the service
906 * bus/connection.c (bus_connection_preallocate_oom_error): set
907 error flag on the OOM error.
909 * dbus/dbus-connection.c (_dbus_connection_new_for_transport):
910 handle _dbus_transport_set_connection failure
912 * dbus/dbus-transport-unix.c (_dbus_transport_new_for_fd): modify
913 to create watches up front and simply enable/disable them as
915 (unix_connection_set): this can now fail on OOM
917 * dbus/dbus-timeout.c, dbus/dbus-watch.c: add concept
918 of enabling/disabling a watch or timeout.
920 * bus/loop.c (bus_loop_iterate): don't touch disabled
923 * glib/dbus-gmain.c: adapt to enable/disable watches and timeouts
925 2003-03-15 Havoc Pennington <hp@pobox.com>
927 * bus/dispatch.c (bus_dispatch_test): OK, now finally actually
928 write useful test code, after all that futzing around ;-)
930 Test does not yet pass because we can't handle OOM in
931 _dbus_transport_messages_pending (basically,
932 dbus_connection_preallocate_send() does not prealloc the write
933 watch). To fix this, I think we need to add new stuff to
934 set_watch_functions, namely a SetEnabled function so we can alloc
935 the watch earlier, then enable it later.
937 * dbus/Makefile.am (libdbus_convenience_la_SOURCES): move
938 dbus-memory.c to the convenience lib
940 * bus/test.c: rename some static functions to keep them clearly
941 distinct from stuff in connection.c. Handle client disconnection.
943 2003-03-14 Havoc Pennington <hp@pobox.com>
945 * bus/dispatch.c (bus_dispatch_test): do test using debug-pipe
946 transport, tests more of the real codepath. Set up clients
947 with bus_setup_debug_client.
949 * bus/test.c (bus_setup_debug_client): function to set up debug
950 "clients" on the main loop
952 * dbus/dbus-transport.c (_dbus_transport_open): add debug-pipe
955 * dbus/dbus-server.c (dbus_server_listen): add debug-pipe
958 * dbus/dbus-server-debug.c: support a debug server based on pipes
960 * dbus/dbus-sysdeps.c (_dbus_full_duplex_pipe): new function
961 (_dbus_close): new function
963 * configure.in: check for socketpair
965 2003-03-14 Havoc Pennington <hp@redhat.com>
967 * dbus/dbus-memory.c: add a "detect buffer overwrites on free"
970 * dbus/dbus-transport-debug.c: rework this a good bit to be
971 less complicated. hopefully still works.
973 * dbus/dbus-server-debug.c (handle_new_client): remove timeout
976 * glib/dbus-gmain.c (timeout_handler): don't remove timeout
979 * dbus/dbus-message.c (dbus_message_copy): rename from
980 dbus_message_new_from_message, fix it up to copy
981 all the message fields, add test case
983 * bus/dispatch.c (bus_dispatch_test): add some more test code,
984 not quite passing yet
986 2003-03-14 Havoc Pennington <hp@pobox.com>
988 * bus/loop.c (bus_loop_iterate): add this so we can "run loop
989 until no work remains" in test code. (the large diff here
990 is just code movement, no actual changes)
992 * dbus/dbus-server-debug.c (DEFAULT_INTERVAL): change interval to
993 1, no point waiting around for test code.
994 (_dbus_server_debug_accept_transport): unref the timeout
995 after adding it (right?)
997 * dbus/dbus-transport-debug.c (DEFAULT_INTERVAL): ditto
999 2003-03-13 Havoc Pennington <hp@redhat.com>
1001 * dbus/dbus-timeout.c (_dbus_timeout_list_set_functions): handle
1004 * dbus/dbus-watch.c (_dbus_watch_list_set_functions): handle out
1007 * dbus/dbus-connection.h: Make AddWatchFunction and
1008 AddTimeoutFunction return a bool so they can fail on out-of-memory
1010 * bus/bus.c (bus_context_new): set up timeout handlers
1012 * bus/connection.c (bus_connections_setup_connection): set up
1015 * glib/dbus-gmain.c: adapt to the fact that set_functions stuff
1018 * bus/bus.c (bus_context_new): adapt to changes
1020 * bus/connection.c: adapt to changes
1022 * test/watch.c: adapt to DBusWatch changes
1024 * bus/dispatch.c (bus_dispatch_test): started adding this but
1027 2003-03-14 Anders Carlsson <andersca@codefactory.se>
1029 * bus/dispatch.c (send_service_nonexistent_error): Fix typo.
1031 2003-03-13 Havoc Pennington <hp@pobox.com>
1033 * bus/test.c, bus/test.h, bus/Makefile.am, bus/test-main.c:
1034 set up a test framework as for the library
1036 2003-03-12 Havoc Pennington <hp@pobox.com>
1038 Throughout: purge global variables, introduce BusActivation,
1039 BusConnections, BusRegistry, etc. objects instead.
1041 * bus/bus.h, bus/bus.c: introduce BusContext as a global
1044 * test/Makefile.am (TEST_BINARIES): disable bus-test for now,
1045 going to redo this a bit differently I think
1047 2003-03-12 Havoc Pennington <hp@redhat.com>
1049 Mega-patch that gets the message bus daemon initially handling
1050 out-of-memory. Work still needed. Also lots of random
1051 moving stuff to DBusError instead of ResultCode.
1053 * dbus/dbus-list.c (_dbus_list_length_is_one): new function
1055 * dbus/dbus-connection.c
1056 (dbus_connection_send_with_reply_and_block): use DBusError
1058 * dbus/dbus-bus.c: adapt to API changes, make it use DBusError not
1061 * dbus/dbus-connection.c (dbus_connection_send): drop the result
1062 code here, as the only failure possible is OOM.
1064 * bus/connection.c (bus_connection_disconnect):
1065 rename bus_connection_disconnected as it's a notification only
1067 * bus/driver.c (bus_driver_handle_acquire_service): don't free
1068 "name" on get_args failure, should be done by get_args;
1069 don't disconnect client for bad args, just return an error.
1070 (bus_driver_handle_service_exists): ditto
1072 * bus/services.c (bus_services_list): NULL-terminate returned array
1074 * bus/driver.c (bus_driver_send_service_lost)
1075 (bus_driver_send_service_acquired): send messages from driver to a
1076 specific client to the client's unique name, not to the broadcast
1079 * dbus/dbus-message.c (decode_header_data): reject messages that
1080 contain no name field
1081 (_dbus_message_get_client_serial): rename to
1082 dbus_message_get_serial and make public
1083 (_dbus_message_set_serial): rename from set_client_serial
1084 (_dbus_message_set_reply_serial): make public
1085 (_dbus_message_get_reply_serial): make public
1087 * bus/connection.c (bus_connection_foreach): allow stopping
1088 iteration by returning FALSE from foreach function.
1090 * dbus/dbus-connection.c (dbus_connection_send_preallocated)
1091 (dbus_connection_free_preallocated_send)
1092 (dbus_connection_preallocate_send): new API for sending a message
1093 without possibility of malloc failure.
1094 (dbus_connection_send_message): rename to just
1095 dbus_connection_send (and same for whole function family)
1097 * dbus/dbus-errors.c (dbus_error_free): make this reinit the error
1099 * dbus/dbus-sysdeps.c (_dbus_exit): new function
1101 * bus/activation.c: handle/return errors
1103 * dbus/dbus-errors.h: add more DBUS_ERROR #define
1105 * dbus/dbus-sysdeps.c (_dbus_directory_open) (_dbus_file_get_contents)
1106 (_dbus_directory_get_next_file): use DBusError instead of DBusResultCode
1107 (_dbus_result_from_errno): move to this file
1109 2003-03-10 Anders Carlsson <andersca@codefactory.se>
1111 * dbus/dbus-marshal.c:
1112 (_dbus_marshal_set_string):
1113 Take a length argument so we can marshal the correct string
1116 (_dbus_marshal_dict), (_dbus_demarshal_dict),
1117 (_dbus_marshal_get_arg_end_pos), (_dbus_marshal_validate_arg),
1118 (_dbus_marshal_test):
1119 * dbus/dbus-marshal.h:
1120 Add support for marshalling and demarshalling dicts.
1122 * dbus/dbus-message-builder.c: (_dbus_message_data_load):
1123 Add support for TYPE DICT.
1125 * dbus/dbus-message.c: (set_string_field):
1126 Adjust header padding.
1128 (dbus_message_append_args_valist), (dbus_message_append_dict),
1129 (dbus_message_get_args_valist), (dbus_message_iter_get_arg_type),
1130 (dbus_message_iter_get_dict), (_dbus_message_loader_return_buffer),
1131 (check_message_handling), (check_have_valid_message):
1132 * dbus/dbus-message.h:
1133 Add functions for setting and getting dicts.
1135 * dbus/dbus-protocol.h:
1141 * doc/dbus-specification.sgml:
1142 Add information about how dicts are marshalled.
1144 * test/data/invalid-messages/dict-with-nil-value.message:
1145 * test/data/invalid-messages/too-short-dict.message:
1146 * test/data/valid-messages/dict-simple.message:
1147 * test/data/valid-messages/dict.message:
1148 Add sample messages containing dicts.
1150 2003-03-08 Anders Carlsson <andersca@codefactory.se>
1152 * dbus/dbus-dict.h: Add DBUS_END_DECLS.
1154 2003-03-07 Anders Carlsson <andersca@codefactory.se>
1157 * dbus/dbus-dict.c: (dbus_dict_entry_free), (dbus_dict_new),
1158 (dbus_dict_get_keys), (insert_entry), (dbus_dict_set_boolean),
1159 (dbus_dict_set_int32), (dbus_dict_set_uint32),
1160 (dbus_dict_set_double), (dbus_dict_set_string),
1161 (dbus_dict_set_boolean_array), (dbus_dict_set_int32_array),
1162 (dbus_dict_set_uint32_array), (dbus_dict_set_double_array),
1163 (dbus_dict_set_string_array), (_dbus_dict_test):
1165 Fix according to comments from Havoc.
1167 2003-03-06 Michael Meeks <michael@server.home>
1169 * configure.in: if we don't have kde-config, disable have_qt.
1171 2003-03-07 Anders Carlsson <andersca@codefactory.se>
1176 * dbus/dbus-dict.c: (dbus_dict_entry_free), (dbus_dict_new),
1177 (dbus_dict_ref), (dbus_dict_unref), (dbus_dict_contains),
1178 (dbus_dict_remove), (dbus_dict_get_value_type),
1179 (dbus_dict_get_keys), (dbus_dict_put_boolean),
1180 (dbus_dict_put_int32), (dbus_dict_put_uint32),
1181 (dbus_dict_put_double), (dbus_dict_put_string),
1182 (dbus_dict_put_boolean_array), (dbus_dict_put_int32_array),
1183 (dbus_dict_put_uint32_array), (dbus_dict_put_double_array),
1184 (dbus_dict_put_string_array), (dbus_dict_get_boolean),
1185 (dbus_dict_get_int32), (dbus_dict_get_uint32),
1186 (dbus_dict_get_double), (dbus_dict_get_string),
1187 (dbus_dict_get_boolean_array), (dbus_dict_get_int32_array),
1188 (dbus_dict_get_uint32_array), (dbus_dict_get_double_array),
1189 (dbus_dict_get_string_array), (_dbus_dict_test):
1191 Add DBusDict implementation
1193 * dbus/dbus-test.c: (dbus_internal_do_not_use_run_tests):
1197 2003-03-04 Havoc Pennington <hp@pobox.com>
1199 * test/data/auth/*: adapt to changes
1201 * dbus/dbus-auth-script.c (_dbus_auth_script_run): add
1202 USERID_BASE64 and change USERNAME_BASE64 to put in username not
1205 * dbus/dbus-keyring.c (_dbus_keyring_validate_context): prevent
1206 more stuff from being in a context name, to make the protocol
1207 simpler to deal with
1209 * dbus/dbus-errors.c (dbus_error_has_name): new function
1210 (dbus_error_is_set): new function
1212 * dbus/dbus-auth.c: replace DBUS_STUPID_TEST_MECH auth
1213 with DBUS_COOKIE_SHA1, implement DBUS_COOKIE_SHA1
1215 * dbus/dbus-connection.c (dbus_connection_flush): also read
1216 messages during a flush operation
1218 * dbus/Makefile.am: remove dbus-md5 since it isn't currently used.
1220 2003-03-05 Anders Carlsson <andersca@codefactory.se>
1222 * configure.in: Check for gethostbyname on Solaris.
1224 * dbus/dbus-transport.c: (_dbus_transport_open):
1225 Remove duplicate "tcp" entry.
1227 * doc/dbus-specification.sgml:
1228 Clarify some things.
1230 2003-03-05 Anders Carlsson <andersca@codefactory.se>
1232 * dbus/dbus-auth.c: (send_rejected), (process_test_subdir):
1233 * dbus/dbus-keyring.c: (_dbus_keyring_new_homedir),
1234 (_dbus_keyring_test):
1235 * dbus/dbus-md5.c: (_dbus_md5_compute):
1236 * dbus/dbus-sha.c: (_dbus_sha_compute):
1239 2003-03-05 Anders Carlsson <andersca@codefactory.se>
1241 * README: Add some things.
1243 2003-03-04 Anders Carlsson <andersca@codefactory.se>
1245 * dbus/dbus-message.c (dbus_message_append_args_valist): Add a break;
1246 after case DBUS_TYPE_BOOELAN.
1248 2003-03-02 Havoc Pennington <hp@pobox.com>
1250 * test/break-loader.c (randomly_set_extreme_ints): add test that
1251 sets really huge and small integers
1253 * dbus/dbus-marshal.c (_dbus_marshal_validate_arg): add check
1254 that length of boolean array fits in the string, and that
1255 string has room for boolean value in single-bool case.
1257 * dbus/dbus-message-builder.c (_dbus_message_data_load): add
1258 optional value to "ALIGN" command which is what to fill the
1261 * test/data/valid-messages/no-padding.message: add regression
1262 test for the message padding problem
1264 2003-03-02 Havoc Pennington <hp@pobox.com>
1266 * dbus/dbus-message.c (decode_header_data): fix to always init
1267 message_padding, from Benjamin Dauvergne
1269 2003-03-02 Havoc Pennington <hp@pobox.com>
1275 2003-03-01 Joe Shaw <joe@assbarn.com>
1277 * configure.in: Check for "struct cmsgcred" and try to access its
1278 members for BSD-like unices.
1280 * dbus/dbus-sysdeps.c (read_credentials_byte): Fold this back into
1281 _dbus_read_credentials_unix_socket().
1282 (_dbus_read_credentials_unix_socket): Use recvmsg() instead of
1283 read() for reading the credential byte off the unix socket. Use
1284 struct cmsgcred on systems that support it.
1286 2003-02-27 Alexander Larsson <alexl@redhat.com>
1290 Make gthreads-2.0 dependency optional. Don't build thread test if
1293 2003-02-27 Havoc Pennington <hp@pobox.com>
1295 * dbus/dbus-connection.c
1296 (dbus_connection_send_message_with_reply_and_block): fix doh!
1297 doh! doh! bug that resulted in never removing a reply from the
1298 queue, no wonder we called get_reply_serial so much ;-)
1300 * dbus/dbus-message.c (struct DBusMessage): cache reply serial
1301 and client serial instead of demarshaling them every time
1303 2003-02-27 Havoc Pennington <hp@pobox.com>
1305 * dbus/dbus-marshal.c (_dbus_demarshal_int32): rewrite to be much
1306 more inlined, using dbus-string-private.h, speeds things up
1309 * dbus/dbus-string.c (_dbus_string_free): apply align offset
1310 when freeing the string
1311 (_dbus_string_steal_data): fix for align offset
1312 (undo_alignment): new function
1314 2003-02-26 Havoc Pennington <hp@redhat.com>
1316 All kinds of audit fixes from Owen, plus initial attempt to
1317 handle unaligned memory returned from malloc.
1319 * dbus/dbus-string.c (_dbus_string_init): clamp max length to
1320 leave room for align_offset and nul byte
1321 (fixup_alignment): function to track an align_offset and
1322 ensure real->str is aligned
1323 (DBUS_GENERIC_STRING_PREAMBLE): len must be less than allocated,
1324 to allow a nul byte plus align offset
1325 (_dbus_string_lock): fix overflow issue
1326 (_dbus_string_init_const_len): add assertions on sanity of len,
1327 assign allocated to be ALLOCATION_PADDING larger than len
1328 (set_length): fixup the overflow handling
1329 (_dbus_string_get_data_len): fix overflow in assertion
1330 (open_gap): detect overflow in size of gap to be opened
1331 (_dbus_string_lengthen): add overflow check
1332 (_dbus_string_align_length): fix overflow with _DBUS_ALIGN_VALUE
1333 (_dbus_string_append): add overflow check
1334 (_dbus_string_append_unichar): overflow
1335 (_dbus_string_delete): fix overflow in assertion
1336 (_dbus_string_copy_len): overflow in assertion
1337 (_dbus_string_replace_len): overflows in assertions
1338 (_dbus_string_find): change to implement in terms of
1339 _dbus_string_find_to
1340 (_dbus_string_find_to): assorted fixage
1341 (_dbus_string_equal_c_str): assert c_str != NULL,
1342 fix logic so the function works
1343 (_dbus_string_ends_with_c_str): fix overflow thingy
1344 (_dbus_string_base64_encode): overflow fix
1345 (_dbus_string_validate_ascii): overflow
1346 (_dbus_string_validate_nul): overflow
1348 2003-02-26 Havoc Pennington <hp@redhat.com>
1350 * dbus/dbus-marshal.c (_dbus_marshal_test): fix to work with DISABLE_ASSERTS
1352 2003-02-26 Alexander Larsson <alexl@redhat.com>
1355 Set DBUS_GLIB_THREADS_LIBS for apps using gthread-2.0
1357 * dbus/dbus-connection.c:
1358 * dbus/dbus-connection.h:
1359 Fix _dbus_connection_acquire_io_path and _dbus_connection_acquire_dispatch.
1360 Add dbus_connection_set_wakeup_main_function and use it when queueing
1361 incoming and outgoing messages.
1364 * dbus/dbus-dataslot.c:
1365 Threadsafe usage of DBusDataSlotAllocator
1367 * dbus/dbus-message.c: (dbus_message_get_args_iter):
1370 * dbus/dbus-server-unix.c:
1373 * glib/dbus-gmain.c:
1374 Implement the new wakeup functions for glib.
1377 * glib/test-thread-client.c:
1378 * glib/test-thread-server.c:
1379 * glib/test-thread.h:
1380 Initial cut at some thread test code. Not really done yet.
1382 2003-02-26 Havoc Pennington <hp@pobox.com>
1384 * dbus/dbus-connection.c
1385 (dbus_connection_send_message_with_reply_and_block): fix crash
1386 where we ref'd the outgoing message instead of the returned reply
1388 * dbus/dbus-transport-unix.c (do_authentication): check read watch
1389 at the end of this function, so if we didn't need to read for
1390 authentication, we reinstall it for receiving messages
1392 * dbus/dbus-message.c (dbus_message_new_reply): allow replies to
1393 a NULL sender for peer-to-peer case
1395 * dbus/dbus-transport-unix.c (check_read_watch): handle
1396 !authenticated case correctly
1398 * glib/dbus-gmain.c: add support for DBusServer
1400 * dbus/dbus-server.c: add data slot support
1402 * glib/dbus-gmain.c (dbus_connection_setup_with_g_main): check
1403 return values and handle errors
1405 * dbus/dbus-dataslot.c: factor out the data slot stuff from
1408 * Doxyfile.in (INPUT): add glib subdir
1410 * glib/dbus-gmain.c (dbus_connection_setup_with_g_main): rename
1411 setup_with_g_main instead of hookup_with_g_main; write docs
1413 2003-02-24 Anders Carlsson <andersca@codefactory.se>
1415 * dbus/dbus-marshal.c: (_dbus_marshal_validate_arg):
1416 * dbus/dbus-message-builder.c: (_dbus_message_data_load):
1417 * dbus/dbus-message.c: (dbus_message_append_boolean),
1418 (dbus_message_append_boolean_array),
1419 (dbus_message_get_args_valist), (_dbus_message_test):
1420 * dbus/dbus-message.h:
1421 * doc/dbus-specification.sgml:
1422 Various fixes as pointed out by Havoc.
1424 * test/data/invalid-messages/bad-boolean-array.message:
1425 * test/data/invalid-messages/bad-boolean.message:
1426 Add invalid boolean value test cases.
1428 2003-02-24 Anders Carlsson <andersca@codefactory.se>
1430 * dbus/dbus-internals.c: (_dbus_type_to_string):
1431 * dbus/dbus-marshal.c: (_dbus_marshal_get_arg_end_pos),
1432 (_dbus_marshal_validate_arg):
1433 * dbus/dbus-message-builder.c: (_dbus_message_data_load):
1434 * dbus/dbus-message.c: (dbus_message_append_args_valist),
1435 (dbus_message_append_boolean), (dbus_message_append_boolean_array),
1436 (dbus_message_get_args_valist), (dbus_message_iter_get_boolean),
1437 (dbus_message_iter_get_int32), (dbus_message_iter_get_uint32),
1438 (dbus_message_iter_get_double),
1439 (dbus_message_iter_get_boolean_array), (message_iter_test):
1440 * dbus/dbus-message.h:
1441 * dbus/dbus-protocol.h:
1442 * doc/dbus-specification.sgml:
1443 * test/data/valid-messages/lots-of-arguments.message:
1444 Add support for boolean and boolean array types.
1446 2003-02-23 Havoc Pennington <hp@pobox.com>
1448 * dbus/dbus-keyring.c: finish most of this implementation and
1451 * dbus/dbus-errors.c (dbus_set_error_const, dbus_set_error): make
1452 these barf if the error isn't cleared to NULL
1454 * dbus/dbus-sysdeps.c (_dbus_delete_file): set error on failure
1455 (_dbus_create_directory): new function
1457 * dbus/dbus-errors.c (dbus_set_error): fix warning
1459 * dbus/dbus-string.c (_dbus_string_hex_encode): new function
1460 (_dbus_string_hex_decode): new function
1461 (test_hex_roundtrip): test code
1463 * dbus/dbus-sha.c (_dbus_sha_compute): use dbus_string_hex_encode
1465 * dbus/dbus-md5.c (_dbus_md5_compute): use dbus_string_hex_encode
1467 * dbus/dbus-sysdeps.c (_dbus_string_save_to_file): make this use
1468 the save-to-temp/rename trick to atomically write the new file
1469 (_dbus_string_parse_uint): new function
1471 2003-02-22 Havoc Pennington <hp@pobox.com>
1473 * test/Makefile.am (dist-hook): fix dist for test/data/sha-1
1475 2003-02-22 Havoc Pennington <hp@pobox.com>
1477 * dbus/dbus-message.c (dbus_message_iter_get_string_array):
1478 (dbus_message_iter_get_byte_array): Fix up doxygen warnings
1480 * dbus/dbus-sha.c: add implementation of SHA-1 algorithm
1482 * dbus/test/data/sha-1: add US government test suite for SHA-1
1484 2003-02-21 Anders Carlsson <andersca@codefactory.se>
1486 * dbus/dbus-marshal.c: (_dbus_demarshal_string_array):
1487 Make string arrays NULL-terminated.
1489 * dbus/dbus-memory.c: (dbus_free_string_array):
1490 * dbus/dbus-memory.h:
1491 New function for freeing NULL-terminated string arrays.
1493 * dbus/dbus-message-builder.c: (append_quoted_string),
1494 (_dbus_message_data_load):
1495 Add support for array types.
1497 * dbus/dbus-message.c: (check_message_handling):
1498 Add more types as test cases.
1500 * dbus/dbus-sysdeps.c: (_dbus_string_parse_int),
1501 (_dbus_string_parse_double):
1502 Add the start offset to the end offset.
1504 * test/data/valid-messages/lots-of-arguments.message:
1505 New test message with lots of arguments.
1507 2003-02-21 Anders Carlsson <andersca@codefactory.se>
1509 * dbus/dbus-message.c: (dbus_message_append_nil),
1510 (dbus_message_append_int32), (dbus_message_append_uint32),
1511 (dbus_message_append_double), (dbus_message_append_string),
1512 (dbus_message_append_int32_array),
1513 (dbus_message_append_uint32_array),
1514 (dbus_message_append_double_array),
1515 (dbus_message_append_byte_array),
1516 (dbus_message_append_string_array):
1517 Fix all out-of-memory handling in these functions.
1519 2003-02-21 Anders Carlsson <andersca@codefactory.se>
1521 * dbus/dbus-message.c: (dbus_message_append_nil):
1524 2003-02-21 Anders Carlsson <andersca@codefactory.se>
1526 * dbus/dbus-message.c: (dbus_message_append_args_valist),
1527 (dbus_message_append_nil), (dbus_message_append_int32_array),
1528 (dbus_message_append_uint32_array),
1529 (dbus_message_append_double_array),
1530 (dbus_message_append_byte_array),
1531 (dbus_message_append_string_array), (dbus_message_get_args_valist),
1532 (dbus_message_iter_get_int32_array),
1533 (dbus_message_iter_get_uint32_array),
1534 (dbus_message_iter_get_double_array),
1535 (dbus_message_iter_get_byte_array),
1536 (dbus_message_iter_get_string_array):
1538 * dbus/dbus-message.h:
1539 Add functions for appending and getting arrays.
1541 2003-02-21 Anders Carlsson <andersca@codefactory.se>
1543 * dbus/dbus-mempool.c (_dbus_mem_pool_new): Make the
1544 element size at least 8 bytes, fixes mempool tests on
1547 2003-02-20 Alexander Larsson <alexl@redhat.com>
1549 * dbus/dbus-transport-unix.c (unix_do_iteration):
1550 Unlock the connection mutex during a blocking select call.
1551 Add todo about how we need a way to wake up the select.
1553 * dbus/dbus-connection-internal.h:
1554 * dbus/dbus-connection.c:
1555 Add _dbus_connection_lock and _dbus_connection_unlock.
1557 2003-02-19 Havoc Pennington <hp@pobox.com>
1559 * Doxyfile.in (PREDEFINED): put DOXYGEN_SHOULD_SKIP_THIS in
1560 Doxyfile.in, not Doxyfile
1562 * dbus/dbus-keyring.c: do some hacking on this
1564 * dbus/dbus-sysdeps.c (_dbus_delete_file): new
1566 * dbus/dbus-errors.c (dbus_set_error_const): do not call
1568 (dbus_set_error): remove dbus_error_init, check for message ==
1569 NULL *before* we sprintf into it, and add @todo about including
1570 system headers in this file
1572 * dbus/dbus-sysdeps.c (_dbus_create_file_exclusively): new
1574 * dbus/dbus-errors.h (DBUS_ERROR_FAILED): add
1576 * dbus/dbus-sysdeps.c (get_user_info): break this function out to
1577 get various bits of user information based on either username
1579 (_dbus_homedir_from_username): new function
1581 2003-02-19 Anders Carlsson <andersca@codefactory.se>
1584 Add check for nonposix getpwnam_r
1586 * dbus/dbus-mempool.c: (_dbus_mem_pool_new):
1587 Align the pool element size to a sizeof (void *) boundary.
1589 * dbus/dbus-sysdeps.c: (_dbus_setenv), (_dbus_connect_unix_socket),
1590 (_dbus_listen_unix_socket), (_dbus_credentials_from_username):
1591 General Solaris fixes.
1593 * test/data/valid-messages/simplest-manual.message:
1594 Explicitly state that we want little-endian packing.
1596 2003-02-19 Mikael Hallendal <micke@codefactory.se>
1598 * dbus/dbus-server.c (dbus_server_listen): Support tcp: addresses.
1600 * dbus/dbus-transport-unix.c (_dbus_transport_new_for_tcp_socket):
1601 Added to create a transport connecting using a tcp/ip socket.
1603 * dbus/dbus-sysdeps.c (_dbus_connect_tcp_socket): Added to connect
1604 to a tcp socket at given host and port.
1605 (_dbus_listen_tcp_socket): added to listen on tcp socket for given
1608 * dbus/dbus-server.c (dbus_server_listen): Support tcp: addresses.
1610 * dbus/dbus-server-unix.c (_dbus_server_new_for_tcp_socket):
1611 Added to create a server listening on a TCP/IP socket.
1613 2003-02-19 Havoc Pennington <hp@pobox.com>
1615 Throughout: mop up all the Doxygen warnings and undocumented
1618 * dbus/dbus-sysdeps.c (do_exec): do not use execvp, we don't want
1619 to search any paths.
1621 * dbus/dbus-threads.c: move global mutex initializers to
1622 dbus-internals.h, multiple prototypes was confusing doxygen
1623 besides being kind of ugly
1625 * Doxyfile (PREDEFINED): have Doxygen define
1626 DOXYGEN_SHOULD_SKIP_THIS so we can exclude things from
1627 docs with #ifndef DOXYGEN_SHOULD_SKIP_THIS
1628 (do not abuse the feature! it's for stuff like the autogenerated
1629 macros in dbus-md5.c, not just for things you don't feel like
1632 2003-02-18 Havoc Pennington <hp@pobox.com>
1634 * dbus/dbus-string.c (_dbus_string_zero): new function
1636 * dbus/dbus-md5.c: include MD5 implementation by L. Peter Deutsch,
1637 wrap it in some dbus-friendly API
1639 * dbus/dbus-types.h: add 16-bit types
1641 2003-02-18 Joe Shaw <joe@assbarn.com>
1643 * dbus/dbus-auth.c (handle_server_data_stupid_test_mech): Just get
1644 credentials from our currently running process.
1645 (get_word): Fix a buglet where we were copying the entire length
1646 instead of relative to our position.
1648 * dbus/dbus-hash.c (_dbus_hash_test): Don't try to allocate the
1649 keys on the stack... it's 640k of data.
1651 * dbus/dbus-sysdeps.c (_dbus_read_credentials_unix_socket): Always
1652 read the credentials byte off the socket, even if we don't have
1654 (_dbus_poll): Implement poll() using select() for systems which
1657 * glib/test-dbus-glib.c (main): Print out an error if no
1658 parameters are given.
1660 * test/data/auth/fallback.auth-script: Added. Tests that a client
1661 can fallback to a secondary auth mechanism if the first fails.
1663 2003-02-18 Havoc Pennington <hp@pobox.com>
1667 2003-02-17 Havoc Pennington <hp@pobox.com>
1669 * doc/dbus-specification.sgml: lots of cosmetic
1670 cleanups/rearrangement, add assorted FIXME, change DBUS_ADDRESS
1671 env variable to DBUS_BUS_ADDRESS, s/client/application/,
1672 s/server/bus/ (except in authentication section). Add a section
1673 "Message Bus Message Routing"
1675 2003-02-17 Anders Carlsson <andersca@codefactory.se.>
1681 2003-02-17 Anders Carlsson <andersca@codefactory.se>
1683 * doc/dbus-specification.sgml:
1684 Specification updates.
1686 2003-02-17 Anders Carlsson <andersca@codefactory.se>
1688 * bus/activation.c: (bus_activation_init), (child_setup),
1689 (bus_activation_activate_service):
1691 * bus/main.c: (main):
1692 Set DBUS_ADDRESS environment variable.
1694 * dbus/dbus-errors.c: (dbus_set_error):
1695 Don't use va_copy since that's a C99 feature.
1697 * dbus/dbus-sysdeps.c: (_dbus_setenv), (do_exec),
1698 (_dbus_spawn_async):
1699 * dbus/dbus-sysdeps.h:
1700 Add child_setup_func to _dbus_spawn_async.
1702 * doc/dbus-specification.sgml:
1703 Update specification.
1705 * test/spawn-test.c: (setup_func), (main):
1708 2003-02-17 Alexander Larsson <alexl@redhat.com>
1710 * dbus/dbus-connection.c (_dbus_connection_handler_destroyed_locked):
1713 2003-02-17 Anders Carlsson <andersca@codefactory.se>
1717 * doc/dbus-test-plan.sgml:
1718 Add test plan document.
1723 2003-02-17 Anders Carlsson <andersca@codefactory.se>
1725 * dbus/dbus-message.c: (decode_header_data),
1726 (_dbus_message_loader_return_buffer):
1727 Set the header padding amount when loading a message.
1729 2003-02-16 Anders Carlsson <andersca@codefactory.se>
1731 * bus/dispatch.c: (send_one_message):
1732 Only send broadcast messages to registered connections.
1734 * dbus/dbus-message.c: (dbus_message_name_is):
1735 * dbus/dbus-message.h:
1736 New convenience function.
1738 * dbus/dbus-transport-debug.c: (do_reading):
1739 Only dispatch one message per run.
1742 * test/bus-test.c: (new_connection_callback), (die),
1743 (test_hello_client1_handler), (test_hello_client2_handler),
1744 (test_hello_replies), (main):
1746 * test/bus-test-loop.[ch]:
1749 2003-02-16 Havoc Pennington <hp@pobox.com>
1751 * dbus/dbus-connection.c (dbus_connection_dispatch_message): fix
1752 backward conditional
1754 2003-02-16 Alexander Larsson <alexl@redhat.com>
1756 * dbus/dbus-connection.c:
1757 Implement sent_message_with_reply. (with_reply_and block is still
1759 Made dispatch_message not lose message if OOM.
1761 * dbus/dbus-errors.h:
1762 Add NoReply error (for reply timeouts).
1764 2003-02-16 Alexander Larsson <alexl@redhat.com>
1766 * dbus/dbus-hash.c (_dbus_hash_table_unref):
1767 Actually free keys and values when destroying hashtable.
1769 2003-02-16 Anders Carlsson <andersca@codefactory.se>
1771 * dbus/dbus-auth.c: (client_try_next_mechanism):
1774 * dbus/dbus-threads.c: (dbus_condvar_wait_timeout):
1775 Return TRUE if there's no thread implementation around.
1777 * glib/dbus-gmain.c: (free_source),
1778 (dbus_connection_hookup_with_g_main):
1779 Make sure to remove the GSource when the connection is finalized.
1781 2003-02-16 Anders Carlsson <andersca@codefactory.se>
1783 * bus/dispatch.c: (bus_dispatch_message_handler):
1784 * dbus/dbus-errors.h:
1785 Return an error if someone tries to send a message to a service
1788 2003-02-16 Anders Carlsson <andersca@codefactory.se>
1790 * bus/activation.c: (load_directory), (bus_activation_init),
1791 (bus_activation_activate_service):
1794 (bus_driver_handle_activate_service), (bus_driver_handle_message):
1795 More work on the activation handling.
1797 * dbus/dbus-errors.h:
1798 Add some error messages
1800 * dbus/dbus-message.c: (dbus_message_new_error_reply):
1801 * dbus/dbus-message.h:
1802 New function that creates an error message.
1804 * dbus/dbus-protocol.h:
1805 Add ACTIVATE_SERVER message.
1807 * dbus/dbus-server-unix.c: (unix_handle_watch),
1808 (_dbus_server_new_for_domain_socket):
1809 Call _dbus_fd_set_close_on_exec.
1811 * dbus/dbus-sysdeps.c: (make_pipe), (do_exec),
1812 (_dbus_spawn_async), (_dbus_disable_sigpipe),
1813 (_dbus_fd_set_close_on_exec):
1814 * dbus/dbus-sysdeps.h:
1815 Add _dbus_fd_set_close_on exec function. Also add function that checks
1816 that all open fds are set to close-on-exec and warns otherwise.
1818 * dbus/dbus-transport-unix.c:
1819 (_dbus_transport_new_for_domain_socket):
1820 Call _dbus_fd_set_close_on_exec.
1822 2003-02-16 Havoc Pennington <hp@pobox.com>
1824 * dbus/dbus-connection.c (dbus_connection_set_change_sigpipe):
1825 allow people to avoid setting SIGPIPE to SIG_IGN
1826 (_dbus_connection_new_for_transport): disable SIGPIPE unless
1827 we've been asked not to
1829 2003-02-15 Anders Carlsson <andersca@codefactory.se>
1831 * dbus/dbus-list.c: (_dbus_list_append_link),
1832 (_dbus_list_prepend_link):
1833 * dbus/dbus-memory.c: (dbus_malloc), (dbus_malloc0),
1837 2003-02-15 Anders Carlsson <andersca@codefactory.se>
1840 * bus/activation.c: (bus_activation_entry_free),
1841 (add_desktop_file_entry), (load_directory), (bus_activation_init):
1843 * bus/main.c: (main):
1844 Add simple activation support, doesn't work yet though.
1846 2003-02-15 Zack Rusin <zack@kde.org>
1848 * qt/dbus-qthread.cpp: small casting fix
1850 2003-02-15 Anders Carlsson <andersca@codefactory.se>
1852 * dbus/dbus-errors.c: (dbus_set_error):
1853 * dbus/dbus-errors.h:
1854 Add a few errors and make dbus_set_error void.
1856 * dbus/dbus-sysdeps.c:
1857 (_dbus_errno_to_string), (close_and_invalidate), (make_pipe),
1858 (write_err_and_exit), (read_ints), (do_exec), (_dbus_spawn_async):
1859 * dbus/dbus-sysdeps.h:
1860 Add _dbus_spawn_async.
1862 * test/spawn-test.c: (main):
1863 Test for _dbus_spawn_async.
1865 2003-02-15 Anders Carlsson <andersca@codefactory.se>
1867 * dbus/dbus-internals.h:
1868 Fix build without tests.
1870 * dbus/dbus-list.c: (alloc_link):
1871 Fix a segfault when a malloc fails.
1873 * dbus/dbus-memory.c: (initialize_malloc_debug), (dbus_malloc),
1874 (dbus_malloc0), (dbus_realloc):
1875 Add support for malloc debugging.
1877 2003-02-15 Alexander Larsson <alexl@redhat.com>
1879 * dbus/dbus-threads.c:
1880 * dbus/dbus-threads.h:
1881 Add condvars. Remove static mutext from API.
1882 Implement static mutexes by initializing them from threads_init.
1884 * glib/dbus-gthread.c:
1885 * qt/dbus-qthread.cpp:
1886 Update with the thread api changes.
1891 Turn StaticMutex into normal mutex + init function.
1892 Export new functions _dbus_list_alloc_link, _dbus_list_free_link,
1893 _dbus_list_append_link, _dbus_list_prepend_link
1896 * dbus/dbus-sysdeps.c:
1897 * dbus/dbus-sysdeps.h:
1898 New type dbus_atomic_t, and new functions _dbus_atomic_inc,
1899 _dbus_atomic_dec. Only slow fallback implementation at the moment.
1901 * dbus/dbus-protocol.h:
1902 Add DBUS_MESSAGE_LOCAL_DISCONNECT define
1904 * dbus/dbus-message.c:
1905 Make ref/unref atomic.
1908 * dbus/dbus-connection-internal.h:
1909 * dbus/dbus-connection.c:
1910 * dbus/dbus-connection.h:
1912 Change _peek to _borrow,_return & _steal_borrowed.
1913 Change disconnect callback to event.
1914 Make dbus_connection_dispatch_messages reentrant.
1916 * dbus/dbus-transport.c:
1917 Don't ref the connection on calls to the transport
1920 * dbus/dbus-message-handler.c:
1923 * glib/dbus-gmain.c:
1924 Don't use peek_message anymore
1927 * test/debug-thread.c:
1928 * test/debug-thread.h:
1929 Simple thread implementation that asserts() on deadlocks in
1930 single-threaded code.
1933 (main) Call debug_threads_init.
1936 Use disconnect message instead of disconnect callback.
1940 Don't call dbus_connection_set_disconnect_function. Instead export
1941 bus_connection_disconnect.
1944 Call bus_connection_disconnect when we get a disconnected message.
1946 2003-02-15 Havoc Pennington <hp@pobox.com>
1948 * dbus/dbus-message.c (dbus_message_new): fool around with the
1951 2003-02-14 Havoc Pennington <hp@pobox.com>
1953 * dbus/dbus-mempool.c: fail if the debug functions so indicate
1955 * dbus/dbus-memory.c: fail if the debug functions indicate we
1958 * dbus/dbus-internals.c (_dbus_set_fail_alloc_counter)
1959 (_dbus_decrement_fail_alloc_counter): debug functions to
1960 simulate memory allocation failures
1962 2003-02-14 Havoc Pennington <hp@pobox.com>
1964 * dbus/dbus-errors.h (struct DBusError): add a word of padding
1967 2003-02-13 Anders Carlsson <andersca@codefactory.se>
1969 * bus/driver.c: (bus_driver_handle_hello):
1971 * bus/services.c: (bus_service_lookup):
1972 Reorder message sending so we get a more sane order.
1974 * test/bus-test.c: (message_handler):
1977 2003-02-13 Anders Carlsson <andersca@codefactory.se>
1979 * bus/driver.c: (bus_driver_send_service_deleted),
1980 (bus_driver_send_service_created), (bus_driver_send_service_lost),
1981 (bus_driver_send_service_acquired), (bus_driver_handle_hello),
1982 (bus_driver_send_welcome_message),
1983 (bus_driver_handle_list_services),
1984 (bus_driver_handle_acquire_service),
1985 (bus_driver_handle_service_exists):
1986 * dbus/dbus-bus.c: (dbus_bus_register_client),
1987 (dbus_bus_acquire_service), (dbus_bus_service_exists):
1988 * dbus/dbus-errors.c: (dbus_result_to_string):
1989 * dbus/dbus-errors.h:
1990 * dbus/dbus-message.c: (dbus_message_append_args),
1991 (dbus_message_append_args_valist), (dbus_message_get_args),
1992 (dbus_message_get_args_valist), (dbus_message_get_args_iter),
1993 (dbus_message_iter_get_arg_type), (dbus_message_iter_get_string),
1994 (dbus_message_iter_get_byte_array),
1995 (dbus_message_iter_get_string_array), (message_iter_test),
1996 (check_message_handling), (_dbus_message_test):
1997 * dbus/dbus-message.h:
1998 * test/bus-test.c: (main):
1999 Change fields to arguments in messages, so that they won't be
2000 confused with header fields.
2002 * glib/test-dbus-glib.c: (main):
2003 Remove append_fields from hello message.
2005 2003-02-13 Anders Carlsson <andersca@codefactory.se>
2007 * dbus/dbus-errors.c:
2008 * dbus/dbus-message.c:
2009 * dbus/dbus-string.c:
2010 Documentation fixes.
2012 2003-02-13 Anders Carlsson <andersca@codefactory.se>
2014 * glib/dbus-gmain.c: (timeout_handler), (add_timeout),
2016 Implement support for timeouts in dbus-glib.
2018 2003-02-13 Anders Carlsson <andersca@codefactory.se>
2020 * dbus/dbus-message-builder.c: (_dbus_message_data_load):
2021 * dbus/dbus-message.c: (process_test_subdir):
2022 * test/break-loader.c: (find_breaks_based_on):
2023 Plug some memory leaks.
2025 2003-02-13 Richard Hult <rhult@codefactory.se>
2027 * bus/main.c: Fix build.
2029 * dbus/dbus-errors.h:
2030 * dbus/dbus-errors.c: Fix copyright for Anders.
2032 2003-02-13 Anders Carlsson <andersca@codefactory.se>
2037 * bus/connection.c: (bus_connection_foreach):
2040 * bus/desktop-file.c: (grow_lines_in_section), (grow_sections),
2041 (unescape_string), (new_section), (parse_section_start),
2042 (parse_key_value), (report_error), (bus_desktop_file_load),
2043 (bus_desktop_file_get_string):
2044 * bus/desktop-file.h:
2045 Use DBusError for error reporting.
2047 * bus/dispatch.c: (send_one_message),
2048 (bus_dispatch_message_handler):
2049 * bus/driver.c: (bus_driver_send_service_deleted),
2050 (bus_driver_send_service_created), (bus_driver_send_service_lost),
2051 (bus_driver_send_service_acquired), (bus_driver_handle_hello),
2052 (bus_driver_send_welcome_message),
2053 (bus_driver_handle_list_services),
2054 (bus_driver_handle_acquire_service),
2055 (bus_driver_handle_service_exists):
2056 * bus/loop.c: (bus_loop_run):
2058 Use BUS_HANDLE_OOM instead of _DBUS_HANDLE_OOM.
2060 * bus/utils.c: (bus_wait_for_memory):
2062 New files with general utility functions.
2064 * dbus/dbus-internals.h:
2065 Remove _DBUS_HANDLE_OOM.
2067 2003-02-13 Anders Carlsson <andersca@codefactory.se>
2069 * dbus/dbus-errors.c: (dbus_result_to_string), (dbus_error_init),
2070 (dbus_error_free), (dbus_set_error_const), (dbus_set_error):
2071 * dbus/dbus-errors.h:
2072 Add DBusError structure.
2074 2003-02-13 Anders Carlsson <andersca@codefactory.se>
2076 * test/data/valid-messages/standard-acquire-service.message:
2077 * test/data/valid-messages/standard-hello.message:
2078 * test/data/valid-messages/standard-list-services.message:
2079 * test/data/valid-messages/standard-service-exists.message:
2080 Add some standard messages.
2082 2003-02-13 Anders Carlsson <andersca@codefactory.se>
2084 * bus/driver.c: (bus_driver_send_welcome_message),
2085 (bus_driver_handle_list_services),
2086 (bus_driver_handle_acquire_service),
2087 (bus_driver_handle_service_exists), (bus_driver_handle_message):
2088 Update for API changes in libdbus.
2090 * dbus/dbus-message.c: (dbus_message_new_reply):
2091 * dbus/dbus-message.h:
2092 Remove the name argument. The spec states that replies shouldn't
2095 2003-02-13 Anders Carlsson <andersca@codefactory.se>
2097 * bus/desktop-file.c: (parse_section_start), (parse_key_value),
2098 (report_error), (bus_desktop_file_load), (lookup_section),
2099 (lookup_line), (bus_desktop_file_get_raw),
2100 (bus_desktop_file_get_string):
2101 * bus/desktop-file.h:
2102 Some fixes, and new functions for getting a key value from a section.
2104 2003-02-13 Havoc Pennington <hp@pobox.com>
2106 * test/data/auth/fail-after-n-attempts.auth-script: new test
2108 * dbus/dbus-auth.c (send_rejected): shutdown_mech() when we
2111 2003-02-13 Havoc Pennington <hp@pobox.com>
2113 * dbus/dbus-auth.c (handle_server_data_external_mech): args to
2114 dbus_credentials_match were backward
2116 * dbus/dbus-auth-script.c (_dbus_auth_script_run): support
2117 NO_CREDENTIALS and ROOT_CREDENTIALS
2119 * dbus/dbus-auth.c (_dbus_auth_do_work): move get_state() routine
2120 into here. Never process more commands after we've reached an
2121 end state; store further data as unused bytes.
2123 * test/data/auth/*: add more auth tests
2125 * dbus/dbus-auth-script.c (_dbus_auth_script_run): support EXPECT
2126 command to match exact string and EXPECT_UNUSED to match unused
2129 * test/Makefile.am (dist-hook): fix to dist all the test stuff
2131 2003-02-12 Havoc Pennington <hp@pobox.com>
2133 * dbus/dbus-string.c (_dbus_string_pop_line): fix to also strip
2134 \r off of popped lines
2136 * dbus/dbus-auth.c (_dbus_auth_test): write code to run auth
2139 * dbus/dbus-auth-script.c (_dbus_auth_script_run): when doing a
2142 2003-02-12 Havoc Pennington <hp@pobox.com>
2144 * dbus/Makefile.am: remove break-loader from the build, since it
2147 * configure.in: add --enable-gcov to turn on coverage profiling
2148 flags and disable optimization
2150 2003-02-10 Havoc Pennington <hp@pobox.com>
2152 * dbus/dbus-auth-script.c, dbus/dbus-auth-script.h: sync
2153 initial cut at test framework for DBusAuth from laptop.
2154 Doesn't quite work yet but it compiles and I need to get
2155 it off the 266mhz laptop. ;-)
2157 * dbus/dbus-server-debug.c (_dbus_server_debug_accept_transport):
2158 fix a memleak in error case
2160 2003-02-12 Anders Carlsson <andersca@codefactory.se>
2163 * bus/desktop-file.c:
2164 * bus/desktop-file.h:
2165 Add a desktop file parser.
2167 2003-02-11 Zack Rusin <zack@kde.org>
2169 * qt/message.[h|cpp]: sample implementation
2170 of the KDE wrapper for DBusMessage
2172 2003-02-09 Zack Rusin <zack@kde.org>
2174 * test/bus-test.c: make_it_compile
2175 * doc/dbus-specification.sgml: minimal semantic fix
2177 2003-02-06 Anders Carlsson <andersca@codefactory.se>
2183 2003-02-06 Anders Carlsson <andersca@codefactory.se>
2186 * dbus/dbus-break-loader.c:
2188 * test/break-loader.c:
2189 Move dbus-break-loader to test/ and rename it to break-loader.
2191 2003-02-02 Havoc Pennington <hp@pobox.com>
2193 * dbus/dbus-keyring.c, dbus/dbus-keyring.h: template files
2194 for code to manage cookies in your home directory
2196 * dbus/dbus-sysdeps.c (_dbus_generate_random_bytes): new function
2198 * dbus/dbus-auth.c (get_state): impose a maximum number of tries
2199 to authenticate, then disconnect the client.
2201 2003-02-03 Alexander Larsson <alexl@redhat.com>
2203 * dbus/dbus-message.c (dbus_message_append_fields):
2206 2003-02-02 Anders Carlsson <andersca@codefactory.se>
2208 * doc/dbus-specification.sgml:
2209 Update address format section.
2211 2003-02-02 Anders Carlsson <andersca@codefactory.se>
2214 * test/bus-test.c: (get_time), (add_timeout), (remove_timeout),
2215 (message_handler), (new_connection_callback), (loop_quit),
2219 2003-02-02 Anders Carlsson <andersca@codefactory.se>
2221 * bus/driver.c: (bus_driver_handle_service_exists):
2222 Simplify the code a bit.
2224 * dbus/dbus-bus.c: (dbus_bus_service_exists):
2227 2003-02-02 Anders Carlsson <andersca@codefactory.se>
2230 Add libdbus-daemon.la and link to it.
2232 2003-02-01 James Willcox <jwillcox@gnome.org>
2234 * bus/driver.c: (bus_driver_handle_own_service):
2235 Actually include the service reply code in the message.
2237 2003-02-02 Anders Carlsson <andersca@codefactory.se>
2239 * bus/driver.c: (bus_driver_handle_service_exists):
2240 Don't unref the incoming message.
2242 2003-02-02 Anders Carlsson <andersca@codefactory.se>
2244 * dbus/dbus.h: Add dbus-address.h and dbus-bus.h
2246 2003-02-02 Anders Carlsson <andersca@codefactory.se>
2248 * dbus/dbus-server.c: (dbus_server_listen):
2249 * dbus/dbus-transport.c: (_dbus_transport_open):
2250 ifdef out the calls to the debug transport and server.
2252 2003-02-02 Alexander Larsson <alexl@redhat.com>
2254 * dbus/dbus-watch.c (dbus_watch_get_flags):
2255 Add note in the docs that ERROR or HANGUP won't be returned
2256 and are assumed always on.
2258 * glib/dbus-gmain.c (add_watch):
2259 Always add IO_ERR | IO_HUP
2261 * dbus/dbus-message.h:
2262 Add semicolon after dbus_message_iter_get_string_array().
2263 Makes qt code build again
2265 2003-02-01 Anders Carlsson <andersca@codefactory.se>
2267 * bus/driver.c: (create_unique_client_name),
2268 (bus_driver_handle_hello):
2269 Don't take a name, just use a numeric id to identify
2273 * dbus/dbus-bus.c: (dbus_bus_register_client),
2274 (dbus_bus_acquire_service), (dbus_bus_service_exists):
2276 Add new convenience functions for communicating with the bus.
2278 * dbus/dbus-message.h:
2280 * dbus/dbus-protocol.h:
2283 2003-02-01 Alexander Larsson <alexl@redhat.com>
2285 * dbus/dbus-message.c (dbus_message_append_fields):
2286 Add some more doc comments.
2288 2003-02-01 Havoc Pennington <hp@pobox.com>
2290 * dbus/dbus-break-loader.c (randomly_modify_length): change
2291 a 4-byte value in the message as if it were a length
2293 * dbus/dbus-sysdeps.c (_dbus_string_save_to_file): don't set
2294 execute bit on saved files
2296 2003-02-01 Havoc Pennington <hp@pobox.com>
2298 * dbus/dbus-break-loader.c (main): new program to find messages
2299 that break the loader.
2301 * dbus/dbus-sysdeps.c (_dbus_string_append_uint): new function
2302 * dbus/dbus-sysdeps.c (_dbus_string_save_to_file): new function
2304 * dbus/dbus-string.c (_dbus_string_set_byte): new
2306 2003-01-31 Havoc Pennington <hp@pobox.com>
2308 * dbus/dbus-message.c: refactor the test code to be more general,
2309 in preparation for writing a "randomly permute test cases to
2310 try to break the loader" program.
2312 2003-01-31 Havoc Pennington <hp@pobox.com>
2314 * doc/dbus-specification.sgml: work on the specification
2316 * dbus/dbus-message.c (_dbus_message_loader_return_buffer): check
2317 the protocol version of the message.
2319 * dbus/dbus-protocol.h: drop special _REPLY names, the spec
2320 no longer specifies that.
2321 (DBUS_SERVICE_REPLY_SERVICE_EXISTS): fix flags (1/2/4/8 not
2324 * dbus/dbus-marshal.c (_dbus_marshal_get_arg_end_pos): add missing
2325 "break" for DBUS_TYPE_NIL, remove @todo
2327 2003-01-31 Havoc Pennington <hp@pobox.com>
2329 * dbus/dbus-message.c (dbus_message_set_is_error_reply): rename
2330 just set_is_error/get_is_error as this is a commonly-used
2331 function, and write docs.
2333 2003-01-31 Anders Carlsson <andersca@codefactory.se>
2335 * dbus/dbus-address.c: (dbus_address_entry_free):
2336 Free key and value lists.
2338 * dbus/dbus-internals.c: (_dbus_type_to_string):
2339 Add the types we didn't have.
2341 * dbus/dbus-marshal.c: (_dbus_marshal_get_arg_end_pos),
2342 (_dbus_marshal_validate_arg):
2345 * dbus/dbus-message.c: (dbus_message_set_sender):
2346 Remove todo about being able to set sender to NULL.
2348 (dbus_message_set_is_error_reply),
2349 (dbus_message_get_is_error_reply):
2350 * dbus/dbus-message.h:
2353 * dbus/dbus-protocol.h:
2354 Add error reply flag.
2356 * test/data/valid-messages/opposite-endian.message:
2357 Add NIL type to test.
2359 2003-01-31 Havoc Pennington <hp@pobox.com>
2361 * doc/dbus-specification.sgml: fully specify the header. Add
2362 flags and major protocol version, and change header/body len to
2365 * dbus/dbus-message-builder.c (append_saved_length): append length
2368 * dbus/dbus-message.c (dbus_message_create_header): change header
2369 length and body length to unsigned. Add the new fields from the
2371 (_dbus_message_loader_return_buffer): unsigned header/body len
2373 2003-01-30 Havoc Pennington <hp@pobox.com>
2375 * dbus/dbus-auth.c: rework to use only REJECTED, no
2378 * doc/dbus-sasl-profile.txt: drop MECHANISMS and just
2379 use REJECTED, suggested by Mark McLoughlin
2381 2003-01-30 Havoc Pennington <hp@pobox.com>
2383 * dbus/dbus-server.c (dbus_server_listen): @todo about how we need
2384 a better way to report errors here. e.g. "unix address lacks
2385 path" or something. also "no such file" when the path doesn't
2388 * dbus/dbus-address.c (dbus_address_entries_free): add @todo about
2390 (dbus_parse_address): add @todo about documenting address format,
2391 and allowing , and ; to be escaped
2393 2003-01-30 Anders Carlsson <andersca@codefactory.se>
2396 Add dbus-address.[ch]
2398 * dbus/dbus-address.c: (dbus_address_entry_free),
2399 (dbus_address_entries_free), (create_entry),
2400 (dbus_address_entry_get_method), (dbus_address_entry_get_value),
2401 (dbus_parse_address), (_dbus_address_test):
2402 * dbus/dbus-address.h:
2403 New files for dealing with address parsing.
2405 * dbus/dbus-connection.c:
2406 Document timeout functions.
2408 * dbus/dbus-message.c:
2409 Document dbus_message_new_from_message.
2411 * dbus/dbus-server-debug.c:
2414 * dbus/dbus-server.c: (dbus_server_listen):
2415 Parse address and use correct server implementation.
2417 * dbus/dbus-string.c: (_dbus_string_find_to), (_dbus_string_test):
2418 * dbus/dbus-string.h:
2419 New function with test.
2421 * dbus/dbus-test.c: (dbus_internal_symbol_do_not_use_run_tests):
2425 * dbus/dbus-transport-debug.c:
2428 * dbus/dbus-transport.c: (_dbus_transport_open):
2429 Parse address and use correct transport implementation.
2431 2003-01-30 Havoc Pennington <hp@pobox.com>
2433 * dbus/dbus-message.c: use message->byte_order instead of
2434 DBUS_COMPILER_BYTE_ORDER throughout.
2435 (dbus_message_create_header): pad header to align the
2436 start of the body of the message to 8-byte boundary
2438 * dbus/dbus-marshal.h: make all the demarshalers take const
2439 DBusString arguments.
2441 * dbus/dbus-message.c (_dbus_message_loader_return_buffer):
2442 validate message args here, so we don't have to do slow validation
2443 later, and so we catch bad messages as they are incoming. Also add
2444 better checks on header_len and body_len. Also fill in
2447 * dbus/dbus-string.c (_dbus_string_validate_utf8): new (not
2448 implemented properly)
2449 (_dbus_string_validate_nul): new function to check all-nul
2451 * dbus/dbus-marshal.c (_dbus_marshal_get_field_end_pos): rename
2452 get_arg_end_pos and remove all validation
2453 (_dbus_marshal_validate_arg): actually do validation here.
2455 2003-01-29 Havoc Pennington <hp@pobox.com>
2457 * dbus/dbus-message.c (check_message_handling): fix assertion
2458 failure on set_client_serial
2460 2003-01-28 Havoc Pennington <hp@pobox.com>
2462 * dbus/dbus-server-debug.c: Add doc section comments
2464 * dbus/dbus-transport-debug.c: add doc section comments
2466 2003-01-28 Havoc Pennington <hp@redhat.com>
2468 * dbus/dbus-string.c (_dbus_string_base64_decode): append bytes in
2469 the reverse order from how I had it
2470 (_dbus_string_base64_encode): reverse encoding order. I was
2471 basically byteswapping everything during encoding.
2473 2003-01-28 Anders Carlsson <andersca@codefactory.se>
2475 * dbus/dbus-connection-internal.h:
2476 * dbus/dbus-connection.c: (_dbus_connection_add_timeout),
2477 (_dbus_connection_remove_timeout):
2478 Add functions for adding and removing timeouts.
2480 * dbus/dbus-message.c: (dbus_message_new_from_message):
2481 Add new function that takes a message and creates an exact
2482 copy of it, but with the refcount set to 1.
2483 (check_message_handling):
2486 * dbus/dbus-server-protected.h:
2487 * dbus/dbus-server.c: (_dbus_server_init_base),
2488 (_dbus_server_finalize_base), (_dbus_server_add_timeout),
2489 (dbus_server_set_timeout_functions):
2490 (_dbus_server_remove_timeout):
2491 New functions so that a server can add and remove timeouts.
2493 (dbus_server_listen):
2494 Add commented out call to dbus_server_debug_new.
2496 * dbus/dbus-timeout.c: (_dbus_timeout_new):
2497 Actually set the handler, doh.
2499 * dbus/dbus-transport.c: (_dbus_transport_open):
2500 Add commented out call to dbus_transport_debug_client_new.
2503 Add dbus-transport-debug.[ch] and dbus-server-debug.[ch]
2505 2003-01-28 Havoc Pennington <hp@pobox.com>
2507 * dbus/dbus-message.c (check_message_handling): function to check
2508 on the loaded message, iterates over it etc.
2510 2003-01-28 Havoc Pennington <hp@pobox.com>
2512 * test/Makefile.am (dist-hook): fix make distdir
2514 * dbus/Makefile.am (TESTS_ENVIRONMENT): fix make check
2516 2003-01-27 Havoc Pennington <hp@pobox.com>
2518 * dbus/dbus-mempool.c (time_for_size): replace printf with
2521 * dbus/dbus-message-builder.c (_dbus_message_data_load): allow
2522 empty lines; fix the SAVE_LENGTH stuff to be
2523 START_LENGTH/END_LENGTH so it actually works; couple other
2526 * test/Makefile.am (dist-hook): add dist-hook for .message files
2528 * dbus/dbus-string.c (DBUS_STRING_COPY_PREAMBLE): source of a copy
2529 can be constant or locked.
2530 (_dbus_string_free): allow freeing a const string as
2533 * dbus/dbus-sysdeps.c (_dbus_concat_dir_and_file): utility
2535 * dbus/dbus-test-main.c (main): take an argument which is the
2536 directory containing test data
2538 * dbus/dbus-message.c (_dbus_message_test): pass a test_data_dir
2539 argument to this and load all the messages in test/data/
2540 checking that they can be loaded or not loaded as appropriate.
2542 2003-01-27 Anders Carlsson <andersca@codefactory.se>
2544 * bus/dispatch.c: (bus_dispatch_message_handler):
2545 Dispatch messages sent to services.
2547 * bus/driver.c: (bus_driver_send_service_deleted),
2548 (bus_driver_send_service_created), (bus_driver_send_service_lost),
2549 (bus_driver_send_service_acquired):
2550 Add helper functions for sending service related messages.
2552 (bus_driver_send_welcome_message):
2553 Send HELLO_REPLY instead of WELCOME.
2555 (bus_driver_handle_list_services):
2556 Send LIST_SERVICES_REPLY instead of SERVICES.
2558 (bus_driver_handle_own_service),
2559 (bus_driver_handle_service_exists):
2560 New message handlers.
2562 (bus_driver_handle_message):
2563 Invoke new message handlers.
2565 (bus_driver_remove_connection):
2566 Don't remove any services here since that's done automatically
2567 by bus_service_remove_owner now.
2570 New function signatures.
2572 * bus/services.c: (bus_service_add_owner):
2573 Send ServiceAcquired message if we're the only primary owner.
2575 (bus_service_remove_owner):
2576 Send ServiceAcquired/ServiceLost messages.
2578 (bus_service_set_prohibit_replacement),
2579 (bus_service_get_prohibit_replacement):
2580 Functions for setting prohibit replacement.
2582 (bus_service_has_owner):
2583 New function that checks if a connection is in the owner queue of
2587 Add new function signatures.
2589 * dbus/dbus-list.c: (_dbus_list_test):
2590 Add tests for _dbus_list_remove_last and traversing the list backwards.
2593 Fix a typo in _dbus_list_get_prev_link, if we're at the first element we can't
2594 go any further, so return NULL then.
2596 * dbus/dbus-protocol.h:
2597 Add new messages, service flags and service replies.
2599 2003-01-26 Havoc Pennington <hp@pobox.com>
2601 * dbus/dbus-message-builder.c: implement, completely untested.
2603 * test/data/*: add data to be used in testing.
2604 ".message" files are our simple loadable text format.
2605 ".message-raw" will be binary dumps of messages.
2607 * dbus/dbus-string.c (_dbus_string_starts_with_c_str): new
2609 2003-01-26 Havoc Pennington <hp@pobox.com>
2611 * dbus/dbus-sysdeps.c (_dbus_file_get_contents): new function
2613 * dbus/dbus-errors.c (dbus_result_to_string): add
2616 * dbus/dbus-message-builder.c: new file, will contain code to load
2617 up messages from files. Not implemented yet.
2619 2003-01-26 Havoc Pennington <hp@pobox.com>
2621 * dbus/dbus-message.c (dbus_message_set_sender): support deleting
2622 the sender by setting to NULL
2624 2003-01-26 Havoc Pennington <hp@pobox.com>
2626 The unit tests pass, but otherwise untested. If it breaks, the
2627 tests should have been better. ;-)
2629 * bus/driver.c (bus_driver_handle_hello): return if we disconnect
2632 * dbus/dbus-message.c: redo everything so we maintain
2633 message->header as the only copy of the various fields.
2634 This avoids the possibility of out-of-memory in some cases,
2635 for example dbus_message_lock() can't run out of memory anymore,
2636 and avoids extra copying. Figured I may as well go ahead and do
2637 this since it was busted for dbus_message_lock to not return
2638 failure on OOM, and dbus_message_write_header was totally
2639 unchecked for OOM. Also fixed some random other bugs.
2641 * dbus/dbus-marshal.c (_dbus_marshal_get_field_end_pos): verify
2642 that strings are nul-terminated. Also, end_pos can be equal
2643 to string length just not greater than, I think.
2644 (_dbus_marshal_set_int32): new function
2645 (_dbus_marshal_set_uint32): new function
2646 (_dbus_marshal_set_string): new function
2648 * dbus/dbus-connection.c (_dbus_connection_new_for_transport): fix
2649 a warning, init timeout_list to NULL
2650 (dbus_connection_send_message): don't use uninitialized variable
2653 * dbus/dbus-string.c (_dbus_string_replace_len): new function
2655 2003-01-26 Anders Carlsson <andersca@codefactory.se>
2657 * bus/driver.c: (bus_driver_handle_hello),
2658 (bus_driver_send_welcome_message):
2661 2003-01-26 Anders Carlsson <andersca@codefactory.se>
2663 * dbus/dbus-auth.c: (process_auth), (_dbus_auth_unref):
2664 * dbus/dbus-connection.c: (_dbus_connection_new_for_transport),
2665 (dbus_connection_unref):
2666 * dbus/dbus-marshal.c: (_dbus_marshal_test):
2667 * dbus/dbus-message.c: (dbus_message_unref),
2670 (dbus_message_get_fields):
2671 Remove debugging printout.
2673 (_dbus_message_loader_return_buffer):
2674 Don't store the header string.
2676 (_dbus_message_test):
2679 2003-01-26 Richard Hult <rhult@codefactory.se>
2681 * glib/dbus-gmain.c (dbus_connection_dispatch): Traverse a copy of
2682 the file descriptor list, since it can change under us.
2684 2003-01-25 Anders Carlsson <andersca@codefactory.se>
2686 * glib/dbus-gmain.c: (dbus_connection_prepare),
2687 (dbus_connection_check), (dbus_connection_dispatch), (add_watch),
2688 (remove_watch), (dbus_connection_hookup_with_g_main):
2689 Rewrite the glib handling to use its own GSource instead of a
2690 GIOChannel so we can catch messages put in the queue while waiting
2693 2003-01-25 Anders Carlsson <andersca@codefactory.se>
2696 * bus/connection.c: (connection_disconnect_handler),
2697 (connection_watch_callback), (bus_connection_setup):
2698 * bus/dispatch.c: (send_one_message),
2699 (bus_dispatch_broadcast_message), (bus_dispatch_message_handler),
2700 (bus_dispatch_add_connection), (bus_dispatch_remove_connection):
2702 * bus/driver.c: (bus_driver_send_service_deleted),
2703 (bus_driver_send_service_created), (bus_driver_handle_hello),
2704 (bus_driver_send_welcome_message),
2705 (bus_driver_handle_list_services), (bus_driver_remove_connection),
2706 (bus_driver_handle_message):
2708 Refactor code, put the message dispatching in its own file. Use
2709 _DBUS_HANDLE_OOM. Also send ServiceDeleted messages when a client
2712 2003-01-25 Anders Carlsson <andersca@codefactory.se>
2714 * dbus/dbus-internals.h:
2715 Add _DBUS_HANDLE_OOM macro, it doesn't do anything currently.
2717 * dbus/dbus-message.c: (dbus_message_get_sender):
2718 * dbus/dbus-message.h:
2719 Implement dbus_message_get_sender.
2721 * dbus/dbus-protocol.h:
2722 Add message and service defines.
2724 2003-01-25 Anders Carlsson <andersca@codefactory.se>
2726 * dbus/dbus-connection.c: (dbus_connection_send_message):
2727 * dbus/dbus-message-internal.h:
2728 * dbus/dbus-message.c: (_dbus_message_get_client_serial),
2729 (dbus_message_write_header):
2730 Remove _dbus_messag_unlock and don't set the client serial on a
2731 message if one already exists.
2733 2003-01-24 Havoc Pennington <hp@pobox.com>
2735 * dbus/dbus-list.c (alloc_link): put a thread lock on the global
2738 * bus/driver.c (bus_driver_handle_list_services): fix a leak
2741 2003-01-25 Anders Carlsson <andersca@codefactory.se>
2743 * dbus/dbus-list.c: (alloc_link), (free_link):
2744 Use a memory pool for the links.
2746 2003-01-25 Anders Carlsson <andersca@codefactory.se>
2748 * bus/connection.c: (bus_connection_foreach):
2750 Add new bus_connection_foreach function.
2752 * bus/driver.c: (send_one_message), (bus_driver_broadcast_message):
2753 Add function that broadcasts a message to all clients.
2755 (bus_driver_send_service_created), (bus_driver_handle_hello),
2756 (bus_driver_send_welcome_message),
2757 (bus_driver_handle_list_services), (bus_driver_message_handler):
2758 Implement functions that take care of listing services, and notifying
2759 clients when new services are created.
2761 * bus/services.c: (bus_services_list):
2763 Add new function that returns an array of strings with the currently
2764 registered services.
2767 * glib/dbus-gmain.c:
2768 Update copyright year.
2770 2003-01-25 Anders Carlsson <andersca@codefactory.se>
2772 * dbus/dbus-connection.c: (dbus_connection_send_message):
2773 Unlock the message in case it was sent earlier.
2775 (dbus_connection_send_message_with_reply_and_block):
2776 Remove the reply message from the list.
2778 * dbus/dbus-marshal.c: (_dbus_demarshal_string_array):
2779 Set array_len and new_pos correctly.
2781 (_dbus_marshal_test):
2782 Remove debug output.
2784 * dbus/dbus-message-internal.h:
2785 * dbus/dbus-message.c: (_dbus_message_get_reply_serial):
2786 New function that returns the reply serial.
2788 (_dbus_message_unlock):
2789 New function that unlocks a message and resets its header.
2791 (dbus_message_append_string_array),
2792 (dbus_message_get_fields_valist),
2793 (dbus_message_iter_get_field_type),
2794 (dbus_message_iter_get_string_array),
2795 (dbus_message_get_fields),
2796 (dbus_message_append_fields_valist):
2797 Handle string arrays.
2799 (dbus_message_set_sender):
2800 Make this function public since the bus daemon needs it.
2802 (decode_header_data):
2803 Set the reply serial to -1 initially.
2805 * dbus/dbus-message.h:
2806 Add dbus_message_set_sender.
2808 2003-01-24 Havoc Pennington <hp@pobox.com>
2810 * doc/dbus-specification.sgml: add some stuff
2812 2003-01-22 Havoc Pennington <hp@pobox.com>
2814 * doc/dbus-specification.sgml: Start to document the protocol.
2816 2003-01-22 Havoc Pennington <hp@pobox.com>
2818 * dbus/dbus-connection.c
2819 (dbus_connection_send_message_with_reply_and_block): add some @todo
2821 * bus/driver.c (bus_driver_add_connection): add a FIXME about memleak
2823 2003-01-21 Havoc Pennington <hp@pobox.com>
2825 (patch untested because can't compile)
2827 * bus/driver.c (create_unique_client_name): make this function
2828 never recycle client names. Also, caller should initialize
2831 * dbus/dbus-sysdeps.c (_dbus_get_current_time): new function
2833 2003-01-21 Anders Carlsson <andersca@codefactory.se>
2835 * dbus/dbus-marshal.c: (_dbus_marshal_double),
2836 (_dbus_marshal_int32), (_dbus_marshal_uint32),
2837 (_dbus_marshal_int32_array), (_dbus_marshal_uint32_array),
2838 (_dbus_marshal_double_array), (_dbus_marshal_string_array),
2839 (_dbus_demarshal_int32_array), (_dbus_demarshal_uint32_array),
2840 (_dbus_demarshal_double_array), (_dbus_demarshal_string_array),
2841 (_dbus_marshal_get_field_end_pos), (_dbus_marshal_test):
2842 * dbus/dbus-marshal.h:
2843 * dbus/dbus-protocol.h:
2844 Add support for marshalling and demarshalling integer, double
2847 2003-01-21 Anders Carlsson <andersca@codefactory.se>
2852 * bus/connection.c: (connection_disconnect_handler):
2853 Remove the connection from the bus driver's list.
2855 (connection_watch_callback): Dispatch messages.
2857 (free_connection_data): Free connection name.
2859 (bus_connection_setup): Add connection to the bus driver's list.
2860 (bus_connection_remove_owned_service):
2861 (bus_connection_set_name), (bus_connection_get_name):
2862 Add functions for setting and getting the connection's name.
2865 Add function headers.
2867 * bus/driver.c: (create_unique_client_name),
2868 (bus_driver_handle_hello_message),
2869 (bus_driver_send_welcome_message), (bus_driver_message_handler),
2870 (bus_driver_add_connection), (bus_driver_remove_connection):
2873 * bus/services.c: (bus_service_free):
2875 New file that handles communication and registreation with the bus
2878 2003-01-21 Anders Carlsson <andersca@codefactory.se>
2880 * dbus/dbus-connection.c: (dbus_connection_send_message):
2881 Add a new client_serial parameter.
2883 (dbus_connection_send_message_with_reply):
2884 Remove a @todo since we've implemented the blocking function.
2886 (dbus_connection_send_message_with_reply_and_block):
2887 New function that sends a message and waits for a reply and
2888 then returns the reply.
2890 * dbus/dbus-connection.h:
2893 * dbus/dbus-errors.c: (dbus_result_to_string):
2894 * dbus/dbus-errors.h:
2895 Add new DBUS_RESULT.
2897 * dbus/dbus-message-internal.h:
2898 * dbus/dbus-message.c: (_dbus_message_get_reply_serial),
2899 (_dbus_message_set_sender), (dbus_message_write_header),
2900 (dbus_message_new_reply), (decode_header_data),
2901 (_dbus_message_loader_return_buffer), (_dbus_message_test):
2902 * dbus/dbus-message.h:
2903 Add new functions that set the reply serial and sender.
2904 Also marshal and demarshal them correctly and add test.
2906 * dbus/dbus-protocol.h:
2907 Add new DBUS_MESSAGE_TYPE_SENDER.
2910 * glib/dbus-gmain.c: (watch_callback), (free_callback_data),
2911 (add_watch), (remove_watch), (add_timeout), (remove_timeout),
2912 (dbus_connection_hookup_with_g_main):
2913 * glib/test-dbus-glib.c: (main):
2914 Rewrite to use GIOChannel and remove the GSource crack.
2916 * test/echo-client.c: (main):
2917 * test/watch.c: (check_messages):
2918 Update for changed APIs
2920 2003-01-19 Anders Carlsson <andersca@codefactory.se>
2922 * dbus/Makefile.am: Add dbus-timeout.[cħ]
2924 * dbus/dbus-connection.c: (_dbus_connection_new_for_transport):
2925 Create a DBusTimeoutList.
2926 (dbus_connection_set_timeout_functions): Add new function to
2927 set timeout callbacks
2929 * dbus/dbus-connection.h: Add public DBusTimeout API.
2931 * dbus/dbus-message.c: (dbus_message_get_service):
2932 * dbus/dbus-message.h: New function.
2934 * dbus/dbus-server.c: Fix small doc typo.
2936 * dbus/dbus-timeout.[ch]: New files for mainloop timeouts.
2938 2003-01-19 Anders Carlsson <andersca@codefactory.se>
2940 * dbus/dbus-string.c (_dbus_string_move_len): Don't delete all
2941 of the string, just as long as specified.
2943 2003-01-19 Havoc Pennington <hp@pobox.com>
2945 * dbus/dbus-connection.c (dbus_connection_get_is_authenticated):
2948 * dbus/dbus-server.c (dbus_server_set_max_connections)
2949 (dbus_server_get_max_connections, dbus_server_get_n_connections):
2950 keep track of current number of connections, and add API for
2951 setting a max (but haven't implemented enforcing the max yet)
2953 2003-01-18 Havoc Pennington <hp@pobox.com>
2955 * dbus/dbus-transport-unix.c (unix_do_iteration): only do the
2956 reading/writing if read_watch != NULL or write_watch != NULL.
2958 * dbus/dbus-message.c (_dbus_message_loader_return_buffer): fix
2959 the message loader code to actually load message->header and
2960 message->body into the newly-created message.
2962 * dbus/dbus-transport-unix.c (check_write_watch): fix a mem leak
2965 * dbus/dbus-connection.c (dbus_connection_set_max_message_size)
2966 (dbus_connection_get_max_message_size)
2967 (dbus_connection_set_max_live_messages_size)
2968 (dbus_connection_get_max_live_messages_size): implement some
2969 resource limitation functions
2971 * dbus/dbus-resources.c: new file implementing some of the
2972 resource limits stuff
2974 * dbus/dbus-message.c (dbus_message_iter_get_byte_array): add
2975 missing docs, add @todo to handle OOM etc.
2977 * dbus/dbus-marshal.c (_dbus_demarshal_byte_array): add missing
2980 2003-01-18 Havoc Pennington <hp@pobox.com>
2982 * dbus/dbus-connection.c (dbus_connection_unref): disconnect the
2983 connection if it hasn't been already.
2985 * dbus/dbus-connection.h: kill off the idea of an ErrorFunction,
2986 replace with DisconnectFunction.
2988 2003-01-18 Havoc Pennington <hp@pobox.com>
2990 Building --disable-verbose-mode --disable-asserts --disable-tests
2991 cuts the library from 112K to 45K or so
2993 * configure.in: check for varargs macro support,
2994 add --enable-verbose-mode, --enable-asserts.
2996 * dbus/dbus-internals.h (_dbus_assert): support
2998 (_dbus_verbose): support DBUS_ENABLE_VERBOSE_MODE
3000 2003-01-18 Havoc Pennington <hp@pobox.com>
3002 * dbus/dbus-test.c: include config.h so that tests actually run
3004 * dbus/dbus-string.c: add assertions that stuff is 8-byte aligned,
3005 so the failure mode when that assumption fails will be plenty
3008 2003-01-18 Havoc Pennington <hp@pobox.com>
3010 * configure.in: default --enable-tests to $USE_MAINTAINER_MODE
3012 * dbus/Makefile.am: fix it up so dubs-test-main.c is included in
3015 * test/Makefile.am: don't use special variable "TESTS" for echo-*
3016 since we don't want to use those in make check
3018 2003-01-15 Havoc Pennington <hp@redhat.com>
3024 2003-01-15 Havoc Pennington <hp@redhat.com>
3026 * test/Makefile.am: fix so that test source code ends up in the
3027 distribution on make distcheck
3029 2003-01-15 Havoc Pennington <hp@redhat.com>
3035 2003-01-15 Havoc Pennington <hp@redhat.com>
3037 * dbus/dbus-test.c (dbus_internal_symbol_do_not_use_run_tests):
3038 fix build when --disable-tests
3040 * Makefile.am (EXTRA_DIST): put HACKING in here
3042 * HACKING: document procedure for making a tarball release.
3044 2003-01-14 Anders Carlsson <andersca@codefactory.se>
3046 * bus/connection.c: (connection_error_handler),
3047 (bus_connection_setup):
3048 * bus/main.c: (main):
3049 Make sure that the DBusConnectionData struct is NULLed
3050 out to prevent a segfault.
3052 * dbus/dbus-errors.c: (dbus_result_to_string):
3053 * dbus/dbus-errors.h:
3054 * dbus/dbus-message.c: (dbus_message_get_fields),
3055 (dbus_message_get_fields_valist), (_dbus_message_test):
3056 * dbus/dbus-message.h:
3057 Make dbus_message_get_fields return a result code so we can
3058 track invalid fields as well as oom.
3060 2003-01-11 Havoc Pennington <hp@pobox.com>
3062 * configure.in: change --enable-test/--enable-ansi action-if-given
3063 to enable_foo=$enableval instead of enable_foo=yes
3065 2003-01-08 Havoc Pennington <hp@pobox.com>
3067 * dbus/dbus-string.c (_dbus_string_align_length): new function
3069 * dbus/dbus-test-main.c: move main() for test app here
3071 (dbus_internal_symbol_do_not_use_run_tests): we have to export a
3072 symbol to run tests, because dbus-test isn't in the main
3075 Code review nitpicks.
3077 * dbus/dbus-message.c (dbus_message_write_header): add newlines
3078 for people with narrow emacs ;-). Assert client_serial was filled
3079 in. Assert message->name != NULL.
3080 (dbus_message_append_fields): have "first_field_type" arg separate
3081 from va list, needed for C++ binding that also uses varargs IIRC
3082 and helps with type safety
3083 (dbus_message_new): add @todo about using DBusString to store
3084 service/name internally
3085 (dbus_message_new): don't leak ->service and ->name on OOM later
3087 (dbus_message_unref): free the service name
3088 (dbus_message_get_fields): same change to varargs
3089 i.e. first_field_type
3090 (_dbus_message_loader_return_buffer): assert that the message data
3091 is aligned (if not it's a bug in our code). Put in verbose griping
3092 about why we set corrupted = TRUE.
3093 (decode_header_data): add FIXME that char* is evil. Was going to
3094 add FIXME about evil locale-specific string.h strncmp, but just
3095 switched to wacky string-as-uint32 optimization. Move check for
3096 "no room for field name" above get_const_data_len() to avoid
3097 assertion failure in get_const_data_len if we have trailing 2
3098 bytes or the like. Check for service and name fields being
3099 provided twice. Don't leak service/name on error. Require field
3100 names to be aligned to 4 bytes.
3102 * dbus/dbus-marshal.c: move byte swap stuff to header
3103 (_dbus_pack_int32): uscore-prefix
3104 (_dbus_unpack_int32): uscore-prefix
3105 (_dbus_unpack_uint32): export
3106 (_dbus_demarshal_string): add @todo complaining about use of
3108 (_dbus_marshal_get_field_end_pos): add @todo about bad error
3109 handling allowing corrupt data to go unchecked
3111 2003-01-08 Havoc Pennington <hp@redhat.com>
3113 * dbus/dbus-transport-unix.c (unix_do_iteration): add read/write
3114 to the select() as needed for authentication. (should be using
3115 _dbus_poll() not select, but for another day)
3117 * dbus/dbus.h: include dbus/dbus-protocol.h
3119 2003-01-08 Anders Carlsson <andersca@codefactory.se>
3121 * dbus/Makefile.am (dbusinclude_HEADERS): Install
3124 2003-01-08 Anders Carlsson <andersca@codefactory.se>
3126 * dbus/dbus-internals.c: (_dbus_type_to_string):
3127 New function that returns a string describing a type.
3129 * dbus/dbus-marshal.c: (_dbus_demarshal_byte_array):
3130 * dbus/dbus-marshal.h:
3131 * dbus/dbus-message.c: (dbus_message_get_fields_valist),
3132 (dbus_message_iter_get_field_type), (dbus_message_iter_get_double),
3133 (dbus_message_iter_get_byte_array):
3134 * dbus/dbus-message.h:
3135 Add new convenience functions for appending and getting message fields.
3136 Also add demarshalling routines for byte arrays.
3138 2003-01-07 Anders Carlsson <andersca@codefactory.se>
3140 * dbus/dbus-connection-internal.h:
3141 * dbus/dbus-connection.c: (_dbus_connection_new_for_transport),
3142 (_dbus_connection_get_next_client_serial),
3143 (dbus_connection_send_message):
3144 * dbus/dbus-internals.h:
3145 * dbus/dbus-marshal.c: (unpack_uint32), (dbus_unpack_int32),
3146 (dbus_pack_int32), (_dbus_marshal_double), (_dbus_marshal_int32),
3147 (_dbus_marshal_uint32), (_dbus_demarshal_double),
3148 (_dbus_demarshal_int32), (_dbus_demarshal_uint32),
3149 (_dbus_demarshal_string), (_dbus_marshal_get_field_end_pos),
3150 (_dbus_verbose_bytes), (_dbus_marshal_test):
3151 * dbus/dbus-marshal.h:
3152 * dbus/dbus-message-internal.h:
3153 * dbus/dbus-message.c: (_dbus_message_set_client_serial),
3154 (dbus_message_write_header), (_dbus_message_lock),
3155 (dbus_message_new), (dbus_message_ref), (dbus_message_unref),
3156 (dbus_message_get_name), (dbus_message_append_int32),
3157 (dbus_message_append_uint32), (dbus_message_append_double),
3158 (dbus_message_append_string), (dbus_message_append_byte_array),
3159 (dbus_message_get_fields_iter), (dbus_message_iter_ref),
3160 (dbus_message_iter_unref), (dbus_message_iter_has_next),
3161 (dbus_message_iter_next), (dbus_message_iter_get_field_type),
3162 (dbus_message_iter_get_string), (dbus_message_iter_get_int32),
3163 (dbus_message_iter_get_uint32), (dbus_message_iter_get_double),
3164 (decode_header_data), (_dbus_message_loader_return_buffer),
3165 (message_iter_test), (_dbus_message_test):
3166 * dbus/dbus-message.h:
3167 * dbus/dbus-protocol.h:
3168 * dbus/dbus-test.c: (main):
3170 * glib/test-dbus-glib.c: (message_handler), (main):
3171 * test/echo-client.c: (main):
3172 * test/watch.c: (check_messages):
3173 Make messages sendable and receivable for real.
3175 2003-01-07 Anders Carlsson <andersca@codefactory.se>
3177 * dbus/dbus-marshal.c: (_dbus_marshal_double),
3178 (_dbus_marshal_string), (_dbus_marshal_byte_array):
3179 * dbus/dbus-message.c: (dbus_message_append_int32),
3180 (dbus_message_append_uint32), (dbus_message_append_double),
3181 (dbus_message_append_string), (dbus_message_append_byte_array):
3182 Handle OOM restoration.
3184 2003-01-07 Anders Carlsson <andersca@codefactory.se>
3186 * dbus/dbus-marshal.c: (_dbus_marshal_string),
3187 (_dbus_demarshal_string), (_dbus_marshal_test):
3188 * dbus/dbus-marshal.h:
3189 * dbus/dbus-message.c: (dbus_message_get_name),
3190 Document these functions.
3192 (dbus_message_append_int32), (dbus_message_append_uint32),
3193 (dbus_message_append_double), (dbus_message_append_string),
3194 (dbus_message_append_byte_array):
3195 * dbus/dbus-message.h:
3196 Add functions for adding message fields of different types.
3198 * dbus/dbus-protocol.h:
3199 Add the different types.
3201 2003-01-05 Havoc Pennington <hp@pobox.com>
3203 * bus/connection.c: implement routines for handling connections,
3204 first thing is keeping a list of owned services on each connection
3205 and setting up watches etc.
3207 * bus/services.c: implement a mapping from service names to lists
3210 * dbus/dbus-hash.c: add DBUS_HASH_POINTER
3212 * dbus/dbus-threads.c (dbus_static_mutex_lock): add functions
3213 to use static mutexes for global data
3215 * dbus/dbus-connection.c (dbus_connection_set_data): add new
3216 collection of functions to set/get application-specific data
3217 on the DBusConnection.
3219 2003-01-04 Havoc Pennington <hp@pobox.com>
3221 * dbus/dbus-sysdeps.c (_dbus_sleep_milliseconds): new function
3222 (_dbus_poll): new function
3224 * dbus/dbus-internals.h (_DBUS_STRUCT_OFFSET): new macro
3227 * bus/loop.c: initial code for the daemon main loop
3229 2003-01-04 Havoc Pennington <hp@pobox.com>
3231 * test/watch.c (error_handler): make it safe if the error handler
3232 is called multiple times (if we s/error handler/disconnect
3233 handler/ we should just guarantee it's called only once)
3235 * dbus/dbus-transport.c (_dbus_transport_disconnect): call the
3236 error handler on disconnect (it's quite possible we should
3237 just change the error handler to a "disconnect handler," I'm
3238 not sure we have any other meaningful errors)
3240 * configure.in: check for getpwnam_r
3242 * dbus/dbus-transport.c, dbus/dbus-transport-unix.c,
3243 dbus/dbus-auth.c: add credentials support, add EXTERNAL auth
3244 mechanism as in SASL spec, using socket credentials
3246 * dbus/dbus-sysdeps.c (_dbus_read_credentials_unix_socket): new function
3247 (_dbus_send_credentials_unix_socket): new function
3249 * dbus/dbus-sysdeps.c (_dbus_accept_unix_socket): rename just
3251 (_dbus_write): only check errno if <0 returned
3252 (_dbus_write_two): ditto
3254 2003-01-02 Anders Carlsson <andersca@codefactory.se>
3256 * dbus/dbus-marshal.c: (_dbus_marshal_utf8_string),
3257 (_dbus_marshal_byte_array), (_dbus_demarshal_utf8_string),
3258 (_dbus_marshal_test):
3259 * dbus/dbus-marshal.h:
3260 Add _dbus_marshal_byte_array and rename _dbus_marshal_string
3261 to _dbus_marshal_utf8_string. Also fix some tests.
3263 2002-12-28 Harri Porten <porten@kde.org>
3265 * configure.in: added check for C++ compiler and a very cheesy
3266 check for the Qt integration
3268 * Makefile.am (SUBDIRS): compile qt subdir if support is enabled
3270 * qt/Makefile.am: added
3272 * qt/.cvsignore: added
3274 * qt/dbus-qthread.cc, qt/dbus-qthread.cpp: renamed former to
3275 latter, added #ifdef QT_THREAD_SUPPORT guard.
3277 * dbus/Makefile.am: added missing headers for make dist
3279 2002-12-28 Kristian Rietveld <kris@gtk.org>
3281 * dbus/Makefile.am: fixup export-symbols-regex.
3283 2002-12-27 Anders Carlsson <andersca@codefactory.se>
3285 * acinclude.m4: Add this file and put the
3286 PKG_CHECK_MODULE macro in it.
3288 2002-12-27 Anders Carlsson <andersca@codefactory.se>
3290 * dbus/dbus-marshal.c: (_dbus_marshal_string),
3291 (_dbus_demarshal_double), (_dbus_demarshal_int32),
3292 (_dbus_demarshal_uint32), (_dbus_demarshal_string),
3293 (_dbus_marshal_test):
3294 Make the demarshalling routines align the pos argument.
3295 Add string marshalling tests and fix the obvious bugs
3298 2002-12-26 Havoc Pennington <hp@pobox.com>
3300 * dbus/dbus-auth.c: fixes fixes fixes
3302 * dbus/dbus-transport-unix.c: wire up support for
3303 encoding/decoding data on the wire
3305 * dbus/dbus-auth.c (_dbus_auth_encode_data)
3306 (_dbus_auth_decode_data): append to target string
3307 instead of nuking it.
3309 2002-12-26 Havoc Pennington <hp@pobox.com>
3311 * dbus/dbus-marshal.h (DBUS_COMPILER_BYTE_ORDER): #ifdef
3312 WORDS_BIGENDIAN then compiler byte order is DBUS_BIG_ENDIAN,
3315 * dbus/dbus-marshal.c: Add macros to do int swapping in-place and
3316 avoid swap_bytes() overhead (ignoring possible assembly stuff for
3317 now). Main point is because I wanted unpack_uint32 to implement
3319 (_dbus_verbose_bytes): new function
3321 * dbus/dbus-string.c (_dbus_string_validate_ascii): new function
3323 * dbus/dbus-message.c (_dbus_message_loader_get_is_corrupted): add
3324 mechanism to handle a corrupt message stream
3325 (_dbus_message_loader_new): fix preallocation to only prealloc,
3328 * dbus/dbus-string.c (_dbus_string_skip_blank): fix this function
3329 (_dbus_string_test): enhance tests for copy/move and fix the
3332 * dbus/dbus-transport-unix.c: Hold references in more places to
3333 avoid reentrancy problems
3335 * dbus/dbus-transport.c: ditto
3337 * dbus/dbus-connection.c (dbus_connection_dispatch_message): don't
3338 leak reference count in no-message case
3340 * test/watch.c (do_mainloop): handle adding/removing watches
3341 during iteration over the watches. Also, ref the connection/server
3342 stored on a watch, so we don't try to mangle a destroyed one.
3344 * dbus/dbus-transport-unix.c (do_authentication): perform
3347 * dbus/dbus-auth.c (get_state): add a state
3348 AUTHENTICATED_WITH_UNUSED_BYTES and return it if required
3349 (_dbus_auth_get_unused_bytes): append the unused bytes
3350 to the passed in string, rather than prepend
3352 * dbus/dbus-transport.c (_dbus_transport_init_base): create
3353 the auth conversation DBusAuth
3355 * dbus/dbus-transport-unix.c (_dbus_transport_new_for_fd)
3356 (_dbus_transport_new_for_domain_socket): when creating a
3357 transport, pass in whether it's a client-side or server-side
3358 transport so we know which DBusAuth to create
3360 2002-12-03 Havoc Pennington <hp@pobox.com>
3362 * dbus/dbus-transport-unix.c (unix_finalize): finalize base
3363 _after_ finalizing the derived members
3364 (unix_connection_set): unref watch if we fail to add it
3366 * dbus/dbus-connection.c (dbus_connection_unref): delete the
3367 transport first, so that the connection owned by the
3368 transport will be valid as the transport finalizes.
3370 * dbus/dbus-transport-unix.c (unix_finalize): free the write_watch
3371 if necessary, and remove watches from the connection.
3373 * dbus/dbus-watch.c (_dbus_watch_list_free): improve a comment
3375 2002-12-26 Anders Carlsson <andersca@codefactory.se>
3377 * dbus/dbus-marshal.c: (_dbus_marshal_string),
3378 (_dbus_demarshal_double), (_dbus_demarshal_int32),
3379 (_dbus_demarshal_uint32), (_dbus_demarshal_string),
3380 (_dbus_marshal_test):
3381 * dbus/dbus-marshal.h:
3382 Add string marshal functions and have the demarshal functions
3383 return the new position.
3385 2002-12-25 Havoc Pennington <hp@pobox.com>
3387 * doc/dbus-sasl-profile.txt: docs on the authentication protocol,
3388 it is a simple protocol that just maps directly to SASL.
3390 * dbus/dbus-auth.h, dbus/dbus-auth.c: authentication protocol
3391 initial implementation, not actually used yet.
3393 * dbus/dbus-string.c (_dbus_string_find): new function
3394 (_dbus_string_equal): new function
3395 (_dbus_string_base64_encode): new function
3396 (_dbus_string_base64_decode): new function
3398 2002-12-25 Anders Carlsson <andersca@codefactory.se>
3401 * dbus/dbus-marshal.c: (swap_bytes), (_dbus_marshal_double),
3402 (_dbus_marshal_int32), (_dbus_marshal_uint32),
3403 (_dbus_demarshal_double), (_dbus_demarshal_int32),
3404 (_dbus_demarshal_uint32), (_dbus_marshal_test):
3405 * dbus/dbus-marshal.h:
3406 * dbus/dbus-protocol.h:
3407 * dbus/dbus-test.c: (main):
3409 Add un-optimized marshalling/demarshalling routines.
3411 2002-12-25 Harri Porten <porten@kde.org>
3413 * qt/dbus-qt.h: adjusted ctor and getter to KDE/Qt conventions
3415 2002-12-24 Zack Rusin <zack@kde.org>
3417 * qt/dbus-qthread.cc: adding - integrates QMutex into Dbus
3418 * qt/dbus-qt.h: skeleton with two sample implemenatation of the
3421 2002-12-24 Havoc Pennington <hp@pobox.com>
3423 * glib/dbus-gthread.c: fix include
3425 * glib/dbus-glib.h: rename DBusMessageHandler for now.
3426 I think glib API needs to change, though, as you don't
3427 want to use DBusMessageFunction, you want to use the
3428 DBusMessageHandler object. Probably
3429 dbus_connection_open_with_g_main_loop()
3430 and dbus_connection_setup_g_main_loop() or something like that
3431 (but think of better names...) that just create a connection
3432 that has watch/timeout functions etc. already set up.
3434 * dbus/dbus-connection.c
3435 (dbus_connection_send_message_with_reply): new function just to
3436 show how the message handler helps us deal with replies.
3438 * dbus/dbus-list.c (_dbus_list_remove_last): new function
3440 * dbus/dbus-string.c (_dbus_string_test): free a string that
3443 * dbus/dbus-hash.c: use memory pools for the hash entries
3444 (rebuild_table): be more paranoid about overflow, and
3445 shrink table when we can
3446 (_dbus_hash_test): reduce number of sprintfs and write
3447 valid C89. Add tests for case where we grow and then
3448 shrink the hash table.
3450 * dbus/dbus-mempool.h, dbus/dbus-mempool.c: memory pools
3452 * dbus/dbus-connection.c (dbus_connection_register_handler)
3453 (dbus_connection_unregister_handler): new functions
3455 * dbus/dbus-message.c (dbus_message_get_name): new
3457 * dbus/dbus-list.c: fix docs typo
3459 * dbus/dbus-message-handler.h, dbus/dbus-message-handler.c:
3460 an object representing a handler for messages.
3462 2002-12-16 Anders Carlsson <andersca@codefactory.se>
3465 * glib/dbus-gthread.c: (dbus_gthread_init):
3466 Don't use the gdbus prefix for public functions.
3468 2002-12-16 Anders Carlsson <andersca@codefactory.se>
3472 Add GLib checks and fixup .pc files
3476 * glib/dbus-gmain.c: (gdbus_connection_prepare),
3477 (gdbus_connection_check), (gdbus_connection_dispatch),
3478 (gdbus_add_connection_watch), (gdbus_remove_connection_watch),
3479 (dbus_connection_gsource_new):
3480 * glib/dbus-gthread.c: (dbus_gmutex_new), (dbus_gmutex_free),
3481 (dbus_gmutex_lock), (dbus_gmutex_unlock), (dbus_gthread_init):
3482 * glib/test-dbus-glib.c: (message_handler), (main):
3485 2002-12-15 Harri Porten <porten@kde.org>
3487 * autogen.sh: check for libtoolize before attempting to use it
3489 * dbus/dbus-transport-unix.c: include <sys/time.h> for timeval
3492 * .cvsignore: ignore more stamp files
3494 * dbus/dbus-watch.c (_dbus_watch_list_new): fixed doc error
3496 * test/Makefile.am: added -I$(top_srcdir) to be able to compile
3497 without make install.
3499 2002-12-15 Havoc Pennington <hp@pobox.com>
3501 * dbus/dbus-threads.c: add thread stubs that a higher library
3502 layer can fill in. e.g. the GLib wrapper might fill them in with
3503 GThread stuff. We still need to use this thread API to
3504 thread-safe-ize the library.
3506 2002-12-12 Havoc Pennington <hp@pobox.com>
3508 * dbus/dbus-transport-unix.c, dbus/dbus-server-unix.c: use the
3509 below new interfaces and include fewer system headers.
3511 * dbus/dbus-sysdeps.c (_dbus_read): new function
3512 (_dbus_write): new function
3513 (_dbus_write_two): new function
3514 (_dbus_connect_unix_socket): new function
3515 (_dbus_listen_unix_socket): new function
3517 * dbus/dbus-message-internal.h: change interfaces to use
3520 2002-12-11 Havoc Pennington <hp@pobox.com>
3522 * dbus/dbus-types.h: add dbus_unichar
3524 * dbus/dbus-internals.c (_dbus_verbose): use _dbus_getenv
3526 * dbus/dbus-connection.c (dbus_connection_send_message): return
3529 * dbus/dbus-transport.c: include dbus-watch.h
3531 * dbus/dbus-connection.c: include dbus-message-internal.h
3533 * HACKING: add file with coding guidelines stuff.
3535 * dbus/dbus-string.h, dbus/dbus-string.c: Encapsulate all string
3536 handling here, for security purposes (as in vsftpd). Not actually
3537 using this class yet.
3539 * dbus/dbus-sysdeps.h, dbus/dbus-sysdeps.c: Encapsulate all
3540 system/libc usage here, as in vsftpd, for ease of auditing (and
3541 should also simplify portability). Haven't actually moved all the
3542 system/libc usage into here yet.
3544 2002-11-25 Havoc Pennington <hp@pobox.com>
3546 * dbus/dbus-internals.c (_dbus_verbose): fix to not
3547 always print the first verbose message.
3549 2002-11-24 Havoc Pennington <hp@pobox.com>
3551 * test/echo-client.c, test/echo-server.c: cheesy test
3554 * configure.in (AC_CHECK_FUNCS): check for writev
3556 * dbus/dbus-message.c (_dbus_message_get_network_data): new
3559 * dbus/dbus-list.c (_dbus_list_foreach): new function
3561 * dbus/dbus-internals.c (_dbus_verbose): new function
3563 * dbus/dbus-server.c, dbus/dbus-server.h: public object
3564 representing a server that listens for connections.
3566 * dbus/.cvsignore: create
3568 * dbus/dbus-errors.h, dbus/dbus-errors.c:
3569 public API for reporting errors
3571 * dbus/dbus-connection.h, dbus/dbus-connection.c:
3572 public object representing a connection that
3573 sends/receives messages. (Same object used for
3574 both client and server.)
3576 * dbus/dbus-transport.h, dbus/dbus-transport.c:
3577 Basic abstraction for different kinds of stream
3578 that we might read/write messages from.
3580 2002-11-23 Havoc Pennington <hp@pobox.com>
3582 * dbus/dbus-internals.h (_DBUS_INT_MAX): add _DBUS_INT_MIN
3585 * dbus/dbus-test.c (main): add list test, and include
3586 dbus-test.h as intended
3588 * dbus/dbus-hash.c (_dbus_hash_table_remove_string)
3589 (_dbus_hash_table_remove_int): return value indicates
3590 whether the entry existed to remove
3592 * dbus/dbus-list.c: add linked list utility class,
3595 * dbus/dbus-hash.c: add TODO item about shrinking the hash bucket
3598 2002-11-23 Havoc Pennington <hp@pobox.com>
3600 * Doxyfile.in (INCLUDE_FILE_PATTERNS): expand DBUS_BEGIN_DECLS/
3601 DBUS_END_DECLS to nothing, that should fix this once and for all
3603 * Doxyfile.in (JAVADOC_AUTOBRIEF): set to YES
3605 * dbus/dbus-message.c, dbus/dbus-hash.c:
3606 add some missing @brief
3608 2002-11-23 Havoc Pennington <hp@pobox.com>
3610 * dbus/dbus-message.h: put semicolons after DEBUG_BEGIN_DECLS
3611 to avoid confusing Doxygen
3613 * dbus/dbus-hash.c: @} not }@
3615 * dbus/dbus-message.c (struct DBusMessage): split out
3618 2002-11-23 Havoc Pennington <hp@pobox.com>
3620 * configure.in: pile on more warning flags if using gcc
3622 * Doxyfile.in (EXTRACT_STATIC): set to NO, so we don't have
3623 to document static functions
3625 * configure.in: add summary to end of configure so it
3626 looks nice and attractive
3628 * dbus/dbus-hash.c: finish implementation and write unit
3631 * configure.in: add --enable-tests to enable unit tests
3633 * dbus/dbus-test.c: test program to run unit tests
3634 for all files in dbus/*, initially runs a test for
3637 * dbus/dbus-internals.h: file to hold some internal utility stuff
3639 2002-11-22 Havoc Pennington <hp@redhat.com>
3641 * dbus/dbus-hash.c: copy in Tcl hash table, not yet
3642 "ported" away from Tcl
3644 * dbus/dbus-types.h: header for types such as dbus_bool_t
3646 2002-11-22 Havoc Pennington <hp@redhat.com>
3648 * dbus/dbus.h: fixups for doc warnings
3650 * Doxyfile.in (FILE_PATTERNS): we need to scan .h to pick up
3652 (QUIET): make it quiet so we can see warnings
3654 * dbus/dbus-memory.c: teach D-BUS to allocate and free memory
3656 2002-11-22 Havoc Pennington <hp@redhat.com>
3658 * Makefile.am: include "Doxyfile" target in all-local
3660 * configure.in: generate the Doxyfile
3662 * Doxyfile.in: move Doxyfile here, so we can use
3663 configure to generate a Doxyfile with the right
3666 2002-11-22 Havoc Pennington <hp@redhat.com>
3668 * dbus/dbus-message.c: move inline docs into .c file
3670 * Doxyfile (OUTPUT_DIRECTORY): move output to doc/api
3671 so all docs are under doc/
3672 (MAN_EXTENSION): generate man pages. Use extension
3673 ".3dbus" which matches ".3qt" on my system,
3674 I guess this is OK, I don't know really.
3675 (FILE_PATTERNS): look for .c files not .h, makes sense
3678 2002-11-22 Havoc Pennington <hp@pobox.com>
3680 * Makefile.am (SUBDIRS): rename subdir "server" to "bus"
3681 because any app can be a server, and any app can be a client,
3682 the bus is a special kind of server.
3684 Thu Nov 21 23:35:31 2002 Zack Rusin <zack@kde.org>
3686 * Doxyfile : adding. Still needs Makefile rules to be generated
3687 automatically (just run "doxygen" in the toplevel dir for now to
3690 * dbus/dbus-message.h : Adding sample docs (javadoc since
3691 resembles gtk-doc a little more)
3693 * dbus/dbus.h : Adding sample docs
3695 2002-11-21 Havoc Pennington <hp@redhat.com>
3697 * dbus/Makefile.am (INCLUDES): define DBUS_COMPILATION
3698 so we can allow ourselves to include files directly,
3699 instead of having to use dbus.h
3701 * dbus/dbus.h: fill in
3703 * dbus/dbus-message.h: sketch out a sample header file.
3704 Include griping if you include it directly instead of
3707 * dbus/dbus-macros.h: new file with macros for extern "C",
3708 TRUE/FALSE, NULL, etc.
3710 * doc/file-boilerplate.c: put include guards in here
3712 2002-11-21 Havoc Pennington <hp@redhat.com>
3714 * doc/file-boilerplate.c: include both AFL and GPL boilerplate.
3716 * COPYING: include the GPL as well, and license code
3717 under both AFL and GPL.
3719 2002-11-21 Havoc Pennington <hp@redhat.com>
3721 * acconfig.h: get rid of this
3723 * autogen.sh (run_configure): add --no-configure option
3725 * configure.in: remove AC_ARG_PROGRAM to make
3726 autoconf complain less. add AC_PREREQ.
3727 add AC_DEFINE third arg.
3729 2002-11-21 Anders Carlsson <andersca@codefactory.se>
3732 Fix references so we can distcheck.
3734 2002-11-21 Havoc Pennington <hp@redhat.com>
3736 * Initial module creation