Skip to content
Snippets Groups Projects
Commit 1a151d9e authored by Nicolas Pope's avatar Nicolas Pope
Browse files

Correction for excessive ws header reads

parent 90cedd0f
No related branches found
No related tags found
No related merge requests found
......@@ -489,12 +489,12 @@ bool Peer::_data() {
UNIQUE_LOCK(recv_mtx_,lk);
if (scheme_ == ftl::URI::SCHEME_WS) {
LOG(INFO) << "Reading WS Header";
if (scheme_ == ftl::URI::SCHEME_WS && !ws_read_header_) {
//LOG(INFO) << "Reading WS Header";
wsheader_type ws;
ws.header_size = 0;
if (ws_parse(recv_buf_, ws) < 0) {
LOG(ERROR) << "Bad WS header " << ws.header_size;
//LOG(ERROR) << "Bad WS header " << ws.header_size;
is_waiting_ = true;
return false;
}
......@@ -505,6 +505,7 @@ bool Peer::_data() {
is_waiting_ = true;
return false;
}
ws_read_header_ = false;
lk.unlock();
......
......@@ -81,6 +81,7 @@ Peer.uuid = my_uuid;
Peer.prototype._dispatchNotification = function(name, args) {
if (this.bindings.hasOwnProperty(name)) {
console.log("Notification for: ", name);
this.bindings[name].apply(this, args);
} else {
console.log("Missing handler for: ", name);
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment