summaryrefslogtreecommitdiffhomepage
path: root/listener.c
diff options
context:
space:
mode:
authorMatt Johnston <matt@ucc.asn.au>2004-08-11 17:26:47 +0000
committerMatt Johnston <matt@ucc.asn.au>2004-08-11 17:26:47 +0000
commit453261a0420a1e4ee5d0feb3df6806c39ae3e0ff (patch)
treedffe7a4d63c88753c9763cbbe584d3d95d1a95f2 /listener.c
parenta712baa8e566bfd8403a3e2bfdf350a0dc50ea9f (diff)
- A nice cleaner structure for tcp (acceptor) forwarding.
- still a checkpoint-ish commit - sorted out listening on localhost only --HG-- extra : convert_revision : c030ac0a3950dba81f2324e2ba9d4b77fc8f8149
Diffstat (limited to 'listener.c')
-rw-r--r--listener.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/listener.c b/listener.c
index 3022bd5..9424c6a 100644
--- a/listener.c
+++ b/listener.c
@@ -42,7 +42,7 @@ void handle_listeners(fd_set * readfds) {
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 @@ void handle_listeners(fd_set * readfds) {
}
-/* 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 @@ struct Listener* new_listener(int socks[], unsigned int nsocks,
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;