Commit Graph

131 Commits

Author SHA1 Message Date
Vinnie Falco be0d74f2aa Documentation fixes 2017-06-05 16:09:38 -07:00
Vinnie Falco 054ac40192 Remove header_parser (API Change) 2017-06-05 16:09:38 -07:00
Vinnie Falco a007eba09c parser is constructible from other body types 2017-06-05 16:09:38 -07:00
Vinnie Falco af47128f0b Documentation work 2017-06-05 16:04:35 -07:00
Vinnie Falco a1848f09ce Add HEAD request example 2017-06-04 17:26:21 -07:00
Vinnie Falco e67c0abe79 Refactor header status, reason, and target (API Change):
* header::result is a family of functions to replace header::status

* header interface now uses status enum and also ints

* reason-phrase is no longer stored unless the user explicitly
  requests it.

* When serializing, the standard reason is used for the
  corresponding status code unless the user has changed it.
2017-06-04 17:26:20 -07:00
Vinnie Falco ac175cb694 Refactor method and verb (API Change):
The verb interfaces now use verb::unknown instead of
boost::optional<verb> == boost::none to indicate that
the request-method is an unrecognized string.

The http::header interface is modified to focus more on the
verb enum rather than the string. For recognized verbs, the
implementation stores an integer instead of the string.
Unknown verbs are still stored as strings.

* header::method now returns a verb
* header::method_string returns the method text
2017-06-04 14:51:41 -07:00
Vinnie Falco e18efedcd1 Documentation work 2017-06-04 14:51:40 -07:00
Vinnie Falco d3a5a05424 Documentation work 2017-06-03 21:03:05 -07:00
Vinnie Falco d6092bc5c8 Documentation work 2017-06-03 14:33:16 -07:00
Vinnie Falco 4707b21a68 Rename to parser (API Change):
* message_parser is renamed to parser
2017-06-03 11:29:49 -07:00
Vinnie Falco 290bdf146e Documentation work 2017-06-03 11:29:48 -07:00
Vinnie Falco 7cb442cd89 Make buffer_prefix_view public
fix #408
2017-06-03 11:29:48 -07:00
Vinnie Falco ef0b121c59 Rename to buffer_cat_view (API Change)
fix #408
2017-06-03 11:29:48 -07:00
Vinnie Falco b9df187557 Tidy up chunk decorator (API Change):
* Rename to no_chunk_decorator
* Decorator no longer has to append "\r\n" to the returned string
2017-06-03 11:29:41 -07:00
Vinnie Falco fc83a031a2 Documentation work 2017-06-03 00:14:49 -07:00
Vinnie Falco fe75a7ca2a Refactor HTTP serialization and parsing (API Change):
fix #404

Parsing and serialization interfaces have been fine tuned and unified.

For parsing these stream operations are defined:

* read
* read_header
* read_some
* async_read
* async_read_header
* async_read_some

For serialization these stream operations are defined:

* write
* write_header
* write_some
* async_write
* async_write_header
* async_write_some
2017-06-02 19:12:34 -07:00
Vinnie Falco 5db707a037 Refactor treatment of status code and obsolete reason (API Change):
fix #398

A new enum status is added for the status code.

The function obsolete_reason returns default reason phrasing.

If a response has an empty reason, the serializer will
automatically insert the default reason phrase for the
status code.
2017-05-30 15:59:54 -07:00
Vinnie Falco 9a585a82d9 Refactor treatment of request-method (API Change):
fix #397

method enum class is added to represent all known request methods.
Functions are provided to convert from strings to and from the method
enumeration.

The fields container is modified to also work with the enum.
2017-05-30 15:59:50 -07:00
Vinnie Falco 60047123ae Documentation work 2017-05-30 09:09:13 -07:00
Vinnie Falco 34ea0b37c4 Refactor serialization algorithms:
serializer interface is changed to be buffer-only, no streams,
and placed in its own header file.

Operations on serializers are moved to free functions as part
of the HTTP write family of synchronous and asynchronous algorithms.
2017-05-28 19:35:20 -07:00
Vinnie Falco 407b0462d4 Rename to make_serializer 2017-05-28 16:00:06 -07:00
Vinnie Falco c29451a8dd Refactor type_traits (API Change):
fix #373

* concepts.hpp is renamed to type_traits.hpp

* Body reader and writer concepts are renamed
2017-05-28 16:00:05 -07:00
Vinnie Falco 8578419433 Refactor HTTP serialization (API Change):
A new class `serializer` is introduced to permit incremental
serialization of HTTP messages. Existing free functions are
re-implemented in terms of this new class.

* The BodyReader concept is refined to support a greater variety
of strategies for providing buffers representing the body to
the serialization algorithms.

* Added buffer_body, a new model of Body which allows the caller
to provide a series of owned buffers using their own serialization
loop.

* Added empty_body, a model of Body which is for serialization only,
to represent HTTP messages with no content body.

* Removed overloads of write and async_write which send only
the HTTP header.

* Removed public interfaces for performing low-level chunk encoding.
2017-05-28 15:58:27 -07:00
Vinnie Falco f8612aa1df Remove HTTP header aliases (API Change):
fix #382

