event/BufferedSocket: pass std::span to OnSocketInput()

This commit is contained in:
Max Kellermann
2024-04-03 20:40:43 +02:00
parent 5de8edced6
commit c94c08c6b4
8 changed files with 16 additions and 16 deletions

View File

@@ -56,7 +56,7 @@ BufferedSocket::ResumeInput() noexcept
return true;
}
const auto result = OnSocketInput(buffer.data(), buffer.size());
const auto result = OnSocketInput(buffer);
switch (result) {
case InputResult::MORE:
if (input.IsFull()) {

View File

@@ -109,11 +109,11 @@ protected:
/**
* Data has been received on the socket.
*
* @param data a pointer to the beginning of the buffer; the
* @param src the buffer containing the data; the
* buffer may be modified by the method while it processes the
* data
*/
virtual InputResult OnSocketInput(void *data, size_t length) noexcept = 0;
virtual InputResult OnSocketInput(std::span<std::byte> src) noexcept = 0;
virtual void OnSocketError(std::exception_ptr ep) noexcept = 0;
virtual void OnSocketClosed() noexcept = 0;