[evolution-data-server/camel-socks-proxy] Use 'localhost' instead of NULL to resolve ports
- From: Federico Mena Quintero <federico src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [evolution-data-server/camel-socks-proxy] Use 'localhost' instead of NULL to resolve ports
- Date: Fri, 23 Jul 2010 20:22:11 +0000 (UTC)
commit e93b7615a24ffc21b0e5dd689d2662e91621caee
Author: Federico Mena Quintero <federico novell com>
Date: Fri Jul 23 15:18:01 2010 -0500
Use 'localhost' instead of NULL to resolve ports
camel_getaddrinfo() does not take NULL hostnames, in contrast with
getaddrinfo(). So for now we'll use localhost and try to do
better in the future.
Signed-off-by: Federico Mena Quintero <federico novell com>
camel/camel-tcp-stream-raw.c | 6 +++++-
1 files changed, 5 insertions(+), 1 deletions(-)
---
diff --git a/camel/camel-tcp-stream-raw.c b/camel/camel-tcp-stream-raw.c
index ff5adfa..0df4a2c 100644
--- a/camel/camel-tcp-stream-raw.c
+++ b/camel/camel-tcp-stream-raw.c
@@ -806,7 +806,11 @@ resolve_port (const char *service, gint fallback_port, CamelException *ex)
port = 0;
camel_exception_init (&my_ex);
- ai = camel_getaddrinfo (NULL, service, NULL, &my_ex);
+ /* FIXME: camel_getaddrinfo() does not take NULL hostnames. This is different
+ * from the standard getaddrinfo(), which lets you pass a NULL hostname
+ * if you just want to resolve a port number.
+ */
+ ai = camel_getaddrinfo ("localhost", service, NULL, &my_ex);
if (ai == NULL && fallback_port != 0 && camel_exception_get_id (&my_ex) != CAMEL_EXCEPTION_USER_CANCEL)
port = fallback_port;
else if (ai == NULL) {
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]