line |
true |
false |
branch |
10
|
2 |
88 |
if (code == 426) { |
11
|
2 |
0 |
_ws_version = headers.get("Sec-WebSocket-Version"); |
|
2 |
0 |
_ws_version = headers.get("Sec-WebSocket-Version"); |
16
|
1 |
87 |
if (code != 101) { |
21
|
87 |
0 |
auto it = headers.find("Connection"); |
22
|
87 |
0 |
if (it == headers.end() || !string_contains_ci(it->value, "upgrade")) { |
|
87 |
0 |
if (it == headers.end() || !string_contains_ci(it->value, "upgrade")) { |
|
1 |
86 |
if (it == headers.end() || !string_contains_ci(it->value, "upgrade")) { |
|
87 |
0 |
if (it == headers.end() || !string_contains_ci(it->value, "upgrade")) { |
|
87 |
0 |
if (it == headers.end() || !string_contains_ci(it->value, "upgrade")) { |
|
1 |
86 |
if (it == headers.end() || !string_contains_ci(it->value, "upgrade")) { |
|
0 |
0 |
if (it == headers.end() || !string_contains_ci(it->value, "upgrade")) { |
|
0 |
0 |
if (it == headers.end() || !string_contains_ci(it->value, "upgrade")) { |
27
|
86 |
0 |
it = headers.find("Upgrade"); |
28
|
86 |
0 |
if (it == headers.end() || !string_contains_ci(it->value, "websocket")) { |
|
86 |
0 |
if (it == headers.end() || !string_contains_ci(it->value, "websocket")) { |
|
1 |
85 |
if (it == headers.end() || !string_contains_ci(it->value, "websocket")) { |
|
86 |
0 |
if (it == headers.end() || !string_contains_ci(it->value, "websocket")) { |
|
86 |
0 |
if (it == headers.end() || !string_contains_ci(it->value, "websocket")) { |
|
1 |
85 |
if (it == headers.end() || !string_contains_ci(it->value, "websocket")) { |
|
0 |
0 |
if (it == headers.end() || !string_contains_ci(it->value, "websocket")) { |
|
0 |
0 |
if (it == headers.end() || !string_contains_ci(it->value, "websocket")) { |
33
|
85 |
0 |
it = headers.find("Sec-WebSocket-Accept"); |
34
|
85 |
0 |
if (it == headers.end() || it->value != _calc_accept_key(_ws_key)) { |
|
85 |
0 |
if (it == headers.end() || it->value != _calc_accept_key(_ws_key)) { |
|
85 |
0 |
if (it == headers.end() || it->value != _calc_accept_key(_ws_key)) { |
|
85 |
0 |
if (it == headers.end() || it->value != _calc_accept_key(_ws_key)) { |
|
1 |
84 |
if (it == headers.end() || it->value != _calc_accept_key(_ws_key)) { |
|
85 |
0 |
if (it == headers.end() || it->value != _calc_accept_key(_ws_key)) { |
|
85 |
0 |
if (it == headers.end() || it->value != _calc_accept_key(_ws_key)) { |
|
85 |
0 |
if (it == headers.end() || it->value != _calc_accept_key(_ws_key)) { |
|
1 |
84 |
if (it == headers.end() || it->value != _calc_accept_key(_ws_key)) { |
|
0 |
0 |
if (it == headers.end() || it->value != _calc_accept_key(_ws_key)) { |
|
0 |
0 |
if (it == headers.end() || it->value != _calc_accept_key(_ws_key)) { |
|
0 |
0 |
if (it == headers.end() || it->value != _calc_accept_key(_ws_key)) { |
38
|
84 |
0 |
else _ws_accept_key = it->value; |
41
|
84 |
0 |
auto ext_range = headers.get_multi("Sec-WebSocket-Extensions"); |
42
|
84 |
0 |
for (auto& val : ext_range) { |
|
84 |
0 |
for (auto& val : ext_range) { |
|
149 |
0 |
for (auto& val : ext_range) { |
|
65 |
84 |
for (auto& val : ext_range) { |
|
65 |
0 |
for (auto& val : ext_range) { |
|
65 |
0 |
for (auto& val : ext_range) { |
43
|
65 |
0 |
parse_header_value(val, _ws_extensions); |
46
|
84 |
0 |
ws_protocol = headers.get("Sec-WebSocket-Protocol"); |
|
84 |
0 |
ws_protocol = headers.get("Sec-WebSocket-Protocol"); |
50
|
313 |
0 |
auto key_base = ws_key + "258EAFA5-E914-47DA-95CA-C5AB0DC85B11"; |
52
|
313 |
0 |
SHA1((const unsigned char*)key_base.data(), key_base.length(), sha1bin); |
53
|
313 |
0 |
return panda::encode::encode_base64(string_view((const char*)sha1bin, 20), false, true); |
59
|
228 |
0 |
headers.add("Upgrade", "websocket"); |
60
|
228 |
0 |
headers.add("Connection", "Upgrade"); |
62
|
151 |
77 |
if (ws_protocol) headers.add("Sec-WebSocket-Protocol", ws_protocol); |
|
151 |
0 |
if (ws_protocol) headers.add("Sec-WebSocket-Protocol", ws_protocol); |
64
|
228 |
0 |
headers.add("Sec-WebSocket-Accept", _calc_accept_key(_ws_key)); |
|
228 |
0 |
headers.add("Sec-WebSocket-Accept", _calc_accept_key(_ws_key)); |
65
|
228 |
0 |
if (!headers.has("Server")) headers.add("Server", "Panda-WebSocket"); |
|
228 |
0 |
if (!headers.has("Server")) headers.add("Server", "Panda-WebSocket"); |
|
228 |
0 |
if (!headers.has("Server")) headers.add("Server", "Panda-WebSocket"); |
67
|
80 |
148 |
if (_ws_extensions.size()) headers.add("Sec-WebSocket-Extensions", compile_header_value(_ws_extensions)); |
|
80 |
0 |
if (_ws_extensions.size()) headers.add("Sec-WebSocket-Extensions", compile_header_value(_ws_extensions)); |