lwip-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[lwip-devel] [bug #46696] accepts_pending not decreased when TCP_EVENT_A


From: Ambroz Bizjak
Subject: [lwip-devel] [bug #46696] accepts_pending not decreased when TCP_EVENT_ACCEPT returns error
Date: Tue, 19 Jan 2016 17:55:06 +0000
User-agent: Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/47.0.2526.111 Safari/537.36

Follow-up Comment #8, bug #46696 (project lwip):

I think it doesn't matter if you manipulate the backlog or accepts_pending. If
you want to have separate control over the backlog, incrementing/decrementing
the accepts_pending instead of decrementing/incrementing the backlog makes
sense.

But then the normal flow would be suboptimal:
(1) When SYN is received accepts_pending would be incremented.
(2) When SYN-ACK is received accepts_pending would be decremented just before
the accept callback.
(3) The accept callback would increment it right back.
(4) When the socket is passed upward, accepts_pending would finally be
decremented.

So maybe we should just not decrement accepts_pending in step (2), and
effectively pass the reference to the accept callback. Just fix the
tcp_accept_null to call tcp_accepted() or more specificaly an equivalent which
find the lpcb, since we don't have it at hand.

Anything that keeps a queue of accepted connections between lwIP core and the
application can deal with this reference properly. So:
- When finally passing the connections into accept, call tcp_accepted().
- If the PCB is killed by lwip before that, tcp_accepted() must be called from
the PCB's error callback.

Note that this doesn't need any change in tcp_pcb_purge(). This one would keep
being responsible just for decrementing accepts_pending of SYN_RCVD PCBs.

    _______________________________________________________

Reply to this item at:

  <http://savannah.nongnu.org/bugs/?46696>

_______________________________________________
  Message sent via/by Savannah
  http://savannah.nongnu.org/




reply via email to

[Prev in Thread] Current Thread [Next in Thread]