Menu

#29 send_request() with HTTPS doesn't close socket

open
nobody
None
5
2003-10-17
2003-10-17
No

a script doing lots of HTTPS requests will fail due to
running out of file descriptors.

it turns out that the DESTROY method in IO::Socket:SSL
will not
actually close the socket.

$self->SUPER::close unless
$close_args->{_SSL_in_DESTROY});

so the socket has to be closed explicitly by
LWP::Protocol::http::request, since it is the only
piece of code actually holding the reference to the socket.

I added a $socket->close just before the return of
$response, and it seems to have solved my problem.

Discussion


Log in to post a comment.

Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.