summaryrefslogtreecommitdiffstats
path: root/test
Commit message (Collapse)AuthorAgeFilesLines
* 2003-06-29 Miloslav Trmac <mitr@volny.cz>Miloslav Trmac2003-06-291-2/+2
| | | | | * doc/Makefile.am: * tools/Makefile.am: Don't assume srcdir == builddir.
* Add .cvsignore filesAnders Carlsson2003-06-182-0/+7
|
* 2003-06-15 Joe Shaw <joe@assbarn.com>Joe Shaw2003-06-151-0/+1
| | | | | | | | | | | * configure.in: Check for socklen_t. * dbus/dbus-sysdeps.c: Define socklen_t if it's not defined. * test/test-segfault.c: Add #include <sys/time.h> * tools/Makefile.am: Add DBUS_X_CFLAGS to the INCLUDES since dbus-launch needs it.
* 2003-05-08 Havoc Pennington <hp@pobox.com>Havoc Pennington2003-05-092-7/+160
| | | | | | | | | | | | | | | | | | | | | | | | * dbus/dbus-spawn.c: s/_exit/exit/ because it was keeping gcov data from getting written, and there wasn't a good reason to use _exit really. * test/decode-gcov.c (mark_inside_dbus_build_tests): don't count dbus_verbose lines in test coverage (main): add list of functions sorted by # of untested blocks to the coverage report * dbus/dbus-mempool.c: put some test-only code in DBUS_BUILD_TESTS * dbus/dbus-marshal.c (_dbus_marshal_test): extend test coverage * dbus/dbus-message-handler.c (_dbus_message_handler_test): extend test coverage * test/data/auth/cancel.auth-script: test canceling an authentication * dbus/Makefile.am: remove dbus-server-debug.[hc] for now, as they aren't used. in CVS history if we end up needing them.
* 2003-04-28 Havoc Pennington <hp@redhat.com>dbus-0.10Havoc Pennington2003-04-282-0/+21
| | | | | | | | | | | | | | | * configure.in: 0.10 * NEWS: update * bus/system.conf.in: add <includedir>system.d</includedir> * dbus/dbus-userdb.c (_dbus_user_database_lookup): fix bug when username was provided but not uid * bus/config-parser.c (struct BusConfigParser): keep track of whether the parser is toplevel or was included; change some of the error handling if it's included.
* 2003-04-25 Havoc Pennington <hp@redhat.com>Havoc Pennington2003-04-251-0/+2
| | | | | | | | | | | | | | | | | | | | | test suite is slightly hosed at the moment, will fix soon * bus/connection.c (bus_connections_expire_incomplete): fix to properly disable the timeout when required (bus_connection_set_name): check whether we can remove incomplete connections timeout after we complete each connection. * dbus/dbus-mainloop.c (check_timeout): fix this up a bit, probably still broken. * bus/services.c (bus_registry_acquire_service): implement max number of services owned, and honor allow/deny rules on which services a connection can own. * bus/connection.c (bus_connection_get_policy): report errors here * bus/activation.c: implement limit on number of pending activations
* 2003-04-24 Havoc Pennington <hp@redhat.com>Havoc Pennington2003-04-241-0/+10
| | | | | | | | * test/data/valid-config-files/basic.conf: add <limit> tags to this test * bus/config-parser.h, bus/config-parser.c, bus/bus.c: Implement <limit> tag in configuration file.
* 2003-04-24 Havoc Pennington <hp@redhat.com>Havoc Pennington2003-04-241-3/+3
| | | | | | | | | | | * bus/dispatch.c: somehow missed some name_is * dbus/dbus-timeout.c (_dbus_timeout_set_enabled) (_dbus_timeout_set_interval): new * bus/connection.c (bus_connections_setup_connection): record time when each connection is first set up, and expire them after the auth timeout passes.
* 2003-04-22 Havoc Pennington <hp@redhat.com>Havoc Pennington2003-04-231-2/+0
| | | | | | | | | | | | | * dbus/dbus-message.c, dbus/dbus-marshal.c: add 64-bit integer support, and do some code cleanups to share more code and speed up array marshal/demarshal. * dbus-1.0.pc.in (Cflags): put libdir include file in cflags * configure.in: generate dbus-arch-deps.h * dbus/dbus-protocol.h (DBUS_TYPE_INT64, DBUS_TYPE_UINT64): add 64-bit typecodes
* 2003-04-22 Havoc Pennington <hp@redhat.com>Havoc Pennington2003-04-225-4/+48
| | | | | | | | | | | | | | * test/data/valid-messages/opposite-endian.message: fix test to use proper type for rply field * test/data/invalid-messages: add tests for below validation * dbus/dbus-message.c (decode_header_data): validate field types, and validate that named fields are valid names (decode_name_field): consider messages in the org.freedesktop.Local. namespace to be invalid. * dbus/dbus-string.c (_dbus_string_validate_name): new
* 2003-04-18 Havoc Pennington <hp@pobox.com>Havoc Pennington2003-04-181-6/+1
| | | | | | | | | | | | | | * glib/dbus-gmain.c: adapt to watch changes * bus/bus.c, bus/activation.c, etc.: adjust to watch changes * dbus/dbus-server.h: remove dbus_server_handle_watch * dbus/dbus-connection.h: remove dbus_connection_handle_watch * dbus/dbus-watch.c (dbus_watch_handle): change DBusWatch to work like DBusTimeout, so we don't need dbus_connection_handle_watch etc.
* 2003-04-14 Havoc Pennington <hp@redhat.com>Havoc Pennington2003-04-141-0/+16
| | | | | | | | | | | | | | * dbus/dbus-userdb.c: user database abstraction, mostly to get caching, but at some point we might want to be able to use a different database. * bus/dispatch.c (bus_dispatch_sha1_test): add a test that uses SHA1 conf file to test the sha1 auth mechanism, since the regular test always uses EXTERNAL when available. * configure.in, test/data/valid-config-files/debug-allow-all-sha1.conf.in: add conf file that requires use of sha1 auth
* 2003-04-13 Havoc Pennington <hp@pobox.com>Havoc Pennington2003-04-141-0/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | * dbus/dbus-mainloop.c: fix some reentrancy issues by refcounting callbacks * test/data/valid-config-files/debug-allow-all.conf.in: allow all users * dbus/dbus-transport.c (_dbus_transport_get_dispatch_status): fix to only recover unused bytes if we're already authenticated (_dbus_transport_get_is_authenticated): fix to still mark us authenticated if there are unused bytes. * bus/dispatch.c: implement security policy checking * bus/connection.c (bus_transaction_send_from_driver): new * bus/bus.c (bus_context_check_security_policy): new * bus/dispatch.c (send_service_nonexistent_error): delete this, now we just set the DBusError and it gets converted to an error reply. * bus/connection.c (allow_user_function): enable code using actual data from the config file * bus/policy.c (list_allows_user): handle wildcard rules for user/group connection perms
* 2003-04-12 Havoc Pennington <hp@pobox.com>Havoc Pennington2003-04-131-5/+56
| | | | | | | | | | | * bus/config-parser.c (bus_config_parser_new): fix a memleak * dbus/dbus-sysdeps.c: change DBusCredentials to use longs for the pid/gid/uid, just for paranoia. * test/break-loader.c (randomly_do_n_things): find a byte containing a type code, and randomly change it to a different type code.
* 2003-04-12 Havoc Pennington <hp@pobox.com>Havoc Pennington2003-04-121-0/+14
| | | | | | | | | | | * bus/policy.h: change BusPolicy to be the thing from the config file, and rename old BusPolicy to BusClientPolicy * bus/bus.c, bus/connection.c, bus/config-parser.c: change to match change in how policy works * dbus/dbus-internals.h: mark assert_not_reached as __attribute((noreturn))__
* 2003-04-11 Havoc Pennington <hp@pobox.com>Havoc Pennington2003-04-112-64/+114
| | | | | | | | | | | * test/decode-gcov.c: add "below average functions" to the coverage report, and change how some of the code works. * bus/test-main.c: bracket some stuff in DBUS_BUILD_TESTS so it's not in the coverage stats. * test/test-service.c (main): use _dbus_verbose not fprintf in a couple places so running the test suite doesn't result in megaspam.
* 2003-04-10 Havoc Pennington <hp@pobox.com>Havoc Pennington2003-04-113-2/+15
| | | | | | | | * bus/dispatch.c (check_segfault_service_activation): add test for launching an executable that just crashes. * test/test-segfault.c (main): try setting coredumpsize to 0 so we don't leave a million cores. We'll see how portable this is.
* 2003-04-10 Havoc Pennington <hp@redhat.com>Havoc Pennington2003-04-111-3/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * dbus/dbus-connection.c (dbus_connection_flush): don't spin on the connection if it's disconnected * bus/activation.c (bus_activation_service_created): use new transaction features to roll back removal of pending activation if we don't successfully create the service after all. Don't remove pending activation if the function fails. * dbus/dbus-list.c (_dbus_list_insert_before_link) (_dbus_list_insert_after_link): new code to facilitate services.c fixes * dbus/dbus-hash.c (_dbus_hash_table_insert_string_preallocated): new functionality, so we can preallocate the ability to insert into a hash table. * bus/connection.c (bus_transaction_add_cancel_hook): new function allowing us to put custom hooks in a transaction to be used for cancelling said transaction * doc/dbus-specification.sgml: add some discussion of secondary service owners, and disallow zero-length service names * bus/services.c (bus_registry_acquire_service): new function, splits out part of bus_driver_handle_acquire_service() and fixes a bug where we didn't remove the service doing the acquiring from the secondary queue if we failed to remove the current owner from the front of the queue.
* 2003-04-10 Alexander Larsson <alexl@redhat.com>Alexander Larsson2003-04-101-0/+5
| | | | | | | | | | | | | | | | | | | * bus/.cvsignore: * glib/.cvsignore: * test/.cvsignore: Added files to cvsignore * dbus/dbus-message.h: * dbus/dbus-message.c: (dbus_message_iter_get_named): Make get_named() take two out argument and return a boolean. (dbus_message_iter_get_args_valist): Update usage of get_named(). (dbus_message_iter_append_byte): Fix typo (dbus_message_iter_append_named) Fix typo (message_iter_test), (check_message_handling_type), (_dbus_message_test): More tests.
* 2003-04-10 Alexander Larsson <alexl@redhat.com>Alexander Larsson2003-04-104-29/+62
| | | | | | | | | | | | | | | | | | | | | | | | | | | * dbus/dbus-marshal.[ch]: Add array_type_pos argument to _dbus_marshal_validate_arg. Let you pass a NULL end_pos to _dbus_marshal_validate_type. * dbus/dbus-message.[ch]: Multi-dimensional arrays have full type specification in the outermost array. Iter code re-arranged to handle this. Added some more iter tests. * doc/dbus-specification.sgml: Add me to authors. Remove old FIXME. Update new array encoding description. Correct DBUS_SERVICE_FLAGS_REPLACE_EXISTING description. * test/data/invalid-messages/array-with-mixed-types.message: * test/data/valid-messages/array-of-array-of-uint32.message: Change to the new array format. * test/data/invalid-messages/too-short-dict.message: Fix bug in test. * test/data/valid-messages/recursive-types.message: Fix up and extend test.
* 2003-04-10 Havoc Pennington <hp@pobox.com>Havoc Pennington2003-04-101-2/+3
| | | | | | | | | | | | | | | | | | | | * bus/dispatch.c: lots of fixes * dbus/dbus-mainloop.c (_dbus_loop_dispatch): export (_dbus_loop_iterate): remove old "quit if no callbacks" code, that was crack, broke the test service. * dbus/dbus-transport.c (_dbus_transport_open): fix error handling to avoid piling up errors if we get a failure on the first address. * dbus/dbus-internals.c (_dbus_real_assert_not_reached): include pid in assertion failures. * dbus/dbus-mainloop.c (_dbus_loop_iterate): use static arrays up to some fixed size of file descriptor array. Don't return TRUE anytime a timeout exists, that led to lots of busy loop silliness in the tests.
* 2003-04-09 Havoc Pennington <hp@redhat.com>Havoc Pennington2003-04-091-39/+31
| | | | | | | | | | | | | | | | | | | | | | | | | | | * test/test-utils.c: use dispatch status function to fix this up * bus/connection.c (connection_watch_callback): don't dispatch from here (connection_timeout_callback): don't dispatch from here (bus_connections_setup_connection): set the dispatch status function (bus_connection_disconnected): unset it * dbus/dbus-mainloop.c (_dbus_loop_queue_dispatch): new function used to add a connection to be dispatched (_dbus_loop_iterate): do the dispatching at the end of each iteration * dbus/dbus-connection.c (dbus_connection_set_dispatch_status_function): new function allowing us to fix up main loop usage (_dbus_connection_last_unref): free all the various function user data (dbus_connection_dispatch): call the DispatchStatusFunction whenever this function returns (dbus_connection_handle_watch): call DispatchStatusFunction (dbus_connection_send_with_reply_and_block): call DispatchStatusFunction (reply_handler_timeout): call DispatchStatusFunction (dbus_connection_flush): call DispatchStatusFunction
* 2003-04-09 Havoc Pennington <hp@redhat.com>Havoc Pennington2003-04-092-1/+7
| | | | | | | | | | | | | * dbus/dbus-bus.c (dbus_bus_register): fix up error handling and a memory leak * bus/dispatch.c (check_service_activated): fix bug in test * dbus/dbus-mainloop.c (check_timeout): fix this up * dbus/dbus-internals.c (_dbus_verbose_real): include PID in verbose output so we can sort out output from different processes, e.g. in the activation case.
* 2003-04-08 Havoc Pennington <hp@redhat.com>Havoc Pennington2003-04-083-0/+105
| | | | | | | | | | | | | | | | * test/data/invalid-messages/array-with-mixed-types.message: regression test that fails for the moment * dbus/dbus-test.c (dbus_internal_do_not_use_run_tests): reorder tests for convenience * dbus/dbus-marshal.c (_dbus_marshal_validate_arg): don't allow array of nil, it broke things. * test/data/invalid-messages/array-of-nil.message: regression test * test/data/valid-messages/array-of-array-of-uint32.message: happened to write this so added it to suite
* 2003-04-08 Alexander Larsson <alexl@redhat.com>Alexander Larsson2003-04-0814-41/+192
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Implemented recursive types, named types and new-style iters * bus/driver.c: * glib/test-thread-client.c: (thread_func): * glib/test-thread-server.c: (handle_test_message): * test/test-service.c: (handle_echo): Update to new api * dbus/Makefile.am: * dbus/dbus-dict.c: * dbus/dbus-dict.h: * dbus/dbus.h Remove DBusDict * dbus/dbus-internals.c: (_dbus_type_to_string): Update for new types. * dbus/dbus-marshal.[ch]: Implement recursive types and the new marshalling format. Remove hardcoded dict marshalling. Marshal named types. * dbus/dbus-message-builder.c: Add BYTE_ARRAY. Remove references to old types * dbus/dbus-message.[ch]: New non-refcounted iter API that supports recursive iters. Use iters for appending, including support for recursive iters. Add byte and named type support. Update everything to new marshalling formats. Add tests for new API. * dbus/dbus-protocol.h: Remove old array types. Add types: BYTE, ARRAY, DICT, NAMED * dbus/dbus-string.c: * dbus/dbus-sysdeps.c: Make parse_double locale safe. * dbus/dbus-test-main.c: Call setlocale. * dbus/dbus-test.c: Kill dict test * doc/dbus-specification.sgml: Update spec * test/data/incomplete-messages/missing-body.message: * test/data/invalid-messages/bad-boolean.message: * test/data/invalid-messages/bad-boolean-array.message: * test/data/invalid-messages/boolean-array-length-too-long.message-raw: * test/data/invalid-messages/boolean-has-no-value.message-raw: * test/data/invalid-messages/too-short-dict.message: * test/data/valid-messages/dict-simple.message: * test/data/valid-messages/dict.message: * test/data/valid-messages/emptiness.message: * test/data/valid-messages/lots-of-arguments.message: * test/data/valid-messages/no-padding.message: * test/data/valid-messages/recursive-types.message: Add missing NAME fields Fix up dicts & arrays * test/data/invalid-messages/dict-with-nil-value.message: Removed, this is not invalid anymore. * test/data/valid-messages/recursive-types.message: Add new test for deeply recursive types.
* 2003-04-07 Havoc Pennington <hp@redhat.com>Havoc Pennington2003-04-073-4/+45
| | | | | | | | | | | | | * doc/dbus-specification.sgml: require that base service names start with ':' and that the base service is created/deleted as first and last things a connection does on the bus * bus/dispatch.c (check_existent_service_activation): lots more work on the activation test; it doesn't fully pass yet... * test/test-service.c (main): fix so we don't memleak the connection to the message bus (filter_func): accept a message asking us to exit
* having a bad cvs add day apparentlyHavoc Pennington2003-04-072-0/+195
|
* 2003-04-06 Havoc Pennington <hp@pobox.com>Havoc Pennington2003-04-071-8/+29
| | | | | | | | | | | | | | | | | | | | * qt/Makefile.am (dbusinclude_HEADERS): install dbus-qt.h, from Colin Walters * configure.in: fixes to Qt detection from Colin Walters * doc/Makefile.am: Only remove generated docbook dirs if they exist, from Colin Walters * dbus/dbus-bus.c: change how we set well-known connections to NULL, so that it works if a single connection is stored in two well-known array slots. * test/Makefile.am: remove a lot of stuff that isn't immediately useful, it's in CVS history if we want it. * test/test-service.c: use dbus-mainloop instead of that watch.[hc] crack
* 2003-04-06 Havoc Pennington <hp@pobox.com>Havoc Pennington2003-04-0711-1087/+17
| | | | | | | | * test/Makefile.am: remove a lot of stuff that isn't immediately useful, it's in CVS history if we want it. * test/test-service.c: use dbus-mainloop instead of that watch.[hc] crack
* 2003-04-06 Havoc Pennington <hp@pobox.com>Havoc Pennington2003-04-061-0/+1
| | | | | | | | | | | | | | * bus/bus.c (bus_context_new): print the address in here, rather than in main(), because we need to do it before forking the daemon * bus/dispatch.c (send_service_nonexistent_error): set the sender on the service nonexistent error * bus/driver.c (bus_driver_handle_acquire_service): set the sender on the AcquireService reply * test/data/valid-config-files/debug-allow-all.conf.in: Make test server also listen on a UNIX socket so services can connect to it.
* 2003-04-05 Havoc Pennington <hp@pobox.com>dbus-0.7Havoc Pennington2003-04-051-1/+1
| | | | | | | | * test/Makefile.am (dist-hook): also dist *.in files * NEWS: update * configure.in: 0.7
* 2003-04-05 Havoc Pennington <hp@pobox.com>Havoc Pennington2003-04-051-37/+97
| | | | | | * test/decode-gcov.c (main): print per-directory stats in the report * Makefile.am (coverage-report.txt): don't include test/* in gcov stats
* 2003-04-05 Havoc Pennington <hp@pobox.com>Havoc Pennington2003-04-052-1/+1944
| | | | | | | | | | * Makefile.am (coverage-report.txt): add target "coverage-report.txt" * test/decode-gcov.c: hack up a little program to suck data out of gcov files. Yes this is sort of silly. * configure.in: define something in config.h and do an AM_CONDITIONAL when gcov is enabled
* 2003-04-04 Havoc Pennington <hp@redhat.com>Havoc Pennington2003-04-055-2/+46
| | | | | | | | | | | | * dbus/dbus-spawn.c, dbus/dbus-spawn.h: Change dbus_spawn to return a "babysitter" object that is used to monitor the status of the spawned process and reap it when required. * test/test-segfault.c, test/test-exit.c, test/test-sleep-forever.c: binaries that do various lame things, used in the test suite. * dbus/dbus-sysdeps.c: kill _dbus_errno_to_string()
* 2003-04-03 Havoc Pennington <hp@redhat.com>Havoc Pennington2003-04-032-4/+85
| | | | | | | | | | * bus/activation.c (load_directory): fix up memleaks (bus_activation_entry_free): free the entry * dbus/dbus-bus.c (dbus_bus_acquire_service): return an error if we get one from the message bus; fix memleaks. * dbus/dbus-message.c (dbus_set_error_from_message): new function
* commit adds/removes here before builddir contents confuse mattersHavoc Pennington2003-04-032-0/+4
|
* 2003-04-03 Havoc Pennington <hp@pobox.com>Havoc Pennington2003-04-032-1/+37
| | | | | | | | | | | | | | | | | | | | | | | | | * bus/config-parser.c (bus_config_parser_unref): free list of mechanisms, bug discovered by test suite enhancements (putting system.conf and session.conf into suite) * test/Makefile.am, test/test-service.c: add placeholder for a test service that we'll activate as part of test suite. Doesn't do anything yet. * dbus/dbus-sysdeps.c (_dbus_setenv): support unsetenv by setting NULL value, and use system malloc not dbus_malloc() when we have unavoidable memleakage. * dbus/dbus-bus.c (dbus_bus_get): fix bug where bus type of 0 didn't work, and support DBUS_BUS_ACTIVATION. * bus/activation.c (child_setup): pass our well-known bus type to the child * bus/config-parser.c: support <type> to specify well-known type * doc/dbus-specification.sgml: document the env variables to locate well-known buses and find service activator
* 2003-04-02 Havoc Pennington <hp@redhat.com>Havoc Pennington2003-04-034-75/+59
| | | | | | | * test/Makefile.am (all-local): add a rule to copy tests to builddir, so we can have generated tests. Use this to remove the silly hack for testing system.conf and session.conf. Will use this shortly to generate .service files pointing to test binaries.
* 2003-04-02 Havoc Pennington <hp@redhat.com>Havoc Pennington2003-04-021-0/+13
| | | | | | | | | | | | | | * dbus/dbus-sysdeps.c (_dbus_file_get_contents): include filenames in error messages (_dbus_string_get_dirname): new (_dbus_sysdeps_test): new (_dbus_directory_open): include dirnames in error messages * bus/config-parser.c: interpret <include> and <includedir> and <servicedir> relative to config file location if the given filename is not absolute. * dbus/dbus-string.c (_dbus_string_find_byte_backward): new
* 2003-04-01 Havoc Pennington <hp@redhat.com>Havoc Pennington2003-04-021-0/+2
| | | | | | | | * bus/config-parser.c, bus/bus.c: implement <servicedir> and <includedir> (at least mostly) * dbus/dbus-sysdeps.c (_dbus_change_identity): set the group ID first, then the user ID
* 2003-03-31 Havoc Pennington <hp@redhat.com>Havoc Pennington2003-03-312-17/+14
| | | | | | | | | | | | Fix some annoying DBusString API and fix all affected code. * dbus/dbus-string.c (_dbus_string_init): get rid of annoying max_length argument (_dbus_string_get_data): change to return string instead of using an out param (_dbus_string_get_const_data): ditto (_dbus_string_get_data_len): ditto (_dbus_string_get_const_data_len): ditto
* 2003-03-31 Havoc Pennington <hp@pobox.com>Havoc Pennington2003-03-315-2/+84
| | | | | | | | | | | | | | | | | | | | | | | | | | | * dbus/dbus-transport-unix.c (_dbus_transport_new_for_domain_socket) (_dbus_transport_new_for_tcp_socket): these didn't need the "server" argument since they are always client side * dbus/dbus-server.c (dbus_server_get_address): new function * bus/main.c (main): take the configuration file as an argument. * test/data/valid-config-files/debug-allow-all.conf: new file to use with dispatch.c tests for example * bus/test-main.c (main): require test data dir * bus/bus.c (bus_context_new): change this to take a configuration file name as argument * doc/config-file.txt (Elements): add <servicedir> * bus/system.conf, bus/session.conf: new files * dbus/dbus-bus.c (dbus_bus_get): look for system bus on well-known socket if none set * configure.in: create system.conf and session.conf
* 2003-03-30 Havoc Pennington <hp@pobox.com>Havoc Pennington2003-03-311-0/+4
| | | | | | | | | | | | | | | | | | | | * bus/config-parser.c: hacking * dbus/dbus-memory.c: don't use DBusList for the list of stuff to shut down, since it could cause weirdness with the DBusList lock * dbus/dbus-list.c (_dbus_list_test): add tests for the link-oriented stack routines (alloc_link): free the mempool if the first alloc from it fails * dbus/dbus-mempool.c (struct DBusMemBlock): fix alignment issue * dbus/dbus-string.c (UNICODE_VALID): sync new version of this from GLib (_dbus_string_skip_white): new * doc/config-file.txt (Elements): add <includedir>
* 2003-03-26 Havoc Pennington <hp@pobox.com>Havoc Pennington2003-03-261-0/+7
| | | | | | | | | | | | | | | * bus/test-main.c, dbus/dbus-test.c (main): check memleaks after every test so it's quick and easy to see which leaked, and so we test multiple dbus_shutdown() calls * configure.in: change configure.in XML stuff to also support expat * config-loader-libxml.c: some hacking * config-loader-expat.c: some hacking * config-parser.c: some hacking, plus tests
* 2003-03-24 Havoc Pennington <hp@redhat.com>Havoc Pennington2003-03-253-12/+16
| | | | | | | | | | | | | | | | * dbus/dbus-sysdeps.c (_dbus_set_fd_nonblocking): move to this file * dbus/dbus-errors.c (dbus_set_error, dbus_set_error_const): allow NULL argument for "message" if the error is a well-known one, fill in a generic message in this case. * dbus/dbus-errors.h (DBusResultCode): Kill DBusResultCode in favor of DBusError * bus/test.c (bus_test_flush_bus): add * bus/policy.c (bus_policy_test): test code stub
* 2003-03-16 Anders Carlsson <andersca@codefactory.se>Anders Carlsson2003-03-161-0/+44
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * dbus/dbus-connection.c: (dbus_connection_send_with_reply_and_block): Decrease connection->n_incoming when removing an entry from the list. * dbus/dbus-dict.c: (dbus_dict_entry_free), (dbus_dict_set_boolean_array), (dbus_dict_set_int32_array), (dbus_dict_set_uint32_array), (dbus_dict_set_double_array), (dbus_dict_set_byte_array), (dbus_dict_set_string_array), (dbus_dict_get_boolean_array), (dbus_dict_get_double_array), (dbus_dict_get_byte_array): Handle NULL arrays and strings. Also add support for byte arrays. * dbus/dbus-marshal.c: (_dbus_marshal_byte_array), (_dbus_marshal_dict), (_dbus_demarshal_byte_array), (_dbus_demarshal_int32_array), (_dbus_demarshal_uint32_array), (_dbus_demarshal_double_array), (_dbus_demarshal_string_array), (_dbus_demarshal_dict), (demarshal_and_validate_len), (_dbus_marshal_validate_arg), (_dbus_marshal_test): * dbus/dbus-marshal.h: Add support for marshalling and demarshalling empty arrays and strings. * dbus/dbus-message.c: (dbus_message_append_args_valist), (dbus_message_append_string_array), (dbus_message_iter_get_boolean), (dbus_message_iter_get_boolean_array), (dbus_message_iter_get_int32_array), (dbus_message_iter_get_uint32_array), (dbus_message_iter_get_double_array), (dbus_message_iter_get_byte_array), (dbus_message_iter_get_string_array), (dbus_message_iter_get_dict), (check_message_handling): Add support for getting empty arrays and dicts. * dbus/dbus-string.c: (_dbus_string_validate_utf8): Don't do any validation at all for now, that's better than just checking for ASCII. * test/data/valid-messages/emptiness.message: New test message with lots of empty arrays.
* 2003-03-16 Havoc Pennington <hp@pobox.com>Havoc Pennington2003-03-161-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Oops - test code was only testing failure of around 30 of the mallocs in the test path, but it turns out there are 500+ mallocs. I believe this was due to misguided linking setup such that there was one copy of dbus_malloc etc. in the daemon and one in the shared lib, and only daemon mallocs were tested. In any case, the test case now tests all 500+ mallocs, and doesn't pass yet, though there are lots of fixes in this patch. * dbus/dbus-connection.c (dbus_connection_dispatch_message): fix this so that it doesn't need to allocate memory, since it has no way of indicating failure due to OOM (and would be annoying if it did). * dbus/dbus-list.c (_dbus_list_pop_first_link): new function * bus/Makefile.am: rearrange to create two self-contained libraries, to avoid having libraries with overlapping symbols. that was resulting in weirdness, e.g. I'm pretty sure there were two copies of global static variables. * dbus/dbus-internals.c: move the malloc debug stuff to dbus-memory.c * dbus/dbus-list.c (free_link): free list mempool if it becomes empty. * dbus/dbus-memory.c (_dbus_disable_mem_pools): new function * dbus/dbus-address.c (dbus_parse_address): free list nodes on failure. * bus/dispatch.c (bus_dispatch_add_connection): free message_handler_slot when no longer using it, so memory leak checkers are happy for the test suite. * dbus/dbus-server-debug-pipe.c (debug_finalize): free server name * bus/bus.c (new_connection_callback): disconnect in here if bus_connections_setup_connection fails. * bus/connection.c (bus_connections_unref): fix to free the connections (bus_connections_setup_connection): if this fails, don't disconnect the connection, just be sure there are no side effects. * dbus/dbus-string.c (undo_alignment): unbreak this * dbus/dbus-auth.c (_dbus_auth_unref): free some stuff we were leaking (_dbus_auth_new): fix the order in which we free strings on OOM failure * bus/connection.c (bus_connection_disconnected): fix to not send ServiceDeleted multiple times in case of memory allocation failure * dbus/dbus-bus.c (dbus_bus_get_base_service): new function to get the base service name (dbus_bus_register_client): don't return base service name, instead store it on the DBusConnection and have an accessor function for it. (dbus_bus_register_client): rename dbus_bus_register() * bus/dispatch.c (check_hello_message): verify that other connections on the bus also got the correct results, not just the one sending hello
* 2003-03-15 Havoc Pennington <hp@pobox.com>Havoc Pennington2003-03-151-44/+55
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Make it pass the Hello handling test including all OOM codepaths. Now to do other messages... * bus/services.c (bus_service_remove_owner): fix crash when removing owner from an empty list of owners (bus_registry_ensure): don't leave service in the list of a connection's owned services if we fail to put the service in the hash table. * bus/connection.c (bus_connection_preallocate_oom_error): set error flag on the OOM error. * dbus/dbus-connection.c (_dbus_connection_new_for_transport): handle _dbus_transport_set_connection failure * dbus/dbus-transport-unix.c (_dbus_transport_new_for_fd): modify to create watches up front and simply enable/disable them as needed. (unix_connection_set): this can now fail on OOM * dbus/dbus-timeout.c, dbus/dbus-watch.c: add concept of enabling/disabling a watch or timeout. * bus/loop.c (bus_loop_iterate): don't touch disabled watches/timeouts * glib/dbus-gmain.c: adapt to enable/disable watches and timeouts
* 2003-03-13 Havoc Pennington <hp@redhat.com>Havoc Pennington2003-03-141-17/+37
| | | | | | | | | | | | | | | | | | | | | | | | | | | | * dbus/dbus-timeout.c (_dbus_timeout_list_set_functions): handle out of memory * dbus/dbus-watch.c (_dbus_watch_list_set_functions): handle out of memory * dbus/dbus-connection.h: Make AddWatchFunction and AddTimeoutFunction return a bool so they can fail on out-of-memory * bus/bus.c (bus_context_new): set up timeout handlers * bus/connection.c (bus_connections_setup_connection): set up timeout handlers * glib/dbus-gmain.c: adapt to the fact that set_functions stuff can fail * bus/bus.c (bus_context_new): adapt to changes * bus/connection.c: adapt to changes * test/watch.c: adapt to DBusWatch changes * bus/dispatch.c (bus_dispatch_test): started adding this but didn't finish
* 2003-03-12 Havoc Pennington <hp@pobox.com>Havoc Pennington2003-03-131-9/+8
| | | | | | | | | | | Throughout: purge global variables, introduce BusActivation, BusConnections, BusRegistry, etc. objects instead. * bus/bus.h, bus/bus.c: introduce BusContext as a global message bus object * test/Makefile.am (TEST_BINARIES): disable bus-test for now, going to redo this a bit differently I think