History log of /external/dbus/dbus/dbus-watch.c
Revision Date Author Comments (<<< Hide modified files) (Show modified files >>>)
4299eb3c0907100fe95d2986984b48d40cc52841 08-Jul-2015 Daniel Erat <derat@google.com> Incorporate upstream changes to v1.6.8.

Squash upstream commits up to and including the v1.6.8
release (upstream commit 1cad15cc).

This repository's changes from upstream are now limited to:

- addition of Android.mk, CleanSpec.mk, config.h, and NOTICE
files
- addition of dbus/dbus-arch-deps.h and removal from
dbus/.gitignore (ebae2d21, f022f55d)
- WANT_PIDFILE #ifdefs added to bus/bus.c to disable writing
dbus-daemon's PID to a file (3100d06a)
- TRACE_LOCKS set to 0 in dbus/dbus-connection.c (88a0ffe5)
- DBUS_ANDROID_LOG added to dbus/dbus-internals.c to use
logcat (7de15def)
- ANDROID_MANAGED_SOCKET added to dbus/dbus-sysdeps-unix.c
to use an SELinux-managed socket rather than a
dbus-daemon-created Unix domain socket (3100d06a)

Bug: 22328216
Change-Id: I793ebdf963d9b0740f0da28f1de593d088f08406
/external/dbus/dbus/dbus-watch.c
d5217348517e6b00a04e500ca460daf6cc928cd9 26-Mar-2010 Ralf Habacker <ralf.habacker@freenet.de> Cleaned up _dbus_verbose calls: function names and code line numbers are printed by default.
/external/dbus/dbus/dbus-watch.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-watch.c
54ebd0acd89b6242b0fcac6db894bdec8bea523f 28-Apr-2009 Christian Ehrlicher <Ch.Ehrlicher@gmx.de> use dbus_watch_get_socket in dbus_watch_get_unix_fd on windows (cherry picked from commit c15206da8e56e32c7de98824d8d2c38a7d92c707)
/external/dbus/dbus/dbus-watch.c
0e36cdd54964c4012acec2bb8e598b85e82d2846 11-Jul-2009 Colin Walters <walters@verbum.org> Bug 896 - Avoid race conditions reading message from exited process

Patch based on extensive work from Michael Meeks <michael.meeks@novell.com>,
thanks to Dafydd Harries <dafydd.harries@collabora.co.uk>,
Kimmo Hämäläinen <kimmo.hamalainen@nokia.com> and others.

The basic idea with this bug is that we effectively ignore errors
on write. Only when we're done reading from a connection do we
close down a connection. This avoids a race condition where
if a process (such as dbus-send) exited while we still had
data to read in the buffer, we'd miss that data.
/external/dbus/dbus/dbus-watch.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-watch.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-watch.c
ee721d13c455b5780af5989662ff7fca68374327 21-Jun-2007 Havoc Pennington <hp@redhat.com> 2007-06-21 Havoc Pennington <hp@redhat.com>

* dbus/dbus-watch.c (dbus_watch_get_fd): 1) its behavior should
not be the same as before, the ABI has never been declared stable
on Windows and 2) do not commit to cross-platform files without
posting the exact patch to the mailing list

* dbus/dbus-sysdeps-util.c (_dbus_sysdeps_test): as I have pointed
out before, either 0xff needs to work on both platforms, or none
of the dbus code can rely on it working. That means the options
are 1) audit the code for anywhere that relies on 0xff working, if
none found ideally add a test that it *doesn't* work and make unix
reject it explicitly, but in any case this test would go away or
2) make it work on Windows also, then we don't have to figure out
whether we rely on it.

And in either case, post the exact patch to the mailing list and
don't just commit.
/external/dbus/dbus/dbus-watch.c
b86ea8c1ec24efe29a32d2d85cde1a949d7c5563 21-Jun-2007 Ralf Habacker <ralf.habacker@freenet.de> * dbus/dbus-watch.c (dbus_watch_get_fd): this function is deprecated and its behavior should be as before until all client code is migrated.
/external/dbus/dbus/dbus-watch.c
98f19852078cf03f8b50a93d49d83b85c0dd400b 18-Jun-2007 Havoc Pennington <hp@redhat.com> 2007-06-18 Havoc Pennington <hp@redhat.com>

