Example #1
0
void li_request_clear(liRequest *req) {
	req->http_method = LI_HTTP_METHOD_UNSET;
	g_string_free(req->http_method_str, TRUE);
	req->http_version = LI_HTTP_VERSION_UNSET;

	g_string_free(req->uri.raw, TRUE);
	g_string_free(req->uri.raw_path, TRUE);
	g_string_free(req->uri.raw_orig_path, TRUE);
	g_string_free(req->uri.scheme, TRUE);
	g_string_free(req->uri.authority, TRUE);
	g_string_free(req->uri.path, TRUE);
	g_string_free(req->uri.query, TRUE);
	g_string_free(req->uri.host, TRUE);

	li_http_headers_free(req->headers);

	req->content_length = -1;
}
Example #2
0
void li_response_clear(liResponse *resp) {
	li_http_headers_free(resp->headers);
	resp->http_status = 0;
	resp->transfer_encoding = LI_HTTP_TRANSFER_ENCODING_IDENTITY;
}