Hi,
The follow patch fix a crash that occurs when c2s connecting clients passed
the define connection limit.

Index: mio_impl.h
===================================================================
--- mio_impl.h (revision 27350)
+++ mio_impl.h (revision 27351)
@@ -99,7 +99,9 @@
     mio_debug(ZONE, "adding fd #%d", fd);

     mio_fd = MIO_ALLOC_FD(m, fd);
-    /* ok to process this one, welcome to the family */
+ if(NULL == mio_fd)
+ return NULL;
+ /* ok to process this one, welcome to the family */
     FD(m,mio_fd)->type = type_NORMAL;
     FD(m,mio_fd)->app = app;
     FD(m,mio_fd)->arg = arg;
@@ -169,7 +171,12 @@
     /* set up the entry for this new socket */
     mio_fd = _mio_setup_fd(m, newfd, FD(m,fd)->app, FD(m,fd)->arg);

-    /* tell the app about the new socket, if they reject it clean up */
+    if(!mio_fd)
+ {
+ close(newfd);
+ return;
+ }
+ /* tell the app about the new socket, if they reject it clean up */
     if (ACT(m, mio_fd, action_ACCEPT, ip))
     {
         mio_debug(ZONE, "accept was rejected for %s:%d", ip, newfd);

Reply via email to