History log of /external/dbus/dbus/dbus-string.c
Revision Date Author Comments (<<< Hide modified files) (Show modified files >>>)
3100d06aa6965f2eaa3f8f393817d0a4858c5329 21-Oct-2008 The Android Open Source Project <initial-contribution@android.com> Initial Contribution

Change-Id: I0ab320d198c700993f361d7d3d5b46a33a708fc9
/external/dbus/dbus/dbus-string.c
dbecdeabb20e0ce11121819c63373f0afba57c58 19-Mar-2010 Marcus Brinkmann <marcus.brinkmann@ruhr-uni-bochum.de> Consistently include <config.h> in all C source files and never in header files.
/external/dbus/dbus/dbus-string.c
47e37899a3daf33ab799f674c2dc8ce869cdd5fa 28-Feb-2010 Ralf Habacker <ralf.habacker@freenet.de> _dbus_string_toupper_ascii(): new function, reviewed by Colin Walters.
/external/dbus/dbus/dbus-string.c
a06c771d2b931f0e5ae600d22a3e07208f16b0a3 28-Feb-2010 Ralf Habacker <ralf.habacker@freenet.de> _dbus_string_tolower_ascii(): new function, reviewed by Colin Walters.
/external/dbus/dbus/dbus-string.c
e1c31c73074513d96fa22b5c0355107c42720597 22-Feb-2010 Colin Walters <walters@verbum.org> Merge branch 'dbus-1.2'

Conflicts:
bus/bus.c
bus/selinux.c
configure.in
fbeb13517ef667b8ed4136bcb9e52ff9924419c1 19-Feb-2010 Colin Walters <walters@verbum.org> [dbus-string] Sync up UNICODE_VALID with glib, add documentation

See https://bugzilla.gnome.org/show_bug.cgi?id=107427 for rationale
behind the first change.

The documentation was derived from an IRC conversation with
Behdad Esfahbod.
/external/dbus/dbus/dbus-string.c
f81e8702a6c09e1394c28ac110fa602050c5f74a 18-Feb-2010 Colin Walters <walters@verbum.org> Revert "_dbus_string_to_lower(): new function"

This reverts commit 39aa8090241b2588eeb2df05880d71abaf8c526e.
/external/dbus/dbus/dbus-string.c
39aa8090241b2588eeb2df05880d71abaf8c526e 12-Feb-2010 Ralf Habacker <ralf.habacker@freenet.de> _dbus_string_to_lower(): new function
/external/dbus/dbus/dbus-string.c
fdf24b805e9e2883bcd08335924e08a9c68ab719 23-Dec-2009 Ralf Habacker <ralf.habacker@freenet.de> nonce tcp support requires _dbus_string_equal_len also when build without tests
/external/dbus/dbus/dbus-string.c
dc33f4f7749ed303374ebdf00e48ea8a471afd25 11-Jul-2009 Tobias Mueller <fdo-bugs@cryptobitch.de> Bug 21161 - Update the FSF address

No comment.

Signed-off-by: Colin Walters <walters@verbum.org>
(cherry picked from commit 5baf2f856a9c6625993234855b07680da1c8916f)
/external/dbus/dbus/dbus-string.c
5baf2f856a9c6625993234855b07680da1c8916f 11-Jul-2009 Tobias Mueller <fdo-bugs@cryptobitch.de> Bug 21161 - Update the FSF address

No comment.

Signed-off-by: Colin Walters <walters@verbum.org>
/external/dbus/dbus/dbus-string.c
86df8ad59229bc511689e0e1d431a5cf246685db 21-Apr-2009 Colin Walters <walters@verbum.org> Followup Bug 19502 - Don't attempt to init va_list, not portable
/external/dbus/dbus/dbus-string.c
eb3b99e7c610988823804f5e6c92aa13459605c7 21-Apr-2009 Kjartan Maraas <kmaraas@gnome.org> Bug 19502 - Sparse warning cleanups

This patch makes various things that should be static static,
corrects some "return FALSE" where it should be NULL, etc.

Signed-off-by: Colin Walters <walters@verbum.org>
/external/dbus/dbus/dbus-string.c
ce09b82ec2dd3cb1d239605f8f458e09afd70694 21-Apr-2009 Colin Walters <walters@verbum.org> Followup Bug 19502 - Don't attempt to init va_list, not portable
/external/dbus/dbus/dbus-string.c
3c89788fa483ebda858ab66797e2834af94b798f 21-Apr-2009 Kjartan Maraas <kmaraas@gnome.org> Bug 19502 - Sparse warning cleanups

This patch makes various things that should be static static,
corrects some "return FALSE" where it should be NULL, etc.

Signed-off-by: Colin Walters <walters@verbum.org>
/external/dbus/dbus/dbus-string.c
0e3ec9cec0f6740acd39d6e6983f419e20461282 11-Jul-2008 Ray Strode <rstrode@redhat.com> Add new function _dbus_string_split_on_byte

It allows you to turn a string like KEY=VALUE
into two strings key and value.
/external/dbus/dbus/dbus-string.c
bef4260ad58bc9eb75e2e1a52ad9b49bc3c70fa5 31-Oct-2007 Havoc Pennington <hp@localhost.localdomain> Fix a problem where a nul byte was wrongly introduced into UUIDs, due to _dbus_string_copy_to_buffer weird behavior.

2007-10-31 Havoc Pennington <hp@redhat.com>

* bus/selinux.c (log_audit_callback): rewrite to use
_dbus_string_copy_to_buffer_with_nul()

* dbus/dbus-string.c (_dbus_string_copy_to_buffer): change to NOT
nul-terminate the buffer; fail an assertion if there is not enough
space in the target buffer. This fixes two bugs where
copy_to_buffer was used to copy the binary bytes in a UUID, where
nul termination did not make sense. Bug reported by David Castelow.
(_dbus_string_copy_to_buffer_with_nul): new function that always
nul-terminates the buffer, and fails an assertion if there is not
enough space in the buffer.
/external/dbus/dbus/dbus-string.c
8c6b0ab3f7e437362112eeaf83a566475b85d27c 20-Sep-2007 Ryan Lortie <desrt@desrt.ca> Add support for compacting DBusStrings to release wasted memory.

2007-09-19 Ryan Lortie <desrt@desrt.ca>

* dbus/dbus-string.[ch] (compact, _dbus_string_compact,
_dbus_string_lock): new compact function to free up allocated memory
that is no longer used.

* dbus/dbus-message.c (load_message): call _dbus_string_compact on the
message loader buffer.

* dbus/dbus-transport-socket.c (do_reading, do_writing): call
_dbus_string_compact on the incoming/outgoing "encoded" buffers.

* dbus/dbus-string-util.c (_dbus_string_test): add a few tests for
string compacting.
/external/dbus/dbus/dbus-string.c
d012387afef0ba02185ebe27bc6bb15551912e92 14-Jul-2007 Havoc Pennington <hp@redhat.com> 2007-07-13 Havoc Pennington <hp@redhat.com>

* Add indent-tabs-mode: nil to all file headers.
/external/dbus/dbus/dbus-string.c
a789b7b38cb4f4540a41444cbd64bf7ada2d60d2 10-Jun-2007 Havoc Pennington <hp@redhat.com> 2007-06-09 Havoc Pennington <hp@redhat.com>

* dbus/dbus-string.c (_dbus_string_pop_line): fix this not to
think an empty line is the end of the file.
Also, fix some whitespace.

* dbus/dbus-string-util.c: add more tests for
_dbus_string_pop_line() revealing that it thinks an empty line is
the end of the file, which broke dbus-auth-script.c so
it didn't really run the scripts

* dbus/dbus-auth.c: add ANONYMOUS mechanism

* dbus/dbus-auth-script.c (_dbus_auth_script_run): fix to detect
an empty/no-op auth script; add commands to check that we have or
don't have the expected credentials
/external/dbus/dbus/dbus-string.c
f2e17db66f2e07e165fc90bba030a9f1d430834b 13-Dec-2006 Ralf Habacker <ralf.habacker@freenet.de> * dbus/dbus-string.c (_dbus_string_pop_line),
bus/desktop-file.c (parse_section_start,
parse_comment_or_blank,parse_key_value,): uses
_dbus_string_find_eol() to support platform independent eol style.
/external/dbus/dbus/dbus-string.c
cb39e60e1639fb982a46aa1625e3adec2bf0df46 13-Dec-2006 Ralf Habacker <ralf.habacker@freenet.de> * dbus/dbus-string.[ch] (_dbus_string_find_eol): new function.
* dbus/dbus-string-util.c (_dbus_string_test): added testcases for
_dbus_string_find_eol().
Approved by: Havoc Pennington.
/external/dbus/dbus/dbus-string.c
e19ebac55d671ecd92877af182300311afa7641a 21-Oct-2006 Havoc Pennington <hp@redhat.com> 2006-10-21 Havoc Pennington <hp@redhat.com>

* Clean up Doxygen group markers for public API so Doxygen finds
everything (not comprehensively fixed for private API).
Means all remaining Doxygen warnings are just about missing docs
and thus pretty simple to resolve.
/external/dbus/dbus/dbus-string.c
15ef0ef6fbba7827453b7973e62b6c1853576601 20-Oct-2006 Havoc Pennington <hp@redhat.com> 2006-10-19 Havoc Pennington <hp@redhat.com>

* Fix a pile of Doxygen warnings and missing docs
/external/dbus/dbus/dbus-string.c
d8155bf51bf6484a94e734601526bf211053a5e1 01-Oct-2006 Havoc Pennington <hp@redhat.com> 2006-09-30 Havoc Pennington <hp@redhat.com>

* configure.in (LT_CURRENT, LT_AGE): increment current and age to
reflect addition of interfaces.

* doc/dbus-specification.xml: describe a new
org.freedesktop.DBus.Peer.GetMachineId method

