set_http_handler and TLS server #295

Open
Banaan opened this Issue Oct 10, 2013 · 3 comments

Projects

None yet

2 participants

@Banaan
Contributor
Banaan commented Oct 10, 2013

When using the http handler (echo_server.set_http_handler(bind(&http_func,&echo_server,::_1));) in the asio_tls config like the Echo Server TLS example I get the followings error ever time a http request has been handled:

[2013-10-10 20:04:25] [connect] HTTP Connection [::ffff:127.0.0.1]:41053 "Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/30.0.1599.66 Safari/537.36" /images/bkg-img.png 200
[2013-10-10 20:04:25] [error] Handshake ended with HTTP error: 200

end later on (after the Timer Expired on the http request/connection) the following error is shown based on the earlier http request:
[2013-10-10 20:04:30] [error] Timer Expired
[2013-10-10 20:04:30] [disconnect] Failed: HTTP connection ended

Seems like the HTTP handler in a TLS/wss scenario is not correctly processed?

Many thanks

@zaphoyd
Owner
zaphoyd commented Oct 10, 2013

Looks like everything was processed correctly, but that the logging code was logging a normally ending HTTP connection as a failed websocket connection. I've pushed an update that should suppress some of the log messages for HTTP connections. Let me know if you see an improvement.

@Banaan
Contributor
Banaan commented Oct 13, 2013

Great! Thanks!!
While testing I notice the ([error] Handshake ended with HTTP error: 200) messages are gone. But in sometimes (not always) the Timer Expired still occurs during HTTP response. Hereby the alog/devel log on a Timer Expired:

[2013-10-13 15:19:24] [connect] HTTP Connection [::ffff:127.0.0.1]:60098 "Mozilla/5.0 (X11; Linux x86_64; rv:24.0) Gecko/20100101 Firefox/24.0" /favicon.ico 200
[2013-10-13 15:19:24] [devel] connection terminate
[2013-10-13 15:19:24] [devel] asio connection async_shutdown
[2013-10-13 15:19:24] [devel] asio open handshake timer cancelled
[2013-10-13 15:19:29] [devel] Asio transport socket shutdown timed out
[2013-10-13 15:19:29] [devel] connection handle_terminate
[2013-10-13 15:19:29] [error] Timer Expired
[2013-10-13 15:19:29] [disconnect] Failed: HTTP connection ended
[2013-10-13 15:19:29] [devel] async_shutdown cancelled

Many thanks

@Banaan
Contributor
Banaan commented Oct 21, 2013

With the latest commits errors (this time different error system:125) are shown again:

[2013-10-21 22:00:59] [connect] HTTP Connection [::ffff:127.0.0.1]:60098 "Mozilla/5.0 (X11; Linux x86_64; rv:24.0) Gecko/20100101 Firefox/24.0" /favicon.ico 200
[2013-10-21 22:00:59] [error] Timer Expired
[2013-10-21 22:00:59] [disconnect] Failed: The opening handshake timed out
[2013-10-21 22:00:59] [info] asio async_read_at_least error: system:125 (Operation canceled)
[2013-10-21 22:05:29] [fatal] error in handle_read_handshake: Underlying Transport Error
[2013-10-21 22:05:29] [info] asio async_read_at_least error: system:104 (Connection reset by peer)
[2013-10-21 22:05:30] [fatal] error in handle_read_handshake: Underlying Transport Error
[2013-10-21 22:05:30] [info] asio async_read_at_least error: system:104 (Connection reset by peer)
[2013-10-21 22:05:31] [fatal] error in handle_read_handshake: Underlying Transport Error
[2013-10-21 22:05:31] [error] Timer Expired
[2013-10-21 22:05:31] [disconnect] Failed: Underlying Transport Error

Could it be related to "additional support for compile time disabling of multithreading features"? great multithreading feature! but when using the http handler one http request is handled correctly and the another gives errors and nothing get send to the browser.

Many thanks

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment