Commit Graph

77 Commits

Author SHA1 Message Date
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
Thijs Wenker d3fe51fa39 Added missing CMake files, organized the CMake structure between test and example directories using the global variable USE_FOLDERS 2015-07-16 12:17:59 +02: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 b866e4e0ca Refactors URI to be exception and regex free 2013-07-09 16:50:47 -05:00
Peter Thorson 4a94a7c518 Merge pull request #253 from breyed/spelling
fixed spelling, including "experimental" in API
2013-06-08 09:19:41 -07:00
breyed 808a8ce0a9 fixed spelling, including "experimental" in API 2013-06-08 11:03:11 -05:00
unknown 1e6c1f9807 Merge remote-tracking branch 'upstream/0.3.x-cmake' into cmake_prebuild_system
Conflicts:
	websocketpp/endpoint.hpp
2013-05-04 02:07:17 +03:00
Peter Thorson 466c9bd626 removes redundant code from echo_server 2013-04-20 08:34:58 -05:00
Jonne Nauha df4d7167fd CMake continued: Try to detect g++, clang, windows and osx and setup appropriate defines and build flags. Improve so that each setup can define platform, boost and ssl libs. I tried to copy everything that I could from the scons scripts, probably some of this can be removed (might be automated from cmake already), left todo:s for that. Added building simple examples, more to follow. NOTE: This has only been tested on windows. 2013-04-03 01:56:10 +03: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
Sven Almgren 36e76ac246 Merged upstream and resolved confilicts 2012-03-14 13:15:01 +01:00
Sven Almgren f085cc63b6 Centralized makefiles for examples 2012-03-14 12:52:55 +01:00
Peter Thorson 7fca59a99b fixes example server bugs and logging levels 2012-03-14 06:27:28 -05:00
Peter Thorson 576b6e43ad unix makefile updates 2012-03-14 06:27:10 -05:00
Peter Thorson 02dd3f8193 removes legacy files 2012-03-14 06:26:55 -05:00
Tobias Oberstein 16a4ba98b4 refactor build for tree of scons makefiles, fix out of source build, correct target handling 2012-03-08 17:55:13 +01: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 c2cbe7110d newlines at end of all files #references #72 2012-02-20 06:41:09 -06:00
Peter Thorson 5065ff2615 preliminary work on endpoint/connection concurrency support fixes #63 2012-02-03 09:25:56 -06:00
Peter Thorson 23a2747e04 experimental c++11 build settings 2012-01-31 09:13:02 -06:00
Peter Thorson 02b48a8dbb tweaks echo server default error logging 2012-01-20 08:02:03 -06:00
Peter Thorson bed6a41c50 updates makefiles for linux 2012-01-19 08:07:43 -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 5131f30d5a makefile fixes for ubuntu 2011-12-17 08:34:42 -06:00
Peter Thorson 00a86b572e hack to link on ubuntu 2011-12-09 19:59:31 -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 0e71fae008 updates makefiles and Xcode project 2011-11-29 09:38:03 -06:00
Peter Thorson dffc49cce8 playing around with logging APIs 2011-11-29 06:55:30 -06:00
Peter Thorson 0e0fd97b83 preliminary work to allow specifying custom paths to boost install 2011-11-28 08:40:04 -06:00
Peter Thorson e848e9bd2b messes with friends 2011-11-19 09:15:55 -06:00
Peter Thorson cb49e04474 many tweaks 2011-11-19 09:05:05 -06:00