| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
1 parent a22a840 commit eb2e96b
1 file changed
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -401,10 +401,11 @@ class WsHandler : public ProtocolHandler { | |||
| 401 | 401 | if (processed > 0) { | |
| 402 | 402 | remove_from_beginning(data, processed); | |
| 403 | 403 | } | |
| 404 | - } while (processed > 0 && !data->empty()); | ||
| 404 | + } while (processed > 0 && !data->empty() && tcp_); | ||
| 405 | 405 | } | |
| 406 | 406 | ||
| 407 | 407 | void Write(const std::vector<char> data) override { | |
| 408 | + if (!tcp_) return; | ||
| 408 | 409 | std::vector<char> output = encode_frame_hybi17(data); | |
| 409 | 410 | WriteRaw(output, WriteRequest::Cleanup); | |
| 410 | 411 | } | |
@@ -666,6 +667,7 @@ ProtocolHandler::ProtocolHandler(InspectorSocket* inspector, | |||
| 666 | 667 | ||
| 667 | 668 | int ProtocolHandler::WriteRaw(const std::vector<char>& buffer, | |
| 668 | 669 | uv_write_cb write_cb) { | |
| 670 | + if (!tcp_) return -1; | ||
| 669 | 671 | return tcp_->WriteRaw(buffer, write_cb); | |
| 670 | 672 | } | |
| 671 | 673 | ||
| Back | FazBrowse Home | New Git URL |
0 commit comments