1
0
mirror of https://github.com/ohwgiles/laminar.git synced 2026-09-24 04:49:17 +00:00

resolves #31: exception thrown on bad file descriptor

Read or writes to bad file descriptors threw exceptions, just log
this instead. Also make sure that LaminarClients are removed from
the list of clients when a connection is aggressively dropped, and
add test
This commit is contained in:
Oliver Giles
2018-01-27 13:11:40 +02:00
parent ade58a202a
commit 3b267967cf
3 changed files with 98 additions and 25 deletions

View File

@@ -48,9 +48,7 @@ private:
void acceptRpcClient(kj::Own<kj::ConnectionReceiver>&& listener);
kj::Promise<void> handleFdRead(kj::AsyncInputStream* stream, char* buffer, std::function<void(const char*,size_t)> cb);
void taskFailed(kj::Exception&& exception) override {
kj::throwFatalException(kj::mv(exception));
}
void taskFailed(kj::Exception&& exception) override;
private:
struct WebsocketConnection;
@@ -58,9 +56,14 @@ private:
int efd_quit;
capnp::Capability::Client rpcInterface;
HttpImpl* httpInterface;
LaminarInterface& laminarInterface;
kj::Own<HttpImpl> httpInterface;
kj::AsyncIoContext ioContext;
kj::TaskSet tasks;
// TODO: restructure so this isn't necessary
friend class ServerTest;
kj::PromiseFulfillerPair<void> httpReady;
};
#endif // LAMINAR_SERVER_H_