This is the mail archive of the
ecos-patches@sourceware.org
mailing list for the eCos project.
Re: Network TCP Handler: stale socket disposal
- From: Andrew Lunn <andrew at lunn dot ch>
- To: John Mills <john dot m dot mills at alum dot mit dot edu>
- Cc: eCos RTOS Patches <ecos-patches at ecos dot sourceware dot org>
- Date: Wed, 29 Aug 2007 22:30:28 +0200
- Subject: Re: Network TCP Handler: stale socket disposal
- References: <Pine.LNX.4.44.0708291412380.15994-100000@otter.localdomain>
> } else if (so->so_state & SS_COMP) {
> + if((so->so_error == ECONNRESET) ||
> + (so->so_error == ECONNREFUSED)){ // forced drop if flagged
> + TAILQ_REMOVE(&head->so_comp, so, so_list);
> + head->so_qlen--;
> + } else {
> /*
> * We must not decommission a socket that's
> * on the accept(2) queue. If we do, then
> @@ -249,11 +258,13 @@
> * that the listening socket was ready.
> */
The full comment is:
/*
* We must not decommission a socket that's
* on the accept(2) queue. If we do, then
* accept(2) may hang after select(2) indicated
* that the listening socket was ready.
*/
Are you sure the socket is not on the accept queue? I wounder if the
accept code should free the socket?
Andrew