*Hi,*
**
*I have some file descriptor leak porblem, I traced it to the function below
as the last time the fd is touched by polipo.*
**
*The following function try to close a client connection, *
*but it uses shutdown instead of close, any idea when and how the close()
will be called to the connection->fd? *
*Shut it down both directions keep out all read/write event that can trigger
a clean up of the connection. With no event, the fd is leaked. *
**
*Regards,*
*Ming*
**
*int*
*httpTimeoutHandler*(TimeEventHandlerPtr event)
{
HTTPConnectionPtr connection = *(HTTPConnectionPtr*)event->data;
*if*(connection->fd >= 0) {
*int* rc;
rc = shutdown(connection->fd, 2);
*if*(rc < 0 && errno != ENOTCONN)
do_log_error(L_ERROR, errno, *"Timeout: shutdown failed"*);
pokeFdEvent(connection->fd, -EDOTIMEOUT, POLLIN | POLLOUT);
}
connection->timeout = NULL;
*return* 1;
}
-------------------------------------------------------------------------
This SF.Net email is sponsored by the Moblin Your Move Developer's challenge
Build the coolest Linux based applications with Moblin SDK & win great prizes
Grand prize is a trip for two to an Open Source event anywhere in the world
http://moblin-contest.org/redirect.php?banner_id=100&url=/
_______________________________________________
Polipo-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/polipo-users