* dbus/dbus-string.c (_dbus_string_skip_white_reverse): new function
(_dbus_string_skip_white, _dbus_string_skip_blank): use new
DBUS_IS_ASCII_BLANK, DBUS_IS_ASCII_WHITE macros and fix assertion
at end of skip_white
(_dbus_string_chop_white): new function

* bus/connection.c (bus_connections_setup_connection): call
dbus_connection_set_route_peer_messages.

* dbus/dbus-connection.c
(_dbus_connection_peer_filter_unlocked_no_update): modify to
support a GetMachineId method.

Also, support a new flag to let the bus pass peer methods through
to apps on the bus, which can be set with
dbus_connection_set_route_peer_messages.

Finally, handle and return an error for anything unknown on the
Peer interface, which will allow us to extend the Peer interface
in the future without fear that we're now intercepting something
apps were wanting to see.

* tools/dbus-uuidgen.c: a thin wrapper around the functions in
dbus/dbus-uuidgen.c

* dbus/dbus-uuidgen.c: implement the bulk of the dbus-uuidgen
binary here, since most of the code is already in libdbus

* dbus/dbus-sysdeps.c (_dbus_read_local_machine_uuid): read the
uuid from the system config file

* dbus/dbus-internals.c (_dbus_generate_uuid, _dbus_uuid_encode)
(_dbus_read_uuid_file_without_creating)
(_dbus_create_uuid_file_exclusively, _dbus_read_uuid_file): new
uuid-related functions, partly factored out from dbus-server.c

* dbus/dbus-sysdeps.c (_dbus_error_from_errno): convert EEXIST to
DBUS_ERROR_FILE_EXISTS instead of EEXIST

* dbus/dbus-protocol.h (DBUS_ERROR_FILE_EXISTS): add file exists error

* tools/dbus-cleanup-sockets.1: explain what the point of this
thing is a bit more

* autogen.sh (run_configure): add --config-cache to default
configure args

* dbus/dbus-internals.h (_DBUS_ASSERT_ERROR_IS_SET): disable the
error set/clear assertions when DBUS_DISABLE_CHECKS is defined

* tools/dbus-launch.c (main): if xdisplay hasn't been opened,
don't try to save address, fixes crash in make check
/external/dbus/dbus/dbus-string.c
d387411488a093f77f4cd752b75e8bf8360550c6 09-Aug-2006 John (J5) Palmieri <johnp@redhat.com> * dbus/dbus-sysdeps.h:
* dbus/dbus-sysdeps.c:
* dbus/dbus-string.c:
s/_dbus_printf_length/_dbus_printf_string_upper_bound to comform with
GLib's function which does the same thing

* configure.in:
* bus/Makefile.am:
* bus/dir-watch-default.c:
* bus/dir-watch-dnotify.c:
* bus/dir-watch-kqueue.c:
Add kqueue directory watching for freebsd and split the directory
watching code into seperate files per method/arch
(patches from Timothy Redaelli <drizzt at gufi dotorg>)
/external/dbus/dbus/dbus-string.c
7bb2361e657dc31ed73891f8e1ffdbfb916624c2 08-Aug-2006 John (J5) Palmieri <johnp@redhat.com> * dbus/dbus-sysdeps.h:
* dbus/dbus-sysdeps.c:
add _dbus_printf_length (patch from Peter Kümmel
<syntheticpp at gmx dot net>)
/external/dbus/dbus/dbus-string.c
7652304bff969afb3969603149bb385efe861fe8 03-Aug-2006 John (J5) Palmieri <johnp@redhat.com> * s/D-BUS/D-Bus/g
/external/dbus/dbus/dbus-string.c
0d0642b31b9bac2546f9fa2c6bdc55b5ced0b7ad 16-Feb-2006 Robert McQueen <robot101@debian.org> 2006-02-16 Robert McQueen <robot101@debian.org>

* dbus/dbus-message.c (dbus_message_iter_get_fixed_array):
Patch from Rob Taylor <rob.taylor@collabora.co.uk> to correct a bogus
assertion that the next element to read from the iter is fixed in
size. This is not the case when you are at the end of the iter,
because the next element type is INVALID.

* dbus/dbus-string.c (_dbus_string_init_const_len): Correct a
a bogus assert which means that you may not initialise a 0-length
string unless you provide a non-NULL pointer. This prevented
you from marshalling messages containing zero-length arrays in
some cases.

* glib/dbus-gvalue.c (demarshal_collection_array): Another patch
from Rob to correct bogus asserts when trying to demarshal an
array and get_fixed_array got you 0 elements. Append nothing to
the GArray in this case.

* test/glib/test-dbus-glib.c: Add a test case for round-tripping
an empty array via the glib bindings. Without all of the above
patches, this new test fails.
/external/dbus/dbus/dbus-string.c
6606169cbcf17dd06dfa7f9e25d9c1c33b0bf080 10-Apr-2005 Havoc Pennington <hp@redhat.com> 2005-04-09 Havoc Pennington <hp@redhat.com>

* dbus/dbus-string.c (copy): change a memcpy to memmove due to
possible overlap, fix from Daniel Reed
(fixup_alignment): fix signedness warnings
(_dbus_string_append_unichar): ditto
/external/dbus/dbus/dbus-string.c
7ce7502e1ae23766ba40105327de787c2d1cef9d 25-Feb-2005 Havoc Pennington <hp@redhat.com> 2005-02-25 Havoc Pennington <hp@redhat.com>

* doc/dbus-specification.xml: document the GUID thing

* dbus/dbus-server.c (_dbus_server_init_base): initialize a
globally unique ID for the server, and put a "guid=hexencoded"
field in the address

* dbus/dbus-bus.c: fix missing #include of dbus-threads-internal.h

* dbus/dbus-message.c: ditto

* dbus/dbus-dataslot.c: ditto

* dbus/dbus-list.c: ditto

* dbus/dbus-internals.h: wait, just include
dbus-threads-internal.h here

* dbus/dbus-string.c (_dbus_string_copy_to_buffer): move back for
use in main library

* dbus/dbus-sysdeps.c (_dbus_generate_random_bytes_buffer): new function
/external/dbus/dbus/dbus-string.c
aa4f823781185fb18187714798795d7e4b0c9b65 11-Feb-2005 Havoc Pennington <hp@redhat.com> 2005-02-10 Havoc Pennington <hp@redhat.com>

* test/glib/test-dbus-glib.c (main): fix so this test doesn't fail
(call dbus_g_proxy_add_signal)

* dbus/dbus-server-unix.c (_dbus_server_new_for_tcp_socket):
escape the hostname
(_dbus_server_new_for_domain_socket): escape the path

* dbus/dbus-address.c (dbus_address_escape_value): new
(dbus_address_unescape_value): new
(dbus_parse_address): unescape values

* dbus/dbus-string.c (_dbus_string_append_byte_as_hex): new function

* doc/dbus-specification.xml: explain how to escape values in
addresses
/external/dbus/dbus/dbus-string.c
3ed9db546e1143bc9aa2d83a6f423fdd81227352 28-Jan-2005 Havoc Pennington <hp@redhat.com> 2005-01-27 Havoc Pennington <hp@redhat.com>

* dbus/dbus-arch-deps.h.in: add 16/32-bit types

* configure.in: find the right type for 16 and 32 bit ints as well
as 64

* dbus/dbus-protocol.h (DBUS_TYPE_INT16, DBUS_TYPE_UINT16): add
the 16-bit types so people don't have to stuff them in 32-bit or
byte arrays.
/external/dbus/dbus/dbus-string.c
7bf62e31a3c820852271768fafc04ba95c31a19f 17-Jan-2005 Havoc Pennington <hp@redhat.com> 2005-01-16 Havoc Pennington <hp@redhat.com>

This is about it on what can be disabled/deleted from libdbus
easily, back below 150K anyhow. Deeper cuts are more work than
just turning the code off as I've done here.

* dbus/dbus-marshal-basic.c (_dbus_pack_int32): we don't need the
signed int convenience funcs

* dbus/dbus-internals.c (_dbus_verbose_real): omit when not in
verbose mode

* dbus/dbus-string-util.c, dbus/dbus-string.c: more breaking
things out of libdbus

* dbus/dbus-sysdeps.c, dbus/dbus-sysdeps-util.c: same

* dbus/dbus-hash.c: purge the TWO_STRINGS crap (well, make it
tests-enabled-only, though it should probably be deleted)

* dbus/dbus-message-util.c: same stuff

* dbus/dbus-auth-util.c: same stuff
/external/dbus/dbus/dbus-string.c
31988af4089f3793940417535f8eabaae1ac26c8 16-Jan-2005 Havoc Pennington <hp@redhat.com> 2005-01-16 Havoc Pennington <hp@redhat.com>

* Add and fix docs according to Doxygen warnings throughout
source.

* dbus/dbus-marshal-recursive.c
(_dbus_type_reader_array_is_empty): change this to just call
array_reader_get_array_len() and make it static

* dbus/dbus-message.c (dbus_message_iter_get_element_type): rename
from get_array_type
(dbus_message_iter_init_append): rename from append_iter_init

* dbus/dbus-marshal-recursive.c
(_dbus_type_reader_get_element_type): rename from
_dbus_type_reader_get_array_type
/external/dbus/dbus/dbus-string.c
b3416423b1e3c17357833d896c1b7cd684660771 16-Jan-2005 Havoc Pennington <hp@redhat.com> 2005-01-15 Havoc Pennington <hp@redhat.com>

* test/glib/test-profile.c (with_bus_server_filter): fix crash

* dbus/dbus-marshal-basic.c (_dbus_unpack_uint32): inline as macro
when DBUS_DISABLE_ASSERT
(_dbus_marshal_set_basic): be sure we align for the string length

