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; |