Handle expired timers in basic_stream transfer_op

Previously, the code only handled expired timers when the buffer was empty.
This commit is contained in:
Mohammad Nejati
2024-05-13 07:36:11 +00:00
committed by Mohammad Nejati
parent 95f0cfb926
commit 2dcdef3890
3 changed files with 36 additions and 7 deletions

View File

@@ -656,6 +656,17 @@ public:
ioc.restart();
}
{
// non-empty buffer, timeout
test_server srv("*", ep, log);
stream_type s(ioc);
s.socket().connect(srv.local_endpoint());
s.expires_after(std::chrono::seconds(0));
s.async_write_some(cb, handler(error::timeout, 0));
ioc.run();
ioc.restart();
}
// abandoned operation
{
stream_type s(ioc);