Commit Graph

189 Commits

Author SHA1 Message Date
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 3de46de96c Make websocket::close_code a proper enum:
fix #311

This changes close_code to be a proper enumeration.
2017-04-23 08:26:17 -07:00
Vinnie Falco 6d5547a32c Set version to 1.0.0-b34 2017-04-19 11:49:39 -07:00
Vinnie Falco ccefa54bf5 Set version to 1.0.0-b33 2017-04-14 19:30:33 -07:00
Vinnie Falco 32afe415c4 Set internal state correctly when writing frames:
fix #300

Correctly set wr_.cont when performing synchronous frame
writes, for the case where masking and autofragment are used.
2017-04-14 19:25:05 -07:00
Vinnie Falco df661658ee Require Visual Studio 2015 Update 3 or later
fix #216
2017-04-12 18:36:59 -07:00
Vinnie Falco b8e5a21bfd Set version to 1.0.0-b32 2017-04-10 16:48:16 -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
Vinnie Falco eba05a76e7 Set version to 1.0.0-b31 2017-03-21 15:52:01 -04:00
Florian Behrens 5663bea6cd Add missing dynabuf_readstream member
fix #277
2017-03-16 07:29:39 -04:00
Vinnie Falco 0fd4030738 Move the handler, don't copy it 2017-03-16 07:29:34 -04:00
Vinnie Falco 1b9a714833 Set version to 1.0.0-b30 2017-02-27 11:55:19 -05:00
Vinnie Falco faed9e57f2 Allow concurrent websocket async ping and writes:
fix #271

This modifies the websocket stream implementation's composed
operations to allow caller-initiated asynchronous pings and
frame/message writes to take place at the same time.
2017-02-27 10:50:32 -05:00
Vinnie Falco 31cda067fa Fix race when write suspends 2017-02-27 10:50:29 -05:00
Vinnie Falco 48dd38eb55 Fix race in close frames during reads 2017-02-27 10:45:05 -05:00
Vinnie Falco e2d1bb062b Fix race in pings during reads 2017-02-27 10:39:53 -05:00
Vinnie Falco 36143be195 Set version to 1.0.0-b29 2017-02-24 13:25:05 -05:00
Vinnie Falco 6406da06b9 Document type-pun in buffer_cat 2017-02-24 13:24:30 -05:00
Vinnie Falco 66cdb378f2 Fix illegal HTTP characters accepted as hex zero 2017-02-24 13:24:30 -05:00
Vinnie Falco 6dfd9f9fe8 Fix compilation error in non-template class
fix #267
2017-02-22 18:15:48 -05:00
Vinnie Falco fa7fea8f02 Fix race in writes during reads:
fix #261

This fixes a rare condition when responding to a ping or
close frame where the wr_block_ stream variable is not
correctly set for a short window of time.
2017-02-22 18:15:43 -05:00
Vinnie Falco 9f10b11eff Set version to 1.0.0-b28 2017-02-07 19:59:14 -05:00
Vinnie Falco 195f974872 Fix HTTP split parse edge case:
fix #257

This fixes a problem when doing split parsing (header then body).
The problem arises when the first buffer passed to the header
parser contains exactly the full header and nothing more. The
symptom is that when parsing the body, the parse will erroneously
be considered complete.
2017-02-07 19:59:04 -05:00
Vinnie Falco 264fd41342 Restyle async result constructions 2017-02-07 19:59:03 -05:00
Vinnie Falco 95b6646167 Tidy up some WebSocket javadocs 2017-02-07 19:59:03 -05:00
Vinnie Falco f6938d3760 Set version to 1.0.0-b27 2017-02-07 15:20:34 -05:00
Vinnie Falco a6120cd8be Update copyright dates 2017-02-07 15:20:25 -05:00
Vinnie Falco f6c91ce9f5 Tidy up tests and docs:
* Add handler_ptr test and increase coverage
* Add test for prepare_buffer
* Move is_call_possible tests to a .cpp file
* Tidy up docs and declarations
2017-02-06 11:34:29 -05:00
Vinnie Falco f03985f3e8 Move basic_streambuf to streambuf.hpp (API Change):
* Also change allocator element type to char
2017-02-06 11:34:29 -05:00
Vinnie Falco b8639a791a Invoke callback on pings and pongs (API Change):
fix #248

This additionally invokes the pong callback for received pings, allowing
callers to more efficiently detect when a connection is still lively:

* pong_callback renamed to ping_callback
* Callback signature has an extra `bool` to indicate if the received
  control frame is a ping or pong.
2017-02-05 18:45:22 -05:00
Vinnie Falco 06f74f05f7 Set version to 1.0.0-b26 2017-02-02 09:04:25 -05:00
Vinnie Falco 68f535f357 Tidy up warnings and tests:
* Enable WebSocket frame tests
* Remove read_message_max warning
* Remove permessage-deflate check offer warning
2017-02-02 08:57:17 -05:00
Vinnie Falco 4ee5fa903e Set version to 1.0.0-b25 2017-02-01 20:05:40 -05:00
Vinnie Falco c3e3a55bd2 Fix deflate setup bug 2017-02-01 20:05:39 -05:00
Vinnie Falco 29565c8bd7 Remove unnecessary include
fix #242
2017-02-01 20:05:39 -05:00
Vinnie Falco caa3b39ec2 Fix 32-bit arm7 warnings
fix #232
2017-02-01 20:05:38 -05:00
Vinnie Falco 0474cc5df2 Better handler_ptr (API Change):
fix #242

* Add public constructors
* Add handler_ptr::empty()
* Add handler_ptr::element_type
* Remove make_handler_ptr free function
* Compiler error if element_type is an array type
* handler_ptr::get() returns nullptr if no object is owned
2017-02-01 20:05:38 -05:00
Vinnie Falco 797631c698 Set version to 1.0.0-b24 2017-01-27 19:48:03 -05:00
Vinnie Falco a4509684cc Add permessage-deflate WebSocket extension:
This implements the permessage-deflate WebSocket
extension as described in HyBi Working Group
draft-ietf-hybi-permessage-compression-28:
https://tools.ietf.org/html/draft-ietf-hybi-permessage-compression-28

This extension allows messages to be compressed using
the raw "deflate" algorithm described in RFC 1951,
"DEFLATE Compressed Data Format Specification version 1.3":
https://www.ietf.org/rfc/rfc1951.txt
2017-01-27 19:46:49 -05:00
Vinnie Falco 67e965e440 Make decorator copyable 2017-01-25 09:51:44 -05:00
Edward Hennis c00cd37b8a Set version to 1.0.0-b23 2017-01-17 14:46:11 -05:00
Vinnie Falco b05fa33402 Fix message constructor and special members
fix #196
2017-01-17 14:45:38 -05:00
Vinnie Falco 149e3a2c45 Add file and line number to thrown exceptions 2017-01-17 14:43:12 -05:00
Vinnie Falco 1ab7a2f04c Set version to 1.0.0-b22 2017-01-08 10:15:26 -05:00
Vinnie Falco 01c76c7b5c Fix websocket stream read documentation 2017-01-07 16:07:03 -05:00
Vinnie Falco 995d86fcc3 Avoid copies in handler_alloc 2017-01-07 16:07:02 -05:00
Vinnie Falco 851cb62a50 Add handler helpers 2017-01-07 16:07:02 -05:00
Vinnie Falco 114175cd1f Implement asio dealloc-before-invoke guarantee:
fix #215

This change guarantees that temporary memory allocated
through the asio hooks by the Beast implementation is
deallocated before invoking the final handler when performing
composed operations.

The change is accomplished by replacing std::shared_ptr with
a thread-safe custom container handler_ptr to manage composed
operation state. The container tracks other instances which
manage the same object and resets them in a safe way before
invoking the final handler.

handler_ptr is provided as a public interface so that users of
this library can utilize the same idiom to write their own
composed operations.
2017-01-07 16:07:01 -05:00
Vinnie Falco 681db2efb8 Add missing include 2017-01-04 12:49:43 -05:00
Vinnie Falco 7db3c6eacf Fix broken Intellisense (MSVC)
Fix #213
2016-12-30 09:39:51 -05:00