static void ssi_finalize(nxweb_filter* filter, nxweb_http_server_connection* conn, nxweb_http_request* req, nxweb_http_response* resp, nxweb_filter_data* fdata) { ssi_filter_data* sfdata=(ssi_filter_data*)fdata; if (sfdata->ssib.data_in.pair) nxe_disconnect_streams(sfdata->ssib.data_in.pair, &sfdata->ssib.data_in); if (sfdata->input_fd) { close(sfdata->input_fd); sfdata->input_fd=0; } if (sfdata->ssib.nxb) { nxb_empty(sfdata->ssib.nxb); nxp_free(conn->hsp.nxb_pool, sfdata->ssib.nxb); } }
void nxd_http_client_proto_rearm(nxd_http_client_proto* hcp) { assert(hcp->nxb); nxb_empty(hcp->nxb); nxp_free(hcp->nxb_pool, hcp->nxb); hcp->nxb=0; memset(&hcp->_req, 0, sizeof(hcp->_req)); hcp->_req.nxb=hcp->nxb; hcp->_req.host=0; hcp->resp.nxb=hcp->nxb; while (hcp->events_pub.sub) nxe_unsubscribe(&hcp->events_pub, hcp->events_pub.sub); if (hcp->req_body_in.pair) nxe_disconnect_streams(hcp->req_body_in.pair, &hcp->req_body_in); if (hcp->resp_body_out.pair) nxe_disconnect_streams(&hcp->resp_body_out, hcp->resp_body_out.pair); nxe_ostream_unset_ready(&hcp->req_body_in); nxe_istream_unset_ready(&hcp->resp_body_out); nxe_ostream_unset_ready(&hcp->data_in); nxe_istream_unset_ready(&hcp->data_out); }
void nxd_http_client_proto_finalize(nxd_http_client_proto* hcp) { nxe_loop* loop=hcp->data_in.super.loop; nxe_unset_timer(loop, NXWEB_TIMER_KEEP_ALIVE, &hcp->timer_keep_alive); nxe_unset_timer(loop, NXWEB_TIMER_READ, &hcp->timer_read); nxe_unset_timer(loop, NXWEB_TIMER_WRITE, &hcp->timer_write); nxe_unset_timer(loop, NXWEB_TIMER_100CONTINUE, &hcp->timer_100_continue); if (hcp->data_error.pub) nxe_unsubscribe(hcp->data_error.pub, &hcp->data_error); while (hcp->events_pub.sub) nxe_unsubscribe(&hcp->events_pub, hcp->events_pub.sub); if (hcp->data_in.pair) nxe_disconnect_streams(hcp->data_in.pair, &hcp->data_in); if (hcp->data_out.pair) nxe_disconnect_streams(&hcp->data_out, hcp->data_out.pair); if (hcp->req_body_in.pair) nxe_disconnect_streams(hcp->req_body_in.pair, &hcp->req_body_in); if (hcp->resp_body_out.pair) nxe_disconnect_streams(&hcp->resp_body_out, hcp->resp_body_out.pair); if (hcp->nxb) { nxb_empty(hcp->nxb); nxp_free(hcp->nxb_pool, hcp->nxb); hcp->nxb=0; } }