564 |
564 |
565 return r; |
565 return r; |
566 } |
566 } |
567 |
567 |
568 int nsapi_finish_request(NSAPISession *sn, NSAPIRequest *rq) { |
568 int nsapi_finish_request(NSAPISession *sn, NSAPIRequest *rq) { |
|
569 request_free_resources(sn, rq); |
|
570 |
569 if(rq->rq.rq_attr.keep_alive) { |
571 if(rq->rq.rq_attr.keep_alive) { |
570 SessionHandler *sh = sn->connection->session_handler; |
572 SessionHandler *sh = sn->connection->session_handler; |
571 sh->keep_alive(sh, sn->connection); |
573 sh->keep_alive(sh, sn->connection); |
572 /* |
574 /* |
573 * keep the connection object |
575 * keep the connection object |
584 free(sn->netbuf); |
586 free(sn->netbuf); |
585 |
587 |
586 pool_destroy(sn->sn.pool); |
588 pool_destroy(sn->sn.pool); |
587 |
589 |
588 return 0; |
590 return 0; |
|
591 } |
|
592 |
|
593 void request_free_resources(NSAPISession *sn, NSAPIRequest *rq) { |
|
594 if(!rq->resources) return; |
|
595 |
|
596 UcxMapIterator i = ucx_map_iterator(rq->resources); |
|
597 ResourceData *resource; |
|
598 UCX_MAP_FOREACH(key, resource, i) { |
|
599 resourcepool_free(&sn->sn, &rq->rq, resource); |
|
600 } |
589 } |
601 } |
590 |
602 |
591 int nsapi_authtrans(NSAPISession *sn, NSAPIRequest *rq) { |
603 int nsapi_authtrans(NSAPISession *sn, NSAPIRequest *rq) { |
592 HTTPObjectConfig *objconf = rq->vs->objects; |
604 HTTPObjectConfig *objconf = rq->vs->objects; |
593 httpd_object *obj = objconf->objects[0]; |
605 httpd_object *obj = objconf->objects[0]; |