send_request() with HTTPS doesn't close socket
Brought to you by:
gisle
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.