* dbus/dbus-marshal-recursive.c (skip_one_complete_type): make
this look faster

* dbus/dbus-string.c (_dbus_string_get_const_data_len): add an
inline macro version
(_dbus_string_set_byte): provide inline macro version
/external/dbus/dbus/dbus-string.c
9c3d566e95c9080f6040c64531b0ccae22bd5d74 15-Jan-2005 Havoc Pennington <hp@redhat.com> 2005-01-15 Havoc Pennington <hp@redhat.com>

* Land the new message args API and type system.

This patch is huge, but the public API change is not
really large. The set of D-BUS types has changed somewhat,
and the arg "getters" are more geared toward language bindings;
they don't make a copy, etc.

There are also some known issues. See these emails for details
on this huge patch:
http://lists.freedesktop.org/archives/dbus/2004-December/001836.html
http://lists.freedesktop.org/archives/dbus/2005-January/001922.html

* dbus/dbus-marshal-*: all the new stuff

* dbus/dbus-message.c: basically rewritten

* dbus/dbus-memory.c (check_guards): with "guards" enabled, init
freed blocks to be all non-nul bytes so using freed memory is less
likely to work right

* dbus/dbus-internals.c (_dbus_test_oom_handling): add
DBUS_FAIL_MALLOC=N environment variable, so you can do
DBUS_FAIL_MALLOC=0 to skip the out-of-memory checking, or
DBUS_FAIL_MALLOC=10 to make it really, really, really slow and
thorough.

* qt/message.cpp: port to the new message args API
(operator<<): use str.utf8() rather than str.unicode()
(pretty sure this is right from the Qt docs?)

* glib/dbus-gvalue.c: port to the new message args API

* bus/dispatch.c, bus/driver.c: port to the new message args API

* dbus/dbus-string.c (_dbus_string_init_const_len): initialize the
"locked" flag to TRUE and align_offset to 0; I guess we never
looked at these anyhow, but seems cleaner.

* dbus/dbus-string.h (_DBUS_STRING_ALLOCATION_PADDING):
move allocation padding macro to this header; use it to implement
(_DBUS_STRING_STATIC): ability to declare a static string.

* dbus/dbus-message.c (_dbus_message_has_type_interface_member):
change to return TRUE if the interface is not set.

* dbus/dbus-string.[hc]: move the D-BUS specific validation stuff
to dbus-marshal-validate.[hc]

* dbus/dbus-marshal-basic.c (_dbus_type_to_string): move here from
dbus-internals.c

* dbus/Makefile.am: cut over from dbus-marshal.[hc]
to dbus-marshal-*.[hc]

* dbus/dbus-object-tree.c (_dbus_decompose_path): move this
function here from dbus-marshal.c
/external/dbus/dbus/dbus-string.c
07d2fd5aa2891d94bcb97db89178a4d536599d14 03-Jan-2005 Havoc Pennington <hp@redhat.com> 2005-01-03 Havoc Pennington <hp@redhat.com>

* dbus/dbus-sysdeps.c (_dbus_sysdeps_test): fix using == on
floating point

* dbus/dbus-string.c (_dbus_string_insert_alignment): new function
/external/dbus/dbus/dbus-string.c
bb8f518d07adffbefcc7d592af0655b2afa4ab19 01-Jan-2005 Havoc Pennington <hp@redhat.com> add int64 to test suites, fix minor bug where marshaling assumed that DBusOctets8 was aligned when passed in as a function argument
/external/dbus/dbus/dbus-string.c
c2a98e1103544277e8d36be53f8a24a32c2c6bea 31-Dec-2004 Havoc Pennington <hp@redhat.com> 2004-12-31 Havoc Pennington <hp@redhat.com>

* dbus/dbus-string.c (_dbus_string_equal_substrings): new function
I keep wishing I had
/external/dbus/dbus/dbus-string.c
617e73f7631e605fc9ebf6a67042a1f451b97850 19-Dec-2004 Havoc Pennington <hp@redhat.com> 2004-12-19 Havoc Pennington <hp@redhat.com>

* dbus/dbus-string.c (_dbus_string_insert_4_aligned)
(_dbus_string_insert_8_aligned): new functions

* dbus/dbus-string.c (_dbus_string_alloc_space): new function
/external/dbus/dbus/dbus-string.c
f3228b477df95ba247c90cc54189ce6d62059251 19-Dec-2004 Havoc Pennington <hp@redhat.com> 2004-12-18 Havoc Pennington <hp@redhat.com>

* dbus/dbus-string.c (_dbus_string_validate_ascii): use ISASCII
macro

* dbus/dbus-message.c: fix a comment, and add a still-unused
not-implemented function

* dbus/dbus-marshal.h: fix comment

* dbus/dbus-internals.h (_DBUS_ISASCII): new macro
/external/dbus/dbus/dbus-string.c
b60c835d346b7e214e627abd8e0cdf06932313a7 27-Nov-2004 Havoc Pennington <hp@redhat.com> 2004-11-27 Havoc Pennington <hp@redhat.com>

* dbus/dbus-string.h (_dbus_string_get_byte): inline when asserts
are disabled
(_dbus_string_get_const_data): inline when asserts are disabled

* dbus/dbus-message.c: record the _dbus_current_generation of
creation so we can complain if dbus_shutdown() is used improperly.
Do this only if checks are enabled.

* dbus/dbus-connection.c: ditto
/external/dbus/dbus/dbus-string.c
dbdea921b5967ed25b24a9e5af5d6a3db54c5ec7 26-Nov-2004 Havoc Pennington <hp@redhat.com> 2004-11-25 Havoc Pennington <hp@redhat.com>

The primary change here is to always write() once before adding
the write watch, which gives us about a 10% performance increase.

* dbus/dbus-transport-unix.c: a number of modifications to cope
with removing messages_pending
(check_write_watch): properly handle
DBUS_AUTH_STATE_WAITING_FOR_MEMORY; adapt to removal of
messages_pending stuff
(check_read_watch): properly handle WAITING_FOR_MEMORY and
AUTHENTICATED cases
(unix_handle_watch): after writing, see if the write watch can be
removed
(unix_do_iteration): assert that write_watch/read_watch are
non-NULL rather than testing that they aren't, since they
aren't allowed to be NULL. check_write_watch() at the end so
we add the watch if we did not finish writing (e.g. got EAGAIN)

* dbus/dbus-transport-protected.h: remove messages_pending call,
since it resulted in too much inefficient watch adding/removing;
instead we now require that the transport user does an iteration
after queueing outgoing messages, and after trying the first
write() we add a write watch if we got EAGAIN or exceeded our
max bytes to write per iteration setting

* dbus/dbus-string.c (_dbus_string_validate_signature): add this
function

* dbus/dbus-server-unix.c (unix_finalize): the socket name was
freed and then accessed, valgrind flagged this bug, fix it

* dbus/dbus-message.c: fix several bugs where HEADER_FIELD_LAST was taken
as the last valid field plus 1, where really it is equal to the
last valid field. Corrects some message corruption issues.

* dbus/dbus-mainloop.c: verbosity changes

* dbus/dbus-keyring.c (_dbus_keyring_new_homedir): handle OOM
instead of aborting in one of the test codepaths

* dbus/dbus-internals.c (_dbus_verbose_real): fix a bug that
caused not printing the pid ever again if a verbose was missing
the newline at the end
(_dbus_header_field_to_string): add HEADER_FIELD_SIGNATURE

* dbus/dbus-connection.c: verbosity changes;
(dbus_connection_has_messages_to_send): new function
(_dbus_connection_message_sent): no longer call transport->messages_pending
(_dbus_connection_send_preallocated_unlocked): do one iteration to
try to write() immediately, so we can avoid the write watch. This
is the core purpose of this patchset
(_dbus_connection_get_dispatch_status_unlocked): if disconnected,
dump the outgoing message queue, so nobody will get confused
trying to send them or thinking stuff is pending to be sent

* bus/test.c: verbosity changes

* bus/driver.c: verbosity/assertion changes

* bus/dispatch.c: a bunch of little tweaks to get it working again
because this patchset changes when/where you need to block.
/external/dbus/dbus/dbus-string.c
25c1f310aafc8b3d89ee19656a64244e6f108dbb 22-Nov-2004 Havoc Pennington <hp@redhat.com> 2004-11-22 Havoc Pennington <hp@redhat.com>

* test/glib/test-profile.c (N_CLIENT_THREADS): run multiple
threads for more time, so sysprof can get a grip on it.

* dbus/dbus-string.c (_dbus_string_validate_utf8): remove
pointless variable
/external/dbus/dbus/dbus-string.c
1b1dfafc344ad7b60b8156a1bbdbfc1b364bfa98 13-Nov-2004 Havoc Pennington <hp@redhat.com> 2004-11-13 Havoc Pennington <hp@redhat.com>

* test/glib/test-profile.c: fix this thing up a bit

* dbus/dbus-message.c (dbus_message_new_empty_header): increase
preallocation sizes by a fair bit; not sure if this will be an
overall performance win or not, but it does reduce reallocs.

* dbus/dbus-string.c (set_length, reallocate_for_length): ignore
the test hack that forced constant realloc if asserts are
disabled, so we can profile sanely. Sprinkle in some
_DBUS_UNLIKELY() which are probably pointless, but before I
noticed the real performance problem I put them in.
(_dbus_string_validate_utf8): micro-optimize this thing a little
bit, though callgrind says it didn't help; then special-case
ascii, which did help a lot; then be sure we detect nul bytes as
invalid, which is a bugfix.
(align_length_then_lengthen): add some more _DBUS_UNLIKELY
superstition; use memset to nul the padding instead of a manual
loop.
(_dbus_string_get_length): inline this as a
macro; it showed up in the profile because it's used for loop
tests and so forth
/external/dbus/dbus/dbus-string.c
935a41a04c3f638134fa905503fc41ddbd18902f 09-Nov-2004 Colin Walters <walters@verbum.org> 2004-11-09 Colin Walters <walters@verbum.org>

