GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — inspector: fix crash when writing to closed inspector socket · nodejs/node@eb2e96b

File tree

Expand file treeCollapse file tree
Open diff view settings
Filter options
  • src
    • inspector_socket.cc
Expand file treeCollapse file tree
Open diff view settings
Collapse file

‎src/inspector_socket.cc‎

Copy file name to clipboardExpand all lines: src/inspector_socket.cc
+3-1Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -401,10 +401,11 @@ class WsHandler : public ProtocolHandler {
401401
if (processed > 0) {
402402
remove_from_beginning(data, processed);
403403
}
404-
} while (processed > 0 && !data->empty());
404+
} while (processed > 0 && !data->empty() && tcp_);
405405
}
406406

407407
void Write(const std::vector<char> data) override {
408+
if (!tcp_) return;
408409
std::vector<char> output = encode_frame_hybi17(data);
409410
WriteRaw(output, WriteRequest::Cleanup);
410411
}
@@ -666,6 +667,7 @@ ProtocolHandler::ProtocolHandler(InspectorSocket* inspector,
666667

667668
int ProtocolHandler::WriteRaw(const std::vector<char>& buffer,
668669
uv_write_cb write_cb) {
670+
if (!tcp_) return -1;
669671
return tcp_->WriteRaw(buffer, write_cb);
670672
}
671673

0 commit comments

Comments
0 (0)
You are visitor 01402503 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.