File: http_server.h

package info (click to toggle)
entropybroker 2.9-3
  • links: PTS, VCS
  • area: main
  • in suites: buster
  • size: 1,600 kB
  • sloc: cpp: 14,386; sh: 934; makefile: 188; java: 148; perl: 12
file content (25 lines) | stat: -rw-r--r-- 544 bytes parent folder | download | duplicates (3)
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
#define HTTP_SERVER_READ_SIZE 4096

class http_server
{
private:
	int fd;
	std::vector<std::string> request_headers;
	http_request_t request_type;
	unsigned char *request_data;
	std::string request_url;
	int request_data_size;

	bool send(unsigned char *p, int len);
	bool send(const char *what);

public:
	http_server(int fd);
	~http_server();

	http_request_t get_request_type();
	http_bundle * get_request();
	std::string get_request_url();

	void send_response(int status_code, std::vector<std::string> *headers, http_bundle *response);
};