rename *.cpp to *.c; renmae API. move benchmarks/* to test/decoder/http; fix TSG-22347

This commit is contained in:
lijia
2024-08-30 19:09:11 +08:00
parent 82cb1eaeeb
commit 94a75460e9
137 changed files with 815 additions and 821 deletions

View File

@@ -6,6 +6,10 @@
#include "http_decoder_result_queue.h"
#include <llhttp.h>
#ifndef hstring
#include <bits/types/struct_iovec.h>
typedef struct iovec hstring;
#endif
// only one http event is fired at a time
enum http_event
{
@@ -38,6 +42,7 @@ struct http_event_context
struct http_decoder_half;
struct http_decoder_half_data;
struct http_decoder_env;
typedef void http_event_cb(enum http_event event, struct http_decoder_half_data **data,
struct http_event_context *ev_ctx, void *httpd_plugin_env);
@@ -69,16 +74,16 @@ int http_decoder_half_data_get_response_line(struct http_decoder_half_data *data
struct http_response_line *line);
int http_decoder_half_data_get_header(const struct http_decoder_half_data *data,
const hstring *key, struct http_header *hdr_res);
const char *name, size_t name_len, struct http_header_field *hdr_res);
int http_decoder_half_data_iter_header(struct http_decoder_half_data *data,
struct http_header *header);
struct http_header_field *header);
int http_decoder_half_data_reset_header_iter(struct http_decoder_half_data *req_data);
int http_decoder_half_data_has_parsed_header(struct http_decoder_half_data *data);
int http_decoder_half_data_get_raw_body(const struct http_decoder_half_data *data, hstring *body);
int http_decoder_half_data_get_raw_body(const struct http_decoder_half_data *data, const char **body, size_t *body_len);
int http_decoder_half_data_get_decompress_body(const struct http_decoder_half_data *data, hstring *body);
int http_decoder_half_data_get_decompress_body(const struct http_decoder_half_data *data, const char **body, size_t *body_len);
void http_half_get_lastest_decompress_buffer(struct http_decoder_half_data *data, hstring *decompress_body);
void http_half_decompress_buffer_free(struct http_decoder_half_data *data, hstring *decompress_body);
void http_decoder_half_data_dump(struct http_decoder_half *half);
@@ -88,11 +93,11 @@ void http_decoder_get_url(struct http_decoder_half_data *hfdata, nmx_pool_t *mem
int http_half_data_get_decode_url(struct http_decoder_half_data *res_data, hstring *url);
void http_decoder_join_url(struct http_decoder_half_data *hfdata,
nmx_pool_t *mempool,
const struct http_header *host_hdr);
const struct http_header_field *host_hdr);
int http_decoder_join_url_finally(struct http_event_context *ev_ctx,
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_url(struct http_decoder_half_data *res_data, const char **url_val, size_t *url_len);
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);