Commit Graph

136 Commits

Author SHA1 Message Date
Miguel Portilla 45eaa8c8da Increase utf8 checker code coverage 2016-11-15 13:09:18 -05:00
Vinnie Falco 9ff1a27160 Add zlib module:
The zlib module is a port of ZLib's raw deflate
algorithm to header-only C++11.
2016-11-15 12:04:59 -05:00
Vinnie Falco a0a335972f Refactor HTTP identifier names (API Change):
fix #171

Several names and  HTTP identifiers are renamed to be
more consistent, self-explanatory, and concise:

* "Fields" is a collection of HTTP header fields (rfc7230 section 3.2)
* "Header" is the Start Line plus Fields. Another way to look at it is,
  the HTTP message minus the body.
* `basic_fields` replaces `basic_headers`
* `fields` replaces `headers`
* `Fields` replaces `Headers` in template parameter lists
* `header` replaces `message_headers`
* `header::fields` replaces `message_headers::fields`

The changes are cosmetic and do not affect run-time behavior.
2016-11-15 12:04:44 -05:00
Vinnie Falco 79be7f8b39 Set version to 1.0.0-b19 2016-11-12 12:37:35 -05:00
Vinnie Falco eda1120c63 Tidy up internal name 2016-11-12 11:27:59 -05:00
Vinnie Falco 4130ad4832 Better buffer_cat:
buffer_cat now determines if all of the buffer sequences in
the list of passed buffer sequences each have value types which
are convertible to mutable_buffer. The returned concatenated
sequence will be a MutableBufferSequence if all the passed
buffer sequences meet the requirements of MutableBufferSequence,
else the returned concatenated sequence will be a ConstBufferSequence.
2016-11-12 11:27:59 -05:00
Vinnie Falco f94f21db0b Fix consuming_buffers value_type (API Change):
This fixes a bug where instantiations of consuming_buffers with
buffer sequence types whose value_type is not const_buffer or
mutable_buffer can cause compilation errors.

The function consumed_buffers is removed.
2016-11-12 11:27:59 -05:00
Vinnie Falco 2c524b41ab prepared_buffers is private (API Change) 2016-11-12 11:27:58 -05:00
Vinnie Falco df2a1081c9 Fix prepare_buffers value_type:
This fixes a bug where calling prepare_buffers on a buffer
sequence whose value_type is not const_buffer or mutable_buffer
causes compilation errors.

The documentation is also tidied up.
2016-11-12 11:27:58 -05:00
Vinnie Falco a4af9d6769 Use boost::lexical_cast instead of std::to_string
fix #176
2016-11-12 11:27:57 -05:00
Vinnie Falco 62d670b94a Fix with_body example:
fix #177
2016-11-12 11:27:57 -05:00
Vinnie Falco a63bd84ee3 Increase code coverage 2016-11-12 11:27:57 -05:00
Vinnie Falco 84a6775dc1 Boost library min/max guidance:
fix #170
2016-11-12 11:27:56 -05:00
Vinnie Falco 02feea5128 Add read, async_read for message_headers:
fix #172, fix #173

This provides overloads of read and async_read to allow
reading message_headers objects.
2016-11-12 11:27:56 -05:00
Vinnie Falco f22458539b Add write, async_write, operator<< for message_headers:
fix #155

This adds overloads of write, async_write, and operator<<
for message_headers.
2016-11-12 11:27:55 -05:00
Vinnie Falco ea48bcf4e6 Make chunk_encode public:
fix #154, fix #156

This adds public interfaces for transforming buffer
sequences into their chunk-encoded equivalents. The
transformations are O(1) in space and time.
2016-11-12 11:27:55 -05:00
Vinnie Falco f6dd744fd1 Refactor message and message_headers declarations:
message_headers is now a set of partial class template
specializations instead of a template class alias. This solves
a problem where template functions taking message_headers as a
parameter could not deduce argument types, since std::conditional
obscured the deduced context.

Both classes are refactored to share declarations using an #ifdef,
to eliminate an ugly set of extra declarations needed when building
the documentation.

Copy and move class special members are added.

