event/BufferedSocket: pass std::exception_ptr to OnSocketError()
This commit is contained in:
@@ -20,8 +20,6 @@
|
||||
#include "config.h"
|
||||
#include "BufferedSocket.hxx"
|
||||
#include "net/SocketError.hxx"
|
||||
#include "util/Error.hxx"
|
||||
#include "util/Domain.hxx"
|
||||
#include "Compiler.h"
|
||||
|
||||
#include <algorithm>
|
||||
@@ -45,7 +43,7 @@ BufferedSocket::DirectRead(void *data, size_t length)
|
||||
if (IsSocketErrorClosed(code))
|
||||
OnSocketClosed();
|
||||
else
|
||||
OnSocketError(NewSocketError(code));
|
||||
OnSocketError(std::make_exception_ptr(MakeSocketError(code, "Failed to receive from socket")));
|
||||
return -1;
|
||||
}
|
||||
|
||||
@@ -80,12 +78,7 @@ BufferedSocket::ResumeInput()
|
||||
switch (result) {
|
||||
case InputResult::MORE:
|
||||
if (input.IsFull()) {
|
||||
// TODO
|
||||
static constexpr Domain buffered_socket_domain("buffered_socket");
|
||||
Error error;
|
||||
error.Set(buffered_socket_domain,
|
||||
"Input buffer is full");
|
||||
OnSocketError(std::move(error));
|
||||
OnSocketError(std::make_exception_ptr(std::runtime_error("Input buffer is full")));
|
||||
return false;
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user