Commit Graph

52 Commits

Author SHA1 Message Date
Vinnie Falco
ec81771fdd root_certificates.hpp is not for production
fix #1702
2019-09-13 09:03:35 -07:00
tal
894917cb23
root_certificates.hpp: brought in the server certificate
close #1537

This allows for the self-sign ssl to work
2019-03-21 19:59:15 -07:00
Vinnie Falco
737d7a97e6 Remove session_alloc (API Change)
* session_alloc is removed, as it does not improve
  performance as intended.

Actions Required:

* Don't use session_alloc
2019-03-01 12:02:40 -08:00
Vinnie Falco
90b783cb62 detect_ssl, async_detect_ssl are public interfaces 2019-02-22 15:39:34 -08:00
Vinnie Falco
6ada618c12 Check BOOST_NO_CXX11_THREAD_LOCAL 2019-02-21 11:09:02 -08:00
Vinnie Falco
eea3929b26 Concept check tidying 2019-02-20 19:19:59 -08:00
Vinnie Falco
2b92189b65 Doc tidying 2019-02-20 19:09:21 -08:00
Vinnie Falco
18447553ca Examples use bind_front_handler 2019-02-14 17:28:54 -08:00
Vinnie Falco
944b5dcda7 Clear error codes idiomatically 2019-01-20 09:50:43 -08:00
Vinnie Falco
abb8203cbe session_alloc is thread-safe
fix #1408
2019-01-15 11:42:05 -08:00
Vinnie Falco
b3a8e6edb5 Tidy up calls to placement new 2018-12-02 19:48:42 -08:00
Vinnie Falco
e0b3aa7745 Fix warning in is_ssl_handshake 2018-11-22 18:34:09 -08:00
Vinnie Falco
15dd535c24 Use bind_front_handler:
The implementation uses bind_front_handler to reduce the
resources consumed when instantiating templates during
compilation.
2018-11-21 12:47:38 -08:00
luz.paz
f3212eba48 Fix some typos:
fix #1255

Found via `codespell -q 3 -L uint,te,tim --skip="./test/extern/zlib*,./example/http/client/crawl*"`
2018-10-07 10:35:12 -07:00
PeterW3
4643b0565e Verify certificates in client examples:
fix #1237

HTTP client examples now verify the server's certificate
and generate an error if the certificate is invalid or
expired:

* Set certificate verify mode
* Remove duplicate root certificate
2018-09-23 10:12:08 -07:00
Arvid Norberg
478c19e863 Use the root certificate which matches the fingerprint:
fix #1121

https://www.geotrust.com/resources/root_certificates/certificates/GeoTrust_Global_CA.pem
2018-05-08 14:08:28 -07:00
Vinnie Falco
6108cf3eb7 Add flat_stream to experimental:
This adds a new stream wrapper class template designed to address
a performance shortcoming of boost::asio::ssl::stream.
2018-05-02 08:32:07 -07:00
Vinnie Falco
90c01e82ca Use flat_stream in ssl_stream example code 2018-04-30 19:49:43 -07:00
Vinnie Falco
c9a445a937 New flat_stream example class:
fix #1108

The `flat_stream` is a stream wrapper designed to overcome a
performance limitation of the `boost::asio::ssl::stream`
implementation. Specifically, when writing buffer sequences having
length greater than one, the `ssl::stream` implementation does
not use scatter-gather I/O and instead performs a kernel transition
for every buffer in the sequence.

The wrapper addresses this problem by allocating memory and
presenting the buffer sequence into a single buffer, using
some logic to determine when this allocation is advantageous
versus simply passing the buffers through as-is.

See Also:
https://github.com/boostorg/asio/issues/100
https://stackoverflow.com/questions/50026167/performance-drop-on-port-from-beast-1-0-0-b66-to-boost-1-67-0-beast
2018-04-30 19:49:42 -07:00
Vinnie Falco
86342dd72b Use executor_work_guard in composed operations:
fix #1076

As per Asio and Networking TS requirements, composed operations must
maintain an object of type executor_work_guard for the executor associated
with the I/O object, for the lifetime of the asynchronous operation.

This is in addition to the requirement for maintaining an object of type
executor_work_guard for the executor associated with the handler.
2018-04-10 08:03:04 -07:00
Vinnie Falco
12cc10f8bb Revert "Tidy up calls to post()"
This reverts commit 5eaa2be85e.
2018-03-22 20:13:39 -07:00
Vinnie Falco
5eaa2be85e Tidy up calls to post() 2018-03-04 13:19:17 -08:00
Vinnie Falco
073b53e448 Fix handler parameter javadocs 2018-02-28 15:04:54 -08:00
Vinnie Falco
45798e0a6e Refactor detect_ssl_op:
fix #955

