Commit Graph

864 Commits

Author SHA1 Message Date
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
Christopher Kohlhoff
b261738d79 Strip the scope id from address string before passing to inet_pton.
On some platforms, like FreeBSD, inet_pton fails if the address
string includes trailing characters like a scope id.
2015-03-19 23:57:44 +11:00
Christopher Kohlhoff
b954a03b6f Allow nested calls to completion handler when using yield_context. 2015-03-19 23:56:46 +11:00
Christopher Kohlhoff
83008fc4ce Treat multicast test failures with ENODEV as non-fatal. 2015-03-19 23:55:38 +11:00
Christopher Kohlhoff
98a3f07417 Map ConnectEx errors to portable equivalents.
Fixes boost trac ticket 10744.
2015-03-19 23:55:02 +11:00
Christopher Kohlhoff
cba8ec4ce8 Fix ssl::stream bug that may cause spurious 'short read' errors. 2015-03-19 23:53:58 +11:00
Christopher Kohlhoff
8f5bf7a739 Move result into coro_handler. 2015-03-19 23:53:12 +11:00
Christopher Kohlhoff
5a136ac8f5 std::addressof isn't available until g++ 4.6. 2015-03-19 23:52:43 +11:00
Christopher Kohlhoff
09eeb03cbb Move result of a yield_context operation. 2015-03-19 23:52:06 +11:00
Christopher Kohlhoff
1b3bd862d2 Fix unsigned int overflow reported by clang's integer sanitizer. 2015-03-19 23:51:28 +11:00
Christopher Kohlhoff
1de80ca253 Automatically support clang with libstdc++ when standalone. 2015-03-19 23:50:55 +11:00
Christopher Kohlhoff
224c7d22d3 Ensure OpenSSL error queue is cleared before each operation. 2015-03-19 23:50:06 +11:00
Christopher Kohlhoff
2580addfc0 Use password callback when loading in-memory private key. 2015-03-19 23:48:32 +11:00
Christopher Kohlhoff
f3a184977a Add options for disabling TLS v1.1 and v1.2. 2015-03-19 23:47:59 +11:00
Christopher Kohlhoff
75928f7ed2 Ensure a system header is included before testing __GLIBC_MINOR__. 2015-03-19 23:46:56 +11:00
Christopher Kohlhoff
ada6e27059 Newest MSVC needs noexcept on error_category members. 2015-03-19 23:46:03 +11:00
Christopher Kohlhoff
1fecaa9898 Version bump. 2014-10-17 22:49:55 +11:00
Christopher Kohlhoff
d109f120fa Explicitly mark asio::strand as deprecated.
Use asio::io_service::strand instead.
2014-10-17 22:49:14 +11:00
Christopher Kohlhoff
b5b6c42cfe Fix compile error in /dev/poll reactor.
Fixes boost trac tickets #10350, #10572.
2014-10-16 19:23:59 +11:00
Christopher Kohlhoff
83c88d6b7a Make all kqueue event registration lazy.
Fixes the kqueue reactor so that it works on FreeBSD again.

Fixes boost trac ticket #10606.
2014-10-16 19:23:59 +11:00
Christopher Kohlhoff
1890b2c488 Deregister EVFILT_WRITE to avoid spinning with serial ports.
Fixes boost trac ticket #10496.
2014-10-16 19:23:59 +11:00
Christopher Kohlhoff
715ae947f2 Use correct type in byte order conversion of shorts.
Fixes boost trac ticket #10539.
2014-10-16 19:23:59 +11:00
Christopher Kohlhoff
7c73af05e9 Fix shadow variable warnings. 2014-10-16 19:12:24 +11:00
Christopher Kohlhoff
d772ea8722 Add lazy kqueue EVFILT_WRITE registration.
This fixes support for read-only file descriptors, such as those
obtained from libpcap by calling pcap_get_selectable_fd.

Fixes boost trac ticket #10367.
2014-10-16 19:10:29 +11:00
Christopher Kohlhoff
ee431b4a1f Fix warnings reported by VS2013.
Fixes boost trac ticket #10376.
2014-10-16 19:08:35 +11:00
Christopher Kohlhoff
504ff0474e Explicitly use WSASocketW, as WSASocketA has been deprecated.
Fixes boost trac ticket #10534.
2014-10-16 19:06:56 +11:00
Christopher Kohlhoff
2c24ee7dd0 Version bump. 2014-07-28 07:29:48 +10:00
Christopher Kohlhoff
cc9730e493 Avoid using newly-deprecated Winsock functions. 2014-07-26 19:23:29 +10:00
Christopher Kohlhoff
39fb24ea39 Fix shadow variable warning. 2014-07-26 19:23:04 +10:00
Christopher Kohlhoff
9108db61bc Don't use EV_CLEAR when registering interrupter.
Fixes copy/paste error introduced in 660e9fe302.
2014-07-26 19:22:13 +10:00
Christopher Kohlhoff
cf2ff15857 Version bump. 2014-06-30 14:03:16 +10:00
Christopher Kohlhoff
be64cc8ac9 The intel compiler doesn't provide the SSE2 intrinsics. 2014-06-29 20:55:21 +10:00
Christopher Kohlhoff
78ff082f0c Use SSE2 intrinsics to allow the Cray compiler to work. 2014-06-28 22:37:20 +10:00
Christopher Kohlhoff
9ef094e650 Work around gcc problem to do with anonymous enums.
Fixes boost trac ticket #10042.
2014-06-28 22:06:19 +10:00
Christopher Kohlhoff
80a3fb7a59 Return bytes transferred when ReadFile fails with ERROR_MORE_DATA.
Reverted the previous change to ignore ERROR_MORE_DATA. Instead,
the error will propagated as with any other (i.e. in an error_code
or thrown as a system_error). For code that needs to handle partial
messages, the error_code overload should be used.

Fixes boost trac ticket #10034.
2014-06-28 22:04:43 +10:00
Christopher Kohlhoff
541d2d48a6 Fix off-by-one error in signal number check.
Fixes boost trac ticket #9324.
2014-06-28 22:03:08 +10:00
Christopher Kohlhoff
ec9768daae Use VerifyVersionInfo rather than GetVersionEx.
GetVersionEx has been deprecated.
2014-06-28 22:02:00 +10:00
Christopher Kohlhoff
c2d25de553 Don't assume SO_UPDATE_CONNECT_CONTEXT is defined.
Fixes boost trac ticket #10016.
2014-06-28 22:00:39 +10:00
Christopher Kohlhoff
4dc6f2c328 Version bump. 2014-05-05 12:48:38 +10:00
Christopher Kohlhoff
f0e429f537 Defend against min/max macros. 2014-05-05 11:33:29 +10:00
Christopher Kohlhoff
4a0c1e5da2 Remove tab character. 2014-05-05 11:33:05 +10:00
Christopher Kohlhoff
2c9b017ccf Put back the event::signal() member.
The asio::detail::event class seems to be being used by other
projects, so we'll keep the old function name to avoid unnecessary
breakage.
2014-05-04 10:57:08 +10:00
Christopher Kohlhoff
0356a567bd Move event #include to correct location. 2014-05-04 10:35:34 +10:00
Christopher Kohlhoff
2114f2d17b Clarify that buffer_copy does not support overlapping memory regions.
Fixes boost trac ticket #8295.
2014-05-04 10:06:45 +10:00
Christopher Kohlhoff
b4bb504599 Support stringified scope ids for link-local multicast. 2014-05-04 10:06:45 +10:00
Christopher Kohlhoff
208748a3b5 Use scope id as default IPv6 multicast interface. 2014-05-04 10:06:45 +10:00
Christopher Kohlhoff
c1fa653a38 Use a single condition variable per io_service.
This change fixes a potential race condition when using run_one() from
multiple threads. It also paves the way for the future addition of
timed io_service::run() overloads.
2014-05-04 10:06:45 +10:00
Christopher Kohlhoff
615a75884b Fix unused argument warning. 2014-05-04 09:37:01 +10:00
Christopher Kohlhoff
0484963a55 Use ConnectEx where available.
N.B. This change conservatively limits the use of ConnectEx to
connection-oriented IP sockets.
2014-05-03 10:25:31 +10:00
Christopher Kohlhoff
107dcb750f Update some more copyright notices. 2014-05-03 10:21:15 +10:00
Christopher Kohlhoff
9d13af49f8 Disable GetQueuedCompletionStatus workaround on recent Windows versions. 2014-05-03 10:18:39 +10:00
Christopher Kohlhoff
e4e914bc4d Fix type aliasing issue reported by gcc.
Fixes boost trac ticket #9550.
2014-05-03 10:17:42 +10:00
Christopher Kohlhoff
c06aa74f08 Make select_reactor more efficient on Windows for large numbers of sockets.
Fixes boost trac ticket #9528.
2014-05-03 10:15:07 +10:00
Christopher Kohlhoff
1417badc04 Clarify that commit() and consume() do not throw.
Fixes boost trac ticket #9605.
2014-05-03 10:14:11 +10:00
Christopher Kohlhoff
9e75760570 Fix infinite recursion in operator~ implementation.
Fixes boost trac ticket #9548.
2014-05-03 10:13:08 +10:00
Christopher Kohlhoff
981addd4ee Fix incorrect documentation on async_send.
Fixed boost trac ticket #9771.
2014-05-03 10:11:02 +10:00
Christopher Kohlhoff
660e9fe302 Fix occasional close() system call hang on MacOS.
Repeated re-registration of kqueue event filters seems to behave as
though there is some kind of "leak" on MacOS, culminating in a suspended
close() system call and an unkillable process. To avoid this, we will
register a descriptor's kqueue event filters once only i.e. when the
descriptor is first created.
2014-05-03 10:10:12 +10:00
Christopher Kohlhoff
92a53bd3cc Compute greatest common divisor to prevent unnecessary integer overflow.
Fixes boost trac tickets #9662, #9778.
2014-05-03 10:09:04 +10:00
Christopher Kohlhoff
bd50a1b593 Ensure incomplete coroutines are correctly unwound.
We must take care not to hold a shared_ptr to the coroutine across
its own suspension point, otherwise it will not be unwound by the
io_service destructor. Move-enabled C++11 compilers take care of this
automatically, but with C++03 we must explicitly reset the shared_ptr.

Fixes boost trac ticket #9731.
2014-05-03 10:05:23 +10:00
Christopher Kohlhoff
85640f548a Fix spawn() when Boost.Coroutine v2 is used.
Fixes boost trac tickets #9442, #9928.
2014-05-03 09:40:42 +10:00
Christopher Kohlhoff
3cc2cd94be Fix delegation of continuation hook.
Fixes boost trac ticket #9741.
2014-05-03 09:28:25 +10:00
Christopher Kohlhoff
8dd99f4e04 Make system_error available via error.hpp. 2014-05-03 09:27:36 +10:00
Christopher Kohlhoff
02659b6fde Add extra #include needed by latest Xcode. 2014-05-03 09:26:42 +10:00
Christopher Kohlhoff
28f690f504 Update copyright notices. 2014-05-03 09:25:39 +10:00
Christopher Kohlhoff
0e90106a30 Make develop identical to master. 2014-05-03 08:57:44 +10:00
Christopher Kohlhoff
0d57ea2d16 Fix typos in spawn() documentation.
[SVN r86465]
2013-10-26 22:42:53 +00:00
Christopher Kohlhoff
0113c1831f Add a note to clarify that concurrent invocation is not guaranteed for handlers in different strands.
[SVN r86464]
2013-10-26 22:39:23 +00:00
Christopher Kohlhoff
41899ae46a Support older versions of OpenSSL that don't supply SSL_CTX_clear_options.
[SVN r86463]
2013-10-26 22:35:32 +00:00
Christopher Kohlhoff
8612b7b1bd Suppress conversion warnings reported by MSVC.
[SVN r86462]
2013-10-26 22:32:01 +00:00
Christopher Kohlhoff
813f272583 Fix WinRT detection.
[SVN r86152]
2013-10-03 23:59:54 +00:00
Christopher Kohlhoff
e290a34cd3 Reverted asio changed made under [85904], [85952], [86050] and [86105]. Will reconsider after 1.55 is released.
[SVN r86151]
2013-10-03 22:59:24 +00:00
Stephen Kelly
bf56879631 Asio: Remove obsolete GCC version checks.
[SVN r86105]
2013-10-01 08:42:20 +00:00
Stephen Kelly
dafe0562c7 ASIO: Clean up pragma guard comment.
[SVN r86050]
2013-09-30 11:22:07 +00:00
Stephen Kelly
93b2b4dc46 Remove obsolete MSVC check from pragma guard
git grep -h -B1 "^#\s*pragma once" | grep -v pragma | sort | uniq

is now clean.

[SVN r85952]
2013-09-26 13:02:51 +00:00
Stephen Kelly
b571d87989 Asio: Remove obsolete MSVC version check.
[SVN r85904]
2013-09-25 13:51:51 +00:00
Christopher Kohlhoff
03b51d1764 MinGW fix.
[SVN r85799]
2013-09-20 12:02:33 +00:00
Christopher Kohlhoff
2c7c13012a Update buffered stream operations to adhere to current handler patterns.
[SVN r85798]
2013-09-20 12:00:44 +00:00
Christopher Kohlhoff
d08bc082f2 Implement end-of-file condition for WinRT stream sockets.
[SVN r85781]
2013-09-18 22:43:01 +00:00
Christopher Kohlhoff
d3845b7fd3 Fix prefix on extern "C" function name.
[SVN r85768]
2013-09-17 22:53:17 +00:00
Christopher Kohlhoff
1cd626f4d7 Add use_future support for Microsoft Visual C++.
[SVN r85767]
2013-09-17 22:42:50 +00:00
Christopher Kohlhoff
8047e7f180 Enable move support for Microsoft Visual C++ 2012.
[SVN r85766]
2013-09-17 22:38:04 +00:00
Christopher Kohlhoff
e746865f78 Initial port to Windows Runtime.
This change adds limited support for using Asio with the Windows
Runtime. It requires that the language extensions be enabled. Due to the
restricted facilities exposed by the Windows Runtime API, the port comes
with the following caveats:

* The core facilities such as the io_service, strand, buffers, composed
  operations, timers, etc., should all work as normal.

* For sockets, only client-side TCP is supported.

* Explicit binding of a client-side TCP socket is not supported.

* The cancel() function is not supported for sockets. Asynchronous
  operations may only be cancelled by closing the socket.

* Operations that use null_buffers are not supported.

* Only tcp::no_delay and socket_base::keep_alive options are supported.

* Resolvers do not support service names, only numbers. I.e. you must
  use 80 rather than http.

* Most resolver query flags have no effect.


[SVN r85764]
2013-09-17 22:24:19 +00:00
Christopher Kohlhoff
d6bb7d0e4a Eliminate some unnecessary handler copies.
[SVN r85763]
2013-09-17 22:14:14 +00:00
Christopher Kohlhoff
9e2fc1f61e Some async operations that missed getting the async_result treatment.
[SVN r85762]
2013-09-17 22:12:07 +00:00
Christopher Kohlhoff
06e5aeedca Visual C++ language extensions use generic as a keyword. Add a
workaround that renames the namespace to cpp_generic when those
language extensions are in effect.


[SVN r85761]
2013-09-17 22:08:43 +00:00
Christopher Kohlhoff
12f4e8280b Enable certain C++11 standard library facilities for recent versions of Microsoft Visual Studio.
[SVN r85760]
2013-09-17 22:08:07 +00:00
Christopher Kohlhoff
4752c98d59 Inore ERROR_MORE_DATA as a non-fatal error when returned by
GetOverlappedResult for a synchronous read.


[SVN r85759]
2013-09-17 22:06:25 +00:00
Christopher Kohlhoff
07f0ea9996 Remove use of std::min.
[SVN r85758]
2013-09-17 22:05:38 +00:00
Christopher Kohlhoff
10dd1488c7 Add missing forward declarations needed for Windows.
[SVN r85757]
2013-09-17 22:04:55 +00:00
Christopher Kohlhoff
558a771072 Fix documentation error where an asynchronous function was described as
having synchronous behaviour.


[SVN r85756]
2013-09-17 22:04:10 +00:00
Christopher Kohlhoff
799f24ddf8 Fix another socket descriptor comparison that doesn't work correctly if
the descriptor type is unsigned.


[SVN r85755]
2013-09-17 22:03:29 +00:00
Christopher Kohlhoff
5cd67a72cc Add missing move cast.
[SVN r85754]
2013-09-17 22:01:26 +00:00
Christopher Kohlhoff
dcc918d0a9 Clean up some internal forward declarations.
[SVN r85753]
2013-09-17 22:00:53 +00:00
Christopher Kohlhoff
8fafa6f60a Remove spurious whitespace.
[SVN r85752]
2013-09-17 21:53:45 +00:00
Christopher Kohlhoff
c230dd2ed0 Fix error in comment.
[SVN r85751]
2013-09-17 21:53:03 +00:00
Christopher Kohlhoff
131b7a25ab Clarify that programs must not issue overlapping async_write_at operations.
[SVN r85750]
2013-09-17 21:52:27 +00:00
Christopher Kohlhoff
32a41f7871 Enable the move optimisation (and otherwise eliminate a copy) for handlers
using the default invocation hook.


[SVN r85749]
2013-09-17 21:51:28 +00:00
Christopher Kohlhoff
aba096cc75 Suppress g++ 4.8+ warning about unused typedefs.
[SVN r85747]
2013-09-17 21:45:43 +00:00
Christopher Kohlhoff
749e9d2219 Ensure signal number is correctly passed to the completion handler when
starting an async_wait on a signal that is already raised.


[SVN r85746]
2013-09-17 21:43:29 +00:00
Christopher Kohlhoff
d203da445e Fix comparison used to test for a successful synchronous accept.
[SVN r85745]
2013-09-17 21:42:48 +00:00
Christopher Kohlhoff
475e3239e5 Fix a bug in handler tracking, where it was not correctly printing out some handler IDs.
[SVN r85744]
2013-09-17 21:42:08 +00:00
Christopher Kohlhoff
d747598321 Ensure ssl::io_op::want_ member is initialised.
[SVN r85743]
2013-09-17 21:41:04 +00:00
Christopher Kohlhoff
c57920f5df Fix a regression on Windows where multiple threads are running an io_service.
[SVN r85741]
2013-09-17 21:39:38 +00:00
Christopher Kohlhoff
f6359cbf6e Fix nfds argument to select.
[SVN r85740]
2013-09-17 21:38:41 +00:00
Christopher Kohlhoff
5554bf5a6c Remove unused parameters and member variables.
[SVN r85739]
2013-09-17 21:36:54 +00:00
Christopher Kohlhoff
0199ad5d3b Fix a regression where, on some platforms, errors from async_connect are not
correctly propagated through to the completion handler.


[SVN r85738]
2013-09-17 21:35:43 +00:00
Christopher Kohlhoff
aea3d133c4 Remove unused variable assignment.
[SVN r85737]
2013-09-17 21:33:39 +00:00
Christopher Kohlhoff
e4b1e832d2 Fix error in async_receive_from example.
[SVN r85736]
2013-09-17 21:32:48 +00:00
Christopher Kohlhoff
977543973d Remove dependency on Boost.Preprocessor library.
[SVN r85735]
2013-09-17 21:31:55 +00:00
Christopher Kohlhoff
623a696a78 Sync version number with release branch.
[SVN r85716]
2013-09-16 22:38:05 +00:00
Christopher Kohlhoff
bf00b5d6d7 Add missing documentation for use_future_t::allocator_type.
[SVN r84878]
2013-06-22 12:57:51 +00:00
Christopher Kohlhoff
a897f60e3d Add mechanism for disabling automatic Winsock initialisation. Refs #3605
[SVN r84877]
2013-06-22 12:47:44 +00:00
Christopher Kohlhoff
74907c9aa2 Fix memory leak in ssl::rfc2818_verification class.
[SVN r84876]
2013-06-22 12:45:33 +00:00
Christopher Kohlhoff
5120123082 Add support for both boost.coroutine v1 and v2.
[SVN r84875]
2013-06-22 12:44:53 +00:00
Christopher Kohlhoff
f97171acc9 Add documentation for new features.
[SVN r84529]
2013-05-27 12:17:19 +00:00
Christopher Kohlhoff
661fb4bac6 Fix potential data race due to reading the reactor pointer outside the lock.
[SVN r84492]
2013-05-25 12:35:43 +00:00
Christopher Kohlhoff
642a1cf824 Fix problem in #warning directive. Refs #7939
[SVN r84488]
2013-05-25 11:57:36 +00:00
Christopher Kohlhoff
e9d0dda331 Fix bug on Windows where certain operations might generate an error_code with
an invalid (i.e. NULL) error_category. Refs #8613


[SVN r84487]
2013-05-25 11:52:54 +00:00
Christopher Kohlhoff
bbf94e800e Automatically disable SSL compression.
To mitigate the risk of certain attacks, SSL compression is now disabled
by default. To enable, you can use the new ssl::context::clear_options()
function like so:

  my_context.clear_options(asio::ssl::context::no_compression);


[SVN r84486]
2013-05-25 11:50:52 +00:00
Christopher Kohlhoff
2b7646ae8d Add assertions that num_buckets_ is non-zero. Refs #7739
[SVN r84485]
2013-05-25 11:46:20 +00:00
Christopher Kohlhoff
b9ae1e866c Fix waitable timer documentation. Refs #8602
[SVN r84484]
2013-05-25 11:41:19 +00:00
Christopher Kohlhoff
2d307d2dcd Fix error in acceptor example. Refs #8421
[SVN r84483]
2013-05-25 11:38:01 +00:00
Christopher Kohlhoff
22d8e5e5f8 Fix potential deadlock in signal_set implementation.
[SVN r84482]
2013-05-25 11:35:10 +00:00
Christopher Kohlhoff
abd9cdb60f Add generic socket protocols and converting move constructors.
Four new protocol classes have been added:

- asio::generic::datagram_protocol
- asio::generic::raw_protocol
- asio::generic::seq_packet_protocol
- asio::generic::stream_protocol

These classes implement the Protocol type requirements, but allow the
user to specify the address family (e.g. AF_INET) and protocol type
(e.g. IPPROTO_TCP) at runtime.

A new endpoint class template, asio::generic::basic_endpoint, has been
added to support these new protocol classes. This endpoint can hold any
other endpoint type, provided its native representation fits into a
sockaddr_storage object.

When using C++11, it is now possible to perform move construction from a
socket (or acceptor) object to convert to the more generic protocol's
socket (or acceptor) type. If the protocol conversion is valid:

  Protocol1 p1 = ...;
  Protocol2 p2(p1);

then the corresponding socket conversion is allowed:

  Protocol1::socket socket1(io_service);
  ...
  Protocol2::socket socket2(std::move(socket1));

For example, one possible conversion is from a TCP socket to a generic
stream-oriented socket:

  asio::ip::tcp::socket socket1(io_service);
  ...
  asio::generic::stream_protocol::socket socket2(std::move(socket1));

The conversion is also available for move-assignment. Note that these
conversions are not limited to the newly added generic protocol classes.
User-defined protocols may take advantage of this feature by similarly
ensuring the conversion from Protocol1 to Protocol2 is valid, as above.

As a convenience, the socket acceptor's accept() and async_accept()
functions have been changed so that they can directly accept into a
different protocol's socket type, provided the protocol conversion is
valid. For example, the following is now possible:

  asio::ip::tcp::acceptor acceptor(io_service);
  ...
  asio::generic::stream_protocol::socket socket1(io_service);
  acceptor.accept(socket1);


[SVN r84363]
2013-05-19 04:55:11 +00:00
Christopher Kohlhoff
c607f44ac6 Fix implementation of asynchronous connect operation so that it can cope
with spurious readiness notifications from the reactor.


[SVN r84349]
2013-05-18 12:13:17 +00:00
Christopher Kohlhoff
85e9b528c4 Fix a problem with lost thread wakeups that can occur when making
concurrent calls to run() and poll() on the same io_service object.


[SVN r84348]
2013-05-18 12:07:00 +00:00
Christopher Kohlhoff
ff5799ea7e Fix basic_waitable_timer's underlying implementation so that it can
handle any time_point value without overflowing the intermediate
duration objects.


[SVN r84347]
2013-05-18 12:01:59 +00:00
Christopher Kohlhoff
280a7d55b3 Remove the stackless coroutine class and macros from the HTTP server 4
example, and instead make them a part of Asio's documented interface.


[SVN r84346]
2013-05-18 11:54:59 +00:00
Christopher Kohlhoff
95d16d75b7 Update copyright notices.
[SVN r84345]
2013-05-18 11:24:59 +00:00
Christopher Kohlhoff
93610840c2 Allow loading of SSL certificate and key data from memory buffers.
Added new buffer-based interfaces:
add_certificate_authority, use_certificate, use_certificate_chain,
use_private_key, use_rsa_private_key, use_tmp_dh.

Thanks go to Nick Jones <nick dot fa dot jones at gmail dot com>, on
whose work this commit is based.


[SVN r84325]
2013-05-17 11:04:11 +00:00
Christopher Kohlhoff
6bc7463804 Add set_verify_depth function to SSL context and stream.
Thanks go to Nick Jones <nick dot fa dot jones at gmail dot com>, on
whose work this commit is based.


[SVN r84322]
2013-05-17 11:00:49 +00:00
Christopher Kohlhoff
0257ed7a11 Support for creation of TLSv1.1 and TLSv1.2 contexts.
Thanks go to Alvin Cheung <alvin dot cheung at alumni dot ust dot hk>
and Nick Jones <nick dot fa dot jones at gmail dot com>, on whose work
this is based.


[SVN r84320]
2013-05-17 10:57:02 +00:00
Christopher Kohlhoff
1c9d4a1ac3 Support handshake with re-use of data already read from the wire.
Add new overloads of the SSL stream's handshake() and async_handshake()
functions, that accepts a ConstBufferSequence to be used as initial
input to the ssl engine for the handshake procedure.

Thanks go to Nick Jones <nick dot fa dot jones at gmail dot com>, on
whose work this commit is partially based.


[SVN r84319]
2013-05-17 10:52:08 +00:00
Christopher Kohlhoff
d3adbad455 Minor cleanup.
[SVN r84316]
2013-05-17 10:15:21 +00:00
Christopher Kohlhoff
9644fab951 Partially decouple Asio from other boost components via an extra level
of indirection.


[SVN r84315]
2013-05-17 10:06:50 +00:00
Christopher Kohlhoff
1bba399354 Add a new handler hook called asio_handler_is_continuation.
Asynchronous operations may represent a continuation of the asynchronous
control flow associated with the current handler. Asio's implementation
can use this knowledge to optimise scheduling of the handler.

The asio_handler_is_continuation hook returns true to indicate whether a
completion handler represents a continuation of the current call
context. The default implementation of the hook returns false, and
applications may customise the hook when necessary. The hook has already
been customised within Asio to return true for the following cases:

- Handlers returned by strand.wrap(), when the corresponding
  asynchronous operation is being initiated from within the strand.

- The internal handlers used to implement the asio::spawn() function's
  stackful coroutines.

- When an intermediate handler of a composed operation (e.g.
  asio::async_read(), asio::async_write(), asio::async_connect(),
  ssl::stream<>, etc.) starts a new asynchronous operation due to the
  composed operation not being complete.

To support this optimisation, a new running_in_this_thread() member
function has been added to the io_service::strand class. This function
returns true when called from within a strand.


[SVN r84314]
2013-05-17 03:07:51 +00:00
Christopher Kohlhoff
546362b425 Add the asio::use_future special value, which adds first-class support
for returning a C++11 std::future from an asynchronous operation's
initiating function.

To use asio::use_future, pass it to an asynchronous operation instead of
a normal completion handler. For example:

  std::future<std::size_t> length =
    my_socket.async_read_some(my_buffer, asio::use_future);

Where a completion handler signature has the form:

  void handler(error_code ec, result_type result);

the initiating function returns a std::future templated on result_type.
In the above example, this is std::size_t. If the asynchronous operation
fails, the error_code is converted into a system_error exception and
passed back to the caller through the future.

Where a completion handler signature has the form:

  void handler(error_code ec);

the initiating function returns std::future<void>. As above, an error
is passed back in the future as a system_error exception.


[SVN r84313]
2013-05-17 02:35:08 +00:00
Christopher Kohlhoff
e4b53793cc Add the asio::spawn() function, a high-level wrapper for running
stackful coroutines. It is based on the Boost.Coroutine library.

Here is an example of its use:

  asio::spawn(my_strand, do_echo);

  // ...

  void do_echo(asio::yield_context yield)
  {
    try
    {
      char data[128];
      for (;;)
      {
        std::size_t length =
          my_socket.async_read_some(
            asio::buffer(data), yield);

        asio::async_write(my_socket,
            asio::buffer(data, length), yield);
      }
    }
    catch (std::exception& e)
    {
      // ...
    }
  }

The first argument to asio::spawn() may be a strand, io_service or
completion handler. This argument determines the context in which the
coroutine is permitted to execute. For example, a server's per-client
object may consist of multiple coroutines; they should all run on the
same strand so that no explicit synchronisation is required.

The second argument is a function object with signature (**):

  void coroutine(asio::yield_context yield);

that specifies the code to be run as part of the coroutine. The
parameter yield may be passed to an asynchronous operation in place of
the completion handler, as in:

  std::size_t length =
    my_socket.async_read_some(
      asio::buffer(data), yield);

This starts the asynchronous operation and suspends the coroutine. The
coroutine will be resumed automatically when the asynchronous operation
completes.

Where a completion handler signature has the form:

  void handler(error_code ec, result_type result);

the initiating function returns the result_type. In the async_read_some
example above, this is std::size_t. If the asynchronous operation fails,
the error_code is converted into a system_error exception and thrown.

Where a completion handler signature has the form:

  void handler(error_code ec);

the initiating function returns void. As above, an error is passed back
to the coroutine as a system_error exception.

To collect the error_code from an operation, rather than have it throw
an exception, associate the output variable with the yield_context as
follows:

  error_code ec;
  std::size_t length =
    my_socket.async_read_some(
      asio::buffer(data), yield[ec]);

**Note: if asio::spawn() is used with a custom completion handler of
type Handler, the function object signature is actually:
  
  void coroutine(asio::basic_yield_context<Handler> yield);


[SVN r84311]
2013-05-17 01:38:47 +00:00
Christopher Kohlhoff
be0221203a Add new traits classes, handler_type and async_result, that allow
the customisation of the return type of an initiating function.


