2
0
mirror of https://github.com/boostorg/asio.git synced 2026-02-22 13:42:08 +00:00
Commit Graph

1541 Commits

Author SHA1 Message Date
Christopher Kohlhoff
67ad756f4e Add buffer literals to the documentation. 2023-04-05 21:08:23 +10:00
Christopher Kohlhoff
680c7e5c7a Use cached offset when seeking a file with seek_cur on Windows. 2023-04-04 20:20:47 +10:00
Christopher Kohlhoff
abe32d5986 Fix clean up of internal I/O object structures when using io_uring. 2023-04-04 20:20:47 +10:00
Christopher Kohlhoff
3c33f03c38 Minor coro fixes for ones with custom allocators. 2023-04-04 20:20:47 +10:00
Christopher Kohlhoff
a4b0f59b37 Fix incorrect reuse of moved-from result in experimental::promise. 2023-04-04 20:20:47 +10:00
Christopher Kohlhoff
9c851335d4 Fix variadic template emulation for is_async_operation and completion_signature_of. 2023-04-04 20:20:47 +10:00
Christopher Kohlhoff
31db19028e Fix interpretation of tuple-based results in experimental::coro. 2023-04-04 20:20:47 +10:00
Christopher Kohlhoff
ca0f1f9b23 Fix completion signature forwarding in use_coro implementation. 2023-04-04 20:20:47 +10:00
Christopher Kohlhoff
7bab8d55dc Ensure this_coro helper structs have explicit 1-arg constructors.
To prevent implicit conversion in co_await expressions.
2023-04-04 20:20:47 +10:00
Christopher Kohlhoff
a33370cbe0 Allow exceptions to escape from work_finished_on_block_exit destructor. 2023-04-04 20:20:47 +10:00
Christopher Kohlhoff
b57d962907 Fix redirect_error compatibility with new completion tokens. 2023-04-04 20:20:47 +10:00
Christopher Kohlhoff
19cff007b0 Fix as_tuple compatibility with legacy completion tokens. 2023-04-04 20:20:47 +10:00
Christopher Kohlhoff
1dd140aa69 Fix detection macro used in use_future's compatibility traits. 2023-04-04 20:20:47 +10:00
Christopher Kohlhoff
91a3159ffa Avoid evaluating concept when Executor1 is not an executor. 2023-04-04 20:20:47 +10:00
Christopher Kohlhoff
caa5341f18 Fix another shadowed variable. 2023-04-04 20:20:47 +10:00
Christopher Kohlhoff
dcfb06da53 Ensure ip::address_v4::to_ulong is marked as deprecated in the documentation. 2023-04-04 20:20:47 +10:00
Christopher Kohlhoff
3b33978e7e Fix compatibility between buffered stream wrappers and move-constructible streams. 2023-04-04 20:20:47 +10:00
Christopher Kohlhoff
c331b57fa8 Disable runtime Windows version test unless targeting older Windows versions. 2023-04-04 20:20:47 +10:00
Christopher Kohlhoff
e93db8e7fa Prevent buffer types from matching contiguous iterator overloads.
Fixes a bug where passing the deprecated const_buffers_1 and
mutable_buffers_1 types to asio::buffer() would result in the contiguous
iterator overloads being incorrectly chosen.
2023-04-04 20:20:47 +10:00
Christopher Kohlhoff
003174d8c9 Fix BOOST_ASIO_ASSUME definition on older compilers.
1. gcc 4.4 does not support __builtin_unreachable, which makes the
  __GNUC__ branch definition to fail.

2. clang 3.5 doesn't support __builtin_assume and uses the last fallback
  option. There, BOOST_ASIO_ASSUME is defined without arguments, meaning it
  expands to incorrect code like `(void)0(base != 0)`. This also affects
  any other compilers that are not handled by prior branches.
2023-04-04 20:20:33 +10:00
Christopher Kohlhoff
7b4ae6d066 Add missing handler tracking source location in co_composed. 2023-04-04 20:14:13 +10:00
Christopher Kohlhoff
82e53bc9f8 Fix handler tracking source location for awaitable's await_transform. 2023-04-04 20:13:59 +10:00
Christopher Kohlhoff
1fa30958e5 Version bump. 2023-03-08 22:22:42 +11:00
Christopher Kohlhoff
08fe58def6 Add more signal_set_base::flags_t constants
This commit only adds useful POSIX constants that don't conflict with
asio's signal handling strategy (e.g. SA_SIGINFO would break asio
interface, so it's avoided). Non-POSIX constants specific to certain
operating systems (e.g. Linux's SA_UNSUPPORTED) are ignored.
2023-03-08 21:06:12 +11:00
Christopher Kohlhoff
f90a0249f1 Fix shadowed variable name. 2023-03-08 21:06:02 +11:00
Christopher Kohlhoff
d6a4d3b898 Add interoperability between channels and associated_immediate_executor. 2023-03-08 21:05:44 +11:00
Christopher Kohlhoff
9291f3d121 Remove spurious comment. 2023-03-08 21:05:25 +11:00
Christopher Kohlhoff
76fbcb2f45 Fix channels to support C++14 and (partially) C++11.
C++11 support is limited to channels with a single completion signature,
or channels with a void() signature (plus the error signature added by
the channel traits).
2023-03-08 21:05:14 +11:00
Christopher Kohlhoff
076089ec77 Fix deferred interoperability with multiple completion signatures. 2023-03-08 21:04:56 +11:00
Christopher Kohlhoff
e33be4b6b9 Fix execution context overloads of get_associated_executor and get_associated_immediate_executor. 2023-03-07 00:04:56 +11:00
Christopher Kohlhoff
adfeed2b5d Add any_completion_handler to the documentation. 2023-03-07 00:04:56 +11:00
Christopher Kohlhoff
4b16652320 Reset timer_thread_ in win_iocp_io_context::shutdown().
Resets timer_thread in shutdown for the case when shutdown is called
more than once.
2023-03-07 00:04:56 +11:00
Christopher Kohlhoff
d6cad8835e Expose sigaction() flags via optional argument to signal_set::add.
When registering a signal, it is now possible to pass flags that specify
the behaviour associated with the signal. These flags are specified as
an enum type in a new class, signal_set_base, and are passed to the
underlying sigaction() call. For example:

  asio::signal_set sigs(my_io_context);
  sigs.add(SIGINT, asio::signal_set::flags::restart);

Specifying flags other than flags::dont_care will fail unless
sigaction() is supported by the target operating system. Since signal
registration is global, conflicting flags (multiple registrations that
pass differing flags other than flags::dont_care) will also result in
an error.
2023-03-07 00:04:56 +11:00
Christopher Kohlhoff
c1269d1c82 Use uint64_t for OpenSSL options. 2023-03-06 23:38:59 +11:00
Christopher Kohlhoff
db1af40f2b Fix spurious operator precedence warning with MSVC. 2023-03-06 23:38:46 +11:00
Christopher Kohlhoff
5f39737f5a Suppress spurious 'potential null dereference' warnings. 2023-03-06 23:38:31 +11:00
Christopher Kohlhoff
7f2743e0d1 Prevent accidental copying of any_completion_handler. 2023-03-06 23:38:10 +11:00
Christopher Kohlhoff
d8e52891d4 Fix any_completion_handler assignment operator. 2023-03-06 23:37:56 +11:00
Christopher Kohlhoff
730441dcbb Ensure buffered messages can still be received when channel is closed. 2023-03-06 23:37:39 +11:00
Christopher Kohlhoff
03f3fa07f1 Fix use of nullptr. 2023-03-06 23:37:18 +11:00
Christopher Kohlhoff
d40e6257bb Explicitly shutdown in io_context and thread_pool destructor.
Fixes a use-after destroy when shutdown() is called from the base class
execution_context destructor, and this in turns triggers the destruction
of outstanding work objects.
2023-03-01 23:10:27 +11:00
Christopher Kohlhoff
85ee73854d Fix execution context overload of get_associated_executor. 2023-03-01 23:10:14 +11:00
Christopher Kohlhoff
d7525504d0 Fix initialization of sqe->user_data for reuse by io_uring_service.
The value of user_data in a submission queue entry is only initialized
with with the ring itself, remaining unchanged after use and even
through calls to io_uring_get_sqe(3). Many submission paths apply
io_uring_sqe_set_data(3) but the remainder are submitted with stale
values that can apply completion operations on the wrong queues with the
wrong results, causing obscure bugs.
2023-03-01 23:10:02 +11:00
Christopher Kohlhoff
7182202ae3 Fix pipe release() when using io_uring. 2023-03-01 23:09:50 +11:00
Christopher Kohlhoff
ae19c7b9a0 Fix thread_pool::join() deadlock when pool has no internal threads. 2023-03-01 23:09:16 +11:00
Christopher Kohlhoff
3c6101b636 Fix experimental::channel try_send failure after cancel. 2023-03-01 23:09:05 +11:00
Christopher Kohlhoff
87c178c9ea Fix awaitable exception pointer check typos. 2023-03-01 23:08:55 +11:00
Christopher Kohlhoff
d341036043 Add protocol for AF_UNIX+SOCK_SEQPACKET. 2023-03-01 23:08:42 +11:00
Christopher Kohlhoff
387f74f575 Add user-defined literals for asio buffer types.
The _buf literal suffix, defined in namespace asio::buffer_literals, may
be used to create const_buffer objects from string, binary integer, and
hexadecimal integer literals. These buffer literals may be arbitrarily
long. For example:

  using namespace asio::buffer_literals;

  asio::const_buffer b1 = "hello"_buf;
  asio::const_buffer b2 = 0xdeadbeef_buf;
  asio::const_buffer b3 = 0x01234567'89abcdef'01234567'89abcdef_buf;
  asio::const_buffer b4 = 0b1010101011001100_buf;

The memory associated with a buffer literal is valid for the lifetime of
the program. This means that the buffer can be safely used with
asynchronous operations:

  async_write(my_socket, "hello"_buf, my_handler);
2023-03-01 23:07:32 +11:00
Christopher Kohlhoff
50600cdb8f Fix ambiguity of associated_cancellation_slot<reference_wrapper>::get(). 2023-03-01 23:07:16 +11:00