799 Commits
Author SHA1 Message Date
Vinnie Falco e06a055503 BodyReader, BodyWriter use two-phase init (API Change):
These types now perform error-based initialization in
a separate init() functions instead of in the constructor.

Actions Required:

* Modify instances of user-defined BodyReader and BodyWriter
  types to perfrom two-phase initialization, as per the
  updated documented type requirements.
2017-07-20 08:15:30 -07:00
Vinnie Falco db59a92011 BodyReader may construct from a non-const message
fix #619
2017-07-20 08:15:30 -07:00
Vinnie Falco 0324dc371f Use Boost.Config 2017-07-20 08:15:30 -07:00
Vinnie Falco f65a611b85 Always go through write_some:
HTTP stream serialization algorithms always go
through write_some or async_write some.
2017-07-20 08:15:30 -07:00
Vinnie Falco b1a8cf8a13 file_body tests 2017-07-20 08:15:30 -07:00
Vinnie Falco 731164bec2 Add serializer::limit 2017-07-20 08:15:30 -07:00
Vinnie Falco eec5f1d8b6 Add file_posix 2017-07-20 08:15:30 -07:00
Vinnie Falco e81026614a Remove common/file_body.hpp 2017-07-20 08:15:30 -07:00
Vinnie Falco 8bf46ffa05 Add file_body 2017-07-20 08:15:30 -07:00
Vinnie Falco 7254cc8976 Add file_win32 2017-07-20 08:15:30 -07:00
Vinnie Falco ddc3099281 Add file_stdio and File concept 2017-07-20 08:15:30 -07:00
Vinnie Falco 48c0fcae50 Adjust benchmarks 2017-07-20 08:15:30 -07:00
Vinnie Falco f5ae60613f serializer::next replaces serializer::get (API Change):
Actions Required:

* Use serializer::next instead of serializer::get at call sites
2017-07-20 08:15:29 -07:00
Vinnie Falco b0e52dd246 Refactor header and message constructors:
fix #581

* request and response headers now have convenience
  constructors so important fields like method, target,
  result, and version may be set upon construction.

Actions Required:

* Evaluate each message constructor call site and
  adjust the constructor argument list as needed.
2017-07-20 08:15:29 -07:00
Vinnie Falco 2ee088de5f Add basic_parser tests 2017-07-20 08:15:29 -07:00
Vinnie Falco e608acb791 basic_parser optimizations:
fix #185, fix #489

* SSE4.2 is detected

* basic_parser uses SSE4.2 if available

* basic_parser tries to parse on the initial buffer and if
  it does not find the end of header it shifts to a new
  strategy of waiting for the end of header to defeat
  slow loris attacks. This coincidentally is also faster
  than the previous algorithm.
2017-07-20 08:15:29 -07:00
Vinnie Falco 09df24ec62 Refactor file_body for best practices 2017-07-20 08:15:29 -07:00
Vinnie Falco ff33783d11 Refine Body::size specification 2017-07-20 08:15:29 -07:00
Vinnie Falco c149321013 Return std::size_t from Body::writer::put (API Change)
`put` returns the number of bytes actually transferred
from the input buffers.

Actions Required:

* Return the number of bytes actually transferred from the
  input buffers in user defined `Body::writer::put` functions.
2017-07-20 08:15:29 -07:00
Vinnie Falco f3afc834b1 Check trailers in test 2017-07-20 08:15:29 -07:00
Sacha 7f05f67464 Add options for building examples and tests.
Move zlib test sources to test/zlib
2017-07-20 08:15:29 -07:00
Vinnie Falco 2843a497a0 Documentation revision
fix #567, fix #572
2017-07-20 08:15:29 -07:00
Vinnie Falco 7753d6eda2 Add parser::on_header to set a callback 2017-07-20 08:15:29 -07:00
Vinnie Falco 788550e833 Add basic_parser header and body limits:
fix #550

* default body limits are now 1MB/8MB
* default header limit is 8KB

Actions Required:

* Call body_limit and/or header_limit as needed to adjust the
  limits to suitable values if the defaults are insufficient.
