OSDN Git Service

bug fix. Can not get statistic when option -c only.
author0809216 <0809216@1ed66053-1c2d-0410-8867-f7571e6e31d3>
Mon, 25 Oct 2010 10:59:16 +0000 (10:59 +0000)
committer0809216 <0809216@1ed66053-1c2d-0410-8867-f7571e6e31d3>
Mon, 25 Oct 2010 10:59:16 +0000 (10:59 +0000)
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
l7vsd/module/protocol/protocol_module_sessionless.cpp
test/script/PT/B/B-17.sh
test/script/PT/B/B-18.sh
test/script/PT/B/B-19.sh
test/script/PT/B/B-20.sh
test/script/PT/B/B-21.sh
test/script/PT/B/B-44-IPv4v4.sh

index a306dda..66c68c3 100644 (file)
@@ -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
index c6a5aae..27ef5dc 100644 (file)
@@ -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);
index ca1c0e6..aee0695 100755 (executable)
@@ -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     
index 204a1e0..c71a3eb 100755 (executable)
@@ -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
index 31c172e..42e3a84 100755 (executable)
@@ -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
index 17b1729..893ca6d 100755 (executable)
@@ -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
index fb77ddb..5b1cc61 100755 (executable)
@@ -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
index cbce7c5..acc8a7e 100755 (executable)
@@ -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}" ]