From 15408f56092616ec7d37b40a6c070b87dc917c57 Mon Sep 17 00:00:00 2001 From: sab24 Date: Sat, 30 Jan 2021 16:23:48 +0100 Subject: [PATCH 1/3] Fixes Firefox WebSocket upgrade request in WebSocket engine --- src/ws_engine.cpp | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-) diff --git a/src/ws_engine.cpp b/src/ws_engine.cpp index a239330c..d3b02bee 100644 --- a/src/ws_engine.cpp +++ b/src/ws_engine.cpp @@ -453,9 +453,18 @@ bool zmq::ws_engine_t::server_handshake () if (strcasecmp ("upgrade", _header_name) == 0) _header_upgrade_websocket = strcasecmp ("websocket", _header_value) == 0; - else if (strcasecmp ("connection", _header_name) == 0) - _header_connection_upgrade = - strcasecmp ("upgrade", _header_value) == 0; + else if (strcasecmp ("connection", _header_name) == 0){ + char *element = strtok (_header_value, ","); + while (element != NULL){ + while (*element == ' ') + element++; + if (strcasecmp ("upgrade", element) == 0){ + _header_connection_upgrade = true; + break; + } + element = strtok (NULL, ","); + } + } else if (strcasecmp ("Sec-WebSocket-Key", _header_name) == 0) strcpy_s (_websocket_key, _header_value); From 133f0d00b6b3ff22662d7497cac4a52937e49e5f Mon Sep 17 00:00:00 2001 From: sab24 Date: Sat, 30 Jan 2021 16:40:26 +0100 Subject: [PATCH 2/3] Fixes indentation --- src/ws_engine.cpp | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/src/ws_engine.cpp b/src/ws_engine.cpp index d3b02bee..cb5510e1 100644 --- a/src/ws_engine.cpp +++ b/src/ws_engine.cpp @@ -454,17 +454,17 @@ bool zmq::ws_engine_t::server_handshake () _header_upgrade_websocket = strcasecmp ("websocket", _header_value) == 0; else if (strcasecmp ("connection", _header_name) == 0){ - char *element = strtok (_header_value, ","); - while (element != NULL){ - while (*element == ' ') - element++; + char *element = strtok (_header_value, ","); + while (element != NULL){ + while (*element == ' ') + element++; if (strcasecmp ("upgrade", element) == 0){ - _header_connection_upgrade = true; - break; - } - element = strtok (NULL, ","); - } - } + _header_connection_upgrade = true; + break; + } + element = strtok (NULL, ","); + } + } else if (strcasecmp ("Sec-WebSocket-Key", _header_name) == 0) strcpy_s (_websocket_key, _header_value); From bdcc4cf06c63fcd49c3fbd745829bfa9f257572a Mon Sep 17 00:00:00 2001 From: sab24 Date: Sat, 30 Jan 2021 20:05:15 +0100 Subject: [PATCH 3/3] Adds RELICENSE --- RELICENSE/sab24.md | 14 ++++++++++++++ 1 file changed, 14 insertions(+) create mode 100644 RELICENSE/sab24.md diff --git a/RELICENSE/sab24.md b/RELICENSE/sab24.md new file mode 100644 index 00000000..4d4acfcd --- /dev/null +++ b/RELICENSE/sab24.md @@ -0,0 +1,14 @@ +# Permission to Relicense under MPLv2 or any other OSI approved license chosen by the current ZeroMQ BDFL + +This is a statement by Bart Smink +that grants permission to relicense its copyrights in the libzmq C++ +library (ZeroMQ) under the Mozilla Public License v2 (MPLv2) or any other +Open Source Initiative approved license chosen by the current +ZeroMQ BDFL (Benevolent Dictator for Life). + +A portion of the commits made by the Github handle "sab24", with +commit author "sab24 ", are copyright of Bart Smink. +This document hereby grants the libzmq project team to relicense libzmq, +including all past, present and future contributions of the author listed above. + +Bart Smink 2021/01/30