2017-07-20 08:15:29 -07:00
Vinnie Falco 58d42cc803 Use BEAST_FALLTHROUGH to silence warnings
fix #545
2017-07-20 08:15:29 -07:00
Vinnie Falco f3eaa409d1 basic_parser optimizations 2017-07-20 08:15:29 -07:00
octopus-prime b5b1295d0c Add const_body, mutable_body to examples 2017-07-20 08:15:29 -07:00
Vinnie Falco 2d6859831c Optimize field lookups 2017-07-20 08:15:29 -07:00
Vinnie Falco 43f8bb841a bad_target replaces bad_path (API Change):
Actions Required:

* Replace references to http::error::bad_path with http::error::bad_target
2017-07-20 08:15:29 -07:00
Vinnie Falco beead1a297 Split common tests to a new project 2017-07-20 08:15:29 -07:00
Vinnie Falco edeb44617b Remove BodyReader::is_deferred (API Change):
The is_deferred nested type is removed from the BodyReader
requirements.

Performance for sending messages with `file_body` was cut
almost in half with is_deferred as `std::true_type` since
it caused double the number of socket writes. If the
deferred behavior is absolutely necessary, callers can get
the same effect by manually sending the headers first.

Actions Required:

* Callers who need the behavior of is_deferred as `std::true_type`
  should manually construct a serializer and serialize the header
  first, followed by the body.
2017-07-20 08:15:29 -07:00
Vinnie Falco bf59634bc2 Change BodyReader, BodyWriter requirements (API Change):
Actions Required:

* Change user defined instances of BodyReader and BodyWriter
  to meet the new requirements.
2017-07-20 08:15:29 -07:00
Vinnie Falco bb1dd72638 Group common example headers 2017-07-20 08:15:29 -07:00
Vinnie Falco e7b01dc5c4 control_callback replaces ping_callback (API Change):
fix #322

The new callback is informed of all frame types including close.

Actions Required:

* Change calls to websocket::stream::ping_callback to use
  websocket::stream::control_callback

* Change user defined ping callbacks to have the new
  signature and adjust the callback definition appropriately.
2017-07-20 08:15:28 -07:00
Vinnie Falco cc1c02e236 Merge stream_base to stream and tidy 2017-07-20 08:15:28 -07:00
Vinnie Falco e389b853c5 Documentation work 2017-07-20 08:15:28 -07:00
Vinnie Falco dab5d3bc12 Handle bad_alloc in parser 2017-07-20 08:15:28 -07:00
Vinnie Falco 86244c8dcf Add serializer request/response aliases 2017-07-20 08:15:28 -07:00
Vinnie Falco 518ae23383 string_param optimizations 2017-07-20 08:15:28 -07:00
Vinnie Falco 8f4e7fd0a0 Fix unused variable warnings 2017-07-20 08:15:28 -07:00
Vinnie Falco d70a78bbda Fix integer warnings 2017-07-20 08:15:28 -07:00
Vinnie Falco e477574681 Remove make_serializer (API Change):
Actions Required:

* Replace calls to make_serializer with variable declarations
2017-07-20 08:15:28 -07:00
Vinnie Falco b2ab40f09c Doc tidying
fix #521, fix #524
2017-07-20 08:15:28 -07:00
Vinnie Falco 67e3e801cb Exemplars are compiled code
fix #455
2017-07-20 08:15:28 -07:00
Vinnie Falco 65b127d2e6 Tidy up Jamfiles 2017-07-20 08:15:28 -07:00
Vinnie Falco 26b5e91725 Tidy up CMakeLists.txt 2017-07-20 08:15:28 -07:00
Vinnie Falco 3ff585d36e Only run the tests under ubasan 2017-07-20 08:15:28 -07:00
Vinnie Falco 7b8149cfd4 Move benchmarks to a separate project 2017-07-20 08:15:27 -07:00
Vinnie Falco 9c4b3ed2a7 Only build and run tests in variant=coverage 2017-07-20 08:15:27 -07:00
Vinnie Falco 5613ce7e97 Add http::is_fields trait
fix #515
2017-07-20 08:15:27 -07:00