uperl / AnyEvent-WebSocket-Client

WebSocket client for AnyEvent
9 stars 10 forks source link

Connection: alwasy set on_read callback on AnyEvent::Handle #25

Closed debug-ito closed 8 years ago

debug-ito commented 8 years ago

In the constructor of AnyEvent::WebSocket::Connection, the on_read callback of AnyEvent::Handle was temporarily disabled. This was because we needed time to let the user set each_message and/or next_message callbacks to the Connection object. However, disabling on_read callback could cause trouble in TLS mode, because on_eof callback could fire even if on_read was disabled. In that case, some messages could be discarded. (See https://metacpan.org/pod/AnyEvent::Handle#I-get-different-callback-invocations-in-TLS-mode-Why-cant-I-pause-reading )

This pull-request contains the following:

plicease commented 8 years ago

Looks good! sent to CPAN as 0.34_01. I expect to do a prod release next week assuming all looks good.

debug-ito commented 8 years ago

Thanks for merging!

plicease commented 8 years ago

Thanks for contributing! I assume this is something you ran into with your AE::WS::Server TLS work?

debug-ito commented 8 years ago

That's right. I have confirmed that Server passes tests in TLS mode with the patched Connection. So I'm gonna release Server after you release Client. No need to rush, though.

plicease commented 8 years ago

production version is on its way to CPAN now.

Sorry meant to send this out yesterday but $work :P