* dbus/dbus-string.c (_dbus_string_get_length): New
function, writes DBusString to C buffer.

* dbus/dbus-string.h: Prototype it.

* dbus/dbus-message.c (dbus_message_type_to_string): New
function, converts message type into C string.

* dbus/dbus-message.h: Prototype it.

* bus/selinux.c (bus_selinux_check): Take source pid,
target pid, and audit data. Pass audit data to
avc_has_perm.
(log_audit_callback): New function, appends extra
audit information.
(bus_selinux_allows_acquire_service): Also take
service name, add it to audit data.
(bus_selinux_allows_send): Also take message
type, interface, method member, error name,
and destination, and add them to audit data.
(log_cb): Initialize func_audit.

* bus/selinux.h (bus_selinux_allows_acquire_service)
(bus_selinux_allows_send): Update prototypes

* bus/services.c (bus_registry_acquire_service): Pass
service name to bus_selinux_allows_acquire_service.

* bus/bus.c (bus_context_check_security_policy): Pass
additional audit data. Move assignment of dest
to its own line.
/external/dbus/dbus/dbus-string.c
43605a6f4e78a8c28afb4b1e924dff0301e0e95c 10-Aug-2004 Havoc Pennington <hp@redhat.com> 2004-08-09 Havoc Pennington <hp@redhat.com>

* COPYING: switch to Academic Free License version 2.1 instead of
2.0, to resolve complaints about patent termination clause.
/external/dbus/dbus/dbus-string.c
54dcec2a8312634116c5a1acbbd0070953525c8a 02-Jun-2004 Kristian Høgsberg <krh@redhat.com> 2004-06-02 Kristian Høgsberg <krh@redhat.com>

* glib/dbus-gproxy.c, glib/dbus-gmain.c, dbus/dbus-string.c,
dbus/dbus-object-tree.c, dbus/dbus-message.c: add comments to
quiet doxygen.

* Doxyfile.in: remove deprecated options.

* dbus/dbus-message-handler.c, dbus/dbus-message-handler.h,
glib/test-thread.h, glib/test-thread-client.c,
glib/test-thread-server.c, glib/test-profile.c,
glib/test-dbus-glib.c: remove these unused files.
/external/dbus/dbus/dbus-string.c
0123e6a927772af6d56ddbe3f75a443ab40646d1 28-May-2004 Michael Meeks <michael@ximian.com> 2004-05-28 Michael Meeks <michael@ximian.com>

* glib/dbus-gvalue.c (dbus_gvalue_marshal, dbus_gvalue_demarshal):
fix no int64 case.

* dbus/dbus-string.c (_dbus_string_parse_basic_type): impl.

* dbus/dbus-message.c (_dbus_message_iter_get_basic_type),
(_dbus_message_iter_get_basic_type_array): impl.
drastically simplify ~all relevant _get methods to use these.
(_dbus_message_iter_append_basic_array),
(dbus_message_iter_append_basic): impl
drastically simplify ~all relevant _append methods to use these.

* dbus/dbus-message-builder.c (parse_basic_type)
(parse_basic_array, lookup_basic_type): impl.
(_dbus_message_data_load): prune scads of duplicate /
cut & paste coding.

* dbus/dbus-marshal.c (_dbus_demarshal_basic_type_array)
(_dbus_demarshal_basic_type): implement,
(demarshal_and_validate_len/arg): beef up debug.
(_dbus_marshal_basic_type, _dbus_marshal_basic_type_array): impl.
/external/dbus/dbus/dbus-string.c
d86fc4071ccb8590d922e3456c5c80c0f7bb9d6f 18-May-2004 Kristian Høgsberg <krh@redhat.com> 2004-05-17 Kristian Høgsberg <krh@redhat.com>

Remove base64 encoding, replace with hex encoding. Original patch
from trow@ximian.com, added error handling.

* dbus/dbus-string.c (_dbus_string_base64_encode)
(_dbus_string_base64_decode): Remove.
(_dbus_string_hex_decode): Add end_return argument so we can
distinguish between OOM and invalid hex encoding.
(_dbus_string_test): Remove base64 tests and add test case for
invalid hex.

* dbus/dbus-keyring.c, dbus/dbus-auth-script.c, dbus/dbus-auth.c:
Replace base64 with hex.

* test/data/auth/invalid-hex-encoding.auth-script: New test case
for invalid hex encoded data in auth protocol.
/external/dbus/dbus/dbus-string.c
868dd4b4b0be082b86354b1f89ed9cffd5b8e193 05-Mar-2004 David Zeuthen <davidz@redhat.com> 2004-03-01 David Zeuthen <david@fubar.dk>

* dbus/dbus-string.c (_dbus_string_append_printf_valist): Fix a
bug where args were used twice. This bug resulted in a segfault
on a Debian/PPC system when starting the messagebus daemon. Include
dbus-sysdeps.h for DBUS_VA_COPY

* dbus/dbus-sysdeps.h: Define DBUS_VA_COPY if neccessary. From GLib

* configure.in: Check for va_copy; define DBUS_VA_COPY to the
appropriate va_copy implementation. From GLib
/external/dbus/dbus/dbus-string.c
a1df3040f29223eddaa3ace0fe018fcb28cddcd9 02-Dec-2003 Richard Hult <richard@imendio.com> 2003-12-02 Richard Hult <richard@imendio.com>

* Update AFL version to 2.0 throughout the source files to reflect
the update that was done a while ago.
/external/dbus/dbus/dbus-string.c
e11ae7246655e59f8e04d1ffcb3788176a6d98b8 28-Oct-2003 Havoc Pennington <hp@redhat.com> 2003-10-28 Havoc Pennington <hp@redhat.com>

* dbus/dbus-message.c (_dbus_message_test): enable and fix the
tests for set_path, set_interface, set_member, etc.

* dbus/dbus-string.c (_dbus_string_insert_bytes): allow 0 bytes

* dbus/dbus-message.c (set_string_field): always just delete and
re-append the field; accept NULL for deletion
(re_align_fields_recurse): reimplement
/external/dbus/dbus/dbus-string.c
75742242000e782719bc1656f0a7da72b059e88e 21-Oct-2003 Havoc Pennington <hp@redhat.com> 2003-10-20 Havoc Pennington <hp@redhat.com>

hmm, make check is currently not passing.

* doc/dbus-specification.xml: add requirement that custom type
names follow the same rules as interface names.

* dbus/dbus-protocol.h: change some of the byte codes, to avoid
duplication and allow 'c' to be 'custom'; dict is now 'm' for
'map'

* doc/dbus-specification.xml: update type codes to match
dbus-protocol.h, using the ASCII byte values. Rename type NAMED to
CUSTOM. Add type OBJECT_PATH to the spec.

2003-10-17 Havoc Pennington <hp@redhat.com>

* bus/driver.c (create_unique_client_name): use "." as separator
in base service names instead of '-'

* dbus/dbus-string.c (_dbus_string_get_byte): allow getting nul
byte at the end of the string

* dbus/dbus-internals.h (_DBUS_LIKELY, _DBUS_UNLIKELY): add
optimization macros since string validation seems to be a slow
point.

* doc/dbus-specification.xml: restrict valid
service/interface/member/error names. Add test suite code for the
name validation.

* dbus/dbus-string.c: limit service/interface/member/error names
to [0-9][A-Z][a-z]_

* dbus/dbus-connection.c (dbus_connection_dispatch): add missing
format arg to verbose spew

* glib/dbus-gproxy.c (dbus_gproxy_call_no_reply): if not out of
memory, return instead of g_error

* test/test-service.c (path_message_func): support emitting a
signal on request

* dbus/dbus-bus.c (init_connections_unlocked): only fill in
activation bus type if DBUS_BUS_ACTIVATION was set; default to
assuming the activation bus was the session bus so that services
started manually will still register.
(init_connections_unlocked): fix so that in OOM situation we get
the same semantics when retrying the function

* test/test-service.c (main): change to use path registration, to
test those codepaths; register with DBUS_BUS_ACTIVATION rather
than DBUS_BUS_SESSION
/external/dbus/dbus/dbus-string.c
46c072e1136ca101aefd5fdae35c457899d55bbb 25-Sep-2003 Mark McLoughlin <mark@skynet.ie> 2003-09-25 Mark McLoughlin <mark@skynet.ie>

* doc/dbus-specification.sgml: don't require header fields
to be 4-byte aligned and specify that fields should be
distinguished from padding by the fact that zero is not
a valid field name.

* doc/TODO: remove re-alignment item and add item to doc
the OBJECT_PATH type.

* dbus/dbus-message.c:
(HeaderField): rename the original member to value_offset
and introduce a name_offset member to keep track of where
the field actually begins.
(adjust_field_offsets): remove.
(append_int_field), (append_uint_field),
(append_string_field): don't align the start of the header
field to a 4-byte boundary.
(get_next_field): impl finding the next marhsalled field
after a given field.
(re_align_field_recurse): impl re-aligning a number of
already marshalled fields.
(delete_field): impl deleting a field of any type and
re-aligning any following fields.
(delete_int_or_uint_field), (delete_string_field): remove.
(set_int_field), (set_uint_field): no need to re-check
that we have the correct type for the field.
(set_string_field): ditto and impl re-aligning any
following fields.
(decode_header_data): update to take into account that
the fields aren't 4-byte aligned any more and the new
way to distinguish padding from header fields. Also,
don't exit when there is too much header padding.
(process_test_subdir): print the directory.
(_dbus_message_test): add test to make sure a following
field is re-aligned correctly after field deletion.

