noxxi / p5-io-socket-ssl

IO::Socket::SSL Perl Module
36 stars 59 forks source link

Do not make non-blocking if the operation was failed. #8

Closed tokuhirom closed 10 years ago

tokuhirom commented 10 years ago

This change fix the Can't locate object method "blocking" via package "GLOB" error.

noxxi commented 10 years ago

I don't completly agree with you. Because IO::Socket::SSL set a non-blocking socket to blocking it has to set it back to non-blocking, no matter if the SSL upgrade failed or not. With 1.963 I only try to call blocking if the downgraded socket has a blocking method.

But the best thing would be to not call a simple start_SSL on a non-blocking socket, but instead use start_SSL with SSL_startHandshake => 0 and make a non-blocking SSL handshake.