+2006-05-30 Sjoerd Simons <sjoerd@luon.net>
+
+ * dbus/dbus-sysdeps.c: Make tcp socket connection error somewhat more
+ clear:
+ "Failed to connect to socket <host>:<port> <error>" instead of
+ "Failed to connect to socket <host>: <error>:<port>"
+
+ * dbus/dbus-transport-unix.c: Fix crash when no host option is given
+ for a tcp transport.
+
2006-05-29 Thiago Macieira <thiago.macieira@trolltech.com>
* qt/*: Update the QtDBus bindings up to revision 546310 in
{
dbus_set_error (error,
_dbus_error_from_errno (errno),
- "Failed to connect to socket %s: %s:%d",
- host, _dbus_strerror (errno), port);
+ "Failed to connect to socket %s:%d %s",
+ host, port, _dbus_strerror (errno));
close (fd);
fd = -1;
return NULL;
}
- if (!_dbus_string_append (&address, "tcp:host=") ||
- !_dbus_string_append (&address, host) ||
- !_dbus_string_append (&address, ",port=") ||
+ if (!_dbus_string_append (&address, "tcp:"))
+ goto error;
+
+ if (host != NULL &&
+ (!_dbus_string_append (&address, "host=") ||
+ !_dbus_string_append (&address, host)))
+ goto error;
+
+ if (!_dbus_string_append (&address, ",port=") ||
!_dbus_string_append_int (&address, port))
- {
- _dbus_string_free (&address);
- dbus_set_error (error, DBUS_ERROR_NO_MEMORY, NULL);
- return NULL;
- }
-
+ goto error;
+
fd = _dbus_connect_tcp_socket (host, port, error);
if (fd < 0)
{
_dbus_string_free (&address);
return transport;
+
+error:
+ _dbus_string_free (&address);
+ dbus_set_error (error, DBUS_ERROR_NO_MEMORY, NULL);
+ return NULL;
}
/** @} */