mirror of
https://gitlab.freedesktop.org/dbus/dbus.git
synced 2026-05-08 04:28:01 +02:00
2003-03-17 Anders Carlsson <andersca@codefactory.se>
* bus/dispatch.c: (bus_dispatch): Refetch the service name since it may have been reallocated when dbus_message_set_sender was called. * dbus/dbus-sysdeps.c: (_dbus_accept): Add address and address length variables and use them to stop valgrind from complaining.
This commit is contained in:
parent
f7c24715b5
commit
73d7ba1d13
3 changed files with 24 additions and 3 deletions
10
ChangeLog
10
ChangeLog
|
|
@ -1,3 +1,13 @@
|
|||
2003-03-17 Anders Carlsson <andersca@codefactory.se>
|
||||
|
||||
* bus/dispatch.c: (bus_dispatch):
|
||||
Refetch the service name since it may have been reallocated
|
||||
when dbus_message_set_sender was called.
|
||||
|
||||
* dbus/dbus-sysdeps.c: (_dbus_accept):
|
||||
Add address and address length variables and use them to stop
|
||||
valgrind from complaining.
|
||||
|
||||
2003-03-17 Havoc Pennington <hp@pobox.com>
|
||||
|
||||
All tests pass, no memleaks, no valgrind complaints.
|
||||
|
|
|
|||
|
|
@ -208,18 +208,25 @@ bus_dispatch (DBusConnection *connection,
|
|||
{
|
||||
sender = bus_connection_get_name (connection);
|
||||
_dbus_assert (sender != NULL);
|
||||
|
||||
|
||||
if (!dbus_message_set_sender (message, sender))
|
||||
{
|
||||
BUS_SET_OOM (&error);
|
||||
goto out;
|
||||
}
|
||||
|
||||
/* We need to refetch the service name here, because
|
||||
* dbus_message_set_sender can cause the header to be
|
||||
* reallocated, and thus the service_name pointer will become
|
||||
* invalid.
|
||||
*/
|
||||
service_name = dbus_message_get_service (message);
|
||||
}
|
||||
|
||||
if (strcmp (service_name, DBUS_SERVICE_DBUS) == 0) /* to bus driver */
|
||||
{
|
||||
if (!bus_driver_handle_message (connection, transaction, message, &error))
|
||||
goto out;
|
||||
goto out;
|
||||
}
|
||||
else if (!bus_connection_is_active (connection)) /* clients must talk to bus driver first */
|
||||
{
|
||||
|
|
|
|||
|
|
@ -786,9 +786,13 @@ int
|
|||
_dbus_accept (int listen_fd)
|
||||
{
|
||||
int client_fd;
|
||||
struct sockaddr addr;
|
||||
socklen_t addrlen;
|
||||
|
||||
addrlen = sizeof (addr);
|
||||
|
||||
retry:
|
||||
client_fd = accept (listen_fd, NULL, NULL);
|
||||
client_fd = accept (listen_fd, &addr, &addrlen);
|
||||
|
||||
if (client_fd < 0)
|
||||
{
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue