mirror of
https://github.com/matrix-construct/construct
synced 2024-05-15 09:31:46 +02:00
ircd::client: Add write overload for iov arguments.
This commit is contained in:
parent
6987e30cf6
commit
16ce9a820e
|
@ -64,6 +64,7 @@ struct ircd::client
|
|||
resource::request request;
|
||||
|
||||
string_view loghead() const;
|
||||
size_t write_all(const net::const_buffers &);
|
||||
size_t write_all(const const_buffer &);
|
||||
void close(const net::close_opts &, net::close_callback);
|
||||
ctx::future<void> close(const net::close_opts & = {});
|
||||
|
@ -120,3 +121,14 @@ struct ircd::client::init
|
|||
init();
|
||||
~init() noexcept;
|
||||
};
|
||||
|
||||
inline size_t
|
||||
ircd::client::write_all(const const_buffer &buf)
|
||||
{
|
||||
const const_buffer bufs[]
|
||||
{
|
||||
buf
|
||||
};
|
||||
|
||||
return write_all(bufs);
|
||||
}
|
||||
|
|
|
@ -1018,7 +1018,7 @@ ircd::client::close(const net::close_opts &opts,
|
|||
}
|
||||
|
||||
size_t
|
||||
ircd::client::write_all(const const_buffer &buf)
|
||||
ircd::client::write_all(const net::const_buffers &bufs)
|
||||
{
|
||||
if(unlikely(!sock))
|
||||
throw std::system_error
|
||||
|
@ -1032,7 +1032,7 @@ ircd::client::write_all(const const_buffer &buf)
|
|||
make_error_code(std::errc::not_connected)
|
||||
};
|
||||
|
||||
return net::write_all(*sock, buf);
|
||||
return net::write_all(*sock, bufs);
|
||||
}
|
||||
|
||||
/// Returns a string_view to a static (tls) buffer containing common
|
||||
|
|
Loading…
Reference in a new issue