[Click] socket.cc patch

Beyers Cronje bcronje at gmail.com
Mon May 29 17:36:54 EDT 2006


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
-------------- next part --------------
A non-text attachment was scrubbed...
Name: socket.patch
Type: text/x-patch
Size: 397 bytes
Desc: not available
Url : https://amsterdam.lcs.mit.edu/pipermail/click/attachments/20060529/45743400/socket.bin


More information about the click mailing list