[dovecot-cvs] dovecot/src/lib network.c, 1.40, 1.41 network.h, 1.15, 1.16
tss at dovecot.org
tss at dovecot.org
Sat Nov 4 18:45:04 UTC 2006
Update of /var/lib/cvs/dovecot/src/lib
In directory talvi:/tmp/cvs-serv28597/lib
Modified Files:
network.c network.h
Log Message:
Changed ips_count to unsigned int in net_gethostbyname(). Also removed
duplicated API comments from network.c.
Index: network.c
===================================================================
RCS file: /var/lib/cvs/dovecot/src/lib/network.c,v
retrieving revision 1.40
retrieving revision 1.41
diff -u -d -r1.40 -r1.41
--- network.c 15 Oct 2006 23:11:12 -0000 1.40
+++ network.c 4 Nov 2006 18:45:01 -0000 1.41
@@ -102,7 +102,6 @@
return 0;
}
-/* Connect to socket with ip address */
int net_connect_ip(const struct ip_addr *ip, unsigned int port,
const struct ip_addr *my_ip)
{
@@ -190,14 +189,12 @@
return fd;
}
-/* Disconnect socket */
void net_disconnect(int fd)
{
if (close(fd) < 0)
i_error("net_disconnect() failed: %m");
}
-/* Set socket blocking/nonblocking */
void net_set_nonblock(int fd, bool nonblock)
{
if (fd_set_nonblock(fd, nonblock) < 0)
@@ -234,8 +231,6 @@
#endif
}
-/* Listen for connections on a socket. if `my_ip' is NULL, listen in any
- address. */
int net_listen(const struct ip_addr *my_ip, unsigned int *port, int backlog)
{
union sockaddr_union so;
@@ -340,7 +335,6 @@
return -1;
}
-/* Accept a connection on a socket */
int net_accept(int fd, struct ip_addr *addr, unsigned int *port)
{
union sockaddr_union so;
@@ -366,7 +360,6 @@
return ret;
}
-/* Read data from socket, return number of bytes read, -1 = error */
ssize_t net_receive(int fd, void *buf, size_t len)
{
ssize_t ret;
@@ -395,7 +388,6 @@
return ret;
}
-/* Transmit data, return number of bytes sent, -1 = error */
ssize_t net_transmit(int fd, const void *data, size_t len)
{
ssize_t ret;
@@ -414,9 +406,8 @@
return ret;
}
-/* Get IP addresses for host. ips contains ips_count of IPs, they don't need
- to be free'd. Returns 0 = ok, others = error code for net_gethosterror() */
-int net_gethostbyname(const char *addr, struct ip_addr **ips, int *ips_count)
+int net_gethostbyname(const char *addr, struct ip_addr **ips,
+ unsigned int *ips_count)
{
/* @UNSAFE */
#ifdef HAVE_IPV6
@@ -489,7 +480,6 @@
return 0;
}
-/* Get socket address/port */
int net_getsockname(int fd, struct ip_addr *addr, unsigned int *port)
{
union sockaddr_union so;
@@ -590,7 +580,6 @@
#endif
}
-/* Get socket error */
int net_geterror(int fd)
{
int data;
@@ -602,7 +591,6 @@
return data;
}
-/* get error of net_gethostname() */
const char *net_gethosterror(int error)
{
#ifdef HAVE_IPV6
@@ -631,8 +619,6 @@
#endif
}
-/* return TRUE if host lookup failed because it didn't exist (ie. not
- some error with name server) */
int net_hosterror_notfound(int error)
{
#ifdef HAVE_IPV6
@@ -646,7 +632,6 @@
#endif
}
-/* Get name of TCP service */
const char *net_getservbyport(unsigned short port)
{
struct servent *entry;
Index: network.h
===================================================================
RCS file: /var/lib/cvs/dovecot/src/lib/network.h,v
retrieving revision 1.15
retrieving revision 1.16
diff -u -d -r1.15 -r1.16
--- network.h 15 Oct 2006 16:19:18 -0000 1.15
+++ network.h 4 Nov 2006 18:45:01 -0000 1.16
@@ -77,7 +77,8 @@
/* Get IP addresses for host. ips contains ips_count of IPs, they don't need
to be free'd. Returns 0 = ok, others = error code for net_gethosterror() */
-int net_gethostbyname(const char *addr, struct ip_addr **ips, int *ips_count);
+int net_gethostbyname(const char *addr, struct ip_addr **ips,
+ unsigned int *ips_count);
/* get error of net_gethostname() */
const char *net_gethosterror(int error);
/* return TRUE if host lookup failed because it didn't exist (ie. not
More information about the dovecot-cvs
mailing list