Adjust benchmark directory,enable HTTP test,rename variables,format codes

This commit is contained in:
lijia
2024-08-16 14:58:19 +08:00
parent cd2a2360fe
commit 3cdfabb683
153 changed files with 1064 additions and 4415 deletions

View File

@@ -1,15 +1,14 @@
#ifndef _HTTP_DECODER_HALF_H_
#define _HTTP_DECODER_HALF_H_
#pragma once
#include <stddef.h>
#include "stellar/session.h"
#include "stellar/http.h"
#include "http_content_decompress.h"
#include "http_decoder_result_queue.h"
#include "llhttp.h"
#include <llhttp.h>
// only one http event is fired at a time
enum http_event {
enum http_event
{
HTTP_EVENT_REQ_INIT = 1 << 1,
HTTP_EVENT_REQ_LINE = 1 << 2,
HTTP_EVENT_REQ_HDR = 1 << 3,
@@ -29,7 +28,8 @@ enum http_event {
HTTP_EVENT_RES_END = 1 << 16,
};
struct http_event_context {
struct http_event_context
{
struct http_decoder_exdata *ref_httpd_ctx;
nmx_pool_t *ref_mempool;
struct session *ref_session;
@@ -43,12 +43,12 @@ typedef void http_event_cb(enum http_event event, struct http_decoder_half_data
struct http_event_context *ev_ctx, void *httpd_plugin_env);
struct http_decoder_half *
http_decoder_half_new(struct http_decoder_exdata *hd_ctx, nmx_pool_t *mempool, http_event_cb *event_cb,
enum llhttp_type http_type, int decompress_switch, struct http_decoder_env *httpd_env,long long start_seq);
http_decoder_half_new(struct http_decoder_exdata *hd_ctx, nmx_pool_t *mempool, http_event_cb *event_cb,
enum llhttp_type http_type, int decompress_switch, struct http_decoder_env *httpd_env, long long start_seq);
void http_decoder_half_free(nmx_pool_t *mempool, struct http_decoder_half *half);
void http_decoder_half_reinit(struct http_decoder_half *half,
void http_decoder_half_reinit(struct http_decoder_half *half,
struct http_decoder_result_queue *queue,
nmx_pool_t *mempool, struct session *sess);
@@ -56,7 +56,7 @@ int http_decoder_half_parse(int proxy_enable, struct http_decoder_half *half, co
long long http_decoder_half_trans_count(struct http_decoder_half *half);
//http decoder half data API
// http decoder half data API
struct http_decoder_half_data *
http_decoder_half_data_new(nmx_pool_t *mempool);
@@ -90,16 +90,15 @@ void http_decoder_join_url(struct http_decoder_half_data *hfdata,
nmx_pool_t *mempool,
const struct http_header *host_hdr);
int http_decoder_join_url_finally(struct http_event_context *ev_ctx,
struct http_decoder_half_data *hfdata,
nmx_pool_t *mempool);
struct http_decoder_half_data *hfdata,
nmx_pool_t *mempool);
int http_half_data_get_url(struct http_decoder_half_data *res_data, hstring *url);
int http_half_data_get_transaction_seq(struct http_decoder_half_data *hf_data);
void http_half_data_update_commit_index(struct http_decoder_half_data * half_data);
void http_half_data_update_commit_index(struct http_decoder_half_data *half_data);
void http_half_pre_context_free(struct session *sess, struct http_decoder_exdata *exdata);
void http_half_update_state(struct http_decoder_half_data *hf_data, enum http_event state);
int http_half_data_get_total_parsed_header_count(struct http_decoder_half_data * half_data);
void http_half_get_max_transaction_seq(struct http_decoder_exdata *exdata, long long *max_req_seq, long long *max_res_seq);
void http_half_update_state(struct http_decoder_half_data *hf_data, enum http_event state);
int http_half_data_get_total_parsed_header_count(struct http_decoder_half_data *half_data);
void http_half_get_max_transaction_seq(struct http_decoder_exdata *exdata, long long *max_req_seq, long long *max_res_seq);
enum http_content_encoding http_half_data_get_content_encoding(struct http_decoder_half_data *hf_data);
#endif
enum http_content_encoding http_half_data_get_content_encoding(struct http_decoder_half_data *hf_data);