-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathWebController.h
More file actions
43 lines (37 loc) · 1.01 KB
/
WebController.h
File metadata and controls
43 lines (37 loc) · 1.01 KB
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
#ifndef _MONGOOSE_WEB_CONTROLLER_H
#define _MONGOOSE_WEB_CONTROLLER_H
#include "Request.h"
#include "Response.h"
#include "Controller.h"
#include "Mutex.h"
#include "StreamResponse.h"
#include "Utils.h"
using namespace std;
/**
* A web controller is a controller that serves HTML pages
*/
namespace Mongoose
{
class WebController : public Controller, public Utils
{
public:
/**
* Creates a web controller, each gcDivisor request, the sessions will be
* garbage collected
*/
WebController(int gcDivisor = 100);
/**
* Pre process the request, this will set the content type to text/html
* and ping the user session
*
* @param Request the request
* @param Response the response
*/
void preProcess(Request &request, Response &response);
protected:
Mutex mutex;
int gcDivisor;
int counter;
};
}
#endif