mirror of
https://github.com/lwip-tcpip/lwip.git
synced 2024-10-04 05:39:53 +00:00
Added an explaining comment for the line 'nsock->rcvevent += -1 - newconn->socket;' in lwip_accept
This commit is contained in:
parent
511cdfb951
commit
f63a3c1f62
@ -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);
|
||||||
|
Loading…
Reference in New Issue
Block a user