Commit Graph

46 Commits

Author SHA1 Message Date
Peter Thorson e65b277017 Remove catching websocketpp::lib::error_code in examples, fixes #584
A few versions ago the library was standardized to only throw
websocketpp::exception. Not all example code was updated.
2016-10-03 19:04:12 -05:00
Peter Thorson 3c77ce3cc7 Fix race condition resulting in corruption of responses sent from non-blocking HTTP handers
The HTTP request processing code was expecting that the http response
state would be `deferred` after a call to an HTTP handler that deferred
the response. If, in addition to deferring, you also sent the response
the HTTP state advanced past `deferred` to `response_written`. This
doesn't easily show up in unit tests because the bug requires that the
async write still be in flight and the connection still be open when
the HTTP handler returns.

An asynchronous network transport (like Asio) combined with a
sufficiently large message that Asio yields control back to WebSocket++
before the response is fully written will trigger a second write on the
same connection while the first is in flight. This is not allowed per
the Asio spec and results in undefined behavior.

The HTTP request processing code now checks if the http state is init,
i.e. not deferred and no response has been started rather than just if
it was deferred.
2015-09-09 10:14:37 -04:00
Peter Thorson 2c843b9343 echo_server now checks for a special command to stop listening for new connections 2015-04-14 08:14:47 -04:00
Peter Thorson 0a47a9a78c adjust example exception behavior to match latest spec 2014-12-08 18:56:28 -05:00
Peter Thorson 6c242b205b detab entire project references #376 2014-10-06 18:33:55 -04:00
Peter Thorson c017331959 remove trailing whitespace 2013-07-21 07:49:15 -05:00
Peter Thorson 2964acd6d7 disable frame payload logging by default 2013-07-14 10:57:05 -05:00
Howard Butler b83b054c7e add CMake config for print_server and telemetry_client 2013-07-11 10:54:43 -05:00
Peter Thorson 466c9bd626 removes redundant code from echo_server 2013-04-20 08:34:58 -05:00
Peter Thorson 1979502a05 adds default logging settings to echo_server and catches more setup exceptions 2013-01-27 10:37:47 -06:00
Peter Thorson 4f914f8477 updates tests and echo server to new handler interface 2013-01-08 07:48:32 -06:00
Peter Thorson a3acc4a1cf removes all old style handler code 2013-01-08 06:43:47 -06:00
Peter Thorson ef8898afef adds support for message_handler 2013-01-08 06:33:02 -06:00
Peter Thorson f5d4cbe143 updates asio on_tcp_init callback to new api 2013-01-06 10:10:35 -06:00
Peter Thorson 2ad049055c updates echo_server to use new interrupt API 2013-01-06 09:59:55 -06:00
Peter Thorson f10f8a4ce0 Initial commit from private 0.3 repository 2013-01-06 06:09:15 -06:00
Peter Thorson 7fca59a99b fixes example server bugs and logging levels 2012-03-14 06:27:28 -05:00
Peter Thorson 9512891f24 missed one ERROR rename in example 2012-03-07 08:01:19 -06:00
Peter Thorson 5ff3a6292f adds preliminary wsperf example code 2012-03-05 08:34:42 -06:00
Peter Thorson 3ec229c223 minor echo server updates 2012-02-24 08:03:16 -06:00
Peter Thorson 02b48a8dbb tweaks echo server default error logging 2012-01-20 08:02:03 -06:00
Peter Thorson 01516318d6 updates basic examples to use new convenience typedefs 2012-01-17 09:43:00 -06:00
Peter Thorson a17a4deb4b normalizes whitespace and sets up gitattributes to preserve fixes #43 fixes #46 2012-01-12 09:57:06 -06:00
Peter Thorson 38b5b561e7 cleans up example code 2012-01-11 17:34:23 -06:00
Peter Thorson f1a724e0d4 more client work 2011-12-06 08:45:59 -06:00
Peter Thorson f9a13dd5ff updates TLS example to use new read interface 2011-12-04 17:54:08 -06:00
Peter Thorson ce9aa352e2 updates echo server example to use new read interface 2011-12-04 08:44:06 -06:00
Peter Thorson fbc506292d splits echo_server example into separate plain and tls versions 2011-11-30 09:16:21 -06:00
Peter Thorson 1cf694ec0a updates echo server for new TLS handler interface 2011-11-29 18:00:30 -06:00
Peter Thorson dffc49cce8 playing around with logging APIs 2011-11-29 06:55:30 -06:00
Peter Thorson cb49e04474 many tweaks 2011-11-19 09:05:05 -06:00
Peter Thorson 7a0f9f3073 updates echo_server example 2011-11-19 01:18:28 -06:00
Peter Thorson 4ed86a7c30 api tweaks, origin and uri detection behaviors. chat server updated for new apis 2011-11-13 07:12:37 -06:00
Peter Thorson 6df22f5d70 first (partially) working copy of the refactored branch 2011-11-10 20:02:43 -06:00
Peter Thorson 63eece760e refactors logging 2011-11-07 09:02:42 -06:00
Peter Thorson d806bea762 more work, compiles and passes tests now 2011-10-30 07:43:59 -05:00
Peter Thorson 95fe9d8966 more work 2011-10-29 12:39:23 -05:00
Peter Thorson 536ded2512 continues work on program options, updates makefiles for examples 2011-10-28 09:26:54 -05:00
Peter Thorson c4da789430 begins work on timeouts 2011-10-14 08:59:03 -05:00
Peter Thorson 1ff8d333a5 completes frame reading changes.
fixes 37, fixes 32
2011-10-10 18:35:38 -05:00
Peter Thorson da1795feac refectors session into client_session/server_session/core, adds client handler and chat_client example. Client functionality is experimental and non-compliant at the moment. 2011-09-26 09:49:52 -05:00
Peter Thorson e497984db3 echo server now accepts host in addition to host:port as a value for the Host handshake header 2011-09-15 06:56:41 -05:00
Peter Thorson e5b307652e added server error exception system; moved host and message size validation into server, references #7, sessions now have a pointer back to the server so they can ask it about server wide policy. 2011-09-10 10:29:25 -05:00
Peter Thorson 8f7fdc8434 more license stuff 2011-09-08 08:31:19 -05:00
Peter Thorson 792b30f291 adjusted how valid hosts are stored 2011-09-08 08:28:56 -05:00
Peter Thorson fa73c478e9 initial commit 2011-09-07 20:27:29 -05:00