Commit f582e997 authored by Kenton Varda's avatar Kenton Varda

Fix WebSocketPair pumpTo() behavior when other end is dropped.

This should be treated as the other end disconnecting, not an error.

This is not related to tables but is needed for the Cloudflare Workers runtime change I'm working on that also uses tables... so I'm throwing it into the same PR.
parent 868051cb
......@@ -2828,7 +2828,11 @@ private:
void abort() override {
canceler.cancel("other end of WebSocketPipe was destroyed");
fulfiller.reject(KJ_EXCEPTION(DISCONNECTED, "other end of WebSocketPipe was destroyed"));
// abort() is called when the pipe end is dropped. This should be treated as disconnecting,
// so pumpTo() should complete normally.
fulfiller.fulfill();
pipe.endState(*this);
pipe.abort();
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment