Commit Graph

864 Commits

Author SHA1 Message Date
Christopher Kohlhoff
0e02f7c51e Fix incorrect reference to 'io_context' in thread_pool documentation. 2018-11-05 23:08:01 +11:00
Christopher Kohlhoff
4d3833013a Fix MSVC version number for availability of std::invoke_result. 2018-11-05 23:07:28 +11:00
Christopher Kohlhoff
569cba5d47 Test language version using _MSVC_LANG rather than _HAS_CXX17. 2018-11-05 23:07:02 +11:00
Christopher Kohlhoff
5603b1f990 Update buffer sequence traits to test new requirements, if decltype is available. 2018-11-05 23:06:21 +11:00
Christopher Kohlhoff
cf0dab4026 Define buffer sequence traits after buffer_sequence_begin/end has been defined. 2018-11-05 23:05:40 +11:00
Christopher Kohlhoff
a9f264d76e Fix MSVC issue when building with exceptions disabled. 2018-11-05 23:04:39 +11:00
Christopher Kohlhoff
be95255430 Add options for TLS v1.3. 2018-11-05 23:03:56 +11:00
Christopher Kohlhoff
8cceba99e6 Prevent global objects from being created once per thread on Windows. 2018-11-05 23:00:35 +11:00
Christopher Kohlhoff
ad8cc21d59 Fix crash when using size(), max_size() or empty() on default-constructed resolver results. 2018-11-05 22:58:47 +11:00
Christopher Kohlhoff
d9a0dec854 Move the return value in basic_resolver_results::begin() to avoid copying.
This is reported as a warning by recent Clang.
2018-11-05 22:58:05 +11:00
Christopher Kohlhoff
e382407610 Don't use BOOST_VERSION macro in standalone mode. 2018-11-05 22:57:46 +11:00
Christopher Kohlhoff
f14f1f044c ASIO_HAS_DECL_TYPE should be ASIO_HAS_DECLTYPE in is_buffer_sequence.hpp. 2018-11-05 22:56:17 +11:00
Christopher Kohlhoff
1e55098569 Enable move support for the Intel Compiler. 2018-11-05 22:50:39 +11:00
Christopher Kohlhoff
38cb197197 Do not double define has_string_view with clang-cl
Clang-cl identifies both as clang and as MSVC.
This resulted in defining BOOST_ASIO_HAS_STD_STRING_VIEW twice.
2018-11-05 22:49:53 +11:00
Christopher Kohlhoff
39346ddc3d Fix handler tracking operation name for io_context::executor_type::dispatch. 2018-11-05 22:48:31 +11:00
Christopher Kohlhoff
dd3a28c9fd Fix buffer overflow when parsing an address string with a 64-bit scope id. 2018-11-05 22:47:35 +11:00
Christopher Kohlhoff
50b66f0fb3 Check for gthreads before enabling std::future with g++. 2018-04-01 21:37:04 +10:00
Christopher Kohlhoff
b61b555157 Need namespace std for sprintf. 2018-04-01 15:49:46 +10:00
Christopher Kohlhoff
158950ed64 Fix storage of decayed function and handler in spawn()-ed coroutine. 2018-04-01 15:28:38 +10:00
Christopher Kohlhoff
e125aa7538 Fixed compilation on Android NDK15+. 2018-04-01 15:28:38 +10:00
Christopher Kohlhoff
da95f47d6b Fix basic_yield_context support for completion signatures with reference parameters. 2018-04-01 15:28:38 +10:00
Christopher Kohlhoff
b10b5f531b Explicitly ignore result of iterator dereference. 2018-04-01 15:28:38 +10:00
Christopher Kohlhoff
0ffe337bda Distinguish legacy completion handlers (which must be CopyConstructible). 2018-04-01 15:28:38 +10:00
Christopher Kohlhoff
ec5c24e3cd Decay the DynamicBuffer type used in enable_if tests. 2018-04-01 15:28:38 +10:00
Christopher Kohlhoff
b5b17a67f0 Use std::string_view for C++17 or later, and std::experimental::string_view for C++14.
Define the preprocessor macro BOOST_ASIO_DISABLE_STD_STRING_VIEW to
force the use of std::experimental::string_view (assuming it is
available) when compiling in C++17 mode.
2018-04-01 15:28:38 +10:00
Christopher Kohlhoff
69a6480fc0 Use std::invoke_result with recent MSVC. 2018-04-01 15:28:38 +10:00
Christopher Kohlhoff
33d4704420 Make add_certificate_authority process multiple certificates in a bundle. 2018-04-01 15:28:38 +10:00
Christopher Kohlhoff
bbc5abf228 Don't call SSL_COMP_free_compression_methods if SSL_OP_NO_COMPRESSION is defined. 2018-04-01 15:28:38 +10:00
Christopher Kohlhoff
c112385412 Fix typo in detail::consuming_buffers specialisation. 2018-04-01 15:28:38 +10:00
Christopher Kohlhoff
4e5cdbf580 Fix basic_resolver_results::value_type typedef. 2018-04-01 15:28:38 +10:00
Christopher Kohlhoff
a224cbfa7b Add missing move in ssl asynchronous operation. 2018-04-01 15:28:38 +10:00
Christopher Kohlhoff
61e0ad085d Fix async_result when used with handler_type. 2018-04-01 15:28:38 +10:00
Christopher Kohlhoff
9660e81957 Correct prepare_memfn_helper test.
Fix prepare_memfn_helper test to use intended member function
'prepare' rather than 'data' copied by mistake from previous check.
2018-04-01 15:28:38 +10:00
Christopher Kohlhoff
5672713c90 Change socket iostreams to use chrono by default.
Define BOOST_ASIO_USE_BOOST_DATE_TIME_FOR_SOCKET_IOSTREAM to enable the
old Boost.Date_Time interface in basic_socket_streambuf and
basic_socket_iostream.
2018-04-01 15:28:37 +10:00
Christopher Kohlhoff
c30ed33c5e Ignore operations posted to a strand during shutdown. 2018-03-12 22:32:35 +11:00
Christopher Kohlhoff
dbccc3beea Fix redirect_error to work with non-const error_codes. 2018-03-12 22:25:17 +11:00
Christopher Kohlhoff
1b61364239 Add missing include of <sys/timerfd.h>. 2018-03-09 20:59:09 +11:00
Christopher Kohlhoff
30b047b1e6 Ensure all coroutine layers are correctly attached to the 'stack'. 2018-03-09 20:57:53 +11:00
Christopher Kohlhoff
41ef7c48df Version bump. 2018-03-07 17:30:08 +11:00
Christopher Kohlhoff
95129f34ca Fix spurious resumption. 2018-03-06 22:19:51 +11:00
Christopher Kohlhoff
9b45abcbff Restrict the types that may be awaited. 2018-03-06 07:32:47 +11:00
Christopher Kohlhoff
97b11c49b7 Fix MSVC compile error. 2018-03-06 07:30:44 +11:00
Christopher Kohlhoff
f7222d0866 Fix namespace qualification issues. 2018-03-05 23:00:10 +11:00
Christopher Kohlhoff
37d49a4f68 Allow the awaitable to be stored and co_await applied to it later. 2018-03-05 22:50:26 +11:00
Christopher Kohlhoff
9cb2eba353 Use memory recycling for awaitees. 2018-03-05 22:48:22 +11:00
Christopher Kohlhoff
c989109489 Fix up make_work_guard ambiguity. 2018-03-04 23:09:04 +11:00
Christopher Kohlhoff
deb02f7a69 Add convenience header for experimental features. 2018-03-04 23:09:04 +11:00
Christopher Kohlhoff
b30dfe8224 Add new experimental::co_spawn function. 2018-03-04 23:09:04 +11:00
Christopher Kohlhoff
142222c0e6 Add new experimental::redirect_error completion token type. 2018-03-04 22:06:55 +11:00
Christopher Kohlhoff
169d1d8cef Add new experimental::detached_t completion token type. 2018-03-04 22:06:12 +11:00
Christopher Kohlhoff
a589d7344a Add missing const qualification to acceptor's get_option members. 2018-03-04 22:02:27 +11:00
Christopher Kohlhoff
69c5b2e31e Work around a mysterious parsing error that occurs with some versions of gcc. 2018-03-04 22:00:17 +11:00
Christopher Kohlhoff
886839cf55 Update copyright notices. 2018-03-04 21:59:30 +11:00
Christopher Kohlhoff
0c9cbdfbf2 Version bump. 2017-12-06 00:10:04 +11:00
Christopher Kohlhoff
1eaa59ea2a gcc 4.7 is the minimum version required for std::allocator_traits. 2017-12-05 07:38:14 +11:00
Christopher Kohlhoff
df2abf35da Ensure that use_future<std::allocator<void>> is always constexpr default-constructible. 2017-12-04 09:08:25 +11:00
Christopher Kohlhoff
4883dcd6c7 Add missing variadic template emulation in use_future. 2017-12-03 23:32:35 +11:00
Christopher Kohlhoff
435f47e8e3 Disable buffer debugging for older MSVC, as it triggers compiler misbehaviour. 2017-12-03 21:56:50 +11:00
Christopher Kohlhoff
619cea4356 Add check for _DEFAULT_SOURCE in addition to _BSD_SOURCE. 2017-12-03 21:53:33 +11:00
Christopher Kohlhoff
a57cb2a7a6 Suppress recv truncation errors on Windows, to match POSIX behaviour. 2017-12-02 18:25:44 +11:00
Christopher Kohlhoff
cdd4a0cc81 Add documentation examples of using asio::post to submit work. 2017-12-02 16:13:27 +11:00
Christopher Kohlhoff
c34e42c129 Don't directly include <chrono>, to keep header C++03-compatible. 2017-12-02 10:57:05 +11:00
Christopher Kohlhoff
077ed86047 Add headers for TS compatibility. 2017-12-02 10:23:24 +11:00
Christopher Kohlhoff
dfa54b4fc5 Suppress MSVC dynamic initialisation warning. 2017-12-02 10:09:55 +11:00
Christopher Kohlhoff
8a8157c36d Add waitable timer headers to convenience header. 2017-12-02 09:16:54 +11:00
Christopher Kohlhoff
7b996f66bd Increase number of buffers per operation for consuming_buffers.
Use a smaller number of buffers when the count can be determined at compile
time, e.g. for std::array or boost::array.
2017-12-02 09:03:14 +11:00
Christopher Kohlhoff
282de16d9b Increase threshold for small memory block recycling to 1KB. 2017-12-02 09:03:14 +11:00
Christopher Kohlhoff
2bfd4d24d0 Make sure asio/system_context.hpp is self-contained. 2017-12-02 09:03:14 +11:00
Christopher Kohlhoff
78df0763bf Don't call memcpy with length 0, to avoid passing null pointers. 2017-12-02 09:03:14 +11:00
Christopher Kohlhoff
f8a0469702 Fix description of std::getline's behaviour. 2017-12-02 09:03:14 +11:00
Christopher Kohlhoff
26d4af19c1 Fix clang narrowing warning. 2017-12-02 09:03:14 +11:00
Christopher Kohlhoff
646250076b Remove last remaining instance of auto_ptr. 2017-12-02 09:03:14 +11:00
Christopher Kohlhoff
edbe617864 Restore binder support for 3, 4 and 5 arguments. 2017-12-02 09:03:14 +11:00
Christopher Kohlhoff
aa0bf0a8b3 Reapply double delete fix, which was overwritten by Networking TS merge. 2017-12-02 09:03:14 +11:00
Christopher Kohlhoff
2e61c6f29f Add backward compatibility for the old ConnectCondition form. 2017-11-08 00:08:40 +11:00
Christopher Kohlhoff
875788fde3 Ensure make_network_vX error_code overload doesn't throw on invalid prefix length. 2017-11-08 00:08:40 +11:00
Christopher Kohlhoff
f15e842c79 Fix the rights for event objects on UWP. 2017-11-08 00:08:40 +11:00
Christopher Kohlhoff
53f052c9a0 Suppress implicit fallthrough warning on newer gcc. 2017-11-08 00:08:40 +11:00
Christopher Kohlhoff
bfa3e0373e Fix clang version detection for suppression of unused typedef warning. 2017-11-08 00:08:40 +11:00
Christopher Kohlhoff
a778425068 Fix compile errors in some asio::connect overloads. 2017-11-08 00:08:40 +11:00
Christopher Kohlhoff
d484b66453 Bump minimum MSVC version required for C++11 allocators. 2017-10-25 07:58:21 +11:00
Christopher Kohlhoff
bfe7a04616 Fix compile warning under Emscripten. 2017-10-25 07:57:45 +11:00
Christopher Kohlhoff
59395d663a Use proper SSL_version() function so that asio can build with BoringSSL. 2017-10-25 07:57:14 +11:00
Christopher Kohlhoff
b60e92b13e Initial merge of Networking TS compatibility.
Merged from chriskohlhoff/asio master branch as of commit
4a4d28b0d24c53236e229bd1b5f378c9964b1ebb.
2017-10-23 21:48:43 +11:00
Christopher Kohlhoff
b002097359 Previous fix introduced a leak, use a better approach. 2017-08-13 07:19:28 +10:00
Christopher Kohlhoff
c8d628ad8a Fix double delete issue introduced by 3541ec2eb9. 2017-08-13 00:56:54 +10:00
Christopher Kohlhoff
c88c5f7e1c Version bump. 2017-08-01 22:31:49 +10:00
Christopher Kohlhoff
de42877700 Require gcc >= 4.7 to use standard atomics. 2017-07-31 18:51:14 +10:00
Christopher Kohlhoff
cdae3dd6b4 Don't use auto_ptr. 2017-07-31 18:51:14 +10:00
Christopher Kohlhoff
25b6042644 Use deregister_internal_descriptor in signal_set_service. 2017-07-31 18:51:14 +10:00
Christopher Kohlhoff
38508353af Make epoll_reactor resistant to events with duplicate user data. 2017-07-31 18:51:14 +10:00
Christopher Kohlhoff
3541ec2eb9 Don't free the reactor's per-descriptor state until after close. 2017-07-31 18:51:14 +10:00
Christopher Kohlhoff
4d1b169964 Enable newer language features for recent MSVC versions. 2017-07-31 18:51:14 +10:00
Christopher Kohlhoff
3b8a8d6636 is_continuation misplaced in reactive socket service. 2017-07-31 18:51:14 +10:00
Christopher Kohlhoff
84572fb9be Use poll.h rather than sys/poll.h if possible. 2017-07-31 18:51:14 +10:00
Christopher Kohlhoff
22d69e570d Fix MSVC Intellisense detection. 2017-07-31 18:51:14 +10:00
Christopher Kohlhoff
3a2e196893 Disable __thread keyword extension for android+x86+clang. 2017-07-31 18:51:14 +10:00
Christopher Kohlhoff
3a73a43f62 Version bump. 2017-03-08 06:49:35 +11:00
Christopher Kohlhoff
9bfe806fc1 Ensure winsock2.h is included before windows.h. 2017-03-05 23:00:10 +11:00
Christopher Kohlhoff
991f613b95 Eliminate new clang comma warning. 2017-03-05 22:59:39 +11:00
Christopher Kohlhoff
2b6230aef8 Make sure asio/ssl/error.hpp is self-contained. 2017-03-05 22:58:18 +11:00
Christopher Kohlhoff
fba6c4ccbd Add limited support for regular file descriptors.
The epoll_reactor now supports the use of regular file descriptors with
posix::stream_descriptor, provided the I/O operations on them never fail
with EAGAIN or EWOULDBLOCK. If the descriptor cannot be added to the
epoll set using epoll_ctl, and errno is EPERM (indicating an unsupported
descriptor type), then no error condition is raised. Instead, any
operation which would require a trip through the reactor will fail.
2017-03-05 22:56:48 +11:00
Christopher Kohlhoff
49aa5e1e6c In c++11 or later, use allocator_traits to rebind allocators. 2017-03-05 22:55:54 +11:00
Christopher Kohlhoff
8e835cccd1 Fix error when OpenSSL compression is disabled at compile time. 2017-03-05 22:54:28 +11:00
Christopher Kohlhoff
16e880c667 Update mingw mutex initialisation to match non-mingw version. 2017-03-05 22:53:59 +11:00
Christopher Kohlhoff
d76c1f0533 Make SSL/TLS version handling more consistent across OpenSSL versions.
This adds new enums context_base::tls, context_base::tls_client and
context_base::tls_server. These allow connections to use any supported
TLS version. (N.B. the deprecated version SSLv3 is explicitly disabled
if you use these values.)
2017-03-05 22:53:05 +11:00
Christopher Kohlhoff
9feee12ac2 Avoid double construction in converting move-constructors. 2017-03-05 22:52:07 +11:00
Christopher Kohlhoff
4645a7c351 Fix compilation with OpenSSL 1.1 API
With OPENSSL_API_COMPAT=0x10100000L, SSL_library_init, SSL_load_error_strings, and OpenSSL_add_all_algorithms are removed.
With OPENSSL_API_COMPAT=0x10000000L, these are function-style macros mapping to OPENSSL_init_ssl, which is called automatically anyway.

References:
https://www.openssl.org/docs/man1.1.0/ssl/OPENSSL_init_ssl.html
https://www.openssl.org/docs/man1.1.0/crypto/OPENSSL_init_crypto.html

(from Marcel Raad)
2017-03-05 22:50:36 +11:00
Christopher Kohlhoff
fdec9d1d8f Suppress some spurious unused variable warnings. 2017-03-05 22:49:54 +11:00
Christopher Kohlhoff
6c19ff7482 Include socket_types.hpp before OpenSSL headers. 2017-03-05 22:48:48 +11:00
Christopher Kohlhoff
4808f72a1f Re-enable building against LibreSSL. 2017-03-05 22:47:57 +11:00
Christopher Kohlhoff
a8cea6a722 Implement fenced_block using std::atomic_thread_fence, when available. 2017-03-05 22:46:59 +11:00
Christopher Kohlhoff
dd18e955fa Add workaround for broken getaddrinfo in Apple's NAT64 environment. 2017-03-05 22:45:50 +11:00
Christopher Kohlhoff
0a852879f5 Fix exception safety issue in hash_map. 2017-03-05 22:45:09 +11:00
Christopher Kohlhoff
f7fa336c91 Update copyright notices. 2017-03-05 22:43:47 +11:00
Christopher Kohlhoff
a1fb7b0c10 Version bump. 2016-09-19 07:37:14 +10:00
Christopher Kohlhoff
c1acb8a57b Add workaround for move-detection issue on MSVC 2015 Update 2. 2016-09-16 08:26:04 +10:00
Christopher Kohlhoff
603ebfb5e1 Call SSL_COMP_free_compression_methods() on ssl cleanup.
This call is needed for OpenSSL >=1.0.2 and <1.1.0.
2016-09-16 08:20:51 +10:00
Christopher Kohlhoff
42e7869f41 Fix allocator usage to compile with g++ 6. 2016-09-11 12:12:39 +10:00
Christopher Kohlhoff
3d71bdaf23 Use new TLS methods on OpenSSL 1.1.0. 2016-09-11 12:12:39 +10:00
Christopher Kohlhoff
8ea3165df9 Backward compatibility for code using OpenSSL < 1.1.0.
Some application code using asio::ssl::stream<> explicitly tests for the
SSL_R_SHORT_READ error. For compatibility, when using older versions of
OpenSSL we will define the ssl::error::stream_truncated to use this
value.
2016-09-11 12:12:39 +10:00
Christopher Kohlhoff
864ca38b6d Terminate loop if connect condition returns an end iterator. 2016-09-11 12:12:39 +10:00
Christopher Kohlhoff
54c9424b5a Enable getaddrinfo by default on Apple platforms.
The getaddrinfo function is now used by default unless Mac OS X 10.4 or
earlier is detected. Its use may also be explicitly disabled by defining
ASIO_DISABLE_GETADDRINFO.
2016-09-11 12:12:39 +10:00
Christopher Kohlhoff
370363b33f Fix errors when OPENSSL_NO_DEPRECATED is defined. 2016-09-11 12:01:12 +10:00
Christopher Kohlhoff
a50a350310 Only apply firewall workaround when getsockname outputs INADDR_ANY. 2016-09-11 11:59:19 +10:00
Christopher Kohlhoff
812cfa7a5c Add compatibility with OpenSSL 1.1
- SSLv2 has been completely removed from OpenSSL, even without OPENSSL_NO_SSL2
- there is a new threading API without locking callbacks
- struct SSL_CTX has been made opaque and must be used via accessor functions
- some cleanup functions have been removed