The asynchronous SSL detector uses a stackless coroutine.
2017-12-31 10:50:26 -08:00
Vinnie Falco
eb0cc97e1a Protect calls from macros
fix #918
2017-12-04 12:14:11 -08:00
Vinnie Falco
c01224ddc4 Tidy up ssl_stream special members
fix #916
2017-12-04 12:14:11 -08:00
Vinnie Falco
41e61a7458 Fix executor type compilation 2017-10-24 09:33:29 -07:00
Vinnie Falco
e94dcae10c Fix shadowing in session_alloc 2017-10-24 09:33:29 -07:00
Vinnie Falco
8312c6eb86 Tidy up unused variable warnings 2017-10-23 20:19:36 -07:00
Vinnie Falco
3a28e999af Update for Net-TS Asio (API Change):
fix #769

The following classes are removed:

* handler_type
* async_result
* async_completion
* is_dynamic_buffer
* is_const_buffer_sequence
* is_mutable_buffer_sequence
* handler_alloc

Actions Required:

* Use BOOST_ASIO_HANDLER_TYPE instead of handler_type
* Use BOOST_ASIO_INITFN_RESULT_TYPE instead of async_result
* Use boost::asio::async_completion
* Use boost::asio::is_dynamic_buffer
* Use boost::asio::is_const_buffer_sequence
* Use boost::asio::is_mutable_buffer_sequence
* boost::asio::associated_allocator_t replaces handler_alloc
2017-10-23 17:11:27 -07:00
Vinnie Falco
dd71b0f94d Refactor all examples:
fix #575, fix #604, fix #608, fix #634, fix #712

All examples are rewritten:

* Using Best Practices
* Mostly self-contained
* New examples to complete the feature matrix
* The server-framework example is removed
2017-08-07 20:53:11 -07:00
Vinnie Falco
60c8a560bf Add teardown_role for correct TIME_WAIT behavior (API Change):
* teardown_tag is replaced with teardown_role, a client/server
  flag used to determine whether the shutdown is performed
  before or after reading the EOF. This is in accordance with
  RFC6455 7.1.1:

  https://tools.ietf.org/html/rfc6455#section-7.1.1

Actions Required:

* Modify signatures of teardown and async_teardown to use
  teardown_role instead of teardown_tag

* Change calls to teardown and async_teardown to pass the
  correct role: client or server depending on context.
2017-08-04 19:02:13 -07:00
Vinnie Falco
030f5eef87 Move extras/ to test/ 2017-07-31 19:02:46 -07:00
Vinnie Falco
8578f3cf76 Update copyrights 2017-07-24 09:42:51 -07:00
Vinnie Falco
982f4c3b70 Update documentation for boost 2017-07-24 09:41:27 -07:00
Vinnie Falco
7139dd639a Boost prep 2017-07-23 17:34:13 -07:00
Vinnie Falco
1d7d7445d5 Add session_alloc to example/common 2017-07-20 08:15:31 -07:00
Vinnie Falco
ff15cf8688 Refactor chunked-encoding serialization:
New buffer sequence classes are provided to allow full
control over the serialization of chunk-encoded message
payloads:

* chunk_header

    A ConstBufferSequence representing the chunk header.
    It includes a hexadecimal-encoded size, an optional
    set of chunk extensions, and the trailing CRLF
    required to denote the end of the chunk header.

    This allows the caller to manually serialize the chunk
    body in one or more calls to a stream output function.
    The caller must also output an object of type `chunk_crlf`
    to the stream to indicate the end of the chunk body.

* chunk_crlf

    A small ConstBufferSequence that simply represents
    the two character sequence "\r\n" (CRLF). This is needed
    for the case where the caller wants to output a chunk
    body as a series of buffers (i.e. "chunking a chunk").

* chunk_body

    A ConstBufferSequence representing a complete chunk.
    This includes the size, an optional set of chunk extensions,
    a caller provided buffer containing the body, and the
    required CRLF that follows.

* chunk_final

    A ConstBufferSequence representing a final chunk. It
    includes an optional set of caller-provided field trailers

* chunk_extensions

    A container for building a set of chunk extensions to use
    during serialization. The use of the container is optional,
    callers may provide their own buffer containing a correctly
    formatted set of chunk extensions, or they may use their
    own convenience container which meets the requirements.

The basic_fields container is modified to allow construction
outside the context of a message. The container can be used
to provide trailers to `chunk_final`.

Actions Required:

* Remove references to ChunkDecorators. Use the new chunk-encoding
  buffer sequences to manually produce a chunked payload body in
  the case where control over the chunk-extensions and/or trailers
  is required.
2017-07-20 08:15:31 -07:00
Vinnie Falco
30ea9bf668 Fix warning in root ca declaration 2017-07-20 08:15:30 -07:00
Vinnie Falco
f34d4f7204 span, string, vector bodies are public 2017-07-20 08:15:30 -07:00
Vinnie Falco
cc198db10e serializing file_body is not const 2017-07-20 08:15:30 -07:00
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
e81026614a Remove common/file_body.hpp 2017-07-20 08:15:30 -07:00
Vinnie Falco
c01dddc4ac Verify certificates in SSL clients 2017-07-20 08:15:30 -07:00
Vinnie Falco
6b6c2e0f93 Add websocket-server-async example 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
octopus-prime
ebfc3f4537 Fix buffer overflow handling for string_body and mutable_body
fix #553, fix #558
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
octopus-prime
b5b1295d0c Add const_body, mutable_body to examples 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