diff svr-main.c @ 63:dcc43965928f

- A nice cleaner structure for tcp (acceptor) forwarding. - still a checkpoint-ish commit - sorted out listening on localhost only
author Matt Johnston <matt@ucc.asn.au>
date Wed, 11 Aug 2004 17:26:47 +0000
parents 20563735e8b5
children ac96bc733e71
line wrap: on
line diff
--- a/svr-main.c	Tue Aug 10 17:09:52 2004 +0000
+++ b/svr-main.c	Wed Aug 11 17:26:47 2004 +0000
@@ -188,7 +188,8 @@
 
 			/* child connection XXX - ip6 stuff here */
 			remoteaddrlen = sizeof(remoteaddr);
-			childsock = accept(listensocks[i], &remoteaddr, &remoteaddrlen);
+			childsock = accept(listensocks[i], 
+					(struct sockaddr*)&remoteaddr, &remoteaddrlen);
 
 			if (childsock < 0) {
 				/* accept failed */
@@ -295,7 +296,7 @@
 static int listensockets(int *sock, int sockcount, int *maxfd) {
 	
 	unsigned int i;
-	char portstring[6];
+	char portstring[NI_MAXSERV];
 	char* errstring = NULL;
 	unsigned int sockpos = 0;
 	int nsock;