* dbus/dbus-watch.c (dbus_watch_get_socket)
(dbus_watch_get_unix_fd): new API to match DBusConnection
(dbus_watch_get_fd): deprecate this

Throughout: just s/dbus_watch_get_fd/dbus_watch_get_socket/g for
now since all the transports use sockets anyway
/external/dbus/dbus/dbus-watch.c
58a0d2759aedc854ccac78d7252f117662734142 21-Oct-2006 Havoc Pennington <hp@redhat.com> 2006-10-21 Havoc Pennington <hp@redhat.com>

* More documentation - all public API now documented according to
Doxygen
/external/dbus/dbus/dbus-watch.c
afa4ffbd852686633086569cd34942917c5c49af 21-Oct-2006 Havoc Pennington <hp@redhat.com> 2006-10-21 Havoc Pennington <hp@redhat.com>

* dbus/dbus-message.h: put #ifndef DBUS_DISABLE_DEPRECATED around
dbus_message_iter_get_array_len().

* throughout: documentation improvements.
/external/dbus/dbus/dbus-watch.c
f1ca9b89e92de4d876dc5e7e85710c4d2dc87638 17-Oct-2006 Havoc Pennington <hp@redhat.com> 2006-10-17 Havoc Pennington <hp@redhat.com>

* dbus/dbus-internals.c (_dbus_warn_check_failed): new function to
be used for return_if_fail type warnings; prefixes the pid, and
fatal by default.
/external/dbus/dbus/dbus-watch.c
7652304bff969afb3969603149bb385efe861fe8 03-Aug-2006 John (J5) Palmieri <johnp@redhat.com> * s/D-BUS/D-Bus/g
/external/dbus/dbus/dbus-watch.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-watch.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-watch.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-watch.c
9f1a60dbba69844c0a04b3dd86280352736187ce 27-Nov-2003 Mikael Hallendal <micke@imendio.com> 2003-11-26 Mikael Hallendal <micke@imendio.com>