A new function message::base() is provided which returns the
message_headers portion of a message.
2016-11-12 11:27:55 -05:00
Vinnie Falco 9fd8aede3d Move sync_ostream to core/detail 2016-11-12 11:27:54 -05:00
Vinnie Falco c98b2d3728 Optimize mask operations 2016-11-12 11:27:54 -05:00
Miguel Portilla d4dfc1ac74 Optimize utf8 validation 2016-11-12 11:27:54 -05:00
Vinnie Falco 7b4de4b951 Set version to 1.0.0-b18 2016-11-04 08:02:50 -04:00
Vinnie Falco feb520414c Add websocket::stream pong and async_pong 2016-11-03 18:58:31 -04:00
Vinnie Falco d4ffde5982 Close connection during async_read on close frame:
fix #163
2016-11-01 09:01:02 -04:00
Vinnie Falco 644d518db5 Move clamp to core 2016-11-01 09:01:01 -04:00
Vinnie Falco 427ba388f7 Fix write_frame masking and auto-fragment handling 2016-11-01 09:01:01 -04:00
Vinnie Falco 54a51b1232 Write buffer option does not change capacity 2016-11-01 09:01:01 -04:00
Vinnie Falco 591dbc07f5 Meet DynamicBuffer requirements for static_streambuf 2016-11-01 09:01:00 -04:00
Vinnie Falco 46d5e7256c Reorganize source files and definitions 2016-11-01 09:01:00 -04:00
Vinnie Falco b6f3a3654d Check invariants in parse_op:
This adds more assertions, comments, and clarification.
2016-10-30 18:56:00 -04:00
Vinnie Falco e90725267d Clean up message docs 2016-10-30 18:55:10 -04:00
Vinnie Falco 1e3543f63e Set version to 1.0.0-b17 2016-10-20 17:26:17 -04:00
Vinnie Falco de97a69012 Trim unused code 2016-10-20 17:22:42 -04:00
Vinnie Falco 796b484bab Doc fixes 2016-10-20 17:22:41 -04:00
Andrew Whatson 95c37e23f0 Fix unused parameter warnings and missing includes:
fix #127

* Added beast::detail::ignore_unused based on boost::ignore_unused
* Added -Wextra compilation flag when building with gcc
* Fixed all unused parameter warnings with ignore_unused
* Fixed all missing includes when building each .hpp separately
2016-10-20 17:22:40 -04:00
Miguel Portilla 8b0d2857b8 Refactor read_size_helper 2016-10-20 17:22:40 -04:00
Vinnie Falco 236caef873 Engaged invokable is destructible:
fix #147
2016-10-20 17:22:39 -04:00
Vinnie Falco d107ba1c1d Add headers_parser:
This allows just the HTTP headers to be parsed, and
the choice of body to be deferred to a subsequent
call to parse.
2016-10-20 17:22:39 -04:00
Vinnie Falco 2f90627dd6 Fix handling of body_what::pause in basic_parser_v1 2016-10-20 17:22:38 -04:00
Vinnie Falco 9353d043b0 Add basic_parser_v1::reset 2016-10-20 17:22:38 -04:00
Vinnie Falco 658e03ca35 Add on_body_what parser callback (API Change):
These changes support parsing the headers separately from the body.

* on_headers now returns void
* on_body_what is a new required callback which returns body_what
2016-10-20 17:22:37 -04:00
Vinnie Falco 50bd4460cb Fix parser traits detection (API Change):
basic_parser_v1 now requires that all callbacks appropriate
to the message are present and have the correct signatures.
Compile errors will result from compiling parsers which are
missing callbacks.
2016-10-20 17:22:37 -04:00
Vinnie Falco df8d306909 Tidy up documentation:
fix #135

* Fix broken references
* Move doc debug headers to extras/
* Add rfc7230 utility classes to quick reference
2016-10-20 17:22:37 -04:00
Vinnie Falco 47105f8454 Tidy up basic_headers for documentation 2016-10-20 17:22:36 -04:00
Vinnie Falco ada1f60e3e Refine message class hierarchy:
Two new objects, request_headers and response_headers,
represent the portion of HTTP messages excluding the body.
2016-10-20 17:22:36 -04:00
Vinnie Falco cf43f516d2 Rework HTTP concepts (API Change):
fix #139, fix #140

* Writer uses write instead of operator()
* Refactor traits to use void_t
* Remove is_ReadableBody, is_WritableBody
* Add has_reader, has_writer, is_Reader, is_Writer
* More friendly compile errors on failed concept checks
2016-10-17 11:11:57 -04:00
Vinnie Falco 8a261ca923 HTTP Reader (API Change):
fix #114, fix #117, fix #136

* Added init() to Reader requirements
* Reader must be nothrow constructible
* Reader is now constructed right before reading the body
  - The message passed on construction is filled in
2016-10-17 11:11:57 -04:00
Vinnie Falco 183055a74c Parser callbacks may not throw (API Change) 2016-10-17 11:11:56 -04:00
Vinnie Falco ebebe52612 Add basic_streambuf::alloc_size
fix #133
2016-10-17 11:11:56 -04:00
Vinnie Falco c9cd171c19 Fix basic_streambuf::capacity 2016-10-17 11:11:56 -04:00
Vinnie Falco 0eb0e485c3 Tidying:
fix #85

* Remove unnecessary boost/system includes
* Remove unused headers_type from write_preparation
* Use braced-init style construction
* handler_alloc doc update
2016-10-17 11:11:51 -04:00