summaryrefslogtreecommitdiffstats
path: root/xmrstak/http/httpd.hpp
blob: bc8bcf612c173a3096a3f09bba2dfb5b8b670379 (plain)
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
#pragma once

struct MHD_Daemon;
struct MHD_Connection;

class httpd
{
public:
	static httpd* inst()
	{
		if (oInst == nullptr) oInst = new httpd;
		return oInst;
	};

	bool start_daemon();

private:
	httpd();
	static httpd* oInst;

	static int req_handler(void * cls,
	        MHD_Connection* connection,
	        const char* url,
	        const char* method,
	        const char* version,
	        const char* upload_data,
	        size_t* upload_data_size,
	        void ** ptr);

	MHD_Daemon *d;
};
OpenPOWER on IntegriCloud