summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/http_decoder.cpp111
-rw-r--r--src/http_decoder_half.cpp14
-rw-r--r--src/http_decoder_inc.h4
-rw-r--r--src/http_decoder_string.cpp2
-rw-r--r--src/http_decoder_table.cpp2
-rw-r--r--test/http_decoder_gtest.h3
-rw-r--r--test/http_decoder_test_plug.cpp238
-rw-r--r--test/http_pcap/http_gzip_out_of_order.pcapbin0 -> 33831 bytes
-rw-r--r--test/test_result_json/http_6over4_single_trans.json2
-rw-r--r--test/test_result_json/http_chunked_res_gzip.json3
-rw-r--r--test/test_result_json/http_get_encoded_uri.json6
-rw-r--r--test/test_result_json/http_get_multi_trans.json3
-rw-r--r--test/test_result_json/http_get_req_pipeline.json3
-rw-r--r--test/test_result_json/http_get_single_trans.json4
-rw-r--r--test/test_result_json/http_gzip_out_of_order.json39
-rw-r--r--test/test_result_json/http_hdr_truncated_after_kv.json16
-rw-r--r--test/test_result_json/http_hdr_truncated_in_kv.json2
-rw-r--r--test/test_result_json/http_hdr_value_empty.json4
-rw-r--r--test/test_result_json/http_hdrs_exceed_maximum.json3
-rw-r--r--test/test_result_json/http_multi_parse_error.json6
-rw-r--r--test/test_result_json/http_no_content_length.json3
-rw-r--r--test/test_result_json/http_out_of_order.json2
-rw-r--r--test/test_result_json/http_over_pppoe.json3
-rw-r--r--test/test_result_json/http_over_tcp_keepalive.json3
-rw-r--r--test/test_result_json/http_post_multipart_form_data.json12
-rw-r--r--test/test_result_json/http_post_single_trans.json4
-rw-r--r--test/test_result_json/http_req_1byte_sliding_window.json3
-rw-r--r--test/test_result_json/http_res_1byte_sliding_window.json3
-rw-r--r--test/test_result_json/http_res_gzip.json3
-rw-r--r--test/test_result_json/http_trans_pipeline.json33
-rw-r--r--test/test_result_json/http_tunnel_for_http.json2
-rw-r--r--test/test_result_json/http_tunnel_for_http_s2c.json2
-rw-r--r--test/test_result_json/http_url_test_with_host.json2
-rw-r--r--test/test_result_json/http_url_test_without_host.json3
-rw-r--r--test/test_result_json/http_zlib_deadlock.json3
-rw-r--r--test_based_on_stellar/CMakeLists.txt6
36 files changed, 347 insertions, 205 deletions
diff --git a/src/http_decoder.cpp b/src/http_decoder.cpp
index 08caaba..3960869 100644
--- a/src/http_decoder.cpp
+++ b/src/http_decoder.cpp
@@ -16,10 +16,33 @@ struct http_message *http_message_new(enum http_message_type type, struct http_d
return msg;
}
+struct http_message *http_body_message_new(enum http_message_type type, struct http_decoder_result_queue *queue,
+ int queue_index, uint8_t flow_type, hstring *raw_payload)
+{
+ struct http_message *msg = CALLOC(struct http_message, 1);
+ msg->type = type;
+ msg->ref_queue = queue;
+ msg->queue_index = queue_index;
+ msg->flow_type = flow_type;
+ msg->raw_payload.iov_base = raw_payload->iov_base;
+ msg->raw_payload.iov_len = raw_payload->iov_len;
+ return msg;
+}
+
+static void http_message_decompress_free(struct http_message *msg)
+{
+ if((msg->type == HTTP_MESSAGE_REQ_BODY)
+ || (msg->type == HTTP_MESSAGE_RES_BODY))
+ {
+ // todo, for tcp reorder, maybe receive many many tcp segment
+ }
+}
+
static void http_message_free(void *http_msg, void *cb_arg)
{
if (http_msg)
{
+ http_message_decompress_free((struct http_message *)http_msg);
FREE(http_msg);
}
}
@@ -92,7 +115,7 @@ static void http_event_handler(enum http_event event, struct http_decoder_half_d
exdata->tunnel_state = HTTP_TUN_C2S_HDR_START;
http_decoder_stat_update(&httpd_env->hd_stat, thread_id, HTTPD_STAT_TUNNEL, 1);
}
- if (httpd_is_tunnel_session(httpd_env,exdata))
+ if (httpd_is_tunnel_session(httpd_env, exdata))
{
http_decoder_get_url(half_data, mempool);
}
@@ -128,8 +151,12 @@ static void http_event_handler(enum http_event event, struct http_decoder_half_d
session_mq_publish_message(ev_ctx->ref_session, exdata->pub_topic_id, msg);
break;
case HTTP_EVENT_REQ_BODY_DATA:
- msg = http_message_new(HTTP_MESSAGE_REQ_BODY, queue, queue_idx, HTTP_REQUEST);
+ {
+ hstring raw_body = {};
+ http_decoder_half_data_get_raw_body(half_data, &raw_body);
+ msg = http_body_message_new(HTTP_MESSAGE_REQ_BODY, queue, queue_idx, HTTP_REQUEST, &raw_body);
session_mq_publish_message(ev_ctx->ref_session, exdata->pub_topic_id, msg);
+ }
break;
case HTTP_EVENT_REQ_BODY_END:
msg = http_message_new(HTTP_MESSAGE_REQ_BODY_END, queue, queue_idx, HTTP_REQUEST);
@@ -146,7 +173,7 @@ static void http_event_handler(enum http_event event, struct http_decoder_half_d
http_decoder_stat_update(&httpd_env->hd_stat, thread_id, HTTPD_STAT_TRANSACTION_FREE, 1);
http_decoder_stat_update(&httpd_env->hd_stat, thread_id, HTTPD_STAT_ASYMMETRY_TRANSACTION_C2S, 1);
}
- if (httpd_is_tunnel_session(httpd_env,exdata))
+ if (httpd_is_tunnel_session(httpd_env, exdata))
{
if (SESSION_SEEN_C2S_FLOW == flow_flag)
{
@@ -236,7 +263,7 @@ static void http_event_handler(enum http_event event, struct http_decoder_half_d
int tot_s2c_headers = http_half_data_get_total_parsed_header_count(half_data);
http_decoder_stat_update(&httpd_env->hd_stat, thread_id, HTTPD_STAT_HEADERS_S2C, tot_s2c_headers);
- if (httpd_is_tunnel_session(httpd_env,exdata))
+ if (httpd_is_tunnel_session(httpd_env, exdata))
{
exdata->tunnel_state = HTTP_TUN_INNER_STARTING;
http_half_pre_context_free(ev_ctx->ref_session, exdata);
@@ -249,8 +276,12 @@ static void http_event_handler(enum http_event event, struct http_decoder_half_d
session_mq_publish_message(ev_ctx->ref_session, exdata->pub_topic_id, msg);
break;
case HTTP_EVENT_RES_BODY_DATA:
- msg = http_message_new(HTTP_MESSAGE_RES_BODY, queue, queue_idx, HTTP_RESPONSE);
+ {
+ hstring raw_body = {};
+ http_decoder_half_data_get_raw_body(half_data, &raw_body);
+ msg = http_body_message_new(HTTP_MESSAGE_RES_BODY, queue, queue_idx, HTTP_RESPONSE, &raw_body);
session_mq_publish_message(ev_ctx->ref_session, exdata->pub_topic_id, msg);
+ }
break;
case HTTP_EVENT_RES_BODY_END:
msg = http_message_new(HTTP_MESSAGE_RES_BODY_END, queue, queue_idx, HTTP_RESPONSE);
@@ -497,40 +528,35 @@ static int http_msg_request_header_next(const struct http_message *msg,
return http_decoder_half_data_iter_header((struct http_decoder_half_data *)req_data, hdr);
}
-static int http_msg_response_header_next(const struct http_message *msg,
- struct http_header *hdr)
+static int http_msg_response_header_next(const struct http_message *msg, struct http_header *hdr)
{
const struct http_decoder_half_data *res_data =
msg->ref_queue->array[msg->queue_index].res_data;
return http_decoder_half_data_iter_header((struct http_decoder_half_data *)res_data, hdr);
}
-static int http_msg_get_request_raw_body(const struct http_message *msg,
- hstring *body)
+static int http_msg_get_request_raw_body(const struct http_message *msg, hstring *body)
{
const struct http_decoder_half_data *req_data =
msg->ref_queue->array[msg->queue_index].req_data;
return http_decoder_half_data_get_raw_body(req_data, body);
}
-static int http_msg_get_response_raw_body(const struct http_message *msg,
- hstring *body)
+static int http_msg_get_response_raw_body(const struct http_message *msg, hstring *body)
{
const struct http_decoder_half_data *res_data =
msg->ref_queue->array[msg->queue_index].res_data;
return http_decoder_half_data_get_raw_body(res_data, body);
}
-static int http_msg_get_request_decompress_body(const struct http_message *msg,
- hstring *body)
+static int http_msg_get_request_decompress_body(const struct http_message *msg, hstring *body)
{
const struct http_decoder_half_data *req_data =
msg->ref_queue->array[msg->queue_index].req_data;
return http_decoder_half_data_get_decompress_body(req_data, body);
}
-static int http_msg_get_response_decompress_body(const struct http_message *msg,
- hstring *body)
+static int http_msg_get_response_decompress_body(const struct http_message *msg, hstring *body)
{
const struct http_decoder_half_data *res_data =
msg->ref_queue->array[msg->queue_index].res_data;
@@ -601,7 +627,7 @@ extern "C"
static void http_decoder_execute(struct session *sess, struct http_decoder_env *httpd_env, http_decoder_exdata *exdata, const char *payload, uint16_t payload_len)
{
- if (httpd_in_tunnel_transmitting(httpd_env,exdata))
+ if (httpd_in_tunnel_transmitting(httpd_env, exdata))
{
http_decoder_push_tunnel_data(sess, exdata, httpd_tunnel_state_to_msg(exdata), payload, payload_len);
httpd_tunnel_state_update(exdata);
@@ -624,7 +650,7 @@ extern "C"
http_decoder_stat_update(&httpd_env->hd_stat, thread_id, HTTPD_STAT_TCP_SEG_S2C, 1);
}
- http_decoder_half_reinit(cur_half, exdata->queue, exdata->mempool, sess);
+ http_decoder_half_reinit(cur_half, exdata->queue, exdata->mempool, sess);
int ret = http_decoder_half_parse(httpd_env->hd_cfg.proxy_enable, cur_half, payload, payload_len);
if (ret < 0)
{
@@ -725,7 +751,7 @@ extern "C"
if (SESSION_STATE_CLOSED == sess_state)
{
- if (httpd_in_tunnel_transmitting(httpd_env,exdata))
+ if (httpd_in_tunnel_transmitting(httpd_env, exdata))
{
http_decoder_push_tunnel_data(sess, exdata, HTTP_TUNNEL_CLOSING, NULL, 0);
}
@@ -743,7 +769,7 @@ extern "C"
{
return;
}
- if (NULL == exdata)//first packet
+ if (NULL == exdata) // first packet
{
size_t http_identify_len = payload_len > HTTP_IDENTIFY_LEN ? HTTP_IDENTIFY_LEN : payload_len;
int ret = http_protocol_identify(payload, http_identify_len);
@@ -936,8 +962,7 @@ extern "C"
return;
}
- int http_message_header_next(const struct http_message *msg,
- struct http_header *header)
+ int http_message_header_next(const struct http_message *msg, struct http_header *header)
{
int ret = 1;
if (unlikely(NULL == msg))
@@ -991,8 +1016,7 @@ extern "C"
return -1;
}
- void http_message_raw_body_get0(const struct http_message *msg,
- hstring *body)
+ void http_message_raw_body_get0(const struct http_message *msg, hstring *body)
{
int ret = -1;
if (unlikely(NULL == msg))
@@ -1001,19 +1025,12 @@ extern "C"
}
assert(msg->ref_queue);
assert(msg->queue_index < HD_RESULT_QUEUE_LEN);
- if (HTTP_MESSAGE_REQ_BODY == msg->type)
+ if(msg->raw_payload.iov_base != NULL && msg->raw_payload.iov_len != 0)
{
- ret = http_msg_get_request_raw_body(msg, body);
- }
- else if (HTTP_MESSAGE_RES_BODY == msg->type)
- {
- ret = http_msg_get_response_raw_body(msg, body);
- }
- if (ret < 0)
- {
- goto fail;
+ body->iov_base = msg->raw_payload.iov_base;
+ body->iov_len = msg->raw_payload.iov_len;
+ return;
}
- return;
fail:
if (body)
{
@@ -1023,8 +1040,7 @@ extern "C"
return;
}
- void http_message_decompress_body_get0(const struct http_message *msg,
- hstring *body)
+ void http_message_decompress_body_get0(const struct http_message *msg, hstring *decompress_body)
{
int ret = -1;
if (unlikely(NULL == msg))
@@ -1033,24 +1049,21 @@ extern "C"
}
assert(msg->ref_queue);
assert(msg->queue_index < HD_RESULT_QUEUE_LEN);
- if (HTTP_MESSAGE_REQ_BODY == msg->type)
- {
- ret = http_msg_get_request_decompress_body(msg, body);
+ if(msg->decompress_payload.iov_base !=NULL && msg->decompress_payload.iov_len != 0){
+ decompress_body->iov_base = msg->decompress_payload.iov_base;
+ decompress_body->iov_len = msg->decompress_payload.iov_len;
+ return;
}
- else if (HTTP_MESSAGE_RES_BODY == msg->type)
- {
- ret = http_msg_get_response_decompress_body(msg, body);
- }
- if (ret < 0)
- {
- goto fail;
+ if(msg->raw_payload.iov_base != NULL && msg->raw_payload.iov_len != 0){
+ decompress_body->iov_base = msg->raw_payload.iov_base;
+ decompress_body->iov_len = msg->raw_payload.iov_len;
}
return;
fail:
- if (body)
+ if (decompress_body)
{
- body->iov_base = NULL;
- body->iov_len = 0;
+ decompress_body->iov_base = NULL;
+ decompress_body->iov_len = 0;
}
return;
}
diff --git a/src/http_decoder_half.cpp b/src/http_decoder_half.cpp
index 9ed171c..c4356fd 100644
--- a/src/http_decoder_half.cpp
+++ b/src/http_decoder_half.cpp
@@ -69,8 +69,7 @@ static void printf_debug_info(const char *desc, const char *at, size_t length)
#define printf_debug_info(desc, at, length)
#endif
-static void
-http_decoder_half_data_decompress(struct http_decoder_half_data *data)
+static void http_decoder_half_data_decompress(struct http_decoder_half_data *data)
{
assert(data);
@@ -521,8 +520,7 @@ static int on_body(llhttp_t *http, const char *at, size_t length)
http_decoder_table_commit(half->ref_data->table, HTTP_ITEM_BODY);
}
- if (1 == half->decompress_switch &&
- half->ref_data->content_encoding != HTTP_CONTENT_ENCODING_NONE)
+ if (1 == half->decompress_switch && half->ref_data->content_encoding != HTTP_CONTENT_ENCODING_NONE)
{
http_decoder_half_data_decompress(half->ref_data);
}
@@ -620,7 +618,7 @@ void http_decoder_half_reinit(struct http_decoder_half *half,
if (half->ref_data != NULL)
{
http_decoder_table_reinit(half->ref_data->table);
- }
+ }
half->http_ev_ctx->ref_mempool = mempool;
half->http_ev_ctx->ref_session = sess;
half->http_ev_ctx->ref_queue = queue;
@@ -883,8 +881,7 @@ int http_decoder_half_data_has_parsed_header(struct http_decoder_half_data *data
return http_decoder_table_has_parsed_header(data->table);
}
-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, hstring *body)
{
if (NULL == data || NULL == body)
{
@@ -893,8 +890,7 @@ int http_decoder_half_data_get_raw_body(const struct http_decoder_half_data *dat
return http_decoder_table_get_body(data->table, body);
}
-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, hstring *body)
{
if (HTTP_CONTENT_ENCODING_NONE == data->content_encoding)
{
diff --git a/src/http_decoder_inc.h b/src/http_decoder_inc.h
index b78d586..ac5a679 100644
--- a/src/http_decoder_inc.h
+++ b/src/http_decoder_inc.h
@@ -94,6 +94,8 @@ struct http_message
enum http_message_type type;
size_t queue_index;
struct http_decoder_result_queue *ref_queue;
+ hstring raw_payload;//cause tcp reorder, maybe receive many tcp segments for one packet
+ hstring decompress_payload;
hstring tunnel_payload;
};
@@ -150,6 +152,8 @@ struct http_message;
struct http_message *http_message_new(enum http_message_type type, struct http_decoder_result_queue *queue,
int queue_index, unsigned char flow_type);
+struct http_message *http_body_message_new(enum http_message_type type, struct http_decoder_result_queue *queue,
+ int queue_index, uint8_t flow_type, hstring *raw_payload);
int http_topic_exdata_compose_get_index(const struct http_decoder_env *httpd_env, int by_topic_id);
#ifdef __cplusplus
}
diff --git a/src/http_decoder_string.cpp b/src/http_decoder_string.cpp
index c74030c..d54d22b 100644
--- a/src/http_decoder_string.cpp
+++ b/src/http_decoder_string.cpp
@@ -207,11 +207,13 @@ void http_decoder_string_reinit(struct http_decoder_string *rstr)
rstr->cache.iov_len = 0;
}
+#if 0
rstr->refer.iov_base = NULL;
rstr->refer.iov_len = 0;
rstr->commit.iov_base = NULL;
rstr->commit.iov_len = 0;
rstr->state = STRING_STATE_INIT;
+#endif
}
enum string_state http_decoder_string_state(const struct http_decoder_string *rstr)
diff --git a/src/http_decoder_table.cpp b/src/http_decoder_table.cpp
index 0ed6313..b58154f 100644
--- a/src/http_decoder_table.cpp
+++ b/src/http_decoder_table.cpp
@@ -354,7 +354,7 @@ void http_decoder_table_reinit(struct http_decoder_table *table)
http_decoder_string_reinit(&header->key);
http_decoder_string_reinit(&header->val);
}
-
+
http_decoder_string_reinit(&table->body);
}
diff --git a/test/http_decoder_gtest.h b/test/http_decoder_gtest.h
index 7ce8b0d..a38e6f4 100644
--- a/test/http_decoder_gtest.h
+++ b/test/http_decoder_gtest.h
@@ -55,7 +55,8 @@ extern "C"
#define GTEST_HTTP_TRANS_SEQ_NAME "__X_HTTP_TRANSACTION_SEQ"
#define GTEST_HTTP_TUPLE4_NAME "__X_HTTP_TUPLE4"
#define GTEST_HTTP_PAYLOAD_NAME "__X_HTTP_PAYLOAD"
-#define GTEST_HTTP_PAYLOAD_MD5_NAME "__X_HTTP_PAYLOAD_MD5"
+#define GTEST_HTTP_RAW_PAYLOAD_MD5_NAME "__X_HTTP_RAW_PAYLOAD_MD5"
+#define GTEST_HTTP_DECOMPRESS_PAYLOAD_MD5_NAME "__X_HTTP_DECOMPRESS_PAYLOAD_MD5"
struct stellar *stellar_init(void);
void stellar_destroy(struct stellar *st);
diff --git a/test/http_decoder_test_plug.cpp b/test/http_decoder_test_plug.cpp
index 50206a3..4c1dd0f 100644
--- a/test/http_decoder_test_plug.cpp
+++ b/test/http_decoder_test_plug.cpp
@@ -24,9 +24,10 @@ extern "C"
#endif
#define MAX_KEY_STR_LEN 2048
-#define GTEST_PLUG_ENTRY_CFG "./etc/http/gtest_entry.toml"
+#define GTEST_PLUG_ENTRY_CFG "./etc/http/gtest_entry.toml"
-struct plug_entry_t{
+struct plug_entry_t
+{
const char *name;
on_session_msg_cb_func *entry;
};
@@ -35,8 +36,7 @@ static struct plug_entry_t g_entry_tbl[] = {
{"http_decoder_test_entry", http_decoder_test_entry},
{"http_decoder_test_state_entry", http_decoder_test_state_entry},
{"http_decoder_tunnel_entry", http_decoder_tunnel_entry},
- {NULL, NULL}
-};
+ {NULL, NULL}};
enum http_transaction_type
{
@@ -46,10 +46,17 @@ enum http_transaction_type
HTTP_TRANSACTION_MAX
};
+enum payload_compress_mode
+{
+ PAYLOAD_RAW = 0,
+ PAYLOAD_DECOMPRESS = 1,
+ PAYLOAD_MAX = 2,
+};
+
struct gtest_plug_exdata_t
{
cJSON *result_jnode[HTTP_TRANSACTION_MAX];
- MD5_CTX *md5ctx[HTTP_TRANSACTION_MAX];
+ MD5_CTX *payload_md5ctx[PAYLOAD_MAX][HTTP_TRANSACTION_MAX];
};
static int g_result_count = 0;
@@ -58,8 +65,6 @@ static int g_http_gtest_plugin_id = -1;
static int g_exdata_idx = -1;
static int g_topic_id = -1;
-
-
#if 0
void output_http_req_line(struct http_request_line *req_line)
{
@@ -125,18 +130,19 @@ void output_http_body(hstring *body, int decompress_flag)
}
#endif
-static void append_http_payload(struct session *sess, struct gtest_plug_exdata_t *gtest_plug_exdata, const hstring *body, enum http_transaction_type type)
+static void append_http_payload(struct session *sess, struct gtest_plug_exdata_t *gtest_plug_exdata, enum payload_compress_mode mode,
+ const hstring *body, enum http_transaction_type type)
{
if (NULL == body->iov_base || 0 == body->iov_len)
{
return;
}
- if (NULL == gtest_plug_exdata->md5ctx[type])
+ if (NULL == gtest_plug_exdata->payload_md5ctx[mode][type])
{
- gtest_plug_exdata->md5ctx[type] = MMALLOC(MD5_CTX, sizeof(MD5_CTX));
- MD5Init(gtest_plug_exdata->md5ctx[type]);
+ gtest_plug_exdata->payload_md5ctx[mode][type] = MMALLOC(MD5_CTX, sizeof(MD5_CTX));
+ MD5Init(gtest_plug_exdata->payload_md5ctx[mode][type]);
}
- MD5Update(gtest_plug_exdata->md5ctx[type], (unsigned char *)body->iov_base, body->iov_len);
+ MD5Update(gtest_plug_exdata->payload_md5ctx[mode][type], (unsigned char *)body->iov_base, body->iov_len);
}
int http_field_to_json(cJSON *object, const char *key, char *val, size_t val_len)
@@ -186,7 +192,8 @@ void res_line_to_json(cJSON *ctx, struct http_response_line *res_line)
void http_header_to_json(cJSON *ctx, struct http_header *header)
{
char key[MAX_KEY_STR_LEN] = {0};
- if((header->key.iov_base == NULL) || (header->val.iov_base == NULL)){
+ if ((header->key.iov_base == NULL) || (header->val.iov_base == NULL))
+ {
return;
}
@@ -215,7 +222,7 @@ void http_url_add_to_json(cJSON *ctx, struct http_message *msg)
}
http_message_raw_url_get0(msg, &raw_url_result);
- if(raw_url_result.iov_base == NULL)
+ if (raw_url_result.iov_base == NULL)
{
return;
}
@@ -231,7 +238,8 @@ void http_url_add_to_json(cJSON *ctx, struct http_message *msg)
hstring decode_url_result = {};
struct http_header decode_url_header_result = {};
http_message_decoded_url_get0(msg, &decode_url_result);
- if(decode_url_result.iov_len != raw_url_result.iov_len){
+ if (decode_url_result.iov_len != raw_url_result.iov_len)
+ {
decode_url_header_result.key.iov_base = (char *)"__X_HTTP_DECODED_URL";
decode_url_header_result.key.iov_len = strlen("__X_HTTP_DECODED_URL");
decode_url_header_result.val = decode_url_result;
@@ -239,38 +247,49 @@ void http_url_add_to_json(cJSON *ctx, struct http_message *msg)
}
}
-// Full duplex
-static void commit_last_half_flow_data(struct gtest_plug_exdata_t *gtest_plug_exdata,
- struct http_message *msg, enum http_transaction_type type, int final)
+static void commit_payload_md5sum(cJSON *last_jnode, struct gtest_plug_exdata_t *gtest_plug_exdata, enum http_transaction_type type)
{
- char result_name[MAX_KEY_STR_LEN] = {0};
-
- cJSON *last_jnode = gtest_plug_exdata->result_jnode[type];
- if (last_jnode)
+ // finish md5 streming hash
+ for (int mode = 0; mode < PAYLOAD_MAX; mode++)
{
- // finish md5 streming hash
- if (gtest_plug_exdata->md5ctx[type])
+ if (gtest_plug_exdata->payload_md5ctx[mode][type])
{
unsigned char md5_result_bin[16] = {0};
unsigned char md5_result_cstr[33] = {0};
- MD5Final(md5_result_bin, gtest_plug_exdata->md5ctx[type]);
+ MD5Final(md5_result_bin, gtest_plug_exdata->payload_md5ctx[mode][type]);
for (int i = 0; i < 16; i++)
sprintf((char *)md5_result_cstr + 2 * i, "%02x", md5_result_bin[i]);
md5_result_cstr[32] = '\0';
-
- cJSON_AddStringToObject(last_jnode, GTEST_HTTP_PAYLOAD_MD5_NAME, (char *)md5_result_cstr);
- FREE(gtest_plug_exdata->md5ctx[type]);
- gtest_plug_exdata->md5ctx[type] = NULL;
+ if(mode == PAYLOAD_RAW){
+ cJSON_AddStringToObject(last_jnode, GTEST_HTTP_RAW_PAYLOAD_MD5_NAME, (char *)md5_result_cstr);
+ }else{
+ cJSON_AddStringToObject(last_jnode, GTEST_HTTP_DECOMPRESS_PAYLOAD_MD5_NAME, (char *)md5_result_cstr);
+ }
+ FREE(gtest_plug_exdata->payload_md5ctx[mode][type]);
+ gtest_plug_exdata->payload_md5ctx[mode][type] = NULL;
}
+ }
+}
+
+// Full duplex
+static void commit_last_half_flow_data(struct gtest_plug_exdata_t *gtest_plug_exdata,
+ struct http_message *msg, enum http_transaction_type type, int final)
+{
+ char result_name[MAX_KEY_STR_LEN] = {0};
+ cJSON *last_jnode = gtest_plug_exdata->result_jnode[type];
+ if (last_jnode)
+ {
+ commit_payload_md5sum(last_jnode, gtest_plug_exdata, type);
sprintf(result_name, "%d", g_result_count);
commit_test_result_json(last_jnode, result_name);
gtest_plug_exdata->result_jnode[type] = NULL;
g_result_count++;
}
- if(0 == final){
+ if (0 == final)
+ {
gtest_plug_exdata->result_jnode[type] = cJSON_CreateObject();
if (HTTP_TRANSACTION_REQ == type)
{
@@ -292,7 +311,8 @@ static void http_decoder_test_update_session_tuple4(struct session *sess, struct
if (gtest_plug_exdata->result_jnode[HTTP_TRANSACTION_SESSION] == NULL)
{
const char *human_addr_cstr = session_get0_readable_addr(sess);
- if(NULL == human_addr_cstr){
+ if (NULL == human_addr_cstr)
+ {
fprintf(stderr, "can't get readable_addr, to use session_get0_readable_addr() the sapp_log.conf level must <= INFO\n");
return;
}
@@ -349,18 +369,20 @@ static int get_gtest_plug_entry(const char *cfg_path, char *entry_name, int max_
static void set_gtest_plug_entry(const char *entry_name)
{
- if(NULL == entry_name){
- g_entry_fun = http_decoder_test_entry; //set default
+ if (NULL == entry_name)
+ {
+ g_entry_fun = http_decoder_test_entry; // set default
return;
}
for (size_t i = 0; g_entry_tbl[i].name != NULL; i++)
{
- if(strcmp(entry_name, g_entry_tbl[i].name) == 0){
+ if (strcmp(entry_name, g_entry_tbl[i].name) == 0)
+ {
g_entry_fun = g_entry_tbl[i].entry;
return;
}
}
- g_entry_fun = http_decoder_test_entry; //set default
+ g_entry_fun = http_decoder_test_entry; // set default
}
extern "C" void http_decoder_test_entry(struct session *sess, int topic_id, const void *raw_msg, void *no_use_ctx, void *plugin_env)
@@ -409,11 +431,19 @@ extern "C" void http_decoder_test_entry(struct session *sess, int topic_id, cons
break;
case HTTP_MESSAGE_REQ_BODY_START:
case HTTP_MESSAGE_REQ_BODY:
- // http_message_get_request_raw_body(msg, &body);
+ memset(&body, 0, sizeof(hstring));
+ http_message_raw_body_get0(msg, &body);
+ if (body.iov_base && body.iov_len)
+ {
+ append_http_payload(sess, gtest_plug_exdata, PAYLOAD_RAW, &body, HTTP_TRANSACTION_REQ);
+ }
// output_http_body(&body, 0);
http_message_decompress_body_get0(msg, &body);
// output_http_body(&body, 1);
- append_http_payload(sess, gtest_plug_exdata, &body, HTTP_TRANSACTION_REQ);
+ if (body.iov_base && body.iov_len)
+ {
+ append_http_payload(sess, gtest_plug_exdata, PAYLOAD_DECOMPRESS, &body, HTTP_TRANSACTION_REQ);
+ }
break;
case HTTP_MESSAGE_RES_LINE:
commit_last_half_flow_data(gtest_plug_exdata, msg, HTTP_TRANSACTION_RES, 0);
@@ -429,11 +459,20 @@ extern "C" void http_decoder_test_entry(struct session *sess, int topic_id, cons
break;
case HTTP_MESSAGE_RES_BODY_START:
case HTTP_MESSAGE_RES_BODY:
- // http_message_get_response_raw_body(msg, &body);
+ memset(&body, 0, sizeof(hstring));
+ http_message_raw_body_get0(msg, &body);
+ if (body.iov_base && body.iov_len)
+ {
+ append_http_payload(sess, gtest_plug_exdata, PAYLOAD_RAW, &body, HTTP_TRANSACTION_RES);
+ }
// output_http_body(&body, 0);
+ memset(&body, 0, sizeof(hstring));
http_message_decompress_body_get0(msg, &body);
// output_http_body(&body, 1);
- append_http_payload(sess, gtest_plug_exdata, &body, HTTP_TRANSACTION_RES);
+ if (body.iov_base && body.iov_len)
+ {
+ append_http_payload(sess, gtest_plug_exdata, PAYLOAD_DECOMPRESS, &body, HTTP_TRANSACTION_RES);
+ }
break;
// to do: check payload
@@ -463,10 +502,10 @@ void http_decoder_test_exdata_free(int idx, void *ex_ptr, void *arg)
static int update_config_file(const char *filename, const char *key, const char *value)
{
- char cmd_buf[1024] = {};
- snprintf(cmd_buf, 1024, "sed 's/^[ \t]*%s=.*/%s=%s/g' -i %s", key, key, value, filename);
- int ret = system(cmd_buf);
- return ret;
+ char cmd_buf[1024] = {};
+ snprintf(cmd_buf, 1024, "sed 's/^[ \t]*%s=.*/%s=%s/g' -i %s", key, key, value, filename);
+ int ret = system(cmd_buf);
+ return ret;
}
extern "C" void http_decoder_test_state_entry(struct session *sess, int topic_id, const void *raw_msg, void *no_use_ctx, void *plugin_env)
@@ -486,30 +525,41 @@ extern "C" void http_decoder_test_state_entry(struct session *sess, int topic_id
session_exdata_set(sess, g_exdata_idx, gtest_plug_exdata);
}
- if (http_message_type_is_req(sess, msg_type)){
+ if (http_message_type_is_req(sess, msg_type))
+ {
json_object = gtest_plug_exdata->result_jnode[HTTP_TRANSACTION_REQ];
- }else{
+ }
+ else
+ {
json_object = gtest_plug_exdata->result_jnode[HTTP_TRANSACTION_RES];
}
- if(HTTP_TRANSACTION_END == msg_type){
+ if (HTTP_TRANSACTION_END == msg_type)
+ {
unsigned char flow_flag;
session_is_symmetric(sess, &flow_flag);
- if(SESSION_SEEN_C2S_FLOW == flow_flag){
+ if (SESSION_SEEN_C2S_FLOW == flow_flag)
+ {
json_object = gtest_plug_exdata->result_jnode[HTTP_TRANSACTION_REQ];
}
- else if(SESSION_SEEN_S2C_FLOW == flow_flag){
+ else if (SESSION_SEEN_S2C_FLOW == flow_flag)
+ {
json_object = gtest_plug_exdata->result_jnode[HTTP_TRANSACTION_RES];
- }else{ // is symmetric
+ }
+ else
+ { // is symmetric
json_object = gtest_plug_exdata->result_jnode[HTTP_TRANSACTION_RES];
}
}
- int cur_transaction_id = http_message_get_transaction_seq((const http_message* )raw_msg);
+ int cur_transaction_id = http_message_get_transaction_seq((const http_message *)raw_msg);
- if(HTTP_TRANSACTION_START ==msg_type || HTTP_TRANSACTION_END == msg_type){
+ if (HTTP_TRANSACTION_START == msg_type || HTTP_TRANSACTION_END == msg_type)
+ {
snprintf(msg_index_name, sizeof(msg_index_name), "msg_%d", msg_index++);
- snprintf(msg_index_value, sizeof(msg_index_value), "%s_transaction_%d", http_message_type_to_string(msg_type), cur_transaction_id);
- cJSON_AddStringToObject(json_object, msg_index_name, msg_index_value);
- }else{
+ snprintf(msg_index_value, sizeof(msg_index_value), "%s_transaction_%d", http_message_type_to_string(msg_type), cur_transaction_id);
+ cJSON_AddStringToObject(json_object, msg_index_name, msg_index_value);
+ }
+ else
+ {
snprintf(msg_index_name, sizeof(msg_index_name), "msg_%d", msg_index++);
cJSON_AddStringToObject(json_object, msg_index_name, http_message_type_to_string(msg_type));
}
@@ -524,57 +574,61 @@ extern "C" void http_decoder_tunnel_entry(struct session *sess, int topic_id, co
static size_t res_payload_block = 0, res_payload_size = 0;
gtest_plug_exdata = (struct gtest_plug_exdata_t *)session_exdata_get(sess, g_exdata_idx);
- switch(tmsg_type){
- case HTTP_TUNNEL_OPENING:
+ switch (tmsg_type)
+ {
+ case HTTP_TUNNEL_OPENING:
+ {
+ if (NULL == gtest_plug_exdata)
{
- if (NULL == gtest_plug_exdata)
- {
- gtest_plug_exdata = (struct gtest_plug_exdata_t *)calloc(1, sizeof(struct gtest_plug_exdata_t));
- session_exdata_set(sess, g_exdata_idx, gtest_plug_exdata);
- }
- const char *human_addr_cstr = session_get0_readable_addr(sess);
- gtest_plug_exdata->result_jnode[HTTP_TRANSACTION_REQ] = cJSON_CreateObject();
- gtest_plug_exdata->result_jnode[HTTP_TRANSACTION_RES] = cJSON_CreateObject();
- gtest_plug_exdata->result_jnode[HTTP_TRANSACTION_SESSION] = cJSON_CreateObject();
- cJSON_AddStringToObject(gtest_plug_exdata->result_jnode[HTTP_TRANSACTION_SESSION], GTEST_HTTP_TUPLE4_NAME, human_addr_cstr);
- commit_test_result_json(gtest_plug_exdata->result_jnode[HTTP_TRANSACTION_SESSION], "TUNNEL_NEW");
+ gtest_plug_exdata = (struct gtest_plug_exdata_t *)calloc(1, sizeof(struct gtest_plug_exdata_t));
+ session_exdata_set(sess, g_exdata_idx, gtest_plug_exdata);
}
+ const char *human_addr_cstr = session_get0_readable_addr(sess);
+ gtest_plug_exdata->result_jnode[HTTP_TRANSACTION_REQ] = cJSON_CreateObject();
+ gtest_plug_exdata->result_jnode[HTTP_TRANSACTION_RES] = cJSON_CreateObject();
+ gtest_plug_exdata->result_jnode[HTTP_TRANSACTION_SESSION] = cJSON_CreateObject();
+ cJSON_AddStringToObject(gtest_plug_exdata->result_jnode[HTTP_TRANSACTION_SESSION], GTEST_HTTP_TUPLE4_NAME, human_addr_cstr);
+ commit_test_result_json(gtest_plug_exdata->result_jnode[HTTP_TRANSACTION_SESSION], "TUNNEL_NEW");
+ }
// OPENING state has payload, go on
- case HTTP_TUNNEL_ACTIVE:
+ case HTTP_TUNNEL_ACTIVE:
+ {
+ enum flow_direction curdir = session_get_current_flow_direction(sess);
+ hstring tunnel_payload = {};
+ http_tunnel_message_get_payload((const struct http_tunnel_message *)raw_msg, &tunnel_payload);
+ if (FLOW_DIRECTION_C2S == curdir)
{
- enum flow_direction curdir = session_get_current_flow_direction(sess);
- hstring tunnel_payload = {};
- http_tunnel_message_get_payload((const struct http_tunnel_message *)raw_msg, &tunnel_payload);
- if(FLOW_DIRECTION_C2S == curdir){
- req_payload_block++;
- req_payload_size += tunnel_payload.iov_len;
- }else{
- res_payload_block++;
- res_payload_size += tunnel_payload.iov_len;
- }
+ req_payload_block++;
+ req_payload_size += tunnel_payload.iov_len;
}
- break;
- case HTTP_TUNNEL_CLOSING:
+ else
{
- cJSON_AddStringToObject(gtest_plug_exdata->result_jnode[HTTP_TRANSACTION_REQ], "flow", "C2S");
- cJSON_AddStringToObject(gtest_plug_exdata->result_jnode[HTTP_TRANSACTION_RES], "flow", "S2C");
- cJSON_AddNumberToObject(gtest_plug_exdata->result_jnode[HTTP_TRANSACTION_REQ], "payload_block", req_payload_block);
- cJSON_AddNumberToObject(gtest_plug_exdata->result_jnode[HTTP_TRANSACTION_REQ], "payload_size", req_payload_size);
- cJSON_AddNumberToObject(gtest_plug_exdata->result_jnode[HTTP_TRANSACTION_RES], "payload_block", res_payload_block);
- cJSON_AddNumberToObject(gtest_plug_exdata->result_jnode[HTTP_TRANSACTION_RES], "payload_size", res_payload_size);
+ res_payload_block++;
+ res_payload_size += tunnel_payload.iov_len;
}
+ }
+ break;
+ case HTTP_TUNNEL_CLOSING:
+ {
+ cJSON_AddStringToObject(gtest_plug_exdata->result_jnode[HTTP_TRANSACTION_REQ], "flow", "C2S");
+ cJSON_AddStringToObject(gtest_plug_exdata->result_jnode[HTTP_TRANSACTION_RES], "flow", "S2C");
+ cJSON_AddNumberToObject(gtest_plug_exdata->result_jnode[HTTP_TRANSACTION_REQ], "payload_block", req_payload_block);
+ cJSON_AddNumberToObject(gtest_plug_exdata->result_jnode[HTTP_TRANSACTION_REQ], "payload_size", req_payload_size);
+ cJSON_AddNumberToObject(gtest_plug_exdata->result_jnode[HTTP_TRANSACTION_RES], "payload_block", res_payload_block);
+ cJSON_AddNumberToObject(gtest_plug_exdata->result_jnode[HTTP_TRANSACTION_RES], "payload_size", res_payload_size);
+ }
+ break;
+ default:
+ assert(0);
break;
- default:
- assert(0);
- break;
}
}
extern "C" void *http_decoder_test_init(struct stellar *st)
{
g_http_gtest_plugin_id = stellar_session_plugin_register(st, NULL, NULL, NULL);
- g_exdata_idx = stellar_exdata_new_index(st, "HTTP_DECODER_GTEST_EXDATA",http_decoder_test_exdata_free, NULL);
+ g_exdata_idx = stellar_exdata_new_index(st, "HTTP_DECODER_GTEST_EXDATA", http_decoder_test_exdata_free, NULL);
if (g_exdata_idx < 0)
{
printf("[%s:%d]: can't get http_decoder exdata index !!!\n", __FUNCTION__, __LINE__);
@@ -583,14 +637,14 @@ extern "C" void *http_decoder_test_init(struct stellar *st)
char entry_name[64] = "";
char topic_name[64] = "";
- get_gtest_plug_entry(GTEST_PLUG_ENTRY_CFG, entry_name, sizeof(entry_name)-1, topic_name, sizeof(topic_name)-1);
+ get_gtest_plug_entry(GTEST_PLUG_ENTRY_CFG, entry_name, sizeof(entry_name) - 1, topic_name, sizeof(topic_name) - 1);
set_gtest_plug_entry(entry_name);
g_topic_id = stellar_mq_get_topic_id(st, topic_name);
if (g_topic_id < 0)
{
printf("[%s:%d]: can't get http_decoder topic:%s id !!!\n", __FUNCTION__, __LINE__, topic_name);
return NULL;
- }
+ }
stellar_session_mq_subscribe(st, g_topic_id, g_entry_fun, g_http_gtest_plugin_id);
printf("http_decoder_gtest_init succ, plugin_id:%d, sub_topic_id:%d\n", g_http_gtest_plugin_id, g_topic_id);
diff --git a/test/http_pcap/http_gzip_out_of_order.pcap b/test/http_pcap/http_gzip_out_of_order.pcap
new file mode 100644
index 0000000..ac62766
--- /dev/null
+++ b/test/http_pcap/http_gzip_out_of_order.pcap
Binary files differ
diff --git a/test/test_result_json/http_6over4_single_trans.json b/test/test_result_json/http_6over4_single_trans.json
index 6c0435b..34d999d 100644
--- a/test/test_result_json/http_6over4_single_trans.json
+++ b/test/test_result_json/http_6over4_single_trans.json
@@ -28,7 +28,7 @@
"Connection": "close",
"Content-Type": "text/plain",
"Cache-Control": "max-age=30, must-revalidate",
- "__X_HTTP_PAYLOAD_MD5": "cd5a4d3fdd5bffc16bf959ef75cf37bc",
+ "__X_HTTP_DECOMPRESS_PAYLOAD_MD5": "cd5a4d3fdd5bffc16bf959ef75cf37bc",
"__X_HTTP_PAYLOAD": "TWljcm9zb2Z0IE5DU0k="
}
] \ No newline at end of file
diff --git a/test/test_result_json/http_chunked_res_gzip.json b/test/test_result_json/http_chunked_res_gzip.json
index 5d2b3d6..370b4a7 100644
--- a/test/test_result_json/http_chunked_res_gzip.json
+++ b/test/test_result_json/http_chunked_res_gzip.json
@@ -40,6 +40,7 @@
"X-Slogan1": "Go deep.",
"CF-RAY": "260a3f709d7b0761-AMS",
"Content-Encoding": "gzip",
- "__X_HTTP_PAYLOAD_MD5": "855f8310be999de806e89a420a95435d"
+ "__X_HTTP_RAW_PAYLOAD_MD5": "5387fc115327b819ba920ad6ce8f3e3a",
+ "__X_HTTP_DECOMPRESS_PAYLOAD_MD5": "855f8310be999de806e89a420a95435d"
}
] \ No newline at end of file
diff --git a/test/test_result_json/http_get_encoded_uri.json b/test/test_result_json/http_get_encoded_uri.json
index b84c051..de1419a 100644
--- a/test/test_result_json/http_get_encoded_uri.json
+++ b/test/test_result_json/http_get_encoded_uri.json
@@ -38,7 +38,8 @@
"Content-Type": "text/html;charset=UTF-8",
"Transfer-Encoding": "chunked",
"Date": "Sat, 18 May 2019 01:36:57 GMT",
- "__X_HTTP_PAYLOAD_MD5": "d545e0faf20f7ffe90e31cfc1aef1782"
+ "__X_HTTP_RAW_PAYLOAD_MD5": "d545e0faf20f7ffe90e31cfc1aef1782",
+ "__X_HTTP_DECOMPRESS_PAYLOAD_MD5": "d545e0faf20f7ffe90e31cfc1aef1782"
},
{
"__X_HTTP_TRANSACTION": "request",
@@ -74,6 +75,7 @@
"Content-Type": "application/vnd.openxmlformats-officedocument.wordprocessingml.document;charset=UTF-8",
"Content-Length": "1703517",
"Date": "Sat, 18 May 2019 01:37:00 GMT",
- "__X_HTTP_PAYLOAD_MD5": "3598c468910611a3128d068e20ae0e82"
+ "__X_HTTP_RAW_PAYLOAD_MD5": "3598c468910611a3128d068e20ae0e82",
+ "__X_HTTP_DECOMPRESS_PAYLOAD_MD5": "3598c468910611a3128d068e20ae0e82"
}
] \ No newline at end of file
diff --git a/test/test_result_json/http_get_multi_trans.json b/test/test_result_json/http_get_multi_trans.json
index dfdca17..917b1c7 100644
--- a/test/test_result_json/http_get_multi_trans.json
+++ b/test/test_result_json/http_get_multi_trans.json
@@ -143,6 +143,7 @@
"Set-Cookie4": "pname_pro=name; Max-Age=28800; Expires=Tue, 31-May-2022 14:41:23 GMT; Domain=testin.cn; Path=/; HttpOnly",
"Content-Language": "zh-CN",
"Content-Encoding": "gzip",
- "__X_HTTP_PAYLOAD_MD5": "39cb5f3a9cbcfbd16f66e040ec49b8c4"
+ "__X_HTTP_RAW_PAYLOAD_MD5": "5d761720e42f13d01ba981fb19b850ca",
+ "__X_HTTP_DECOMPRESS_PAYLOAD_MD5": "39cb5f3a9cbcfbd16f66e040ec49b8c4"
}
] \ No newline at end of file
diff --git a/test/test_result_json/http_get_req_pipeline.json b/test/test_result_json/http_get_req_pipeline.json
index e69ba8c..af8ff75 100644
--- a/test/test_result_json/http_get_req_pipeline.json
+++ b/test/test_result_json/http_get_req_pipeline.json
@@ -62,6 +62,7 @@
"Date": "Wed, 25 Oct 2023 06:43:35 GMT",
"Content-Type": "text/html",
"Connection": "close",
- "__X_HTTP_PAYLOAD_MD5": "6fb335f443cfc8a9d952d27cf3dc1059"
+ "__X_HTTP_RAW_PAYLOAD_MD5": "6fb335f443cfc8a9d952d27cf3dc1059",
+ "__X_HTTP_DECOMPRESS_PAYLOAD_MD5": "6fb335f443cfc8a9d952d27cf3dc1059"
}
] \ No newline at end of file
diff --git a/test/test_result_json/http_get_single_trans.json b/test/test_result_json/http_get_single_trans.json
index 4c6f6d8..165bb65 100644
--- a/test/test_result_json/http_get_single_trans.json
+++ b/test/test_result_json/http_get_single_trans.json
@@ -28,7 +28,7 @@
"Content-type": "text/html",
"Content-Length": "144",
"Last-Modified": "Thu, 30 Nov 2023 08:38:54 GMT",
- "__X_HTTP_PAYLOAD_MD5": "3e11876cd3a234541ae37d833c088a76",
- "__X_HTTP_PAYLOAD": "PCFET0NUWVBFIGh0bWw+CjxodG1sPgo8aGVhZD4KPHRpdGxlPlBhZ2UgVGl0bGU8L3RpdGxlPgo8L2hlYWQ+Cjxib2R5PgoKPGgxPlRoaXMgaXMgYSBIZWFkaW5nPC9oMT4KPHA+VGhpcyBpcyBhIHBhcmFncmFwaC48L3A+Cgo8L2JvZHk+CjwvaHRtbD4K"
+ "__X_HTTP_RAW_PAYLOAD_MD5": "3e11876cd3a234541ae37d833c088a76",
+ "__X_HTTP_DECOMPRESS_PAYLOAD_MD5": "3e11876cd3a234541ae37d833c088a76"
}
] \ No newline at end of file
diff --git a/test/test_result_json/http_gzip_out_of_order.json b/test/test_result_json/http_gzip_out_of_order.json
new file mode 100644
index 0000000..1fbb228
--- /dev/null
+++ b/test/test_result_json/http_gzip_out_of_order.json
@@ -0,0 +1,39 @@
+[
+ {
+ "__X_HTTP_TUPLE4": "192.168.61.10:2064-192.168.40.139:8088-6-0"
+ },
+ {
+ "__X_HTTP_TRANSACTION": "request",
+ "__X_HTTP_TRANSACTION_SEQ": 0,
+ "method": "GET",
+ "uri": "/",
+ "req_version": "1.1",
+ "major_version": 1,
+ "minor_version": 1,
+ "Host": "192.168.40.139:8088",
+ "Connection": "keep-alive",
+ "DNT": "1",
+ "Upgrade-Insecure-Requests": "1",
+ "User-Agent": "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/127.0.0.0 Safari/537.36",
+ "Accept": "text/html,application/xhtml+xml,application/xml;q=0.9,image/avif,image/webp,image/apng,*/*;q=0.8,application/signed-exchange;v=b3;q=0.7",
+ "Accept-Encoding": "gzip, deflate",
+ "Accept-Language": "zh-CN,zh;q=0.9",
+ "__X_HTTP_URL": "192.168.40.139:8088/"
+ },
+ {
+ "__X_HTTP_TRANSACTION": "response",
+ "__X_HTTP_TRANSACTION_SEQ": 0,
+ "res_version": "1.0",
+ "res_status": "OK",
+ "major_version": 1,
+ "minor_version": 0,
+ "status_code": 200,
+ "Server": "BaseHTTP/0.6 Python/3.6.8",
+ "Date": "Tue, 13 Aug 2024 14:21:42 GMT",
+ "Content-type": "text/html; charset=utf-8",
+ "Content-Encoding": "gzip",
+ "Content-length": "28425",
+ "__X_HTTP_RAW_PAYLOAD_MD5": "873ed9c8c691a5f9f144fbf0fbfca011md5su",
+ "__X_HTTP_DECOMPRESS_PAYLOAD_MD5": "7047cf4ae8ce6fd7bcd363e2b626f338"
+ }
+] \ No newline at end of file
diff --git a/test/test_result_json/http_hdr_truncated_after_kv.json b/test/test_result_json/http_hdr_truncated_after_kv.json
index a549339..01ec6bd 100644
--- a/test/test_result_json/http_hdr_truncated_after_kv.json
+++ b/test/test_result_json/http_hdr_truncated_after_kv.json
@@ -72,7 +72,7 @@
"Cache-Control": "max-age=2592000",
"Last-Modified": "Wed, 10 Nov 2021 08:00:14 GMT",
"ETag": "\"c289a42885b30107ad119e2a6e405e4d\"",
- "__X_HTTP_PAYLOAD_MD5": "c289a42885b30107ad119e2a6e405e4d"
+ "__X_HTTP_DECOMPRESS_PAYLOAD_MD5": "c289a42885b30107ad119e2a6e405e4d"
},
{
"__X_HTTP_TRANSACTION": "request",
@@ -180,7 +180,7 @@
"Cache-Control": "max-age=2592000",
"Last-Modified": "Mon, 08 Nov 2021 19:50:54 GMT",
"ETag": "\"35d56b6a0ef3b5857013f44620bd8888\"",
- "__X_HTTP_PAYLOAD_MD5": "35d56b6a0ef3b5857013f44620bd8888"
+ "__X_HTTP_DECOMPRESS_PAYLOAD_MD5": "35d56b6a0ef3b5857013f44620bd8888"
},
{
"__X_HTTP_TRANSACTION": "response",
@@ -198,7 +198,7 @@
"Cache-Control": "max-age=2592000",
"Last-Modified": "Tue, 26 Oct 2021 15:12:58 GMT",
"ETag": "\"bb83961ad5fe366dcbb5240ead69f650\"",
- "__X_HTTP_PAYLOAD_MD5": "bb83961ad5fe366dcbb5240ead69f650"
+ "__X_HTTP_DECOMPRESS_PAYLOAD_MD5": "bb83961ad5fe366dcbb5240ead69f650"
},
{
"__X_HTTP_TRANSACTION": "response",
@@ -216,7 +216,7 @@
"Cache-Control": "max-age=2592000",
"Last-Modified": "Thu, 04 Nov 2021 20:44:22 GMT",
"ETag": "\"c5be6a7137482da270bb2adc8d44a28d\"",
- "__X_HTTP_PAYLOAD_MD5": "c5be6a7137482da270bb2adc8d44a28d"
+ "__X_HTTP_DECOMPRESS_PAYLOAD_MD5": "c5be6a7137482da270bb2adc8d44a28d"
},
{
"__X_HTTP_TRANSACTION": "response",
@@ -234,7 +234,7 @@
"Cache-Control": "max-age=2592000",
"Last-Modified": "Sat, 25 Sep 2021 05:02:49 GMT",
"ETag": "\"61bec96775876749bb57139f86f6b0ca\"",
- "__X_HTTP_PAYLOAD_MD5": "61bec96775876749bb57139f86f6b0ca"
+ "__X_HTTP_DECOMPRESS_PAYLOAD_MD5": "61bec96775876749bb57139f86f6b0ca"
},
{
"__X_HTTP_TRANSACTION": "response",
@@ -252,7 +252,7 @@
"Cache-Control": "max-age=2592000",
"Last-Modified": "Fri, 02 Jul 2021 10:15:04 GMT",
"ETag": "\"841065529f1e89eabd0ef235a3d3291c\"",
- "__X_HTTP_PAYLOAD_MD5": "841065529f1e89eabd0ef235a3d3291c"
+ "__X_HTTP_DECOMPRESS_PAYLOAD_MD5": "841065529f1e89eabd0ef235a3d3291c"
},
{
"__X_HTTP_TRANSACTION": "response",
@@ -270,7 +270,7 @@
"Cache-Control": "max-age=2592000",
"Last-Modified": "Tue, 19 Oct 2021 14:00:02 GMT",
"ETag": "\"21d4b2c21a3a2f26ba665670e8513940\"",
- "__X_HTTP_PAYLOAD_MD5": "21d4b2c21a3a2f26ba665670e8513940"
+ "__X_HTTP_DECOMPRESS_PAYLOAD_MD5": "21d4b2c21a3a2f26ba665670e8513940"
},
{
"__X_HTTP_TRANSACTION": "request",
@@ -306,6 +306,6 @@
"Cache-Control": "max-age=2592000",
"Last-Modified": "Thu, 11 Nov 2021 17:32:01 GMT",
"ETag": "\"837a2051f7d0f2899baf54ff20b3d9ad\"",
- "__X_HTTP_PAYLOAD_MD5": "f18a76ecf35648cb46ea6f42e4391cb8"
+ "__X_HTTP_DECOMPRESS_PAYLOAD_MD5": "f18a76ecf35648cb46ea6f42e4391cb8"
}
] \ No newline at end of file
diff --git a/test/test_result_json/http_hdr_truncated_in_kv.json b/test/test_result_json/http_hdr_truncated_in_kv.json
index d774320..66edef3 100644
--- a/test/test_result_json/http_hdr_truncated_in_kv.json
+++ b/test/test_result_json/http_hdr_truncated_in_kv.json
@@ -48,6 +48,6 @@
"X-Robots-Tag4": "noindex, nofollow",
"Report-To": "{ \"url\": \"https://pxl.tsyndicate.com/api/v1/heavy-ad/report\", \"max_age\": 86401 }",
"Content-Encoding": "gzip",
- "__X_HTTP_PAYLOAD_MD5": "075802aa31b42d465d56b213915fb0a2"
+ "__X_HTTP_DECOMPRESS_PAYLOAD_MD5": "075802aa31b42d465d56b213915fb0a2"
}
] \ No newline at end of file
diff --git a/test/test_result_json/http_hdr_value_empty.json b/test/test_result_json/http_hdr_value_empty.json
index e8d3088..86ac4a5 100644
--- a/test/test_result_json/http_hdr_value_empty.json
+++ b/test/test_result_json/http_hdr_value_empty.json
@@ -16,7 +16,7 @@
"Date": "Sat Sep 7 10:04:57 2019",
"Content-Length": "468",
"__X_HTTP_URL": ":4445/RPC2",
- "__X_HTTP_PAYLOAD_MD5": "033e27f72bc41b4a7e222df464749420"
+ "__X_HTTP_DECOMPRESS_PAYLOAD_MD5": "033e27f72bc41b4a7e222df464749420"
},
{
"__X_HTTP_TRANSACTION": "response",
@@ -31,6 +31,6 @@
"Transfer-Encoding": "chunked",
"X-Powered-By": "ulxmlrpcpp/1.7.4",
"Date": "Sat Sep 7 01:09:08 2019",
- "__X_HTTP_PAYLOAD_MD5": "69db29507d10b0d57fcaa5afffd81934"
+ "__X_HTTP_DECOMPRESS_PAYLOAD_MD5": "69db29507d10b0d57fcaa5afffd81934"
}
] \ No newline at end of file
diff --git a/test/test_result_json/http_hdrs_exceed_maximum.json b/test/test_result_json/http_hdrs_exceed_maximum.json
index d6068ed..9bc751b 100644
--- a/test/test_result_json/http_hdrs_exceed_maximum.json
+++ b/test/test_result_json/http_hdrs_exceed_maximum.json
@@ -45,6 +45,7 @@
"Keep-Alive": "timeout=15",
"Connection": "Keep-Alive",
"Content-Type": "image/gif",
- "__X_HTTP_PAYLOAD_MD5": "ad480fd0732d0f6f1a8b06359e3a42bb"
+ "__X_HTTP_RAW_PAYLOAD_MD5": "ad480fd0732d0f6f1a8b06359e3a42bb",
+ "__X_HTTP_DECOMPRESS_PAYLOAD_MD5": "ad480fd0732d0f6f1a8b06359e3a42bb"
}
] \ No newline at end of file
diff --git a/test/test_result_json/http_multi_parse_error.json b/test/test_result_json/http_multi_parse_error.json
index db830bb..c49d41e 100644
--- a/test/test_result_json/http_multi_parse_error.json
+++ b/test/test_result_json/http_multi_parse_error.json
@@ -16,7 +16,8 @@
"Date": "Sat Sep 7 10:05:13 2019",
"Content-Length": "468",
"__X_HTTP_URL": ":4445/RPC2",
- "__X_HTTP_PAYLOAD_MD5": "6eccbcf261f04aabfa69884aa283f4f3"
+ "__X_HTTP_RAW_PAYLOAD_MD5": "6eccbcf261f04aabfa69884aa283f4f3",
+ "__X_HTTP_DECOMPRESS_PAYLOAD_MD5": "6eccbcf261f04aabfa69884aa283f4f3"
},
{
"__X_HTTP_TRANSACTION": "response",
@@ -31,6 +32,7 @@
"Transfer-Encoding": "chunked",
"X-Powered-By": "ulxmlrpcpp/1.7.4",
"Date": "Sat Sep 7 01:09:24 2019",
- "__X_HTTP_PAYLOAD_MD5": "5cf8a4aa9a54e7f2d05b55ed05bf9071"
+ "__X_HTTP_RAW_PAYLOAD_MD5": "5cf8a4aa9a54e7f2d05b55ed05bf9071",
+ "__X_HTTP_DECOMPRESS_PAYLOAD_MD5": "5cf8a4aa9a54e7f2d05b55ed05bf9071"
}
] \ No newline at end of file
diff --git a/test/test_result_json/http_no_content_length.json b/test/test_result_json/http_no_content_length.json
index 03449dc..9310d04 100644
--- a/test/test_result_json/http_no_content_length.json
+++ b/test/test_result_json/http_no_content_length.json
@@ -40,6 +40,7 @@
"P3P": "policyref=\"/w3c/p3p.xml\", CP=\"ALL IND DSP COR ADM CONo CUR IVAo IVDo PSA PSD TAI TELo OUR SAMo CNT COM INT NAV ONL PHY PRE PUR UNI\"",
"Set-Cookie": "trafic_ranking=xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx; expires=Sun, 11-Jan-2037 14:00:00 GMT; path=/; domain=.xxxxxx.xx",
"connection": "close",
- "__X_HTTP_PAYLOAD_MD5": "9fb54a2726ca3cf54a82804d0e66d08a"
+ "__X_HTTP_RAW_PAYLOAD_MD5": "9fb54a2726ca3cf54a82804d0e66d08a",
+ "__X_HTTP_DECOMPRESS_PAYLOAD_MD5": "9fb54a2726ca3cf54a82804d0e66d08a"
}
] \ No newline at end of file
diff --git a/test/test_result_json/http_out_of_order.json b/test/test_result_json/http_out_of_order.json
index 5b77c18..f0e9b85 100644
--- a/test/test_result_json/http_out_of_order.json
+++ b/test/test_result_json/http_out_of_order.json
@@ -38,6 +38,6 @@
"Keep-Alive": "timeout=120, max=1000",
"Connection": "Keep-Alive",
"Content-Type": "image/jpeg",
- "__X_HTTP_PAYLOAD_MD5": "c4c9d459415e922f877a2af6afd9d316"
+ "__X_HTTP_DECOMPRESS_PAYLOAD_MD5": "c4c9d459415e922f877a2af6afd9d316"
}
] \ No newline at end of file
diff --git a/test/test_result_json/http_over_pppoe.json b/test/test_result_json/http_over_pppoe.json
index 579679a..b4b4bfb 100644
--- a/test/test_result_json/http_over_pppoe.json
+++ b/test/test_result_json/http_over_pppoe.json
@@ -30,6 +30,7 @@
"X-RTFM": "Learn about this site at http://bit.ly/14DAh2o and don't abuse the service",
"X-YOU-SHOULD-APPLY-FOR-A-JOB": "If you're reading this, apply here: http://rackertalent.com/",
"X-ICANHAZNODE": "icanhazip1.nugget",
- "__X_HTTP_PAYLOAD_MD5": "624520ac54235ac2284ed2dd2b17e1ad"
+ "__X_HTTP_RAW_PAYLOAD_MD5": "624520ac54235ac2284ed2dd2b17e1ad",
+ "__X_HTTP_DECOMPRESS_PAYLOAD_MD5": "624520ac54235ac2284ed2dd2b17e1ad"
}
] \ No newline at end of file
diff --git a/test/test_result_json/http_over_tcp_keepalive.json b/test/test_result_json/http_over_tcp_keepalive.json
index 3928510..2754249 100644
--- a/test/test_result_json/http_over_tcp_keepalive.json
+++ b/test/test_result_json/http_over_tcp_keepalive.json
@@ -39,6 +39,7 @@
"Pragma": "no-cache",
"Cache-Control": "no-store",
"Content-Encoding": "gzip",
- "__X_HTTP_PAYLOAD_MD5": "af9b1a0118edd2920db355f9eee4ab75"
+ "__X_HTTP_RAW_PAYLOAD_MD5": "3f80dc84438b2f2d6b5e58084e31671c",
+ "__X_HTTP_DECOMPRESS_PAYLOAD_MD5": "af9b1a0118edd2920db355f9eee4ab75"
}
] \ No newline at end of file
diff --git a/test/test_result_json/http_post_multipart_form_data.json b/test/test_result_json/http_post_multipart_form_data.json
index 874dbbe..ac524f6 100644
--- a/test/test_result_json/http_post_multipart_form_data.json
+++ b/test/test_result_json/http_post_multipart_form_data.json
@@ -31,7 +31,8 @@
"Content-Type": "text/html;charset=UTF-8",
"Content-Length": "468",
"Date": "Thu, 28 Mar 2019 08:13:33 GMT",
- "__X_HTTP_PAYLOAD_MD5": "2b8cd757ab5ffba85acac26c008a1ffc"
+ "__X_HTTP_RAW_PAYLOAD_MD5": "2b8cd757ab5ffba85acac26c008a1ffc",
+ "__X_HTTP_DECOMPRESS_PAYLOAD_MD5": "2b8cd757ab5ffba85acac26c008a1ffc"
},
{
"__X_HTTP_TRANSACTION": "request",
@@ -62,7 +63,8 @@
"Content-Type": "text/html;charset=UTF-8",
"Content-Length": "468",
"Date": "Thu, 28 Mar 2019 08:13:33 GMT",
- "__X_HTTP_PAYLOAD_MD5": "2b8cd757ab5ffba85acac26c008a1ffc"
+ "__X_HTTP_RAW_PAYLOAD_MD5": "2b8cd757ab5ffba85acac26c008a1ffc",
+ "__X_HTTP_DECOMPRESS_PAYLOAD_MD5": "2b8cd757ab5ffba85acac26c008a1ffc"
},
{
"__X_HTTP_TRANSACTION": "request",
@@ -85,7 +87,8 @@
"Accept-Language": "zh-CN,zh;q=0.8",
"Cookie": "JSESSIONID=969AC5FBD069EE6218EB10513726B244; JSESSIONID=400CC78DF5784F303702CC7F02C6122C",
"__X_HTTP_URL": "192.168.57.14:8080/fileupload/servlet/UploadHandleServlet",
- "__X_HTTP_PAYLOAD_MD5": "550be33bf0ac01b6f7ac175bb8f4522a"
+ "__X_HTTP_RAW_PAYLOAD_MD5": "550be33bf0ac01b6f7ac175bb8f4522a",
+ "__X_HTTP_DECOMPRESS_PAYLOAD_MD5": "550be33bf0ac01b6f7ac175bb8f4522a"
},
{
"__X_HTTP_TRANSACTION": "response",
@@ -99,6 +102,7 @@
"Content-Type": "text/html;charset=UTF-8",
"Content-Length": "144",
"Date": "Thu, 28 Mar 2019 08:13:37 GMT",
- "__X_HTTP_PAYLOAD_MD5": "3fa07f3ec9f9fefed96e9886f80760bb"
+ "__X_HTTP_RAW_PAYLOAD_MD5": "3fa07f3ec9f9fefed96e9886f80760bb",
+ "__X_HTTP_DECOMPRESS_PAYLOAD_MD5": "3fa07f3ec9f9fefed96e9886f80760bb"
}
] \ No newline at end of file
diff --git a/test/test_result_json/http_post_single_trans.json b/test/test_result_json/http_post_single_trans.json
index b6b8c65..823c310 100644
--- a/test/test_result_json/http_post_single_trans.json
+++ b/test/test_result_json/http_post_single_trans.json
@@ -20,7 +20,7 @@
"Connection": "keep-alive",
"Content-Length": "26",
"__X_HTTP_URL": "192.168.40.139:8080/",
- "__X_HTTP_PAYLOAD_MD5": "5ffe2871e6d5f6ee25ad7c1bfdd9f7b3"
+ "__X_HTTP_DECOMPRESS_PAYLOAD_MD5": "5ffe2871e6d5f6ee25ad7c1bfdd9f7b3"
},
{
"__X_HTTP_TRANSACTION": "response",
@@ -33,6 +33,6 @@
"Server": "BaseHTTP/0.6 Python/3.6.8",
"Date": "Mon, 08 Apr 2024 07:19:16 GMT",
"Content-length": "84",
- "__X_HTTP_PAYLOAD_MD5": "cd8a54dd3e915946c4df262111e5aa05"
+ "__X_HTTP_DECOMPRESS_PAYLOAD_MD5": "cd8a54dd3e915946c4df262111e5aa05"
}
] \ No newline at end of file
diff --git a/test/test_result_json/http_req_1byte_sliding_window.json b/test/test_result_json/http_req_1byte_sliding_window.json
index d69b234..13b360d 100644
--- a/test/test_result_json/http_req_1byte_sliding_window.json
+++ b/test/test_result_json/http_req_1byte_sliding_window.json
@@ -29,6 +29,7 @@
"Content-type": "text/html",
"Content-Length": "144",
"Last-Modified": "Fri, 29 Dec 2023 08:50:53 GMT",
- "__X_HTTP_PAYLOAD_MD5": "3e11876cd3a234541ae37d833c088a76"
+ "__X_HTTP_RAW_PAYLOAD_MD5": "3e11876cd3a234541ae37d833c088a76",
+ "__X_HTTP_DECOMPRESS_PAYLOAD_MD5": "3e11876cd3a234541ae37d833c088a76"
}
] \ No newline at end of file
diff --git a/test/test_result_json/http_res_1byte_sliding_window.json b/test/test_result_json/http_res_1byte_sliding_window.json
index 35860bb..f527839 100644
--- a/test/test_result_json/http_res_1byte_sliding_window.json
+++ b/test/test_result_json/http_res_1byte_sliding_window.json
@@ -29,6 +29,7 @@
"Content-type": "text/html",
"Content-Length": "144",
"Last-Modified": "Fri, 29 Dec 2023 08:50:53 GMT",
- "__X_HTTP_PAYLOAD_MD5": "3e11876cd3a234541ae37d833c088a76"
+ "__X_HTTP_RAW_PAYLOAD_MD5": "3e11876cd3a234541ae37d833c088a76",
+ "__X_HTTP_DECOMPRESS_PAYLOAD_MD5": "3e11876cd3a234541ae37d833c088a76"
}
] \ No newline at end of file
diff --git a/test/test_result_json/http_res_gzip.json b/test/test_result_json/http_res_gzip.json
index ca86532..9d3e9c7 100644
--- a/test/test_result_json/http_res_gzip.json
+++ b/test/test_result_json/http_res_gzip.json
@@ -39,6 +39,7 @@
"Content-Length": "92",
"Connection": "close",
"Content-Type": "text/html; charset=UTF-8",
- "__X_HTTP_PAYLOAD_MD5": "61b9e97f96045587bb55db781f7543ad"
+ "__X_HTTP_RAW_PAYLOAD_MD5": "dc2c0aff94148ca24acb516113a4d018",
+ "__X_HTTP_DECOMPRESS_PAYLOAD_MD5": "61b9e97f96045587bb55db781f7543ad"
}
] \ No newline at end of file
diff --git a/test/test_result_json/http_trans_pipeline.json b/test/test_result_json/http_trans_pipeline.json
index d979863..4bd0879 100644
--- a/test/test_result_json/http_trans_pipeline.json
+++ b/test/test_result_json/http_trans_pipeline.json
@@ -106,7 +106,8 @@
"Content-Type": "text/html",
"Content-Length": "146",
"Connection": "keep-alive",
- "__X_HTTP_PAYLOAD_MD5": "32dc0b2772bd73a952abba009291a399"
+ "__X_HTTP_RAW_PAYLOAD_MD5": "32dc0b2772bd73a952abba009291a399",
+ "__X_HTTP_DECOMPRESS_PAYLOAD_MD5": "32dc0b2772bd73a952abba009291a399"
},
{
"__X_HTTP_TRANSACTION": "response",
@@ -121,7 +122,8 @@
"Content-Type": "text/html",
"Content-Length": "146",
"Connection": "keep-alive",
- "__X_HTTP_PAYLOAD_MD5": "db2ff8008149d8e70d8a2929acbb0f56"
+ "__X_HTTP_RAW_PAYLOAD_MD5": "db2ff8008149d8e70d8a2929acbb0f56",
+ "__X_HTTP_DECOMPRESS_PAYLOAD_MD5": "db2ff8008149d8e70d8a2929acbb0f56"
},
{
"__X_HTTP_TRANSACTION": "response",
@@ -136,7 +138,8 @@
"Content-Type": "text/html",
"Content-Length": "146",
"Connection": "keep-alive",
- "__X_HTTP_PAYLOAD_MD5": "f5df152f7d8f34c630f298d2fcb46ed3"
+ "__X_HTTP_RAW_PAYLOAD_MD5": "f5df152f7d8f34c630f298d2fcb46ed3",
+ "__X_HTTP_DECOMPRESS_PAYLOAD_MD5": "f5df152f7d8f34c630f298d2fcb46ed3"
},
{
"__X_HTTP_TRANSACTION": "response",
@@ -151,7 +154,8 @@
"Content-Type": "text/html",
"Content-Length": "146",
"Connection": "keep-alive",
- "__X_HTTP_PAYLOAD_MD5": "73e98ca7b62764869357b3e3c40dcd68"
+ "__X_HTTP_RAW_PAYLOAD_MD5": "73e98ca7b62764869357b3e3c40dcd68",
+ "__X_HTTP_DECOMPRESS_PAYLOAD_MD5": "73e98ca7b62764869357b3e3c40dcd68"
},
{
"__X_HTTP_TRANSACTION": "response",
@@ -166,7 +170,8 @@
"Content-Type": "text/html",
"Content-Length": "146",
"Connection": "keep-alive",
- "__X_HTTP_PAYLOAD_MD5": "a5733c8989bde7f08506fa68c20f0c62"
+ "__X_HTTP_RAW_PAYLOAD_MD5": "a5733c8989bde7f08506fa68c20f0c62",
+ "__X_HTTP_DECOMPRESS_PAYLOAD_MD5": "a5733c8989bde7f08506fa68c20f0c62"
},
{
"__X_HTTP_TRANSACTION": "request",
@@ -285,7 +290,8 @@
"Content-Type": "text/html",
"Content-Length": "146",
"Connection": "keep-alive",
- "__X_HTTP_PAYLOAD_MD5": "4bc0dde3722f76d60fef6f1d878cbb14"
+ "__X_HTTP_RAW_PAYLOAD_MD5": "4bc0dde3722f76d60fef6f1d878cbb14",
+ "__X_HTTP_DECOMPRESS_PAYLOAD_MD5": "4bc0dde3722f76d60fef6f1d878cbb14"
},
{
"__X_HTTP_TRANSACTION": "response",
@@ -300,7 +306,8 @@
"Content-Type": "text/html",
"Content-Length": "146",
"Connection": "keep-alive",
- "__X_HTTP_PAYLOAD_MD5": "728dc2eafd49c9be8149add7c6aff207"
+ "__X_HTTP_RAW_PAYLOAD_MD5": "728dc2eafd49c9be8149add7c6aff207",
+ "__X_HTTP_DECOMPRESS_PAYLOAD_MD5": "728dc2eafd49c9be8149add7c6aff207"
},
{
"__X_HTTP_TRANSACTION": "response",
@@ -315,7 +322,8 @@
"Content-Type": "text/html",
"Content-Length": "146",
"Connection": "keep-alive",
- "__X_HTTP_PAYLOAD_MD5": "0cde98e33181ee0ded49e8d0a3178d55"
+ "__X_HTTP_RAW_PAYLOAD_MD5": "0cde98e33181ee0ded49e8d0a3178d55",
+ "__X_HTTP_DECOMPRESS_PAYLOAD_MD5": "0cde98e33181ee0ded49e8d0a3178d55"
},
{
"__X_HTTP_TRANSACTION": "response",
@@ -330,7 +338,8 @@
"Content-Type": "text/html",
"Content-Length": "146",
"Connection": "keep-alive",
- "__X_HTTP_PAYLOAD_MD5": "d627268e0aba817d818b6e2b7e41aa11"
+ "__X_HTTP_RAW_PAYLOAD_MD5": "d627268e0aba817d818b6e2b7e41aa11",
+ "__X_HTTP_DECOMPRESS_PAYLOAD_MD5": "d627268e0aba817d818b6e2b7e41aa11"
},
{
"__X_HTTP_TRANSACTION": "response",
@@ -345,7 +354,8 @@
"Content-Type": "text/html",
"Content-Length": "146",
"Connection": "keep-alive",
- "__X_HTTP_PAYLOAD_MD5": "e99d9829d50bd94b3497b91011f6e349"
+ "__X_HTTP_RAW_PAYLOAD_MD5": "e99d9829d50bd94b3497b91011f6e349",
+ "__X_HTTP_DECOMPRESS_PAYLOAD_MD5": "e99d9829d50bd94b3497b91011f6e349"
},
{
"__X_HTTP_TRANSACTION": "request",
@@ -373,6 +383,7 @@
"Content-Type": "text/html",
"Content-Length": "146",
"Connection": "keep-alive",
- "__X_HTTP_PAYLOAD_MD5": "99a813d29c5da4e6f7269be4c1a31c8e"
+ "__X_HTTP_RAW_PAYLOAD_MD5": "99a813d29c5da4e6f7269be4c1a31c8e",
+ "__X_HTTP_DECOMPRESS_PAYLOAD_MD5": "99a813d29c5da4e6f7269be4c1a31c8e"
}
] \ No newline at end of file
diff --git a/test/test_result_json/http_tunnel_for_http.json b/test/test_result_json/http_tunnel_for_http.json
index acc5828..ad653d5 100644
--- a/test/test_result_json/http_tunnel_for_http.json
+++ b/test/test_result_json/http_tunnel_for_http.json
@@ -57,6 +57,6 @@
"Pragma": "no-cache",
"Server": "bfe/1.0.8.18",
"Set-Cookie": "BDORZ=27315; max-age=86400; domain=.baidu.com; path=/",
- "__X_HTTP_PAYLOAD_MD5": "090fe607a5be1228362614ccaa088577"
+ "__X_HTTP_DECOMPRESS_PAYLOAD_MD5": "090fe607a5be1228362614ccaa088577"
}
] \ No newline at end of file
diff --git a/test/test_result_json/http_tunnel_for_http_s2c.json b/test/test_result_json/http_tunnel_for_http_s2c.json
index 7bd4996..851d652 100644
--- a/test/test_result_json/http_tunnel_for_http_s2c.json
+++ b/test/test_result_json/http_tunnel_for_http_s2c.json
@@ -31,6 +31,6 @@
"Pragma": "no-cache",
"Server": "bfe/1.0.8.18",
"Set-Cookie": "BDORZ=27315; max-age=86400; domain=.baidu.com; path=/",
- "__X_HTTP_PAYLOAD_MD5": "090fe607a5be1228362614ccaa088577"
+ "__X_HTTP_DECOMPRESS_PAYLOAD_MD5": "090fe607a5be1228362614ccaa088577"
}
] \ No newline at end of file
diff --git a/test/test_result_json/http_url_test_with_host.json b/test/test_result_json/http_url_test_with_host.json
index 019a9a2..ab91ded 100644
--- a/test/test_result_json/http_url_test_with_host.json
+++ b/test/test_result_json/http_url_test_with_host.json
@@ -30,6 +30,6 @@
"Server": "BaseHTTP/0.6 Python/3.6.8",
"Date": "Thu, 14 Mar 2024 07:37:43 GMT",
"Content-type": "application/json",
- "__X_HTTP_PAYLOAD_MD5": "49dfdd54b01cbcd2d2ab5e9e5ee6b9b9"
+ "__X_HTTP_DECOMPRESS_PAYLOAD_MD5": "49dfdd54b01cbcd2d2ab5e9e5ee6b9b9"
}
] \ No newline at end of file
diff --git a/test/test_result_json/http_url_test_without_host.json b/test/test_result_json/http_url_test_without_host.json
index 5c68075..09427a7 100644
--- a/test/test_result_json/http_url_test_without_host.json
+++ b/test/test_result_json/http_url_test_without_host.json
@@ -24,6 +24,7 @@
"Server": "BaseHTTP/0.6 Python/3.6.8",
"Date": "Thu, 14 Mar 2024 06:15:20 GMT",
"Content-type": "application/json",
- "__X_HTTP_PAYLOAD_MD5": "49dfdd54b01cbcd2d2ab5e9e5ee6b9b9"
+ "__X_HTTP_RAW_PAYLOAD_MD5": "49dfdd54b01cbcd2d2ab5e9e5ee6b9b9",
+ "__X_HTTP_DECOMPRESS_PAYLOAD_MD5": "49dfdd54b01cbcd2d2ab5e9e5ee6b9b9"
}
] \ No newline at end of file
diff --git a/test/test_result_json/http_zlib_deadlock.json b/test/test_result_json/http_zlib_deadlock.json
index db350cd..0ea9b7f 100644
--- a/test/test_result_json/http_zlib_deadlock.json
+++ b/test/test_result_json/http_zlib_deadlock.json
@@ -37,6 +37,7 @@
"X-NWS-LOG-UUID": "12197298277844186084",
"Connection": "keep-alive",
"X-Cache-Lookup": "Cache Miss",
- "__X_HTTP_PAYLOAD_MD5": "d383effc464d797b5fdb4d98f4ab0111"
+ "__X_HTTP_RAW_PAYLOAD_MD5": "3979c98326c16f482f364ee94be3c382",
+ "__X_HTTP_DECOMPRESS_PAYLOAD_MD5": "d383effc464d797b5fdb4d98f4ab0111"
}
] \ No newline at end of file
diff --git a/test_based_on_stellar/CMakeLists.txt b/test_based_on_stellar/CMakeLists.txt
index 7ae821f..be76c16 100644
--- a/test_based_on_stellar/CMakeLists.txt
+++ b/test_based_on_stellar/CMakeLists.txt
@@ -88,7 +88,8 @@ add_test(NAME STELLAR_HTTP_FIN_TEST COMMAND sh -c "ln -sf ${TEST_PCAP_DIR}/http
# -r ${TEST_PCAP_DIR}/http_tunnel_s2c_only_hdr.pcap WORKING_DIRECTORY ${TEST_RUN_DIR})
add_test(NAME STELLAR_HTTP_CHN_ENCODE_URL COMMAND sh -c "ln -sf ${TEST_PCAP_DIR}/http_chn_encode_url.pcap ${TEST_RUN_DIR}/pcap/test.pcap; ./${TEST_MAIN} ${TEST_JSON_DIR}/http_chn_encode_url.json" WORKING_DIRECTORY ${TEST_RUN_DIR})
add_test(NAME STELLAR_HTTP_ZLIB_DEADLOCK COMMAND sh -c "ln -sf ${TEST_PCAP_DIR}/http_zlib_deadlock.pcap ${TEST_RUN_DIR}/pcap/test.pcap; ./${TEST_MAIN} ${TEST_JSON_DIR}/http_zlib_deadlock.json" WORKING_DIRECTORY ${TEST_RUN_DIR})
-add_test(NAME STELLAR_HTTP_OUT_OF_DRDER COMMAND sh -c "ln -sf ${TEST_PCAP_DIR}/http_out_of_order.pcap ${TEST_RUN_DIR}/pcap/test.pcap; ./${TEST_MAIN} ${TEST_JSON_DIR}/http_out_of_order.json" WORKING_DIRECTORY ${TEST_RUN_DIR})
+add_test(NAME STELLAR_HTTP_OUT_OF_ORDER COMMAND sh -c "ln -sf ${TEST_PCAP_DIR}/http_out_of_order.pcap ${TEST_RUN_DIR}/pcap/test.pcap; ./${TEST_MAIN} ${TEST_JSON_DIR}/http_out_of_order.json" WORKING_DIRECTORY ${TEST_RUN_DIR})
+add_test(NAME STELLAR_HTTP_GZIP_OUT_OF_ORDER COMMAND sh -c "ln -sf ${TEST_PCAP_DIR}/http_gzip_out_of_order.pcap ${TEST_RUN_DIR}/pcap/test.pcap; ./${TEST_MAIN} ${TEST_JSON_DIR}/http_gzip_out_of_order.json" WORKING_DIRECTORY ${TEST_RUN_DIR})
set_tests_properties(STELLAR_HTTP_GET_SINGLE_TRANS_TEST
STELLAR_HTTP_GET_MULTI_TRANS_TEST
@@ -115,7 +116,8 @@ set_tests_properties(STELLAR_HTTP_GET_SINGLE_TRANS_TEST
STELLAR_HTTP_FIN_TEST
STELLAR_HTTP_CHN_ENCODE_URL
STELLAR_HTTP_ZLIB_DEADLOCK
- STELLAR_HTTP_OUT_OF_DRDER
+ STELLAR_HTTP_OUT_OF_ORDER
+ STELLAR_HTTP_GZIP_OUT_OF_ORDER
PROPERTIES FIXTURES_REQUIRED TestFixture)
add_test(NAME UPDATE_STATE_PLUG_ENTRY COMMAND bash -c "sed -i 's/name=.*/name=\\x22http_decoder_test_state_entry\\x22/' ${TEST_RUN_DIR}/etc/http/gtest_entry.toml")