Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 6 additions & 2 deletions src/inspector_socket.cc
Original file line number Diff line number Diff line change
Expand Up @@ -401,10 +401,12 @@ class WsHandler : public ProtocolHandler {
if (processed > 0) {
remove_from_beginning(data, processed);
}
} while (processed > 0 && !data->empty());
} while (processed > 0 && !data->empty() && tcp_);
}

void Write(const std::vector<char> data) override {
void Write(const std::vector<char>& data) override {
if (!tcp_)
return;
std::vector<char> output = encode_frame_hybi17(data);
WriteRaw(output, WriteRequest::Cleanup);
}
Expand Down Expand Up @@ -666,6 +668,8 @@ ProtocolHandler::ProtocolHandler(InspectorSocket* inspector,

int ProtocolHandler::WriteRaw(const std::vector<char>& buffer,
uv_write_cb write_cb) {
if (!tcp_)
return -1;
return tcp_->WriteRaw(buffer, write_cb);
}

Expand Down