From b5bf6c3260bd726b0181671625c007be5ad49845 Mon Sep 17 00:00:00 2001 From: Pavel Pimenov Date: Fri, 20 Dec 2019 21:15:11 +0300 Subject: [PATCH] fix http_stream::handshake2 --- src/http_stream.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/http_stream.cpp b/src/http_stream.cpp index 936d6debd..00fa61709 100644 --- a/src/http_stream.cpp +++ b/src/http_stream.cpp @@ -94,7 +94,7 @@ namespace libtorrent { // look for \n\n and \r\n\r\n // both of which means end of http response header bool found_end = false; - if (m_buffer[read_pos - 1] == '\n' && read_pos > 2) + if (read_pos > 2 && m_buffer[read_pos - 1] == '\n') { if (m_buffer[read_pos - 2] == '\n') {