diff listener.c @ 13:db2c8e6fb284

Fixed stupid agentfwd error (using the listening FD, not the accepted on. gah)
author Matt Johnston <matt@ucc.asn.au>
date Thu, 03 Jun 2004 18:08:34 +0000
parents 7f77962de998
children 20563735e8b5
line wrap: on
line diff
--- a/listener.c	Thu Jun 03 17:29:17 2004 +0000
+++ b/listener.c	Thu Jun 03 18:08:34 2004 +0000
@@ -3,7 +3,7 @@
 #include "session.h"
 #include "dbutil.h"
 
-void listener_initialise() {
+void listeners_initialise() {
 
 	/* just one slot to start with */
 	ses.listeners = (struct Listener**)m_malloc(sizeof(struct Listener*));
@@ -21,6 +21,7 @@
 	for (i = 0; i < ses.listensize; i++) {
 		listener = ses.listeners[i];
 		if (listener != NULL) {
+			TRACE(("set listener fd %d", listener->sock));
 			FD_SET(listener->sock, readfds);
 		}
 	}
@@ -36,6 +37,7 @@
 	for (i = 0; i < ses.listensize; i++) {
 		listener = ses.listeners[i];
 		if (listener != NULL) {
+		TRACE(("handle listener num %d fd %d", i, listener->sock));
 			if (FD_ISSET(listener->sock, readfds)) {
 				listener->accepter(listener);
 			}
@@ -80,6 +82,8 @@
 
 	ses.maxfd = MAX(ses.maxfd, sock);
 
+	TRACE(("new listener num %d fd %d", i, sock));
+
 	newlisten = (struct Listener*)m_malloc(sizeof(struct Listener));
 	newlisten->index = i;
 	newlisten->type = type;