* dbus/dbus-string.[ch]:
(_dbus_string_insert_bytes): rename from insert_byte and
allow the insert of multiple bytes.
(_dbus_string_test): test inserting multiple bytes.

* dbus/dbus-marshal.c: (_dbus_marshal_set_string): add
warning note to docs about having to re-align any
marshalled values following the string.

* dbus/dbus-message-builder.c:
(append_string_field), (_dbus_message_data_load):
don't align the header field.

* dbus/dbus-auth.c: (process_test_subdir): print the
directory.

* test/break-loader.c: (randomly_add_one_byte): upd. for
insert_byte change.

* test/data/invalid-messages/bad-header-field-alignment.message:
new test case.

* test/data/valid-messages/unknown-header-field.message: shove
a dict in the unknown field.
/external/dbus/dbus/dbus-string.c
85ab0327d82e4945ad16630e583d8cc68df25a90 08-Sep-2003 Havoc Pennington <hp@redhat.com> 2003-09-07 Havoc Pennington <hp@pobox.com>

* Make Doxygen contented.
/external/dbus/dbus/dbus-string.c
5fd1e389e1c1c12ad4a55c2af6abdc8e7a2f6d41 31-Aug-2003 Havoc Pennington <hp@redhat.com> 2003-08-30 Havoc Pennington <hp@pobox.com>

* test/data/valid-config-files/system.d/test.conf: change to
root for the user so warnings don't get printed

* dbus/dbus-message.c: add dbus_message_get_path,
dbus_message_set_path

* dbus/dbus-object-tree.c (do_test_dispatch): add test of
dispatching to a path

* dbus/dbus-string.c (_dbus_string_validate_path): add

* dbus/dbus-marshal.c (_dbus_demarshal_object_path): implement
(_dbus_marshal_object_path): implement

* dbus/dbus-protocol.h (DBUS_HEADER_FIELD_PATH): new header field
to contain the path to the target object
(DBUS_HEADER_FIELD_SENDER_SERVICE): rename
DBUS_HEADER_FIELD_SENDER to explicitly say it's the sender service
/external/dbus/dbus/dbus-string.c
24f411a6a10e4838f57595720642ce83ceae814c 25-Aug-2003 Havoc Pennington <hp@redhat.com> 2003-08-25 Havoc Pennington <hp@pobox.com>

Just noticed that dbus_message_test is hosed, I wonder when I
broke that. I thought make check was passing earlier...

* dbus/dbus-object-tree.c: add new "object tree" to match DCOP
container tree, will replace most of dbus-object-registry

* dbus/dbus-string.c (_dbus_string_append_printf_valist): fix C99
screwup
/external/dbus/dbus/dbus-string.c
68a3c593b9e77b33614726363c7b6fd85d113021 19-Aug-2003 Havoc Pennington <hp@redhat.com> 2003-08-18 Havoc Pennington <hp@redhat.com>

* dbus/dbus-hash.c (_dbus_hash_table_insert_two_strings): fix

* dbus/dbus-message.c (_dbus_message_loader_queue_messages): fix
dumb bug created earlier (wrong order of args to
decode_header_data())

* tools/dbus-send.c: port

* tools/dbus-print-message.c (print_message): port

