Closed debug-ito closed 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.
Thanks for merging!
Thanks for contributing! I assume this is something you ran into with your AE::WS::Server
TLS work?
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.
production version is on its way to CPAN now.
Sorry meant to send this out yesterday but $work
:P
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:
t/server_initial_data_shutdown.t
, which demonstrates the above problem. The Connection fails to detect a message sent by the server just after handshake completion before shutdown, only in TLS mode.Connection.pm
. It now always sets on_read callback, but just delays message processing. At first received messages are queued in@temp_messages
, which are processed later either in an AE::idle callback or in$finish
callback.Connection.pm
and test codes.