File Coverage

src/panda/protocol/websocket/ConnectRequest.h
Criterion Covered Total %
statement 1 4 25.0
branch 0 2 0.0
condition n/a
subroutine n/a
pod n/a
total 1 6 16.6


line stmt bran cond sub pod time code
1             #pragma once
2             #include "DeflateExt.h"
3             #include "HeaderValueParamsParser.h"
4             #include
5             #include
6             #include
7             #include
8              
9             namespace panda { namespace protocol { namespace websocket {
10              
11             using panda::uri::URI;
12             using panda::uri::URISP;
13              
14             static const int supported_ws_versions[] = {13};
15              
16             struct ConnectRequest : http::Request {
17             string ws_key;
18             int ws_version;
19             string ws_protocol;
20              
21             ErrorCode error;
22              
23 0 0         ConnectRequest () : ws_version(0), _ws_version_supported(true) {
24 0           _method = Request::Method::GET;
25 0           }
26              
27             virtual void process_headers ();
28              
29             const HeaderValues& ws_extensions () const { return _ws_extensions; }
30             bool ws_version_supported () const { return _ws_version_supported; }
31              
32 12           void ws_extensions (const HeaderValues& new_extensions) { _ws_extensions = new_extensions; }
33              
34             void add_deflate(const DeflateExt::Config& cfg);
35              
36             string to_string();
37              
38             http::ResponseSP new_response() const override;
39              
40             protected:
41             // virtual void _to_string (string& str);
42              
43             private:
44             HeaderValues _ws_extensions;
45             bool _ws_version_supported;
46             };
47              
48             using ConnectRequestSP = panda::iptr;
49              
50             }}}