Hi Eddie,

Attached patch fixes the following bug:

Server socket with connected upstream input non-empty queue before the
connection has been accepted will never set SELECT_WRITE on the active
socket, causing the queue to fill up without ever being emptied by the
socket element. Setting SELECT_WRITE after accept on the active socket is
the solution. This works even when the queue is empty as the elements will
disable SELECT_WRITE as soon as the queue signal goes off.

Beyers

PS For future enhancements I'd like to add a signal to the socket element to
indicate an active connection. This will prevent elements from pushing
packets into the socket upstream queue if there is no active connection. If
this is something you think you would want to integrate with cvs let me
know.


--- /home/bcronje/src/clickcvs/click/elements/userlevel/socket.cc
2006-04-08 18:22:59.000000000 +0200
+++ /home/bcronje/click/elements/userlevel/socket.cc    2006-05-29 23:15:
21.000000000 +0200
@@ -235,6 +235,8 @@

      add_select(_active, SELECT_READ);
      _events = SELECT_READ;
+      add_select(_active, SELECT_WRITE);
+      _events |= SELECT_WRITE;
    }

    // read data from socket
--- /home/bcronje/src/clickcvs/click/elements/userlevel/socket.cc	2006-04-08 18:22:59.000000000 +0200
+++ /home/bcronje/click/elements/userlevel/socket.cc	2006-05-29 23:15:21.000000000 +0200
@@ -235,6 +235,8 @@
 
       add_select(_active, SELECT_READ);
       _events = SELECT_READ;
+      add_select(_active, SELECT_WRITE);
+      _events |= SELECT_WRITE;
     }
 
     // read data from socket
_______________________________________________
click mailing list
click@amsterdam.lcs.mit.edu
https://amsterdam.lcs.mit.edu/mailman/listinfo/click

Reply via email to