-
Notifications
You must be signed in to change notification settings - Fork 13
Expand file tree
/
Copy pathProxyHeaders.h
More file actions
41 lines (31 loc) · 758 Bytes
/
ProxyHeaders.h
File metadata and controls
41 lines (31 loc) · 758 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
#ifndef __PROXY_HEADER_H__
#define __PROXY_HEADER_H__
#include <string>
#include <map>
#include "ProxyUri.h"
#define PARSE_WRONG_FORMAT -1
#define PARSE_IMCOMPLETE_HEADER -2
struct RequestHeader
{
std::string method;
Uri uri;
std::string version;
std::map<std::string, std::string> header;
size_t header_length;
int Parse(const char* data, unsigned int len);
std::string ToString() const;
void Clear();
RequestHeader();
};
struct ResponseHeader
{
std::string version;
unsigned int code;
std::string reason;
std::map<std::string, std::string> header;
size_t header_length;
int Parse(const char* data, unsigned int len);
void Clear();
ResponseHeader();
};
#endif //__HEADER_H__