> MIO doesn't keep track of the remote port, but it does keep the remote IP in the 
>m->ip member..

I've made a small patch to jabberd that gets MIO to keep track of the port.
If you accept it, it will be useful with the PASS component I wrote, if
nothing else.

Regards,
Rob.
diff -r -U3 jabberd.old/jabberd.h jabberd/jabberd.h
--- jabberd.old/jabberd.h       Wed Jun 13 09:56:34 2001
+++ jabberd/jabberd.h   Wed Jun 13 09:56:24 2001
@@ -218,6 +218,7 @@
     int rated;   /* is this socket rate limted? */
     jlimit rate; /* if so, what is the rate?    */
     char *ip;
+    int port;
 } *mio, _mio;
 
 /* MIO SOCKET HANDLERS */
diff -r -U3 jabberd.old/mio.c jabberd/mio.c
--- jabberd.old/mio.c   Wed Jun 13 09:56:34 2001
+++ jabberd/mio.c       Wed Jun 13 09:56:24 2001
@@ -397,6 +397,7 @@
     /* create a new sock object for this connection */
     new      = mio_new(fd, m->cb, m->cb_arg, mio_handlers_new(m->mh->read, 
m->mh->write, m->mh->parser));
     new->ip  = pstrdup(new->p, inet_ntoa(serv_addr.sin_addr));
+    new->port = ntohs(serv_addr.sin_port);
 #ifdef HAVE_SSL
     new->ssl = m->ssl;
     

PGP signature

Reply via email to