Commit 6327f6b7 authored by Kenton Varda's avatar Kenton Varda

Fix WebSocketPipe pumpTo() semantics to match generic WebSocket::pumpTo().

parent 44eaeccd
......@@ -3059,7 +3059,12 @@ private:
}
kj::Promise<void> close(uint16_t code, kj::StringPtr reason) override {
KJ_REQUIRE(canceler.isEmpty(), "another message send is already in progress");
return canceler.wrap(output.close(code, reason));
return canceler.wrap(output.close(code, reason).then([this]() {
// A pump is expected to end upon seeing a Close message.
canceler.release();
pipe.endState(*this);
fulfiller.fulfill();
}));
}
kj::Promise<void> disconnect() override {
KJ_REQUIRE(canceler.isEmpty(), "another message send is already in progress");
......
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