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

Merge branch 'bug/122/logsubscribe' into 'master'

Resolves #122 with handshake fix

Closes #122

See merge request nicolas.pope/ftl!59
parents d9fc99af 8f3db79f
No related branches found
No related tags found
1 merge request!59Resolves #122 with handshake fix
Pipeline #11954 passed
...@@ -465,22 +465,27 @@ bool Peer::_data() { ...@@ -465,22 +465,27 @@ bool Peer::_data() {
_badClose(false); _badClose(false);
LOG(ERROR) << "Missing handshake - got '" << get<1>(hs) << "'"; LOG(ERROR) << "Missing handshake - got '" << get<1>(hs) << "'";
return false; 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(...) { } catch(...) {
_badClose(false); _badClose(false);
LOG(ERROR) << "Bad first message format"; LOG(ERROR) << "Bad first message format";
return false; 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) { if (scheme_ == ftl::URI::SCHEME_WS && recv_buf_.nonparsed_size() > 0) {
wsheader_type ws; wsheader_type ws;
if (ws_parse(recv_buf_, ws) < 0) { 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