Пример #1
0
void connections_free(server *srv) {
	connections *conns = srv->conns;
	size_t i;

	for (i = 0; i < conns->size; i++) {
		connection *con = conns->ptr[i];

		connection_reset(srv, con);

		chunkqueue_free(con->write_queue);
		chunkqueue_free(con->read_queue);
		chunkqueue_free(con->request_content_queue);
		array_free(con->request.headers);
		array_free(con->response.headers);
		array_free(con->environment);

#define CLEAN(x) \
	buffer_free(con->x);

		CLEAN(request.uri);
		CLEAN(request.request_line);
		CLEAN(request.request);
		CLEAN(request.pathinfo);

		CLEAN(request.orig_uri);

		CLEAN(uri.scheme);
		CLEAN(uri.authority);
		CLEAN(uri.path);
		CLEAN(uri.path_raw);
		CLEAN(uri.query);

		CLEAN(physical.doc_root);
		CLEAN(physical.path);
		CLEAN(physical.basedir);
		CLEAN(physical.etag);
		CLEAN(physical.rel_path);
		CLEAN(parse_request);

		CLEAN(authed_user);
		CLEAN(server_name);
		CLEAN(error_handler);
		CLEAN(dst_addr_buf);
#if defined USE_OPENSSL && ! defined OPENSSL_NO_TLSEXT
		CLEAN(tlsext_server_name);
#endif
#undef CLEAN
		free(con->plugin_ctx);
		free(con->cond_cache);

		free(con);
	}

	free(conns->ptr);
}
Пример #2
0
static void cgi_session_free(cgi_session *sess) {
	if (!sess) return;

	iosocket_free(sess->sock);
	iosocket_free(sess->sock_err);
	iosocket_free(sess->wb_sock);

	chunkqueue_free(sess->wb);
	chunkqueue_free(sess->rb);
	chunkqueue_free(sess->rb_err);

	free(sess);
}
Пример #3
0
static void handler_ctx_free(handler_ctx *hctx) {
	buffer_free(hctx->response);
	buffer_free(hctx->response_header);
	chunkqueue_free(hctx->wb);

	free(hctx);
}
Пример #4
0
static void handler_ctx_free(handler_ctx *hctx) {
      #if 0
	if (hctx->output != p->tmp_buf) {
		buffer_free(hctx->output);
	}
      #endif
	chunkqueue_free(hctx->in_queue);
	free(hctx);
}
Пример #5
0
static void handler_ctx_free(handler_ctx *hctx)
{
  if (hctx->request_queue) chunkqueue_free(hctx->request_queue);
  if (hctx->response_buf) buffer_free(hctx->response_buf);
  free(hctx);
}