(from Marcel Raad <raad@teamviewer.com>)
2016-09-11 11:57:28 +10:00
Christopher Kohlhoff
424ad6b736 BoringSSL does not provide CONF_modules_unload. 2016-09-11 11:37:29 +10:00
Christopher Kohlhoff
84e840390b Add new error category and constant for ssl::error::stream_truncated.
This error replaces uses of SSL_R_SHORT_READ, and indicates that the
SSL stream has been shut down abruptly. (I.e. the underlying socket
has been closed without performing an SSL-layer shutdown.)
2016-09-11 11:36:53 +10:00
Christopher Kohlhoff
36eef63a9c Update copyright notices. 2016-09-11 11:35:40 +10:00
Christopher Kohlhoff
0f0f94a9d7 Remove old header file that was accidentally left behind. 2016-09-11 11:30:19 +10:00
Christopher Kohlhoff
8fe7f5d24e Version bump. 2015-12-14 12:01:39 +11:00
Christopher Kohlhoff
763d513043 Xcode/clang and plain clang use different version numbering. 2015-12-12 11:13:36 +11:00
Christopher Kohlhoff
fb4befe985 LibreSSL doesn't provide SSL_CTX_clear_chain_certs. 2015-12-12 11:12:47 +11:00
Christopher Kohlhoff
345ac9aa13 Use CreateEventW rather than CreateEvent. 2015-12-10 22:51:53 +11:00
Christopher Kohlhoff
e1c67f0377 Pass correct output buffer size to strncat. 2015-12-10 22:51:53 +11:00
Christopher Kohlhoff
6582b6966a Fix typo in comment. 2015-12-10 22:51:53 +11:00
Christopher Kohlhoff
bae401b1eb Support for building with OpenSSL when OPENSSL_NO_SSL3 is defined. 2015-12-10 22:45:24 +11:00
Christopher Kohlhoff
073b2943cc Suppress unused typedef warning when using clang. 2015-12-10 22:45:24 +11:00
Christopher Kohlhoff
dd28aed1e5 Use SSL_CTX_clear_chain_certs, if available. 2015-12-10 22:45:24 +11:00
Christopher Kohlhoff
b9cb61416e Prevent multiple definition of BOOST_ASIO_ERROR_CATEGORY_NOEXCEPT with newest MSVC. 2015-12-10 22:45:24 +11:00
Christopher Kohlhoff
798f2a98e8 Add support for Windows 8.1 store apps. 2015-12-10 22:45:24 +11:00
Christopher Kohlhoff
d1db517230 Version bump. 2015-03-24 07:21:45 +11:00
Christopher Kohlhoff
c9c75601e0 Don't push/pop options around Boost.DateTime header. 2015-03-22 10:57:34 +11:00
Christopher Kohlhoff
c05d773886 Remove redundant pointer check in SSL engine. 2015-03-21 20:54:31 +11:00
Christopher Kohlhoff
3aa7b1b19d Fix race condition in windows::object_handle. 2015-03-21 20:26:31 +11:00
Christopher Kohlhoff
382804a432 Use default visibility everywhere. 2015-03-21 18:28:43 +11:00
Christopher Kohlhoff
6cf37dc2f2 Fix WinRT detection.
WINAPI_FAMILY_ONE_PARTITION is no longer defined in newer
Windows SDKs.
2015-03-20 18:58:46 +11:00
Christopher Kohlhoff
f342f9bdd2 ERR_remove_state is deprecated, use ERR_remove_thread_state instead. 2015-03-20 09:35:13 +11:00
Christopher Kohlhoff
41bf42b8da Update copyright notices. 2015-03-20 00:14:19 +11:00
Christopher Kohlhoff
a1d5248f3a New macro BOOST_ASIO_DISABLE_CONNECTEX to disable ConnectEx use. 2015-03-20 00:06:08 +11:00