[SVN r84308]
2013-05-16 23:26:04 +00:00
Christopher Kohlhoff
0dfdb9b45c Enable handler type requirements static_assert on clang.
[SVN r84301]
2013-05-16 21:34:54 +00:00
Christopher Kohlhoff
9a5cfcb604 Version bump.
[SVN r82286]
2012-12-30 22:01:28 +00:00
Christopher Kohlhoff
88cf604923 Add missing include of asio/error.hpp header.
[SVN r82279]
2012-12-29 23:21:32 +00:00
Christopher Kohlhoff
e7d150b823 Add missing include of <climits> header.
[SVN r82278]
2012-12-29 23:10:17 +00:00
Christopher Kohlhoff
e2e33e0f31 Add a small block recycling optimisation.
[SVN r82265]
2012-12-29 13:30:34 +00:00
Christopher Kohlhoff
901bd9d539 Enable noexcept qualifier for error categories. Refs #7797
[SVN r82264]
2012-12-29 13:24:03 +00:00
Christopher Kohlhoff
0a4b463f70 Fix deadlock that can occur on Windows when shutting down a pool of io_service threads due to running out of work. Refs #7552
[SVN r82263]
2012-12-29 13:22:16 +00:00
Christopher Kohlhoff
e5cc32264b Use _snwprintf to address a compile error due to the changed swprintf signature in recent versions of MinGW. Refs #7373
[SVN r82262]
2012-12-29 13:20:44 +00:00
Christopher Kohlhoff
817b56a269 Use long rather than int for SSL_CTX options, to match OpenSSL. Refs #7209
[SVN r82261]
2012-12-29 13:17:59 +00:00
Christopher Kohlhoff
489f421f8e Fix error in example embedded in basic_socket::get_option's documentation. Refs #7562
[SVN r82259]
2012-12-29 13:12:49 +00:00
Christopher Kohlhoff
e8c6842df7 Fix typos in comments. Refs #7761
[SVN r82258]
2012-12-29 13:11:43 +00:00
Christopher Kohlhoff
f65f8bd9f8 Fix some 64-to-32-bit conversion warnings. Refs #7459
[SVN r82257]
2012-12-29 13:08:30 +00:00
Vicente J. Botet Escriba
27896e9147 System/FileSystem/Asio/Thread: ref #7278 Added noexcept to Boost.System to conform with C++11
[SVN r81808]
2012-12-09 14:47:39 +00:00
Christopher Kohlhoff
355da949d5 Instead of using tie(), set the ios_base::unitbuf flag to force the stream to be flushed after every insertion. Refs #7162
[SVN r79710]
2012-07-23 23:52:15 +00:00
Christopher Kohlhoff
4d9e2461e0 Decorate GCC attribute names with underscores to prevent interaction with user-defined macros. Refs #6415
[SVN r79649]
2012-07-22 06:07:23 +00:00
Christopher Kohlhoff
b38937e17c Add missing #include of <cctype>, needed for some versions of MinGW.
[SVN r79648]
2012-07-22 06:05:26 +00:00
Christopher Kohlhoff
e00679b068 Use gcc's atomic builtins on arm, when available.
[SVN r79647]
2012-07-22 06:04:23 +00:00
Christopher Kohlhoff
7df5c95ca9 Ensure use of __thread keyword is disabled for older Intel compilers.
[SVN r79568]
2012-07-17 00:01:37 +00:00
Christopher Kohlhoff
cb65bde33b Sync version number with release branch.
[SVN r79551]
2012-07-16 06:29:59 +00:00
Christopher Kohlhoff
15b3e9a902 Make strand destruction a no-op, to allow strand objects to be destroyed after their associated io_service has been destroyed.
[SVN r79525]
2012-07-15 04:38:03 +00:00
Christopher Kohlhoff
8162904ea1 Use the __thread keyword extension when compiling with gcc on linux x86.
[SVN r79524]
2012-07-15 04:35:08 +00:00
Christopher Kohlhoff
fa10fb2fff Avoid calling work_finished() if a completion handler creates more work.
[SVN r79523]
2012-07-15 04:30:50 +00:00
Christopher Kohlhoff
8288819a86 Eliminate redundant call to call_stack::contains(this) when dispatching a completion handler.
[SVN r79522]
2012-07-15 04:26:05 +00:00
Christopher Kohlhoff
0736d31291 Add support for some newer versions of glibc which provide the epoll_create1 function but always fail with ENOSYS. Refs #7012
[SVN r79521]
2012-07-15 04:22:28 +00:00
Christopher Kohlhoff
b510b81b70 Use SSE2 load and store fences.
[SVN r79520]
2012-07-15 04:18:37 +00:00
Christopher Kohlhoff
5d4e191a92 Throw exception if SSL engine initialisation fails. Refs #6303
[SVN r79519]
2012-07-15 04:17:06 +00:00
Christopher Kohlhoff
91eea21a78 Fix another regression in buffered_write_stream. Refs #6310
[SVN r79518]
2012-07-15 04:10:59 +00:00
Christopher Kohlhoff
cf17fa2fc8 Use the thread's private_op_queue for handlers returned by the reactor task.
This fixes a problem where signal_set handlers are not being called when the
io_service's concurrency hint is set to 1. Refs #6657.


[SVN r78739]
2012-05-28 22:03:36 +00:00
Christopher Kohlhoff
5882dc476c Add support for g++ 4.7 when compiling in C++11 mode. Update revision history.
[SVN r78738]
2012-05-28 21:36:43 +00:00
Christopher Kohlhoff
b7c806fc78 Added lazy registration for EPOLLOUT.
[SVN r78667]
2012-05-26 22:28:34 +00:00
Christopher Kohlhoff
21d2df5acc Eliminate a lock/unlock pair when rescheduling a strand.
[SVN r78666]
2012-05-26 22:25:30 +00:00
Christopher Kohlhoff
69a388f92d Remove trailing whitespace.
[SVN r78665]
2012-05-26 22:23:53 +00:00
Christopher Kohlhoff
70598a8a58 Last version's race-condition-related revert in the epoll_reactor was
incomplete and broke out-of-band handling. Fixed epoll_reactor::start_op so
that it is now exactly the same as the older, working version.


[SVN r78664]
2012-05-26 22:22:46 +00:00
Christopher Kohlhoff
1fe87f03b4 Respect the OPENSSL_NO_ENGINE feature test #define.
[SVN r78663]
2012-05-26 22:20:47 +00:00
Christopher Kohlhoff
4806f0e274 Use correct basic_io_object member functions so that basic_object_handle works with c++11 compilers.
[SVN r78662]
2012-05-26 22:16:14 +00:00
Christopher Kohlhoff
b4e3ff2d9e Fixed a bug where the second buffer in an array of two buffers may be ignored
if the first buffer is empty.


[SVN r77033]
2012-02-15 22:16:53 +00:00
Christopher Kohlhoff
40608f9e0d Reverted earlier change to allow some speculative operations to be performed
without holding the lock, as it introduced a race condition in some
multithreaded scenarios.


