Menu

[r359]: / framework / trunk / worker_thread.h  Maximize  Restore  History

Download this file

65 lines (50 with data), 1.3 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
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
#ifndef _WORKER_THREAD_H_
#define _WORKER_THREAD_H_
#include <pthread.h>
#include <sstream>
#include <string>
#include <cgicc/Cgicc.h>
#include <cgicc/HTTPHTMLHeader.h>
#include <cgicc/HTTPStatusHeader.h>
#include <cgicc/HTMLClasses.h>
#include <boost/noncopyable.hpp>
#include <memory>
#include "fcgi.h"
#include "cppcms_error.h"
#include "url.h"
#include "cache_interface.h"
#include "base_cache.h"
#include "cgicc_connection.h"
namespace cppcms {
using namespace std;
using cgicc::CgiEnvironment;
using cgicc::Cgicc;
using cgicc::HTTPHeader;
class worker_thread: private boost::noncopyable {
friend class url_parser;
friend class cache_iface;
cache_factory const &cf;
protected:
Cgicc *cgi;
CgiEnvironment const *env;
auto_ptr<HTTPHeader> response_header;
list<string> other_headers;
void set_header(HTTPHeader*h){response_header=auto_ptr<HTTPHeader>(h);};
void add_header(string s) { other_headers.push_back(s); };
virtual void main();
// Output and Cahce
cache_iface cache;
base_cache *caching_module;
bool gzip;
bool gzip_done;
string out;
void init_internal();
public:
int id;
pthread_t pid;
void run(cgicc_connection &);
worker_thread(cache_factory const &f=cache_factory()) : cf(f), cache(this) { init_internal(); } ;
virtual ~worker_thread();
};
}
#endif
MongoDB Logo MongoDB