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

Merge branch 'master' of gitlab.utu.fi:nicolas.pope/ftl

parents 455391ac 5d1e5d1e
No related branches found
No related tags found
No related merge requests found
Pipeline #11955 passed
......@@ -465,22 +465,27 @@ bool Peer::_data() {
_badClose(false);
LOG(ERROR) << "Missing handshake - got '" << get<1>(hs) << "'";
return false;
} else {
// Must handle immediately with no other thread able
// to read next message before completion.
// The handshake handler must not block.
disp_->dispatch(*this, obj);
}
} catch(...) {
_badClose(false);
LOG(ERROR) << "Bad first message format";
return false;
}
} else {
// CHECK Safe to unlock here?
is_waiting_ = true;
lk.unlock();
disp_->dispatch(*this, obj);
// Relock before next loop of while
lk.lock();
is_waiting_ = false;
}
// CHECK Safe to unlock here?
is_waiting_ = true;
lk.unlock();
disp_->dispatch(*this, obj);
// Relock before next loop of while
lk.lock();
is_waiting_ = false;
if (scheme_ == ftl::URI::SCHEME_WS && recv_buf_.nonparsed_size() > 0) {
wsheader_type ws;
if (ws_parse(recv_buf_, ws) < 0) {
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment