mirror of
https://github.com/boostorg/beast.git
synced 2025-07-30 21:07:26 +02:00
Fix buffer lifetime in websocket write
This commit is contained in:
@ -3,6 +3,11 @@ Version 83:
|
||||
* Add flat_static_buffer::mutable_data
|
||||
* Add buffer_front
|
||||
|
||||
WebSocket
|
||||
|
||||
* Add wstest compression option
|
||||
* Fix buffer lifetime in websocket write
|
||||
|
||||
--------------------------------------------------------------------------------
|
||||
|
||||
Version 82:
|
||||
|
@ -401,20 +401,21 @@ loop:
|
||||
}
|
||||
d.fh.fin = ! more;
|
||||
d.fh.len = n;
|
||||
detail::fh_streambuf fh_buf;
|
||||
detail::write<flat_static_buffer_base>(fh_buf, d.fh);
|
||||
detail::write<
|
||||
flat_static_buffer_base>(d.fh_buf, d.fh);
|
||||
d.ws.wr_.cont = ! d.fin;
|
||||
// Send frame
|
||||
d.step = more ?
|
||||
do_deflate + 1 : do_deflate + 2;
|
||||
boost::asio::async_write(d.ws.stream_,
|
||||
buffer_cat(fh_buf.data(), b),
|
||||
buffer_cat(d.fh_buf.data(), b),
|
||||
std::move(*this));
|
||||
return;
|
||||
}
|
||||
|
||||
case do_deflate + 1:
|
||||
BOOST_ASSERT(d.ws.wr_block_ == &d);
|
||||
d.fh_buf.consume(d.fh_buf.size());
|
||||
d.ws.wr_block_ = nullptr;
|
||||
d.fh.op = detail::opcode::cont;
|
||||
d.fh.rsv1 = false;
|
||||
|
Reference in New Issue
Block a user