* bus/*.[ch]:
* dbus/*.[ch]:
* glib/*.[ch]: Made ref functions return the pointer
/external/dbus/dbus/dbus-watch.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-watch.c
306eab3e3d998472ad111146a12b7697ea96c9b9 16-May-2003 Havoc Pennington <hp@redhat.com> 2003-05-16 Havoc Pennington <hp@redhat.com>

* dbus/dbus-connection.c: disable verbose lock spew

* tools/dbus-send.c: add --print-reply command line option

* tools/dbus-print-message.h (print_message): new util function
shared by dbus-send and dbus-monitor

* tools/dbus-monitor.c (handler_func): exit on disconnect

* dbus/dbus-transport-unix.c (do_reading): if the transport is
disconnected, don't try to use the read_watch

* dbus/dbus-watch.c (dbus_watch_get_enabled): assert watch != NULL
so we can find this bug more easily
/external/dbus/dbus/dbus-watch.c
c0158234d046381a6bc8c004c82577576977d0d7 04-May-2003 Havoc Pennington <hp@redhat.com> 2003-05-03 Havoc Pennington <hp@pobox.com>

* dbus/dbus-watch.c (dbus_watch_handle): warn and return if a
watch is invalid when handled

* tools/Makefile.am, tools/dbus-launch.c, tools/dbus-launch.1: add
dbus-launch utility to launch the bus from a shell script. Didn't
actually implement dbus-launch yet, it's just a placeholder still.
/external/dbus/dbus/dbus-watch.c
9c010fbc04a450cc13484682abfbecd31f610305 25-Apr-2003 Havoc Pennington <hp@redhat.com> 2003-04-25 Havoc Pennington <hp@redhat.com>

* glib/dbus-gmain.c (remove_watch): fix for a crash when watches
were toggled without add/remove, fix from Anders Gustafsson
/external/dbus/dbus/dbus-watch.c
3df260c07102745c5606c313af862558f105f83e 18-Apr-2003 Havoc Pennington <hp@redhat.com> 2003-04-18 Havoc Pennington <hp@pobox.com>

* 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.
/external/dbus/dbus/dbus-watch.c
03b9ca6d4ecf2577958530b8390d675c73a58825 05-Apr-2003 Havoc Pennington <hp@redhat.com> 2003-04-04 Havoc Pennington <hp@redhat.com>

* 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()
/external/dbus/dbus/dbus-watch.c
b4a1100f4f81534e2aac0141afda750f318223d4 17-Mar-2003 Havoc Pennington <hp@redhat.com> 2003-03-16 Havoc Pennington <hp@pobox.com>

* dbus/dbus-watch.c (_dbus_watch_new): handle failure to malloc
the watch

* dbus/dbus-server-debug-pipe.c (_dbus_transport_debug_pipe_new):
add some missing dbus_set_result

* bus/dispatch.c (bus_dispatch_add_connection): handle failure to
alloc the DBusMessageHandler

* dbus/dbus-transport.c (_dbus_transport_disconnect): don't ref
the transport here, since we call this from the finalizer; it
resulted in a double-finalize.

* dbus/dbus-transport.c (_dbus_transport_disconnect): fix a bug
where we tried to use transport->connection that was NULL,
happened when transport was disconnected early on due to OOM

* bus/*.c: adapt to handle OOM for watches/timeouts

* dbus/dbus-transport-unix.c: port to handle OOM during
watch handling

* dbus/dbus-auth.c (_dbus_auth_get_unused_bytes): return a
reference to unused bytes instead of a copy

* dbus/dbus-server.c (dbus_server_handle_watch): return FALSE for
out of memory

* dbus/dbus-connection.c (dbus_connection_handle_watch): return
FALSE on OOM

* dbus/dbus-timeout.c (dbus_timeout_handle): return FALSE for out
of memory
/external/dbus/dbus/dbus-watch.c
f587ce7845edb0eb01451368d01b5bc86b5904cd 15-Mar-2003 Havoc Pennington <hp@redhat.com> 2003-03-15 Havoc Pennington <hp@pobox.com>

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
/external/dbus/dbus/dbus-watch.c
3bea935316ff048e68dea6a26c2e8e9fd314477f 14-Mar-2003 Havoc Pennington <hp@redhat.com> 2003-03-13 Havoc Pennington <hp@redhat.com>

* 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
/external/dbus/dbus/dbus-watch.c
f023895590208ea70ff7ac7444cc5e0729a3a815 01-Feb-2003 Alexander Larsson <alexl@redhat.com> 2003-02-02 Alexander Larsson <alexl@redhat.com>

* dbus/dbus-watch.c (dbus_watch_get_flags):
Add note in the docs that ERROR or HANGUP won't be returned
and are assumed always on.

* glib/dbus-gmain.c (add_watch):
Always add IO_ERR | IO_HUP

* dbus/dbus-message.h:
Add semicolon after dbus_message_iter_get_string_array().
Makes qt code build again
/external/dbus/dbus/dbus-watch.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-watch.c
b7d029e5d706a2ec1c06e8d51fd4facfa13dd752 15-Dec-2002 Harri Porten <porten@kde.org> fixed doc error
/external/dbus/dbus/dbus-watch.c
8a60a95e92cbd30f412c4d6d75e10bf21505701e 25-Nov-2002 Havoc Pennington <hp@redhat.com> s/an file/a file/
/external/dbus/dbus/dbus-watch.c
041b0767b284034aee09e9a0de2a3844b8cc546a 25-Nov-2002 Havoc Pennington <hp@redhat.com> 2002-11-24 Havoc Pennington <hp@pobox.com>

* test/echo-client.c, test/echo-server.c: cheesy test
clients.

* configure.in (AC_CHECK_FUNCS): check for writev

* dbus/dbus-message.c (_dbus_message_get_network_data): new
function

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

* dbus/dbus-internals.c (_dbus_verbose): new function

* dbus/dbus-server.c, dbus/dbus-server.h: public object
representing a server that listens for connections.

* dbus/.cvsignore: create

* dbus/dbus-errors.h, dbus/dbus-errors.c:
public API for reporting errors

* dbus/dbus-connection.h, dbus/dbus-connection.c:
public object representing a connection that
sends/receives messages. (Same object used for
both client and server.)

* dbus/dbus-transport.h, dbus/dbus-transport.c:
Basic abstraction for different kinds of stream
that we might read/write messages from.
/external/dbus/dbus/dbus-watch.c