line |
true |
false |
branch |
16
|
1 |
105 |
if (_flags[CONNECTION_REQUESTED]) throw Error("already requested connection"); |
19
|
105 |
0 |
_connect_response_parser.set_context_request(req); |
20
|
88 |
17 |
if (_deflate_cfg) req->add_deflate(*_deflate_cfg); |
25
|
0 |
170 |
if (!_flags[CONNECTION_REQUESTED]) throw Error("has not requested connection"); |
26
|
0 |
170 |
if (_flags[CONNECTION_RESPONSE_PARSED]) throw Error("already parsed connect response"); |
29
|
170 |
0 |
http::ResponseParser::Result res = _connect_response_parser.parse(buf); |
30
|
170 |
0 |
_connect_response = dynamic_pointer_cast(res.response); |
32
|
0 |
170 |
if (res.error) { |
33
|
0 |
0 |
_connect_response->error = res.error; |
34
|
0 |
0 |
_flags.set(CONNECTION_RESPONSE_PARSED); |
41
|
80 |
90 |
else if (res.state != http::State::done) { |
44
|
90 |
0 |
_connect_response->_ws_key = _connect_request->ws_key; |
45
|
90 |
0 |
_connect_response->process_headers(); |
47
|
90 |
0 |
_flags.set(CONNECTION_RESPONSE_PARSED); |
49
|
84 |
6 |
if (!_connect_response->error && _deflate_cfg) { |
|
70 |
14 |
if (!_connect_response->error && _deflate_cfg) { |
|
70 |
20 |
if (!_connect_response->error && _deflate_cfg) { |
54
|
70 |
0 |
auto deflate_matches = DeflateExt::select(exts, *_deflate_cfg, role); |
57
|
61 |
0 |
_deflate_ext.reset(DeflateExt::uplift(deflate_matches, used_extensions, role)); |
58
|
61 |
0 |
_connect_response->ws_extensions(used_extensions); |
68
|
80 |
10 |
if (!_connect_response->error) { |
69
|
80 |
0 |
_buffer = buf.substr(res.position);// if something remains in buf, user can get it via get_frames() or get_messages() without buf param. |
|
80 |
0 |
_buffer = buf.substr(res.position);// if something remains in buf, user can get it via get_frames() or get_messages() without buf param. |
70
|
80 |
0 |
_flags.set(ESTABLISHED); |
85
|
18 |
0 |
}}} |
|
18 |
0 |
}}} |