[ECOS] atHTTP hangs connections on select() errors

Tad ecos_removethispart@ds3switch.com
Mon Jun 11 23:00:00 GMT 2007

athttp often locks up resources and never frees them if select() returns
an error.

A robust implementation of athttp will want to change the main
cyg_httpd_daemon listen() loop so that
cyg_httpd_close_unused_sockets(listener); is called regardless of the
return value from the listen() call.  Otherwise, errors from listen()
will prevent all connections (possibly causing the errors) from ever
timing out and being shut down.  The system will quickly run out of
sockets, as all will be left in the ESTABLISHED state.  Not theoretical,
fairly easy to get listen() to return errors.

Also see my post about athttp hanging in accept() when out of sockets if
attempting a robust port.

Before posting, please read the FAQ: http://ecos.sourceware.org/fom/ecos
and search the list archive: http://ecos.sourceware.org/ml/ecos-discuss

More information about the Ecos-discuss mailing list