diff options
Diffstat (limited to 'test')
| -rw-r--r-- | test/http_decoder_gtest.cpp | 13 | ||||
| -rw-r--r-- | test/http_decoder_perf_main.cpp | 5 | ||||
| -rw-r--r-- | test/http_pcap/http_error.pcap | bin | 0 -> 456 bytes | |||
| -rw-r--r-- | test/http_pcap/http_session_exception_c2s.pcap | bin | 0 -> 710 bytes | |||
| -rw-r--r-- | test/http_pcap/http_session_exception_s2c.pcap | bin | 0 -> 1113 bytes | |||
| -rw-r--r-- | test/test_result_json/http_msg_type_state_exception_c2s.json | 12 | ||||
| -rw-r--r-- | test/test_result_json/http_msg_type_state_exception_s2c.json | 15 |
7 files changed, 44 insertions, 1 deletions
diff --git a/test/http_decoder_gtest.cpp b/test/http_decoder_gtest.cpp index 3956a28..b2677fc 100644 --- a/test/http_decoder_gtest.cpp +++ b/test/http_decoder_gtest.cpp @@ -464,7 +464,18 @@ extern "C" void http_decoder_test_state_entry(struct session *sess, int topic_id }else{ json_object = gtest_plug_exdata->result_jnode[HTTP_TRANSACTION_RES]; } - + if(HTTP_TRANSACTION_FREE == msg_type){ + unsigned char flow_flag; + session_is_symmetric(sess, &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){ + json_object = gtest_plug_exdata->result_jnode[HTTP_TRANSACTION_RES]; + }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); if(HTTP_TRANSACTION_NEW ==msg_type || HTTP_TRANSACTION_FREE == msg_type){ diff --git a/test/http_decoder_perf_main.cpp b/test/http_decoder_perf_main.cpp index 1dd7734..5cfcf2c 100644 --- a/test/http_decoder_perf_main.cpp +++ b/test/http_decoder_perf_main.cpp @@ -106,6 +106,11 @@ void *session_exdata_get(struct session *sess, int idx) return sess->exdata; } +enum session_state session_get_current_state(struct session *sess) +{ + return SESSION_STATE_ACTIVE; +} + int stellar_session_mq_get_topic_id(struct stellar *st, const char *topic_name) { if(strcmp(topic_name, "HTTP_DECODER_MESSAGE") == 0){ diff --git a/test/http_pcap/http_error.pcap b/test/http_pcap/http_error.pcap Binary files differnew file mode 100644 index 0000000..3ef0829 --- /dev/null +++ b/test/http_pcap/http_error.pcap diff --git a/test/http_pcap/http_session_exception_c2s.pcap b/test/http_pcap/http_session_exception_c2s.pcap Binary files differnew file mode 100644 index 0000000..eb93c24 --- /dev/null +++ b/test/http_pcap/http_session_exception_c2s.pcap diff --git a/test/http_pcap/http_session_exception_s2c.pcap b/test/http_pcap/http_session_exception_s2c.pcap Binary files differnew file mode 100644 index 0000000..d5caa49 --- /dev/null +++ b/test/http_pcap/http_session_exception_s2c.pcap diff --git a/test/test_result_json/http_msg_type_state_exception_c2s.json b/test/test_result_json/http_msg_type_state_exception_c2s.json new file mode 100644 index 0000000..1edf964 --- /dev/null +++ b/test/test_result_json/http_msg_type_state_exception_c2s.json @@ -0,0 +1,12 @@ +[ + { + "msg_0": "HTTP_TRANSACTION_NEW_transaction_0", + "msg_1": "HTTP_MESSAGE_REQ_LINE", + "msg_2": "HTTP_MESSAGE_REQ_HEADER", + "msg_3": "HTTP_MESSAGE_REQ_HEADER_END", + "msg_4": "HTTP_MESSAGE_REQ_BODY" + }, + { + "msg_5": "HTTP_TRANSACTION_FREE_transaction_0" + } +]
\ No newline at end of file diff --git a/test/test_result_json/http_msg_type_state_exception_s2c.json b/test/test_result_json/http_msg_type_state_exception_s2c.json new file mode 100644 index 0000000..50fda4e --- /dev/null +++ b/test/test_result_json/http_msg_type_state_exception_s2c.json @@ -0,0 +1,15 @@ +[ + { + "msg_0": "HTTP_TRANSACTION_NEW_transaction_0", + "msg_1": "HTTP_MESSAGE_REQ_LINE", + "msg_2": "HTTP_MESSAGE_REQ_HEADER", + "msg_3": "HTTP_MESSAGE_REQ_HEADER_END" + }, + { + "msg_4": "HTTP_MESSAGE_RES_LINE", + "msg_5": "HTTP_MESSAGE_RES_HEADER", + "msg_6": "HTTP_MESSAGE_RES_HEADER_END", + "msg_7": "HTTP_MESSAGE_RES_BODY", + "msg_8": "HTTP_TRANSACTION_FREE_transaction_0" + } +]
\ No newline at end of file |