[SVN r76990]
2012-02-12 12:53:06 +00:00
Christopher Kohlhoff
657c782117 Fix doxygen comments.
[SVN r76507]
2012-01-15 11:29:25 +00:00
Christopher Kohlhoff
be171b6abb Add extra include required for OVERLAPPED struct.
[SVN r76449]
2012-01-13 12:58:52 +00:00
Christopher Kohlhoff
c1a8562cf9 Disable object_handle on Windows CE.
[SVN r76448]
2012-01-13 12:57:59 +00:00
Christopher Kohlhoff
0725446de9 Fix non-paged pool "leak" on Windows when io_service is repeatedly run without anything to do. Refs #6321.
[SVN r76432]
2012-01-12 13:38:17 +00:00
Christopher Kohlhoff
c2d491a4e0 On linux, connect can return EAGAIN in certain circumstances. Remap to another
error so that it doesn't look like a non-blocking operation. Refs #6048.


[SVN r76430]
2012-01-12 12:27:02 +00:00
Christopher Kohlhoff
28fe058750 Fix deadlock on Mac OS X. Refs #6275.
[SVN r76427]
2012-01-12 10:08:15 +00:00
Christopher Kohlhoff
19da914b2c Fix regression in buffered_write_stream. Refs #6310.
[SVN r76426]
2012-01-12 07:42:47 +00:00
Christopher Kohlhoff
a132c47ca6 Fix for NetBSD. Refs #6098.
[SVN r76425]
2012-01-12 07:37:57 +00:00
Christopher Kohlhoff
d649b2acb8 Fix MSVC "performance warning".
[SVN r76424]
2012-01-12 07:30:05 +00:00
Christopher Kohlhoff
30f3e430a7 Update copyright notices.
[SVN r76420]
2012-01-11 23:04:08 +00:00
Christopher Kohlhoff
70cd19f75b Need to enable the basic_handle class when object_handle is supported.
[SVN r76408]
2012-01-11 07:10:06 +00:00
Christopher Kohlhoff
81f394e29d Added object_handle support.
[SVN r76397]
2012-01-10 09:58:05 +00:00
Christopher Kohlhoff
40316dfdb4 Chrono support.
[SVN r76380]
2012-01-09 13:43:38 +00:00
Christopher Kohlhoff
4badacaace Make number of strand implementations configurable by defining
BOOST_ASIO_STRAND_IMPLEMENTATIONS to the number.

Programs can now define BOOST_ASIO_ENABLE_SEQUENTIAL_STRAND_ALLOCATION to
switch the allocation of strand implementations to use a round-robin approach
rather than hashing.

Fix potential strand starvation issue that can occur when strand.post() is used.


[SVN r74955]
2011-10-15 23:59:12 +00:00
Christopher Kohlhoff
7e20d34537 Update descriptor state allocation to match approach used in epoll_reactor.
[SVN r74954]
2011-10-15 23:56:21 +00:00
Christopher Kohlhoff
fb588f5c1e Construct interrupter member first to fix exception safety issue. Refs #6006
[SVN r74953]
2011-10-15 23:55:24 +00:00
Christopher Kohlhoff
cc4f30f3b5 Clarify that the read operation ends when the buffer is full. Refs #5999
[SVN r74952]
2011-10-15 23:46:49 +00:00
Christopher Kohlhoff
c974f1088d Various performance improvements:
* Split the task_io_service's run and poll code.

* Use thread-local operation queues in single-threaded use cases (i.e. concurrency_hint is 1) to eliminate a lock/unlock pair.

* Only fence block exit when a handler is being run directly out of the io_service.

* Prefer x86 mfence-based fenced block when available.

* Use a plain ol' long for the atomic_count when all thread support is disabled.

* Allow some epoll_reactor speculative operations to be performed without holding the lock.

* Improve locality of reference by performing an epoll_reactor's I/O operation immediately before the corresponding handler is called. This also improves scalability across CPUs when multiple threads are running the io_service.

* Pass same error_code variable through to each operation's complete() function.

* Optimise creation of and access to the io_service implementation.


[SVN r74826]
2011-10-08 21:58:10 +00:00
Christopher Kohlhoff
1882513c3e Fix error mapping when session is gracefully shut down.
[SVN r74825]
2011-10-08 21:38:43 +00:00
Christopher Kohlhoff
198913776d Initialise all OpenSSL algorithms.
[SVN r74824]
2011-10-08 21:38:08 +00:00
Christopher Kohlhoff
dd7f43285a Specialise operations for buffer sequences that are arrays of exactly two buffers.
[SVN r74823]
2011-10-08 21:36:36 +00:00
Christopher Kohlhoff
e66e5d5fb3 Fix crash due to gcc_x86_fenced_block that shows up when using the Intel C++ compiler. Refs #5763
[SVN r74822]
2011-10-08 21:31:26 +00:00
Christopher Kohlhoff
04b8773fd5 Disable warning due to const qualifier being applied to function type.
[SVN r74821]
2011-10-08 21:28:00 +00:00
Christopher Kohlhoff
8d24d33883 Set size of select fd_set at runtime when using Windows.
[SVN r74820]
2011-10-08 21:25:20 +00:00
Christopher Kohlhoff
21bbcdeae1 Make sure the synchronous null_buffers operations obey the user's non_blocking setting. Refs #5756
[SVN r74818]
2011-10-08 21:15:42 +00:00