line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
#pragma once |
2
|
|
|
|
|
|
|
#include "Parser.h" |
3
|
|
|
|
|
|
|
#include "ConnectRequest.h" |
4
|
|
|
|
|
|
|
#include "ConnectResponse.h" |
5
|
|
|
|
|
|
|
#include |
6
|
|
|
|
|
|
|
#include |
7
|
|
|
|
|
|
|
#include |
8
|
|
|
|
|
|
|
|
9
|
|
|
|
|
|
|
namespace panda { namespace protocol { namespace websocket { |
10
|
|
|
|
|
|
|
|
11
|
|
|
|
|
|
|
using panda::string; |
12
|
|
|
|
|
|
|
|
13
|
|
|
|
|
|
|
struct ServerParser : Parser { |
14
|
|
|
|
|
|
|
ServerParser (const Parser::Config& cfg = {}); |
15
|
|
|
|
|
|
|
|
16
|
|
|
|
|
|
|
bool accept_parsed () const { return _flags[ACCEPT_PARSED]; } |
17
|
510
|
|
|
|
|
|
bool accepted () const { return _flags[ACCEPTED]; } |
18
|
|
|
|
|
|
|
|
19
|
|
|
|
|
|
|
ConnectRequestSP accept (string& buf); |
20
|
|
|
|
|
|
|
|
21
|
|
|
|
|
|
|
string accept_error (); |
22
|
|
|
|
|
|
|
string accept_error (http::Response* res); |
23
|
|
|
|
|
|
|
string accept_response (ConnectResponse* res); |
24
|
|
|
|
|
|
|
|
25
|
|
|
|
|
|
|
string accept_response () { |
26
|
|
|
|
|
|
|
ConnectResponse res; |
27
|
|
|
|
|
|
|
return accept_response(&res); |
28
|
|
|
|
|
|
|
} |
29
|
|
|
|
|
|
|
|
30
|
|
|
|
|
|
|
virtual void reset (); |
31
|
|
|
|
|
|
|
|
32
|
|
|
|
|
|
|
virtual ~ServerParser (); |
33
|
|
|
|
|
|
|
|
34
|
|
|
|
|
|
|
private: |
35
|
|
|
|
|
|
|
static const int ACCEPT_PARSED = LAST_FLAG + 1; |
36
|
|
|
|
|
|
|
static const int ACCEPTED = ACCEPT_PARSED + 1; |
37
|
|
|
|
|
|
|
|
38
|
|
|
|
|
|
|
http::RequestParser _connect_parser; |
39
|
|
|
|
|
|
|
ConnectRequestSP _connect_request; |
40
|
|
|
|
|
|
|
}; |
41
|
|
|
|
|
|
|
|
42
|
|
|
|
|
|
|
}}} |