src/server/daemon/httprequest.c

changeset 114
c3a0f1275d71
parent 110
43a746e905f6
child 115
51d9a15eac98
equal deleted inserted replaced
113:57e706fed20a 114:c3a0f1275d71
57 57
58 req->req_start = time(NULL); 58 req->req_start = time(NULL);
59 } 59 }
60 60
61 void http_request_cleanup(HTTPRequest *req) { 61 void http_request_cleanup(HTTPRequest *req) {
62 // TODO: implement 62 header_array_free(req->headers);
63 free(req);
63 } 64 }
64 65
65 sstr_t http_request_get_abspath(HTTPRequest *req) { 66 sstr_t http_request_get_abspath(HTTPRequest *req) {
66 sstr_t uri = req->uri; 67 sstr_t uri = req->uri;
67 68
342 nsapi_handle_request(sn, rq); 343 nsapi_handle_request(sn, rq);
343 } else { 344 } else {
344 // execute nsapi functions on a different thread pool 345 // execute nsapi functions on a different thread pool
345 nsapi_change_threadpool(sn, rq, lstp); 346 nsapi_change_threadpool(sn, rq, lstp);
346 } 347 }
347 348
348 return 0; 349 return 0;
349 } 350 }
350 351
351 352
352 353
491 * keep the connection object 492 * keep the connection object
492 * the sn->config is referenced by the connection, so we don't 493 * the sn->config is referenced by the connection, so we don't
493 * unref it 494 * unref it
494 */ 495 */
495 } else { 496 } else {
496 close(sn->connection->fd); 497 connection_destroy(sn->connection);
497 free(sn->connection);
498 cfg_unref(sn->config); 498 cfg_unref(sn->config);
499 // TODO: create connection_close function
500 } 499 }
501 500
502 // free all memory 501 // free all memory
503 free(sn->netbuf->inbuf); 502 free(sn->netbuf->inbuf);
504 free(sn->netbuf); 503 free(sn->netbuf);
505 504
506 pool_destroy(sn->sn.pool); 505 pool_destroy(sn->sn.pool);
507 506
508 return 0; 507 return 0;
509 } 508 }
510 509
511 int nsapi_authtrans(NSAPISession *sn, NSAPIRequest *rq) { 510 int nsapi_authtrans(NSAPISession *sn, NSAPIRequest *rq) {
512 HTTPObjectConfig *objconf = rq->vs->objects; 511 HTTPObjectConfig *objconf = rq->vs->objects;

mercurial