From 0f4216f4e3136429dfbbe3c276bb725500630230 Mon Sep 17 00:00:00 2001 From: 0809216 <0809216@1ed66053-1c2d-0410-8867-f7571e6e31d3> Date: Mon, 25 Oct 2010 10:59:16 +0000 Subject: [PATCH 1/1] bug fix. Can not get statistic when option -c only. git-svn-id: http://10.144.169.20/repos/um/branches/l7vsd-3.x-ramiel-epoll-cond@10408 1ed66053-1c2d-0410-8867-f7571e6e31d3 --- l7vsd/module/protocol/protocol_module_ip.cpp | 2 +- l7vsd/module/protocol/protocol_module_sessionless.cpp | 4 ++-- test/script/PT/B/B-17.sh | 2 ++ test/script/PT/B/B-18.sh | 2 ++ test/script/PT/B/B-19.sh | 2 ++ test/script/PT/B/B-20.sh | 2 ++ test/script/PT/B/B-21.sh | 2 ++ test/script/PT/B/B-44-IPv4v4.sh | 2 +- 8 files changed, 14 insertions(+), 4 deletions(-) diff --git a/l7vsd/module/protocol/protocol_module_ip.cpp b/l7vsd/module/protocol/protocol_module_ip.cpp index a306dda0..66c68c39 100644 --- a/l7vsd/module/protocol/protocol_module_ip.cpp +++ b/l7vsd/module/protocol/protocol_module_ip.cpp @@ -1720,7 +1720,7 @@ protocol_module_base::EVENT_TAG protocol_module_ip::handle_client_recv(const boo putLogError(600037, formatter.str(), __FILE__, __LINE__); status = FINALIZE; } else { - if (forwarded_for == FORWARDED_FOR_OFF && session_data_ptr->sorry_flag == SORRY_FLAG_OFF) { + if ( statistic == COLLECT_STATS_OFF && forwarded_for == FORWARDED_FOR_OFF && session_data_ptr->sorry_flag == SORRY_FLAG_OFF) { session_data_ptr->data_state = UNKNOWN; } //data state is HTTP_START diff --git a/l7vsd/module/protocol/protocol_module_sessionless.cpp b/l7vsd/module/protocol/protocol_module_sessionless.cpp index c6a5aaed..27ef5dcb 100644 --- a/l7vsd/module/protocol/protocol_module_sessionless.cpp +++ b/l7vsd/module/protocol/protocol_module_sessionless.cpp @@ -1747,7 +1747,7 @@ protocol_module_base::EVENT_TAG protocol_module_sessionless::handle_client_recv( } //status is SEND_NG else if (it->status == SEND_NG) { - if (forwarded_for == FORWARDED_FOR_ON) { + if (statistic == COLLECT_STATS_ON || forwarded_for == FORWARDED_FOR_ON) { //check http method check_result = check_http_method(recv_data.receive_buffer + it->send_offset, data_remain_size); /*-------- DEBUG LOG --------*/ @@ -1958,7 +1958,7 @@ protocol_module_base::EVENT_TAG protocol_module_sessionless::handle_client_recv( new_send_it->send_offset = recv_data.receive_buffer_max_size - recv_data.receive_buffer_rest_size - request_data_remain_size; - if (forwarded_for == FORWARDED_FOR_ON || session_data->sorry_flag == SORRY_FLAG_ON) { + if (statistic == COLLECT_STATS_ON || forwarded_for == FORWARDED_FOR_ON || session_data->sorry_flag == SORRY_FLAG_ON) { //check http method check_result = check_http_method(recv_data.receive_buffer + new_send_it->send_offset, request_data_remain_size); diff --git a/test/script/PT/B/B-17.sh b/test/script/PT/B/B-17.sh index ca1c0e67..aee06950 100755 --- a/test/script/PT/B/B-17.sh +++ b/test/script/PT/B/B-17.sh @@ -14,6 +14,7 @@ then echo "Test failed: $INIT_L7VSD start" exit 1 fi +usleep 100000 $INIT_L7VSD stop if [ $? -ne 0 ] @@ -21,6 +22,7 @@ then echo "Test failed: $INIT_L7VSD stop" exit 1 fi +usleep 100000 #Add Service $INIT_L7VSD start diff --git a/test/script/PT/B/B-18.sh b/test/script/PT/B/B-18.sh index 204a1e06..c71a3eb2 100755 --- a/test/script/PT/B/B-18.sh +++ b/test/script/PT/B/B-18.sh @@ -15,6 +15,7 @@ then echo "Test failed: $INIT_L7VSD start" exit 1 fi +usleep 100000 $INIT_L7VSD stop if [ $? -ne 0 ] @@ -22,6 +23,7 @@ then echo "Test failed: $INIT_L7VSD stop" exit 1 fi +usleep 100000 #Add Service $INIT_L7VSD start diff --git a/test/script/PT/B/B-19.sh b/test/script/PT/B/B-19.sh index 31c172ed..42e3a849 100755 --- a/test/script/PT/B/B-19.sh +++ b/test/script/PT/B/B-19.sh @@ -14,6 +14,7 @@ then echo "Test failed: $INIT_L7VSD start" exit 1 fi +usleep 100000 $INIT_L7VSD stop if [ $? -ne 0 ] @@ -21,6 +22,7 @@ then echo "Test failed: $INIT_L7VSD stop" exit 1 fi +usleep 100000 #Add Service $INIT_L7VSD start diff --git a/test/script/PT/B/B-20.sh b/test/script/PT/B/B-20.sh index 17b17295..893ca6d3 100755 --- a/test/script/PT/B/B-20.sh +++ b/test/script/PT/B/B-20.sh @@ -14,6 +14,7 @@ then echo "Test failed: $INIT_L7VSD start" exit 1 fi +usleep 100000 $INIT_L7VSD stop if [ $? -ne 0 ] @@ -21,6 +22,7 @@ then echo "Test failed: $INIT_L7VSD stop" exit 1 fi +usleep 100000 #Add Service $INIT_L7VSD start diff --git a/test/script/PT/B/B-21.sh b/test/script/PT/B/B-21.sh index fb77ddb1..5b1cc61c 100755 --- a/test/script/PT/B/B-21.sh +++ b/test/script/PT/B/B-21.sh @@ -11,6 +11,7 @@ then echo "Test failed: $INIT_L7VSD start" exit 1 fi +usleep 100000 $INIT_L7VSD stop if [ $? -ne 0 ] @@ -18,6 +19,7 @@ then echo "Test failed: $INIT_L7VSD stop" exit 1 fi +usleep 100000 #Add Service $INIT_L7VSD start diff --git a/test/script/PT/B/B-44-IPv4v4.sh b/test/script/PT/B/B-44-IPv4v4.sh index cbce7c5d..acc8a7ef 100755 --- a/test/script/PT/B/B-44-IPv4v4.sh +++ b/test/script/PT/B/B-44-IPv4v4.sh @@ -23,6 +23,7 @@ then exit 1 fi usleep 100000 + #Add Virtual Service $L7VSADM -A -t $VS1:40001 -m sessionless -s rr if [ $? -ne 0 ] @@ -42,7 +43,6 @@ fi #Check Return Value RET=`snmpget -v 2c -c public localhost ULTRAMONKEY-L7-MIB::l7vsVsAddr.1 2>&1` -usleep 100000 EXPECT="ULTRAMONKEY-L7-MIB::l7vsVsAddr.1 = STRING: \"$VS1\"" if [ "${RET}" != "${EXPECT}" ] -- 2.11.0