[evolution-data-server/camel-socks-proxy-master] Use 'localhost' instead of NULL to resolve ports



commit f43d9725a5985e01e7a0a507a57fade06cee7a62
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 a807183..bacdfca 100644
--- a/camel/camel-tcp-stream-raw.c
+++ b/camel/camel-tcp-stream-raw.c
@@ -746,7 +746,11 @@ resolve_port (const char *service, gint fallback_port, GError **error)
 	port = 0;
 
 	my_error = NULL;
-	ai = camel_getaddrinfo (NULL, service, NULL, &my_error);
+	/* 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_error);
 	if (ai == NULL && fallback_port != 0 && !g_error_matches (local_error, G_IO_ERROR, G_IO_ERROR_CANCELLED))
 		port = fallback_port;
 	else if (ai == NULL) {



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]