From 768472c0d4e176c70e91a40ba64b8248e66f9187 Mon Sep 17 00:00:00 2001 From: Peter Thorson Date: Fri, 12 Dec 2014 18:07:32 -0500 Subject: [PATCH] get_websocket_version now checks if request is complete an incomplete request otherwise would produce a spurious zero value --- websocketpp/processors/processor.hpp | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/websocketpp/processors/processor.hpp b/websocketpp/processors/processor.hpp index c460314..99b64ca 100644 --- a/websocketpp/processors/processor.hpp +++ b/websocketpp/processors/processor.hpp @@ -105,6 +105,10 @@ bool is_websocket_handshake(request_type& r) { */ template int get_websocket_version(request_type& r) { + if (!r.ready()) { + return -2; + } + if (r.get_header("Sec-WebSocket-Version") == "") { return 0; }