changeset 2113:c5817f302aa6 HEAD

net_gethostbyname() was broken with IPv6 enabled (wasn't really used with Dovecot anyway). Some other cleanups.
author Timo Sirainen <tss@iki.fi>
date Mon, 14 Jun 2004 02:37:40 +0300
parents 55d3864cc4f8
children 4aedcb4c51cb
files src/lib/network.c src/lib/network.h
diffstat 2 files changed, 3 insertions(+), 6 deletions(-) [+]
line wrap: on
line diff
--- a/src/lib/network.c	Mon Jun 14 00:50:42 2004 +0300
+++ b/src/lib/network.c	Mon Jun 14 02:37:40 2004 +0300
@@ -442,7 +442,7 @@
 	for (ai = origai; ai != NULL; ai = ai->ai_next, count++) {
 		so = (union sockaddr_union *) ai->ai_addr;
 
-		sin_get_ip(so, ips[count]);
+		sin_get_ip(so, &(*ips)[count]);
 	}
 	freeaddrinfo(origai);
 #else
@@ -607,7 +607,7 @@
 }
 
 /* Get name of TCP service */
-char *net_getservbyport(unsigned short port)
+const char *net_getservbyport(unsigned short port)
 {
 	struct servent *entry;
 
--- a/src/lib/network.h	Mon Jun 14 00:50:42 2004 +0300
+++ b/src/lib/network.h	Mon Jun 14 02:37:40 2004 +0300
@@ -49,9 +49,6 @@
 int net_connect_unix(const char *path);
 /* Disconnect socket */
 void net_disconnect(int fd);
-/* Try to let the other side close the connection, if it still isn't
-   disconnected after certain amount of time, close it ourself */
-void net_disconnect_later(int fd);
 
 /* Set socket blocking/nonblocking */
 void net_set_nonblock(int fd, int nonblock);
@@ -101,7 +98,7 @@
 int net_geterror(int fd);
 
 /* Get name of TCP service */
-char *net_getservbyport(unsigned short port);
+const char *net_getservbyport(unsigned short port);
 
 int is_ipv4_address(const char *addr);
 int is_ipv6_address(const char *addr);