* request_header and response_header are removed
2017-05-28 15:55:58 -07:00
Vinnie Falco 96b9892dba Documentation work 2017-05-28 08:50:01 -07:00
Vinnie Falco 9a8bcb7040 Fix message doc image 2017-05-25 22:19:41 -07:00
Vinnie Falco 1b616fa1da Tidy up and make get_lowest_layer public
fix #379
2017-05-24 12:36:08 -07:00
Vinnie Falco 386b817b38 Reformat README.md QR code 2017-05-22 04:44:58 -07:00
Vinnie Falco 0bdb148765 Make buffers_view a public interface 2017-05-18 19:38:58 -07:00
Vinnie Falco 338fc81623 Add formal review notes 2017-05-18 19:38:58 -07:00
Vinnie Falco 88adbdd95e Remove handler helpers, tidy up hook invocations (API Change) 2017-05-14 15:00:52 -07:00
Vinnie Falco 4974af2972 Rename prepare_buffer(s) to buffer_prefix (API Change) 2017-05-14 15:00:52 -07:00
Vinnie Falco d81196294f Concept revision and documentation (API Change):
The concept type traits are renamed for consistency,
and consolidated into a single header file <beast/core/type_traits.hpp>

A new section, Core Concepts, is added to the documentation describing all
of the core utility classes and functions. This also includes a complete
explanation and sample program describing how to write asynchronous initiation
functions and their associated composed operations.
2017-05-14 15:00:34 -07:00
Vinnie Falco bdae92a8b4 Replace asynchronous helper macros with template aliases (API Change) 2017-05-12 17:40:00 -07:00
Vinnie Falco 6d003216b7 Add to_static_string:
This function converts integers to their decimal
representation as a static string.

In addition, static_string::resize no longer initializes
characters if the new size is larger.
2017-05-09 19:38:49 -07:00
Vinnie Falco 2bf515069d Harmonize concepts and identifiers with net-ts (API Change):
fix #321

This synchronizes identifier names and some implementation details
with the Networking-TS document and reference implementation.
The following interfaces have changed:

* async_completion
* is_buffer_sequence (removed)
* is_const_buffer_sequence (was is_ConstBufferSequence)
* is_dynamic_buffer (was is_DynamicBuffer)
* is_mutable_buffer_sequence (was is_MutableBufferSequence)
* async_result (new)
* BEAST_HANDLER_TYPE macro (new)
* BEAST_INITFN_RESULT_TYPE macro (new)

Filename changes:

* async_result.hpp (was async_completion.hpp)
2017-05-09 07:23:09 -07:00
Vinnie Falco 1c9067b1da Use beast::string_view alias 2017-05-09 07:23:09 -07:00
Vinnie Falco 771c5cade5 Doc fixes and tidying 2017-05-09 07:23:08 -07:00
Vinnie Falco e2b5c317fc Rename to buffered_read_stream (API Change):
dynabuf_readstream is renamed to buffered_read_stream.
2017-05-09 07:23:08 -07:00
Vinnie Falco a753f1cb38 Rename to static_buffer, static_buffer_n (API Change):
These classes are renamed:

* static_streambuf to static_buffer
* static_streambuf_n to static_buffer_n
2017-05-09 07:23:08 -07:00
Vinnie Falco 24b66864d8 Rename to flat_buffer, basic_flat_buffer (API Change):
These classes are renamed:

* flat_streambuf to flat_buffer
* basic_flat_streambuf to basic_flat_buffer
2017-05-09 07:23:08 -07:00
Vinnie Falco 69259efe87 Rename to multi_buffer, basic_multi_buffer (API Change):
These classes are renamed:

* streambuf to multi_buffer
* basic_streambuf to basic_multi_buffer
2017-05-09 07:23:07 -07:00
Vinnie Falco bef9ae11ea New buffers() replaces to_string() (API Change):
A new function, buffers(), returns an implementation defined object
which wraps a ConstBufferSequence and supports formatting to a
std::ostream.

The function to_string is removed, as the new implementation allows
conversion to string using boost::lexical_cast on the return value
of the call to buffers(). Streaming to an output stream is more
efficient: no dynamic allocations are performed.

Example:

    streambuf sb;
    std::cout << buffers(sb.data()) << std::endl;
2017-05-09 07:23:04 -07:00
Vinnie Falco a7ef4f53dc New ostream() returns dynamic buffer output stream (API Change):
This eliminates beast::write output for dynamic buffers and replaces
it with the function ostream() that wraps a caller provided dynamic
buffer and returns the result as a std::ostream derived object.
Callers may now produce formatted output into any object meeting the
requirements of DynamicBuffer using operator<< and the standard stream
modifiers such as std::endl.

This new technique is more efficient, as implementations of operator<<
can now write directly into the output using std::ostream::write and
std::ostream::put.

Example of use:

  beast::streambuf sb;
  beast::ostream(sb) << "Hello, world!" << std::endl;
2017-05-08 15:46:03 -07:00
Vinnie Falco ff5e659545 Refactor http::header contents (API Change):
fix #124

The http::header data members "method", "url", and "reason"
are changed from data members, to pairs of get and set
functions which forward the call to the Fields type used
to instantiate the template.

Previously, these data members were implemented using
std::string. With this change, the implementation of the
Fields type used to instantiate the template is now in
control of the representation of those values. This permits
custom memory allocation strategies including uniform use of
the Allocator type already provided to beast::http::basic_fields.
2017-05-07 13:40:04 -07:00
Vinnie Falco c2b32dc740 Remove websocket::keep_alive option (API Change):
fix #332

This removes the keep_alive option from the WebSocket stream.
Callers who wish to control the behavior of the Connection
header may do so in the decorator and completion handlers
for the handshake and accept functions.
2017-05-07 13:39:40 -07:00
Vinnie Falco dd6b5004ac WebSocket doc work 2017-05-07 13:39:40 -07:00
Brad Anderson 7d08f59fa6 Fix typo in documentation example 2017-05-05 21:00:56 -07:00
Vinnie Falco 21ef97d220 Rename to http::dynamic_body, consolidate header:
fix #284

* streambuf_body is renamed to dynamic_body
* basic_dynabuf_body is renamed to basic_dynamic_body
2017-05-05 21:00:56 -07:00