-
Notifications
You must be signed in to change notification settings - Fork 42
/
Copy pathxBlog.h
57 lines (48 loc) · 1.52 KB
/
xBlog.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
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
/*
* ----------------------------------------------------------------------------
* Copyright (c) 2012-2013, xSky <guozhw at gmail dot com>
* All rights reserved.
* Distributed under GPL license.
* ----------------------------------------------------------------------------
*/
#ifndef _xBlog_H_
#define _xBlog_H_
#include "xBlogBase.h"
#include "xUntil.h"
#include "xBlogPage.h"
#include "xLog.h"
#include "xBlogData.h"
class xBlog
{
public:
xBlog();
~xBlog();
public:
bool Init();
void StartMysqlPool();
static void HttpDebug(struct evhttp_request *req);
static void DebugHttpHeader(struct evhttp_request *req);
static const char *DebugHttpGetCommand(struct evhttp_request *req);
static void HttpParseURL(struct evhttp_request *req, struct evkeyvalq *evMyheader);
static void GetHttpPostData(struct evhttp_request *req, struct evkeyvalq *evdata);
static void SendHttpResphone(struct evhttp_request *req, const string & strData);
bool StartHttpd();
void SetRouteTable(evhttp * http);
int BindSocket(const char *ip, uint16 port);
bool Run(const char *ip, uint16 port, uint32 timeout_secs, uint32 nthreads);
static void *Dispatch(void *arg);
static void OnTimer();
event_base *GetEventBase()
{
return base;
};
public:
uint64 ssid_token;
char szDir[SIZE_1024];
uint32 StartTime;
char uri_root[SIZE_1024];
private:
struct event_base *base;
struct evhttp *http;
};
#endif