-
Notifications
You must be signed in to change notification settings - Fork 0
/
http.h
29 lines (25 loc) · 897 Bytes
/
http.h
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
#ifndef _HTTP_
#define _HTTP_
#include "headfile.h"
class Http {
public:
std::string httpMessage;
std::string method;
std::string path;
std::string protocol;
std::string pf;
std::string connection;
explicit Http(const char* buffer);
Http(Http&& other) noexcept;
int response_http(struct bufferevent *bev);
int send_header(struct bufferevent *bev, int no, const char* desp, const char *type, long len);
static int send_dir(struct bufferevent *bev,const char *dirname);
int send_error(struct bufferevent *bev);
static int send_file_to_http(const std::string& filename, struct bufferevent *bev);
static const char *get_file_type(const std::string& filename);
static void strdecode(char *to, char *from);
static void strencode(char* to, size_t tosize, const char* from);
static int hexit(char c);
~Http() = default;
};
#endif