* test/data/*messages: port all messages over

* dbus/dbus-message-builder.c: support including
message type

* bus/driver.c: port over

* bus/dispatch.c: port over to new stuff

* dbus/dbus-connection.c (_dbus_connection_new_for_transport):
rename disconnect signal to "Disconnected"
/external/dbus/dbus/dbus-string.c
95717a938b237d12211935f6a7467ef610288fe5 18-Aug-2003 Havoc Pennington <hp@redhat.com> 2003-08-17 Havoc Pennington <hp@pobox.com>

This doesn't compile yet, but syncing up so I can hack on it from
work. What are branches for if not broken code? ;-)

* dbus/dbus-protocol.h: remove DBUS_HEADER_FIELD_NAME, add
DBUS_HEADER_FIELD_INTERFACE, DBUS_HEADER_FIELD_MEMBER,
DBUS_HEADER_FIELD_ERROR_NAME

* dbus/dbus-hash.c: Introduce DBUS_HASH_TWO_STRINGS as hack to use
for the interface+member pairs
(string_hash): change to use g_str_hash algorithm
(find_direct_function, find_string_function): refactor these to
share most code.

* dbus/dbus-message.c: port all of this over to support
interface/member fields instead of name field

* dbus/dbus-object-registry.c: port over

* dbus/dbus-string.c (_dbus_string_validate_interface): rename
from _dbus_string_validate_name

* bus/dbus-daemon-1.1: change file format for the
<deny>/<allow> stuff to match new message naming scheme

* bus/policy.c: port over

* bus/config-parser.c: parse new format
/external/dbus/dbus/dbus-string.c
1d1b0f20a467cf1cbdcaf81fbad3a111bcff6c48 12-Aug-2003 Havoc Pennington <hp@redhat.com> 2003-08-12 Havoc Pennington <hp@pobox.com>

* bus/dispatch.c (bus_dispatch): make this return proper
DBusHandlerResult to avoid DBUS_ERROR_UNKNOWN_METHOD

* dbus/dbus-errors.c (dbus_set_error): use
_dbus_string_append_printf_valist

* dbus/dbus-string.c (_dbus_string_append_printf_valist)
(_dbus_string_append_printf): new

* dbus/dbus-errors.h (DBUS_ERROR_UNKNOWN_MESSAGE): change to
UNKNOWN_METHOD

* dbus/dbus-connection.c (dbus_connection_dispatch): handle
DBUS_HANDLER_RESULT_NEED_MEMORY; send default error reply if a
message is unhandled.
/external/dbus/dbus/dbus-string.c
fe195a911d86d0a71349988360de65cfac1b3f86 02-Aug-2003 Havoc Pennington <hp@redhat.com> 2003-08-01 Havoc Pennington <hp@pobox.com>

* dbus/dbus-protocol.h (DBUS_MESSAGE_TYPE_*): introduce
a message type enum to distinguish kinds of message
(DBUS_HEADER_FLAG_NO_REPLY_EXPECTED): flag for a message
that need not be replied to

2003-08-01 Havoc Pennington <hp@pobox.com>

* dbus/dbus-marshal.c: adapt to DBusObjectID changes
(unpack_8_octets): fix no-64-bit-int bug

* dbus/dbus-object-registry.c (validate_id): validate the
connection ID bits, not just the instance ID.

* dbus/dbus-connection.c (_dbus_connection_init_id): initialize
the connection-global 33 bits of the object ID

* dbus/dbus-object-registry.c (info_from_entry): fill in
object ID in the new way

* dbus/dbus-objectid.h: rather than high/low bits, specifically
define server/client/instance bits.
/external/dbus/dbus/dbus-string.c
d4e80132af03363a2f861cfd611847ee8758aed9 12-May-2003 Havoc Pennington <hp@redhat.com> 2003-05-11 Havoc Pennington <hp@pobox.com>

* dbus/dbus-marshal.c (_dbus_marshal_validate_arg): fix to avoid
calling _dbus_marshal_validate_arg() for every byte in a byte
array, etc.

* dbus/dbus-message-handler.c: use atomic reference counting to
reduce number of locks slightly; the global lock in here sucks

* dbus/dbus-connection.c
(_dbus_connection_update_dispatch_status_and_unlock): variant of
update_dispatch_status that can be called with lock held; then use
in a couple places to reduce locking/unlocking
(dbus_connection_send): hold the lock over the whole function
instead of acquiring it twice.

* dbus/dbus-timeout.c (_dbus_timeout_new): handle OOM

* bus/connection.c (bus_connections_setup_connection): fix access
to already-freed memory.

* dbus/dbus-connection.c: keep a little cache of linked list
nodes, to avoid using the global linked list alloc lock in the
normal send-message case. Instead we just use the connection lock
that we already have to take.

* dbus/dbus-list.c (_dbus_list_find_last): new function

* dbus/dbus-sysdeps.c (_dbus_atomic_inc, _dbus_atomic_dec):
change to use a struct for the atomic type; fix docs,
they return value before increment, not after increment.

* dbus/dbus-string.c (_dbus_string_append_4_aligned)
(_dbus_string_append_8_aligned): new functions to try to
microoptimize this operation.
(reallocate_for_length): break this out of set_length(), to
improve profile info, and also so we can consider inlining the
set_length() part.

* dbus/dbus-message.c (dbus_message_new_empty_header): init data
strings with some preallocation, cuts down on our calls to realloc
a fair bit. Though if we can get the "move entire string to empty
string" optimization below to kick in here, it would be better.

* dbus/dbus-string.c (_dbus_string_move): just call
_dbus_string_move_len
(_dbus_string_move_len): add a special case for moving
an entire string into an empty string; we can just
swap the string data instead of doing any reallocs.
(_dbus_string_init_preallocated): new function
/external/dbus/dbus/dbus-string.c
d1c7eefb66483c3ea4d9e7fb6dca23dcfac8cad5 05-May-2003 Havoc Pennington <hp@redhat.com> 2003-05-04 Havoc Pennington <hp@pobox.com>

* dbus/dbus-message-handler.c (_dbus_message_handler_test): add
unit test

* dbus/dbus-marshal.c (_dbus_demarshal_string_array): fix this
function, which assumed length was in # of strings, not bytes

* dbus/dbus-message.c (_dbus_message_test): add tests for some
missing coverage

* dbus/dbus-connection.c
(_dbus_connection_queue_received_message): disable function for
now, we are only using it in test mode

* dbus/dbus-message.c (_dbus_message_loader_queue_messages):
remove a mistaken FIXME
/external/dbus/dbus/dbus-string.c
b3a3969897930eeda308113acbbb3f98069ee1ab 22-Apr-2003 Havoc Pennington <hp@redhat.com> 2003-04-22 Havoc Pennington <hp@redhat.com>

* 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
/external/dbus/dbus/dbus-string.c
d3fb6f35716ff1d6f6644dea2043d539007811de 18-Apr-2003 Havoc Pennington <hp@redhat.com> 2003-04-18 Havoc Pennington <hp@pobox.com>

* dbus/dbus-auth.c (record_mechanisms): memleak fixes

* dbus/dbus-sysdeps.c (_dbus_string_save_to_file): fix some
memleaks

* dbus/dbus-keyring.c (add_new_key): fix a memleak, and
on realloc be sure to update the pointer in the keyring

* dbus/dbus-string.c (_dbus_string_zero): compensate for align
offset to avoid writing to unallocated memory

* dbus/dbus-auth.c (process_rejected): return FALSE if we fail to
try the next mechanism, so we properly handle OOM

* dbus/dbus-keyring.c (_dbus_keyring_new_homedir): fix double-free
on OOM.
(_dbus_keyring_new): fix OOM bug
(_dbus_keyring_new_homedir): always set error; impose a maximum
number of keys we'll load from the file, mostly to speed up the
test suite and make its OOM checks more useful, but also for
general sanity.

* dbus/dbus-auth.c (process_error_server): reject authentication
if we get an error from the client
(process_cancel): on cancel, send REJECTED, per the spec
(process_error_client): send CANCEL if we get an error from the
server.
/external/dbus/dbus/dbus-string.c
c5020ac870c5990a36c3576453cc23431213e8bf 08-Apr-2003 Alexander Larsson <alexl@redhat.com> 2003-04-08 Alexander Larsson <alexl@redhat.com>

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.
/external/dbus/dbus/dbus-string.c
35ab7c6fab22dca58fc4b5c22b9e8587a6fd1492 05-Apr-2003 Havoc Pennington <hp@redhat.com> 2003-04-05 Havoc Pennington <hp@pobox.com>

* dbus/dbus-string.c: docs warning

* dbus/dbus-spawn.c: missing docs

* dbus/dbus-memory.c (struct ShutdownClosure): missing docs
/external/dbus/dbus/dbus-string.c
21cef58bc1b46ba4d5e7371463920c7744904d32 02-Apr-2003 Havoc Pennington <hp@redhat.com> 2003-04-02 Havoc Pennington <hp@redhat.com>

* dbus/dbus-string.c (set_length): fix a bug - we allocated max of
current alloc and needed new length, not max of the doubled
allocation and needed new length. Also, when building tests,
don't do the double-allocation stuff, just realloc every time.
/external/dbus/dbus/dbus-string.c
94790fef4a846ef2bed9bf1825c4c2b0ca7b8566 02-Apr-2003 Havoc Pennington <hp@redhat.com> 2003-04-02 Havoc Pennington <hp@redhat.com>

* 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
/external/dbus/dbus/dbus-string.c
fa05de9230d62e7c427b5313796fc6ccd4d0ff60 31-Mar-2003 Havoc Pennington <hp@redhat.com> 2003-03-31 Havoc Pennington <hp@redhat.com>

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
/external/dbus/dbus/dbus-string.c
bc86794f23fa538a405813fb61b531c2eacc9ae1 31-Mar-2003 Havoc Pennington <hp@redhat.com> 2003-03-30 Havoc Pennington <hp@pobox.com>

* 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>
/external/dbus/dbus/dbus-string.c
bf99381351b802fb3348a24037898222aae631e2 28-Mar-2003 Havoc Pennington <hp@redhat.com> 2003-03-28 Havoc Pennington <hp@pobox.com>

* bus/test.c (bus_test_flush_bus): remove the sleep from here,
I think it may have just been superstition. Not sure.

* dbus/dbus-string.c (_dbus_string_base64_decode): catch some OOM
failures that were not being handled.

* dbus/dbus-auth.c (process_auth): fix a memleak in OOM handling

* dbus/dbus-memory.c: add ability to set number of mallocs in a
row that will fail on out-of-memory.

* dbus/dbus-internals.c (_dbus_test_oom_handling): convenience
function for testing out-of-memory handling.

* bus/config-loader-expat.c (memsuite): don't wrap the dbus
allocation functions, they do map exactly to the expat ones.
/external/dbus/dbus/dbus-string.c
ebb57e719c32becd95a1efe3dd269c21e5a011b6 16-Mar-2003 Havoc Pennington <hp@redhat.com> 2003-03-16 Havoc Pennington <hp@pobox.com>

* dbus/dbus-string.c (_dbus_string_validate_utf8): oops, unbreak
this. always run the test suite before commit...

* bus/*: adapt to DBusConnection API changes

* glib/dbus-gmain.c: adapt to DBusConnection API changes,
requires renaming stuff to avoid dbus_connection_dispatch name
conflict.

* dbus/dbus-transport.c (_dbus_transport_queue_messages): new
function

* dbus/dbus-message.c (_dbus_message_loader_queue_messages):
separate from _dbus_message_loader_return_buffer()

* dbus/dbus-connection.c (dbus_connection_get_n_messages): remove
this, because it's now always broken to use; the number of
messages in queue vs. the number still buffered by the message
loader is undefined/meaningless. Should use
dbus_connection_get_dispatch_state().
(dbus_connection_dispatch): rename from
dbus_connection_dispatch_message
/external/dbus/dbus/dbus-string.c
021305e5686fc4847fec942922d2115ae5c9c2bb 16-Mar-2003 Havoc Pennington <hp@redhat.com> 2003-03-16 Havoc Pennington <hp@pobox.com>

* dbus/dbus-string.c (_dbus_string_validate_utf8): copy in a real
implementation
/external/dbus/dbus/dbus-string.c
e537e421ff4f092621fcd9f6b51526a017ad020c 16-Mar-2003 Anders Carlsson <andersca@codefactory.se> 2003-03-16 Anders Carlsson <andersca@codefactory.se>

* 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.
/external/dbus/dbus/dbus-string.c
ce173b29fc1e9432cb5956952afdbe775da12415 16-Mar-2003 Havoc Pennington <hp@redhat.com> 2003-03-16 Havoc Pennington <hp@pobox.com>

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
/external/dbus/dbus/dbus-string.c
13f70ce711630d7f70c0b11fa57639fad95e4afd 27-Feb-2003 Havoc Pennington <hp@redhat.com> 2003-02-27 Havoc Pennington <hp@pobox.com>

* dbus/dbus-marshal.c (_dbus_demarshal_int32): rewrite to be much
more inlined, using dbus-string-private.h, speeds things up
substantially

* dbus/dbus-string.c (_dbus_string_free): apply align offset
when freeing the string
(_dbus_string_steal_data): fix for align offset
(undo_alignment): new function
/external/dbus/dbus/dbus-string.c
b7bc5ba7a323c6a17a442310c40585b67edff5d4 26-Feb-2003 Havoc Pennington <hp@redhat.com> 2003-02-26 Havoc Pennington <hp@redhat.com>

All kinds of audit fixes from Owen, plus initial attempt to
handle unaligned memory returned from malloc.

* dbus/dbus-string.c (_dbus_string_init): clamp max length to
leave room for align_offset and nul byte
(fixup_alignment): function to track an align_offset and
ensure real->str is aligned
(DBUS_GENERIC_STRING_PREAMBLE): len must be less than allocated,
to allow a nul byte plus align offset
(_dbus_string_lock): fix overflow issue
(_dbus_string_init_const_len): add assertions on sanity of len,
assign allocated to be ALLOCATION_PADDING larger than len
(set_length): fixup the overflow handling
(_dbus_string_get_data_len): fix overflow in assertion
(open_gap): detect overflow in size of gap to be opened
(_dbus_string_lengthen): add overflow check
(_dbus_string_align_length): fix overflow with _DBUS_ALIGN_VALUE
(_dbus_string_append): add overflow check
(_dbus_string_append_unichar): overflow
(_dbus_string_delete): fix overflow in assertion
(_dbus_string_copy_len): overflow in assertion
(_dbus_string_replace_len): overflows in assertions
(_dbus_string_find): change to implement in terms of
_dbus_string_find_to
(_dbus_string_find_to): assorted fixage
(_dbus_string_equal_c_str): assert c_str != NULL,
fix logic so the function works
(_dbus_string_ends_with_c_str): fix overflow thingy
(_dbus_string_base64_encode): overflow fix
(_dbus_string_validate_ascii): overflow
(_dbus_string_validate_nul): overflow
/external/dbus/dbus/dbus-string.c
2f38c959212d98e2194139daa9120fda37415b4f 24-Feb-2003 Havoc Pennington <hp@redhat.com> 2003-02-23 Havoc Pennington <hp@pobox.com>

* dbus/dbus-keyring.c: finish most of this implementation and
simple unit test

* dbus/dbus-errors.c (dbus_set_error_const, dbus_set_error): make
these barf if the error isn't cleared to NULL

* dbus/dbus-sysdeps.c (_dbus_delete_file): set error on failure
(_dbus_create_directory): new function

* dbus/dbus-errors.c (dbus_set_error): fix warning

* dbus/dbus-string.c (_dbus_string_hex_encode): new function
(_dbus_string_hex_decode): new function
(test_hex_roundtrip): test code

* dbus/dbus-sha.c (_dbus_sha_compute): use dbus_string_hex_encode

* dbus/dbus-md5.c (_dbus_md5_compute): use dbus_string_hex_encode

* dbus/dbus-sysdeps.c (_dbus_string_save_to_file): make this use
the save-to-temp/rename trick to atomically write the new file
(_dbus_string_parse_uint): new function
/external/dbus/dbus/dbus-string.c
c21511c01ab56d75f3aa4643761e9fd096a7f8be 19-Feb-2003 Havoc Pennington <hp@redhat.com> 2003-02-19 Havoc Pennington <hp@pobox.com>

Throughout: mop up all the Doxygen warnings and undocumented
stuff.

* dbus/dbus-sysdeps.c (do_exec): do not use execvp, we don't want
to search any paths.

* dbus/dbus-threads.c: move global mutex initializers to
dbus-internals.h, multiple prototypes was confusing doxygen
besides being kind of ugly

* Doxyfile (PREDEFINED): have Doxygen define
DOXYGEN_SHOULD_SKIP_THIS so we can exclude things from
docs with #ifndef DOXYGEN_SHOULD_SKIP_THIS
(do not abuse the feature! it's for stuff like the autogenerated
macros in dbus-md5.c, not just for things you don't feel like
documenting...)
/external/dbus/dbus/dbus-string.c
78e16e99e753175fa49e787eab256932eefaa03f 19-Feb-2003 Havoc Pennington <hp@redhat.com> 2003-02-18 Havoc Pennington <hp@pobox.com>

* dbus/dbus-string.c (_dbus_string_zero): new function

* dbus/dbus-md5.c: include MD5 implementation by L. Peter Deutsch,
wrap it in some dbus-friendly API

* dbus/dbus-types.h: add 16-bit types
/external/dbus/dbus/dbus-string.c
a7c05492537b149f67760ecb1958350900843173 13-Feb-2003 Anders Carlsson <andersca@codefactory.se> 2003-02-13 Anders Carlsson <andersca@codefactory.se>

* dbus/dbus-errors.c:
* dbus/dbus-message.c:
* dbus/dbus-string.c:
Documentation fixes.
/external/dbus/dbus/dbus-string.c
c9ea8fac502c6109713aa372c4c8cfafd0b86858 13-Feb-2003 Havoc Pennington <hp@redhat.com> 2003-02-12 Havoc Pennington <hp@pobox.com>

* dbus/dbus-string.c (_dbus_string_pop_line): fix to also strip
\r off of popped lines

* dbus/dbus-auth.c (_dbus_auth_test): write code to run auth
scripts

* dbus/dbus-auth-script.c (_dbus_auth_script_run): when doing a
SEND, append \r\n
/external/dbus/dbus/dbus-string.c
3791dcca16cb46b0ff7305beff75d1aa2645940c 13-Feb-2003 Havoc Pennington <hp@redhat.com> 2003-02-10 Havoc Pennington <hp@pobox.com>

* dbus/dbus-auth-script.c, dbus/dbus-auth-script.h: sync
initial cut at test framework for DBusAuth from laptop.
Doesn't quite work yet but it compiles and I need to get
it off the 266mhz laptop. ;-)

* dbus/dbus-server-debug.c (_dbus_server_debug_accept_transport):
fix a memleak in error case
/external/dbus/dbus/dbus-string.c
a07bc460ae1a3d3582a6dac7e48ed1ea117990ef 05-Feb-2003 Havoc Pennington <hp@redhat.com> 2003-02-02 Havoc Pennington <hp@pobox.com>

* dbus/dbus-keyring.c, dbus/dbus-keyring.h: template files
for code to manage cookies in your home directory

* dbus/dbus-sysdeps.c (_dbus_generate_random_bytes): new function

* dbus/dbus-auth.c (get_state): impose a maximum number of tries
to authenticate, then disconnect the client.
/external/dbus/dbus/dbus-string.c
e0ffb6eb1472e6766d79346e1fae418c129ef536 01-Feb-2003 Havoc Pennington <hp@redhat.com> 2003-02-01 Havoc Pennington <hp@pobox.com>

* dbus/dbus-break-loader.c (main): new program to find messages
that break the loader.

* dbus/dbus-sysdeps.c (_dbus_string_append_uint): new function
* dbus/dbus-sysdeps.c (_dbus_string_save_to_file): new function

* dbus/dbus-string.c (_dbus_string_set_byte): new
/external/dbus/dbus/dbus-string.c
5ebb5748c2a7587c734eeed9c66f2a1fc0635d09 30-Jan-2003 Anders Carlsson <andersca@codefactory.se> 2003-01-30 Anders Carlsson <andersca@codefactory.se>

* dbus/Makefile.am:
Add dbus-address.[ch]

* dbus/dbus-address.c: (dbus_address_entry_free),
(dbus_address_entries_free), (create_entry),
(dbus_address_entry_get_method), (dbus_address_entry_get_value),
(dbus_parse_address), (_dbus_address_test):
* dbus/dbus-address.h:
New files for dealing with address parsing.

* dbus/dbus-connection.c:
Document timeout functions.

* dbus/dbus-message.c:
Document dbus_message_new_from_message.

* dbus/dbus-server-debug.c:
Document.

* dbus/dbus-server.c: (dbus_server_listen):
Parse address and use correct server implementation.

* dbus/dbus-string.c: (_dbus_string_find_to), (_dbus_string_test):
* dbus/dbus-string.h:
New function with test.

* dbus/dbus-test.c: (dbus_internal_symbol_do_not_use_run_tests):
* dbus/dbus-test.h:
Add address tests.

* dbus/dbus-transport-debug.c:
Document.

* dbus/dbus-transport.c: (_dbus_transport_open):
Parse address and use correct transport implementation.
/external/dbus/dbus/dbus-string.c
7ba714ad7fe8256edfaad7d9a0f09aeb9611ca44 30-Jan-2003 Havoc Pennington <hp@redhat.com> 2003-01-30 Havoc Pennington <hp@pobox.com>

* dbus/dbus-message.c: use message->byte_order instead of
DBUS_COMPILER_BYTE_ORDER throughout.
(dbus_message_create_header): pad header to align the
start of the body of the message to 8-byte boundary

* dbus/dbus-marshal.h: make all the demarshalers take const
DBusString arguments.

* dbus/dbus-message.c (_dbus_message_loader_return_buffer):
validate message args here, so we don't have to do slow validation
later, and so we catch bad messages as they are incoming. Also add
better checks on header_len and body_len. Also fill in
message->byte_order

* dbus/dbus-string.c (_dbus_string_validate_utf8): new (not
implemented properly)
(_dbus_string_validate_nul): new function to check all-nul

* dbus/dbus-marshal.c (_dbus_marshal_get_field_end_pos): rename
get_arg_end_pos and remove all validation
(_dbus_marshal_validate_arg): actually do validation here.
/external/dbus/dbus/dbus-string.c
def834b73b7e306790437b3d02613b14a94e6655 28-Jan-2003 Havoc Pennington <hp@redhat.com> 2003-01-28 Havoc Pennington <hp@redhat.com>

* dbus/dbus-string.c (_dbus_string_base64_decode): append bytes in
the reverse order from how I had it
(_dbus_string_base64_encode): reverse encoding order. I was
basically byteswapping everything during encoding.
/external/dbus/dbus/dbus-string.c
05a4ad6994919b352b5229d0b1b0a8ebebe2a42f 28-Jan-2003 Havoc Pennington <hp@redhat.com> 2003-01-27 Havoc Pennington <hp@pobox.com>

* dbus/dbus-mempool.c (time_for_size): replace printf with
_dbus_verbose

* dbus/dbus-message-builder.c (_dbus_message_data_load): allow
empty lines; fix the SAVE_LENGTH stuff to be
START_LENGTH/END_LENGTH so it actually works; couple other
bugfixes

* test/Makefile.am (dist-hook): add dist-hook for .message files

* dbus/dbus-string.c (DBUS_STRING_COPY_PREAMBLE): source of a copy
can be constant or locked.
(_dbus_string_free): allow freeing a const string as
documented/intended

* dbus/dbus-sysdeps.c (_dbus_concat_dir_and_file): utility

* dbus/dbus-test-main.c (main): take an argument which is the
directory containing test data

* dbus/dbus-message.c (_dbus_message_test): pass a test_data_dir
argument to this and load all the messages in test/data/
checking that they can be loaded or not loaded as appropriate.
/external/dbus/dbus/dbus-string.c
2f440457d5fe45afb732820da64a147157e2e82d 26-Jan-2003 Havoc Pennington <hp@redhat.com> 2003-01-26 Havoc Pennington <hp@pobox.com>

* dbus/dbus-message-builder.c: implement, completely untested.

* test/data/*: add data to be used in testing.
".message" files are our simple loadable text format.
".message-raw" will be binary dumps of messages.

* dbus/dbus-string.c (_dbus_string_starts_with_c_str): new
/external/dbus/dbus/dbus-string.c
1d2478ae4f2da8869eab94ca455a1329230c179e 26-Jan-2003 Havoc Pennington <hp@redhat.com> add a couple @todo
/external/dbus/dbus/dbus-string.c
50c25505f62786756519ef1e194883360eda82e0 26-Jan-2003 Havoc Pennington <hp@redhat.com> 2003-01-26 Havoc Pennington <hp@pobox.com>

The unit tests pass, but otherwise untested. If it breaks, the
tests should have been better. ;-)

* bus/driver.c (bus_driver_handle_hello): return if we disconnect
the connection.

* dbus/dbus-message.c: redo everything so we maintain
message->header as the only copy of the various fields.
This avoids the possibility of out-of-memory in some cases,
for example dbus_message_lock() can't run out of memory anymore,
and avoids extra copying. Figured I may as well go ahead and do
this since it was busted for dbus_message_lock to not return
failure on OOM, and dbus_message_write_header was totally
unchecked for OOM. Also fixed some random other bugs.

* dbus/dbus-marshal.c (_dbus_marshal_get_field_end_pos): verify
that strings are nul-terminated. Also, end_pos can be equal
to string length just not greater than, I think.
(_dbus_marshal_set_int32): new function
(_dbus_marshal_set_uint32): new function
(_dbus_marshal_set_string): new function

* dbus/dbus-connection.c (_dbus_connection_new_for_transport): fix
a warning, init timeout_list to NULL
(dbus_connection_send_message): don't use uninitialized variable
"serial"

* dbus/dbus-string.c (_dbus_string_replace_len): new function
/external/dbus/dbus/dbus-string.c
8a587f6415dd806ad3b77049a5dd47ae24540ae4 19-Jan-2003 Anders Carlsson <andersca@codefactory.se> 2003-01-19 Anders Carlsson <andersca@codefactory.se>

* dbus/dbus-string.c (_dbus_string_move_len): Don't delete all
of the string, just as long as specified.
/external/dbus/dbus/dbus-string.c
650c2745b8e1065b957779e26413a5040fd97f30 18-Jan-2003 Havoc Pennington <hp@redhat.com> 2003-01-18 Havoc Pennington <hp@pobox.com>

* dbus/dbus-test.c: include config.h so that tests actually run

* dbus/dbus-string.c: add assertions that stuff is 8-byte aligned,
so the failure mode when that assumption fails will be plenty
obvious.
/external/dbus/dbus/dbus-string.c
993be1059afcb0e9a5b67f5287fb1122d6c48ce6 09-Jan-2003 Havoc Pennington <hp@redhat.com> 2003-01-08 Havoc Pennington <hp@pobox.com>

* dbus/dbus-string.c (_dbus_string_align_length): new function

* dbus/dbus-test-main.c: move main() for test app here
* dbus/dbus-test.c
(dbus_internal_symbol_do_not_use_run_tests): we have to export a
symbol to run tests, because dbus-test isn't in the main
library

Code review nitpicks.

* dbus/dbus-message.c (dbus_message_write_header): add newlines
for people with narrow emacs ;-). Assert client_serial was filled
in. Assert message->name != NULL.
(dbus_message_append_fields): have "first_field_type" arg separate
from va list, needed for C++ binding that also uses varargs IIRC
and helps with type safety
(dbus_message_new): add @todo about using DBusString to store
service/name internally
(dbus_message_new): don't leak ->service and ->name on OOM later
in the function
(dbus_message_unref): free the service name
(dbus_message_get_fields): same change to varargs
i.e. first_field_type
(_dbus_message_loader_return_buffer): assert that the message data
is aligned (if not it's a bug in our code). Put in verbose griping
about why we set corrupted = TRUE.
(decode_header_data): add FIXME that char* is evil. Was going to
add FIXME about evil locale-specific string.h strncmp, but just
switched to wacky string-as-uint32 optimization. Move check for
"no room for field name" above get_const_data_len() to avoid
assertion failure in get_const_data_len if we have trailing 2
bytes or the like. Check for service and name fields being
provided twice. Don't leak service/name on error. Require field
names to be aligned to 4 bytes.

* dbus/dbus-marshal.c: move byte swap stuff to header
(_dbus_pack_int32): uscore-prefix
(_dbus_unpack_int32): uscore-prefix
(_dbus_unpack_uint32): export
(_dbus_demarshal_string): add @todo complaining about use of
memcpy()
(_dbus_marshal_get_field_end_pos): add @todo about bad error
handling allowing corrupt data to go unchecked
/external/dbus/dbus/dbus-string.c
b3ef8b0e9bd2719d502c7f2e0cf829e151386162 27-Dec-2002 Havoc Pennington <hp@redhat.com> 2002-12-26 Havoc Pennington <hp@pobox.com>

* dbus/dbus-auth.c: fixes fixes fixes

* dbus/dbus-transport-unix.c: wire up support for
encoding/decoding data on the wire

* dbus/dbus-auth.c (_dbus_auth_encode_data)
(_dbus_auth_decode_data): append to target string
instead of nuking it.
/external/dbus/dbus/dbus-string.c
ff5283ab92c668453fd2f28c1715a1e0e9b949f5 27-Dec-2002 Havoc Pennington <hp@redhat.com> 2002-12-26 Havoc Pennington <hp@pobox.com>

* dbus/dbus-marshal.h (DBUS_COMPILER_BYTE_ORDER): #ifdef
WORDS_BIGENDIAN then compiler byte order is DBUS_BIG_ENDIAN,
doh

* dbus/dbus-marshal.c: Add macros to do int swapping in-place and
avoid swap_bytes() overhead (ignoring possible assembly stuff for
now). Main point is because I wanted unpack_uint32 to implement
_dbus_verbose_bytes
(_dbus_verbose_bytes): new function

* dbus/dbus-string.c (_dbus_string_validate_ascii): new function

* dbus/dbus-message.c (_dbus_message_loader_get_is_corrupted): add
mechanism to handle a corrupt message stream
(_dbus_message_loader_new): fix preallocation to only prealloc,
not prelengthen

* dbus/dbus-string.c (_dbus_string_skip_blank): fix this function
(_dbus_string_test): enhance tests for copy/move and fix the
functions

* dbus/dbus-transport-unix.c: Hold references in more places to
avoid reentrancy problems

* dbus/dbus-transport.c: ditto

* dbus/dbus-connection.c (dbus_connection_dispatch_message): don't
leak reference count in no-message case

* test/watch.c (do_mainloop): handle adding/removing watches
during iteration over the watches. Also, ref the connection/server
stored on a watch, so we don't try to mangle a destroyed one.

* dbus/dbus-transport-unix.c (do_authentication): perform
authentication

* dbus/dbus-auth.c (get_state): add a state
AUTHENTICATED_WITH_UNUSED_BYTES and return it if required
(_dbus_auth_get_unused_bytes): append the unused bytes
to the passed in string, rather than prepend

* dbus/dbus-transport.c (_dbus_transport_init_base): create
the auth conversation DBusAuth

* dbus/dbus-transport-unix.c (_dbus_transport_new_for_fd)
(_dbus_transport_new_for_domain_socket): when creating a
transport, pass in whether it's a client-side or server-side
transport so we know which DBusAuth to create
/external/dbus/dbus/dbus-string.c
2297787455989c9ec47ea899b2ad6f3f6ef72c05 25-Dec-2002 Havoc Pennington <hp@redhat.com> 2002-12-25 Havoc Pennington <hp@pobox.com>

* doc/dbus-sasl-profile.txt: docs on the authentication protocol,
it is a simple protocol that just maps directly to SASL.

* dbus/dbus-auth.h, dbus/dbus-auth.c: authentication protocol
initial implementation, not actually used yet.

* dbus/dbus-string.c (_dbus_string_find): new function
(_dbus_string_equal): new function
(_dbus_string_base64_encode): new function
(_dbus_string_base64_decode): new function
/external/dbus/dbus/dbus-string.c
17fbe2b702cdc880abd6cbe117e620b6432f42e0 24-Dec-2002 Havoc Pennington <hp@redhat.com> 2002-12-24 Havoc Pennington <hp@pobox.com>

* glib/dbus-gthread.c: fix include

* glib/dbus-glib.h: rename DBusMessageHandler for now.
I think glib API needs to change, though, as you don't
want to use DBusMessageFunction, you want to use the
DBusMessageHandler object. Probably
dbus_connection_open_with_g_main_loop()
and dbus_connection_setup_g_main_loop() or something like that
(but think of better names...) that just create a connection
that has watch/timeout functions etc. already set up.

* dbus/dbus-connection.c
(dbus_connection_send_message_with_reply): new function just to
show how the message handler helps us deal with replies.

* dbus/dbus-list.c (_dbus_list_remove_last): new function

* dbus/dbus-string.c (_dbus_string_test): free a string that
wasn't

* dbus/dbus-hash.c: use memory pools for the hash entries
(rebuild_table): be more paranoid about overflow, and
shrink table when we can
(_dbus_hash_test): reduce number of sprintfs and write
valid C89. Add tests for case where we grow and then
shrink the hash table.

* dbus/dbus-mempool.h, dbus/dbus-mempool.c: memory pools

* dbus/dbus-connection.c (dbus_connection_register_handler)
(dbus_connection_unregister_handler): new functions

* dbus/dbus-message.c (dbus_message_get_name): new

* dbus/dbus-list.c: fix docs typo

* dbus/dbus-message-handler.h, dbus/dbus-message-handler.c:
an object representing a handler for messages.
/external/dbus/dbus/dbus-string.c
271fa7fc335f332bb2be3beeef735334546c4957 13-Dec-2002 Havoc Pennington <hp@redhat.com> 2002-12-12 Havoc Pennington <hp@pobox.com>

* dbus/dbus-transport-unix.c, dbus/dbus-server-unix.c: use the
below new interfaces and include fewer system headers.

* dbus/dbus-sysdeps.c (_dbus_read): new function
(_dbus_write): new function
(_dbus_write_two): new function
(_dbus_connect_unix_socket): new function
(_dbus_listen_unix_socket): new function

* dbus/dbus-message-internal.h: change interfaces to use
DBusString
/external/dbus/dbus/dbus-string.c
d4b870e7f91b7018524f7b85dc00b90cc64453bf 12-Dec-2002 Havoc Pennington <hp@redhat.com> 2002-12-11 Havoc Pennington <hp@pobox.com>

* dbus/dbus-types.h: add dbus_unichar

* dbus/dbus-internals.c (_dbus_verbose): use _dbus_getenv

* dbus/dbus-connection.c (dbus_connection_send_message): return
TRUE on success

* dbus/dbus-transport.c: include dbus-watch.h

* dbus/dbus-connection.c: include dbus-message-internal.h

* HACKING: add file with coding guidelines stuff.

* dbus/dbus-string.h, dbus/dbus-string.c: Encapsulate all string
handling here, for security purposes (as in vsftpd). Not actually
using this class yet.

* dbus/dbus-sysdeps.h, dbus/dbus-sysdeps.c: Encapsulate all
system/libc usage here, as in vsftpd, for ease of auditing (and
should also simplify portability). Haven't actually moved all the
system/libc usage into here yet.
/external/dbus/dbus/dbus-string.c