src/server/daemon/sessionhandler.c

changeset 67
50505dc3f8a6
parent 60
feb2f1e115c6
child 78
3578977d29a3
equal deleted inserted replaced
66:74babc0082b7 67:50505dc3f8a6
43 HttpParser *parser; 43 HttpParser *parser;
44 } EventHttpIO; 44 } EventHttpIO;
45 45
46 SessionHandler* create_basic_session_handler() { 46 SessionHandler* create_basic_session_handler() {
47 BasicSessionHandler *handler = malloc(sizeof(BasicSessionHandler)); 47 BasicSessionHandler *handler = malloc(sizeof(BasicSessionHandler));
48 handler->threadpool = threadpool_new(8); 48 handler->threadpool = threadpool_new(4, 8);
49 handler->sh.enqueue_connection = basic_enq_conn; 49 handler->sh.enqueue_connection = basic_enq_conn;
50 50
51 51
52 return (SessionHandler*)handler; 52 return (SessionHandler*)handler;
53 } 53 }
237 237
238 int evt_request_finish(event_handler_t *h, event_t *event) { 238 int evt_request_finish(event_handler_t *h, event_t *event) {
239 EventHttpIO *io = event->cookie; 239 EventHttpIO *io = event->cookie;
240 HttpParser *parser = io->parser; 240 HttpParser *parser = io->parser;
241 HTTPRequest *request = io->request; 241 HTTPRequest *request = io->request;
242 242
243 int r = handle_request(request, NULL); 243 int r = handle_request(request, NULL);
244 if(r != 0) { 244 if(r != 0) {
245 // TODO: error message 245 // TODO: error message
246 close(request->connection->fd); 246 close(request->connection->fd);
247 } 247 }

mercurial