psqlodbc.git / summary / log / commit / refs
commit 571eeb88924fa905f99b97feaec63e3cf32082bd
Author: Hiroshi Inoue <inoue@tpf.co.jp>
Date: Wed Dec 11 11:50:02 2013 +0000
Call getaddrinfo() with AI_NUMERICSERV because the service is a port number.
socket.c | 1 +
1 file changed, 1 insertion(+)
diff --git a/socket.c b/socket.c
index 01ea56cf..61d36ecb 100644
--- a/socket.c
+++ b/socket.c
@@ -279,6 +279,7 @@ SOCK_connect_to(SocketClass *self, unsigned short port, char *hostname, long tim
rest.ai_socktype = SOCK_STREAM;
rest.ai_family = AF_UNSPEC;
snprintf(portstr, sizeof(portstr), "%d", port);
+ rest.ai_flags |= AI_NUMERICSERV;
if (is_numeric_address(hostname))
/* don't resolve address in getaddrinfo() if not necessary */
rest.ai_flags |= AI_NUMERICHOST;
[parent: 82a80bbadfd0]