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

Fix for uninit scheme_

parent 6dd893ba
No related branches found
No related tags found
No related merge requests found
Pipeline #11326 failed
...@@ -290,6 +290,9 @@ bool Peer::reconnect() { ...@@ -290,6 +290,9 @@ bool Peer::reconnect() {
void Peer::_updateURI() { void Peer::_updateURI() {
sockaddr_storage addr; sockaddr_storage addr;
scheme_ = ftl::URI::SCHEME_TCP;
int rsize = sizeof(sockaddr_storage); int rsize = sizeof(sockaddr_storage);
if (getpeername(sock_, (sockaddr*)&addr, (socklen_t*)&rsize) == 0) { if (getpeername(sock_, (sockaddr*)&addr, (socklen_t*)&rsize) == 0) {
char addrbuf[INET6_ADDRSTRLEN]; char addrbuf[INET6_ADDRSTRLEN];
...@@ -435,7 +438,7 @@ bool Peer::_data() { ...@@ -435,7 +438,7 @@ bool Peer::_data() {
} }
disp_->dispatch(*this, obj); disp_->dispatch(*this, obj);
if (recv_buf_.nonparsed_size() > 0 && scheme_ == ftl::URI::SCHEME_WS) { 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) {
return false; return false;
......
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