Commit Graph

16 Commits

Author SHA1 Message Date
Vinnie Falco f47b66179e New HTTP interfaces (API Change):
fix #123
fix #154
fix #265

This completely replaces the HTTP parser used to read and
parse incoming messages. The new version is faster than
the old one, and written in fewer lines. A summary of
changes:

* parse and async_parse renamed to read and async_read

* basic_parser is optimized for linear buffers,
  use flat_streambuf for the best performance with these
  functions:

  - http::read
  - http::read_some
  - http::async_read
  - http::async_read_some

* The overloads of read() and async_read() which take
  just a header have been removed, since they would
  throw away important parse metadata.

* The derived class callbacks for basic_parser have
  been streamlined. All strings passed to callbacks
  are presented in their entirety, instead of being
  provided in pieces.

These changes allow use-cases that were previously
difficult or impossible, such as:

- Efficient relaying

- Late body type commitment

- Expect: 100-continue handling
2017-05-04 18:58:33 -07:00
Vinnie Falco 7e37723be0 Add flat_streambuf:
Objects of this type meet the requirements of DynamicBuffer
and offer an additional invariant: buffer sequences returned
by data() and prepare() are always of length one.
2017-05-04 18:58:33 -07:00
Vinnie Falco b893749e29 Remove http Writer suspend and resume feature (API Change):
fix #154

The resume_context parameter passed to instances
of Writer during HTTP serialization is removed.
2017-04-10 15:54:29 -07:00
Steve Brain 4fa0bf645b Fix Writer return value documentation 2017-02-24 13:24:49 -05:00
Vinnie Falco e64ca2fa33 Fix Body requirements doc 2017-02-22 18:15:48 -05:00
Vinnie Falco a6120cd8be Update copyright dates 2017-02-07 15:20:25 -05: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 6b4fb28cee Fix Writer exemplar in docs 2016-10-14 15:03:58 -04:00
Vinnie Falco 4224a3a2db Relax ForwardIterator requirements in FieldSequence 2016-10-14 15:03:58 -04:00
Vinnie Falco 2765a67594 Refine Parser concept:
* Parser is not HTTP-specific
* parse algorithms are in their own header
* Update documentation
2016-10-14 14:12:41 -04:00
Vinnie Falco b4a8342795 Update and tidy documentation 2016-09-29 13:03:36 -04:00
Vinnie Falco 50b5dab5df Rename concept to DynamicBuffer (API change):
Conform to the Networking TS by renaming the Streambuf concept
to DynamicBuffer in all places. Values of types meeting the
requirements of DynamicBuffer are renamed to dynabuf.

See:
http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2015/n4478.html#requirements.dynamic_buffers

* Headers renamed
* Formal parameter names renamed
* Template argument types renamed
* Documentation updated
2016-05-28 18:39:18 -04:00
Vinnie Falco 20dfecd2b6 HTTP improvements:
* Increased code coverage

* New Body concepts:
    is_Body
    is_ReadableBody
    is_WritableBody
2016-05-25 12:00:14 -04:00
Vinnie Falco eb7bd6a2f1 WebSocket ping, fixes, coverage:
* Improve test coverage
* tests for invokable in composed ops

* Update documentation
* Add License badge to README
* Target Windows 7 SDK and later
* Make role_type private
* Remove extra unused masking functions
* Allow stream reuse / reconnect after failure
* Restructure logic of composed operations
* Allow 0 for read_message_max meaning no limit
* Respect keep alive when building HTTP responses
* Check version in upgrade request
* Response with 426 status on unsupported WebSocket version
* Remove unnecessary Sec-WebSocket-Key in HTTP responses
* Rename to mask_buffer_size

* Remove maybe_throw
* Add ping, async_ping, async_on_pong
* Add ping_op
* Add pong_op
* Fix crash in accept_op
* Fix suspend in close_op
* Fix read_frame_op logic
* Fix crash in read_op
* Fix races in echo sync and async echo servers
2016-05-25 12:00:14 -04:00
Vinnie Falco d46db18a31 Update documentation:
* http parse functions
* Parser concept
* More detail on concepts
* Better hyperlinking
2016-05-25 12:00:13 -04:00