diff listener.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 e3adf4cf5465
line wrap: on
line diff
--- a/listener.c	Tue Aug 10 17:09:52 2004 +0000
+++ b/listener.c	Wed Aug 11 17:26:47 2004 +0000
@@ -42,7 +42,7 @@
 			for (j = 0; j < listener->nsocks; j++) {
 				sock = listener->socks[j];
 				if (FD_ISSET(sock, readfds)) {
-					listener->accepter(listener, sock);
+					listener->acceptor(listener, sock);
 				}
 			}
 		}
@@ -50,11 +50,11 @@
 }
 
 
-/* accepter(int fd, void* typedata) is a function to accept connections, 
+/* acceptor(int fd, void* typedata) is a function to accept connections, 
  * cleanup(void* typedata) happens when cleaning up */
 struct Listener* new_listener(int socks[], unsigned int nsocks,
 		int type, void* typedata, 
-		void (*accepter)(struct Listener*, int sock), 
+		void (*acceptor)(struct Listener* listener, int sock), 
 		void (*cleanup)(struct Listener*)) {
 
 	unsigned int i, j;
@@ -99,7 +99,7 @@
 	newlisten->typedata = typedata;
 	newlisten->nsocks = nsocks;
 	memcpy(newlisten->socks, socks, nsocks * sizeof(int));
-	newlisten->accepter = accepter;
+	newlisten->acceptor = acceptor;
 	newlisten->cleanup = cleanup;
 
 	ses.listeners[i] = newlisten;