Added an explaining comment for the line 'nsock->rcvevent += -1 - newconn->socket;' in lwip_accept

This commit is contained in:
goldsimon 2007-11-25 14:33:23 +00:00
parent 511cdfb951
commit f63a3c1f62

View File

@ -296,11 +296,11 @@ lwip_accept(int s, struct sockaddr *addr, socklen_t *addrlen)
sock_set_errno(sock, 0); sock_set_errno(sock, 0);
sys_sem_wait(socksem); sys_sem_wait(socksem);
/* @todo: This piece of code effectively does nothing: newconn->socket is set to -1 on /* See event_callback: If data comes in right away after an accept, even
correct program flow, nsock->rcvevent is 0 before and after this line. * though the server task might not have created a new socket yet.
Unless there's a specific reason for this code, it should be deleted! * In that case, newconn->socket is counted down (newconn->socket--),
* so nsock->rcvevent is >= 1 here!
This code came in with rev. 1.8 of the file (committed by davidhaas, maybe he knows more) */ */
nsock->rcvevent += -1 - newconn->socket; nsock->rcvevent += -1 - newconn->socket;
newconn->socket = newsock; newconn->socket = newsock;
sys_sem_signal(socksem); sys_sem_signal(socksem);