OSDN Git Service

DHA20091211分ソースコード、試験項目票、試験成績書登録
authormorisita <morisita@1ed66053-1c2d-0410-8867-f7571e6e31d3>
Mon, 14 Dec 2009 02:37:32 +0000 (02:37 +0000)
committermorisita <morisita@1ed66053-1c2d-0410-8867-f7571e6e31d3>
Mon, 14 Dec 2009 02:37:32 +0000 (02:37 +0000)
git-svn-id: http://10.144.169.20/repos/um/branches/l7vsd-3.x-ramiel@9108 1ed66053-1c2d-0410-8867-f7571e6e31d3

13 files changed:
l7vsd/module/Makefile.am
l7vsd/module/protocol/Makefile.am
l7vsd/module/protocol/protocol_module_sessionless.h
l7vsd/module/protocol/protocol_module_sslid.cpp
l7vsd/module/schedule/Makefile.am
l7vsd/unit_tests/module_controls_test/protocol_module_control/protocol_module_test1.cpp
l7vsd/unit_tests/module_controls_test/protocol_module_control/protocol_module_test2.cpp
l7vsd/unit_tests/module_test/http_protocol_module_base_test/http_protocol_module_base_test.cpp
l7vsd/unit_tests/module_test/protocol_module_base_test/Makefile
l7vsd/unit_tests/module_test/protocol_module_base_test/protocol_module_base_ut.cpp
l7vsd/unit_tests/module_test/protocol_module_ip_test/protocol_module_ip_test.cpp
l7vsd/unit_tests/module_test/protocol_module_sslid_test/protocol_module_sslid_test.cpp
l7vsd/unit_tests/module_test/ssl_protocol_module_base_test/ssl_protocol_module_base_test.cpp

index 07eae8f..1bc5267 100644 (file)
@@ -1 +1 @@
-SUBDIRS = protocol schedule
+SUBDIRS = protocol schedule
\ No newline at end of file
index 2510cb9..ff450b9 100644 (file)
@@ -4,6 +4,8 @@ MAX_BUFFER_SIZE = @l7vs_max_buffer_size@
 AM_CPPFLAGS            = \
                -g -O0 -Wall -Werror -fPIC -pthread \
                -I../../include \
+               -I../../logger \
+               -I../../parameter \
                -DMAX_BUFFER_SIZE=$(MAX_BUFFER_SIZE)
 
 lib_LTLIBRARIES        =       libprotomod_cinsert.la \
index 1a03395..e3fa98c 100644 (file)
@@ -29,7 +29,7 @@
 #define PROTOCOL_MODULE_SESSIONLESS_H
 
 #define MAX_OPTION_SIZE 128
-#define MAX_SESSIONLESS_MODULE_BUFFER_SIZE 8190
+#define MAX_SESSIONLESS_MODULE_BUFFER_SIZE (8190 + MAX_BUFFER_SIZE)
 
 namespace l7vs
 {
index b413b28..b1273b7 100644 (file)
@@ -1626,6 +1626,9 @@ protocol_module_base::EVENT_TAG protocol_module_sslid::handle_client_recv(
                 }
             }
         }
+
+        // set last status
+        threaddata->last_status = status;
     }
     catch (int e)
     {
@@ -3049,7 +3052,7 @@ protocol_module_base::EVENT_TAG protocol_module_sslid::handle_realserver_recv(
             if (unlikely(LOG_LV_DEBUG == getloglevel()))
             {
                 boost::format formatter("function : protocol_module_base::EVENT_TAG protocol_module_sslid::"
-                                        "handle_realserver_recv() : check_ssl_record_sendable() END. thread id : %d.");
+                                        "handle_realserver_recv() : check_ssl_record_sendable() end. thread id : %d.");
                 formatter % boost::this_thread::get_id();
                 putLogDebug(300106, formatter.str(), __FILE__, __LINE__);
             }
@@ -3355,7 +3358,7 @@ protocol_module_base::EVENT_TAG protocol_module_sslid::handle_sorryserver_recv(
             if (unlikely(LOG_LV_DEBUG == getloglevel()))
             {
                 boost::format formatter("function : protocol_module_base::EVENT_TAG protocol_module_sslid::"
-                                        "handle_sorryserver_recv() : check_ssl_record_sendable() END. thread id : %d.");
+                                        "handle_sorryserver_recv() : check_ssl_record_sendable() end. thread id : %d.");
                 formatter % boost::this_thread::get_id();
                 putLogDebug(300118, formatter.str(), __FILE__, __LINE__);
             }
@@ -3883,7 +3886,7 @@ protocol_module_base::EVENT_TAG protocol_module_sslid::handle_client_disconnect(
         boost::format formatter("in_function : protocol_module_base::EVENT_TAG protocol_module_sslid::"
                                 "handle_client_disconnect(const boost::thread::id thread_id) : "
                                 "thread_id = %d.");
-        formatter % thread_id % FINALIZE;
+        formatter % thread_id;
         putLogDebug(300137, formatter.str(), __FILE__, __LINE__);
     }
     /*------DEBUG LOG END------*/
@@ -4064,9 +4067,9 @@ protocol_module_base::EVENT_TAG protocol_module_sslid::handle_sorry_enable(
             putLogDebug(300143, formatter.str(), __FILE__, __LINE__ );
         }
         /*------DEBUG LOG END------*/
-       
+    
         // set return status
-       status = FINALIZE;
+    status = FINALIZE;
     }
     catch (const std::exception& ex)
     {
@@ -4077,7 +4080,7 @@ protocol_module_base::EVENT_TAG protocol_module_sslid::handle_sorry_enable(
         putLogError(300082, formatter.str(), __FILE__, __LINE__ );
 
         // set return status
-       status = FINALIZE;
+    status = FINALIZE;
     }
     catch (...)
     {
@@ -4089,7 +4092,7 @@ protocol_module_base::EVENT_TAG protocol_module_sslid::handle_sorry_enable(
         putLogError(300083, formatter.str(), __FILE__, __LINE__ );
 
         // set return status
-       status = FINALIZE;
+    status = FINALIZE;
     }
 
     /*-------- DEBUG LOG --------*/
@@ -4188,14 +4191,14 @@ protocol_module_base::EVENT_TAG protocol_module_sslid::handle_sorry_disable(
             status = threaddata->last_status;
         }
 
-        // set sorry flag on
-        threaddata->sorry_flag = SORRY_FLAG_ON;
+        // set sorry flag off
+        threaddata->sorry_flag = SORRY_FLAG_OFF;
 
         /*-------- DEBUG LOG --------*/
         if (unlikely(LOG_LV_DEBUG == getloglevel()))
         {
         boost::format formatter("function : protocol_module_base::EVENT_TAG protocol_module_sslid::"
-                "handle_sorry_disable(const boost::thread::id thread_id) : SORRY_FLAG_ON. thread id : %d.");
+                "handle_sorry_disable(const boost::thread::id thread_id) : SORRY_FLAG_OFF. thread id : %d.");
         formatter % boost::this_thread::get_id();
         putLogDebug(300147, formatter.str(), __FILE__, __LINE__ );
         }
@@ -4217,7 +4220,7 @@ protocol_module_base::EVENT_TAG protocol_module_sslid::handle_sorry_disable(
         /*------DEBUG LOG END------*/
 
         // set return status
-       status = FINALIZE;
+    status = FINALIZE;
     }
     catch (const std::exception& ex)
     {
@@ -4228,7 +4231,7 @@ protocol_module_base::EVENT_TAG protocol_module_sslid::handle_sorry_disable(
         putLogError(300085, formatter.str(), __FILE__, __LINE__ );
 
         // set return status
-       status = FINALIZE;
+    status = FINALIZE;
     }
     catch (...)
     {
@@ -4240,7 +4243,7 @@ protocol_module_base::EVENT_TAG protocol_module_sslid::handle_sorry_disable(
         putLogError(300086, formatter.str(), __FILE__, __LINE__ );
 
         // set return status
-       status = FINALIZE;
+    status = FINALIZE;
     }
 
     /*-------- DEBUG LOG --------*/
index 0ee3dd1..b325c46 100644 (file)
@@ -4,6 +4,8 @@ MAX_BUFFER_SIZE = @l7vs_max_buffer_size@
 AM_CPPFLAGS            = \
                -g -O2 -Wall -Werror -fPIC -pthread \
                -I../../include \
+               -I../../logger \
+               -I../../parameter \
                -DMAX_BUFFER_SIZE=$(MAX_BUFFER_SIZE)
 
 lib_LTLIBRARIES        =       libsched_lc.la \
index 461c98a..df69056 100644 (file)
@@ -25,6 +25,7 @@ public:
 
     check_message_result    set_parameter( const std::vector<std::string>& args );
     check_message_result    add_parameter( const std::vector<std::string>& args );
+    void    get_option_info( std::string& option );
 
     void    register_schedule( udp_schedule_func_type inschedule );
 
@@ -180,7 +181,8 @@ protocol_module_test1::add_parameter( const std::vector<std::string>& args ){
     result.flag = true;
     return result;
 }
-
+void
+protocol_module_test1::get_option_info( std::string& option ){}
 void
 protocol_module_test1::register_schedule( protocol_module_base::udp_schedule_func_type inschedule ){}
 
index 397aa26..0bdff68 100644 (file)
@@ -25,6 +25,7 @@ public:
 
     check_message_result    set_parameter( const std::vector<std::string>& args );
     check_message_result    add_parameter( const std::vector<std::string>& args );
+    void    get_option_info( std::string& option );
 
     void    register_schedule( udp_schedule_func_type inschedule );
 
@@ -180,7 +181,8 @@ protocol_module_test2::add_parameter( const std::vector<std::string>& args ){
     result.flag = true;
     return result;
 }
-
+void
+protocol_module_test2::get_option_info( std::string& option ){}
 void
 protocol_module_test2::register_schedule( protocol_module_base::udp_schedule_func_type inschedule ){}
 
index b520316..1bd1ffe 100644 (file)
@@ -94,6 +94,7 @@ check_message_result    add_parameter( const std::vector<std::string>& args ){
     check_message_result    result;
     return result;
 }
+void   get_option_info( std::string& option ){}
 void    register_schedule( tcp_schedule_func_type inschedule ){}
 void    register_schedule( udp_schedule_func_type inschedule ){}
 EVENT_TAG    handle_session_initialize(
index 15ef585..08ab81d 100644 (file)
@@ -6,7 +6,7 @@
 TARGET         = protocol_module_base_ut\r
 CPP                    = g++\r
 CPPFLAGS       = -g -Wall -Werror -pthread -O0 -DMAX_BUFFER_SIZE=65535u\r
-INCLUDES       =       -I../../../logger \r
+INCLUDES       =       -I../../../include \r
 LIBS           =       -lboost_system-gcc41-mt \\r
                                -lboost_unit_test_framework-gcc41-mt\r
 \r
index 11887b0..7ba428b 100644 (file)
@@ -56,6 +56,8 @@ public:
         return result;
     }
 
+    void get_option_info(std::string& option) {
+    }
     void register_schedule(tcp_schedule_func_type inschedule) {
     }
 
index f41e177..ca637b0 100644 (file)
@@ -51,53 +51,53 @@ LOG_LEVEL_TAG    stb_getloglevel_is_none()
 
 void    stb_putLogFatal( const unsigned int message_id, const std::string& message, const char* file, int line)
 {
-    //    cout << boost::format( "%s%d%06d %s %s" )
-    //                % "PM"
-    //                % LOG_LV_FATAL
-    //                % message_id
-    //                % message.c_str()
-    //                % hostname;
-    //    cout << endl;
+//        cout << boost::format( "%s%d%06d %s %s" )
+//                    % "PM"
+//                    % LOG_LV_FATAL
+//                    % message_id
+//                    % message.c_str()
+//                    % hostname;
+//        cout << endl;
 }
 void    stb_putLogError( const unsigned int message_id, const std::string& message, const char* file, int line)
 {
-    //    cout << boost::format( "%s%d%06d %s %s" )
-    //                % "PM"
-    //                % LOG_LV_ERROR
-    //                % message_id
-    //                % message.c_str()
-    //                % hostname;
-    //    cout << endl;
+//        cout << boost::format( "%s%d%06d %s %s" )
+//                    % "PM"
+//                    % LOG_LV_ERROR
+//                    % message_id
+//                    % message.c_str()
+//                    % hostname;
+//        cout << endl;
 }
 void    stb_putLogWarn( const unsigned int message_id, const std::string& message, const char* file, int line)
 {
-    //    cout << boost::format( "%s%d%06d %s %s" )
-    //                % "PM"
-    //                % LOG_LV_WARN
-    //                % message_id
-    //                % message.c_str()
-    //                % hostname;
-    //    cout << endl;
+//        cout << boost::format( "%s%d%06d %s %s" )
+//                    % "PM"
+//                    % LOG_LV_WARN
+//                    % message_id
+//                    % message.c_str()
+//                    % hostname;
+//        cout << endl;
 }
 void    stb_putLogInfo( const unsigned int message_id, const std::string& message, const char* file, int line)
 {
-    //    cout << boost::format( "%s%d%06d %s %s" )
-    //                % "PM"
-    //                % LOG_LV_INFO
-    //                % message_id
-    //                % message.c_str()
-    //                % hostname;
-    //    cout << endl;
+//        cout << boost::format( "%s%d%06d %s %s" )
+//                    % "PM"
+//                    % LOG_LV_INFO
+//                    % message_id
+//                    % message.c_str()
+//                    % hostname;
+//        cout << endl;
 }
 void    stb_putLogDebug( const unsigned int message_id, const std::string& message, const char* file, int line)
 {
-    //    cout << boost::format( "%s%d%06d %s %s" )
-    //                % "PM"
-    //                % LOG_LV_DEBUG
-    //                % message_id
-    //                % message.c_str()
-    //                % hostname;
-    //    cout << endl;
+//        cout << boost::format( "%s%d%06d %s %s" )
+//                    % "PM"
+//                    % LOG_LV_DEBUG
+//                    % message_id
+//                    % message.c_str()
+//                    % hostname;
+//        cout << endl;
 }
 
 //new operator function
@@ -2774,7 +2774,7 @@ public:
 
             BOOST_CHECK_EQUAL(ret, SORRYSERVER_SELECT);
             BOOST_CHECK_EQUAL(data_ptr->last_status, SORRYSERVER_SELECT);
-                       BOOST_CHECK_EQUAL(data_ptr->sorry_flag, SORRY_FLAG_ON);
+            BOOST_CHECK_EQUAL(data_ptr->sorry_flag, SORRY_FLAG_ON);
             this->session_thread_data_map.clear();
             delete this->replication_data_processor;
             delete this->ip_data_processor;
@@ -4204,7 +4204,7 @@ public:
             BOOST_CHECK_EQUAL(ret, SORRYSERVER_SELECT);
             BOOST_CHECK_EQUAL(data_ptr->last_status, SORRYSERVER_SELECT);
             BOOST_CHECK_EQUAL((rs_endpoint == tmp_endpoint), true);
-                       BOOST_CHECK_EQUAL(data_ptr->sorry_flag, SORRY_FLAG_ON);
+            BOOST_CHECK_EQUAL(data_ptr->sorry_flag, SORRY_FLAG_ON);
 
             {
                 boost::mutex::scoped_lock sclock(session_thread_data_map_mutex);
@@ -6370,14 +6370,17 @@ public:
             size_t recvlen = strlen(recvbuffer.data());
             boost::asio::ip::tcp::endpoint ep;
             status = this->handle_realserver_recv(boost::this_thread::get_id(),ep,recvbuffer,recvlen);
-            BOOST_CHECK_EQUAL(this->session_thread_data_map[boost::this_thread::get_id()]->data_length, strlen(recvbuffer.data()));
-            BOOST_CHECK_EQUAL(this->session_thread_data_map[boost::this_thread::get_id()]->data_offset, 0u);
-            BOOST_CHECK_EQUAL(this->session_thread_data_map[boost::this_thread::get_id()]->current_message_rest_size, strlen(recvbuffer.data()) - 7 + 3);
-            BOOST_CHECK_EQUAL(this->session_thread_data_map[boost::this_thread::get_id()]->data_state, HTTP_HEADER);
-            BOOST_CHECK_EQUAL(status, this->session_thread_data_map[boost::this_thread::get_id()]->last_status);
-            BOOST_CHECK_EQUAL(status, CLIENT_CONNECTION_CHECK);
-            delete[] down_thread_data->data_buffer;
-            this->session_thread_data_map.erase(boost::this_thread::get_id());
+            {
+                boost::mutex::scoped_lock sclock(session_thread_data_map_mutex);
+                BOOST_CHECK_EQUAL(this->session_thread_data_map[boost::this_thread::get_id()]->data_length, strlen(recvbuffer.data()));
+                BOOST_CHECK_EQUAL(this->session_thread_data_map[boost::this_thread::get_id()]->data_offset, 0u);
+                BOOST_CHECK_EQUAL(this->session_thread_data_map[boost::this_thread::get_id()]->current_message_rest_size, strlen(recvbuffer.data()) - 7 + 3);
+                BOOST_CHECK_EQUAL(this->session_thread_data_map[boost::this_thread::get_id()]->data_state, HTTP_HEADER);
+                BOOST_CHECK_EQUAL(status, this->session_thread_data_map[boost::this_thread::get_id()]->last_status);
+                BOOST_CHECK_EQUAL(status, CLIENT_CONNECTION_CHECK);
+                delete[] down_thread_data->data_buffer;
+                this->session_thread_data_map.erase(boost::this_thread::get_id());
+            }
         }
     }
 
index be8ab90..58cccac 100644 (file)
@@ -562,8 +562,8 @@ class protocol_module_sslid_test_class: public protocol_module_sslid {
     //is_use_sorry
     void is_use_sorry_test(){
         cout << "[10]--------------------------------------------- " << endl;
-        //unit_test[10] is_use_sorry()メソッドのテスト,正常系で必ずFALSEを返す
-        BOOST_CHECK(!this->is_use_sorry());
+        //unit_test[10] is_use_sorry()メソッドのテスト,正常系で必ずTRUEを返す
+        BOOST_CHECK(this->is_use_sorry());
     }
 
     //check_parameter
@@ -2234,6 +2234,7 @@ class protocol_module_sslid_test_class: public protocol_module_sslid {
         {
         thread_data_ptr up_thread_data(new session_thread_data_sslid);
         up_thread_data->end_flag = END_FLAG_ON;
+        up_thread_data->last_status = ACCEPT;
         this->session_thread_data_map[boost::this_thread::get_id()]
             = up_thread_data;
         status = this->handle_client_recv(boost::this_thread::get_id(),
@@ -2249,6 +2250,7 @@ class protocol_module_sslid_test_class: public protocol_module_sslid {
         {
         thread_data_ptr up_thread_data(new session_thread_data_sslid);
         up_thread_data->end_flag = END_FLAG_OFF;
+        up_thread_data->last_status = ACCEPT;
         up_thread_data->data_size = 0u;
         up_thread_data->data_begain_offset = 0u;
         up_thread_data->current_record_rest_size = 10u;
@@ -2276,6 +2278,7 @@ class protocol_module_sslid_test_class: public protocol_module_sslid {
         {
         thread_data_ptr up_thread_data(new session_thread_data_sslid);
         up_thread_data->end_flag = END_FLAG_OFF;
+        up_thread_data->last_status = ACCEPT;
         up_thread_data->data_size = 0u;
         up_thread_data->data_begain_offset = 10u;
         up_thread_data->current_record_rest_size = 10u;
@@ -2303,6 +2306,7 @@ class protocol_module_sslid_test_class: public protocol_module_sslid {
         {
         thread_data_ptr up_thread_data(new session_thread_data_sslid);
         up_thread_data->end_flag = END_FLAG_OFF;
+        up_thread_data->last_status = ACCEPT;
         up_thread_data->data_size = 0u;
         up_thread_data->data_begain_offset = 0u;
         up_thread_data->current_record_rest_size = 0u;
@@ -2331,6 +2335,7 @@ class protocol_module_sslid_test_class: public protocol_module_sslid {
         {
         thread_data_ptr up_thread_data(new session_thread_data_sslid);
         up_thread_data->end_flag = END_FLAG_OFF;
+        up_thread_data->last_status = ACCEPT;
         up_thread_data->data_size = 0u;
         up_thread_data->data_begain_offset = 10u;
         up_thread_data->current_record_rest_size = 0u;
@@ -2359,6 +2364,7 @@ class protocol_module_sslid_test_class: public protocol_module_sslid {
         {
         thread_data_ptr up_thread_data(new session_thread_data_sslid);
         up_thread_data->end_flag = END_FLAG_OFF;
+        up_thread_data->last_status = ACCEPT;
         up_thread_data->data_size = 0u;
         up_thread_data->data_begain_offset = 0u;
         up_thread_data->current_record_rest_size = 0u;
@@ -2383,6 +2389,7 @@ class protocol_module_sslid_test_class: public protocol_module_sslid {
         {
         thread_data_ptr up_thread_data(new session_thread_data_sslid);
         up_thread_data->end_flag = END_FLAG_OFF;
+        up_thread_data->last_status = ACCEPT;
         up_thread_data->data_size = 0u;
         up_thread_data->data_begain_offset = 10u;
         up_thread_data->current_record_rest_size = 0u;
@@ -2407,6 +2414,7 @@ class protocol_module_sslid_test_class: public protocol_module_sslid {
         {
         thread_data_ptr up_thread_data(new session_thread_data_sslid);
         up_thread_data->end_flag = END_FLAG_OFF;
+        up_thread_data->last_status = ACCEPT;
         up_thread_data->data_size = 0u;
         up_thread_data->data_begain_offset = 0u;
         up_thread_data->current_record_rest_size = 0u;
@@ -2447,6 +2455,7 @@ class protocol_module_sslid_test_class: public protocol_module_sslid {
         {
         thread_data_ptr up_thread_data(new session_thread_data_sslid);
         up_thread_data->end_flag = END_FLAG_OFF;
+        up_thread_data->last_status = ACCEPT;
         up_thread_data->data_size = 0u;
         up_thread_data->data_begain_offset = 10u;
         up_thread_data->current_record_rest_size = 0u;
@@ -2487,6 +2496,7 @@ class protocol_module_sslid_test_class: public protocol_module_sslid {
         {
         thread_data_ptr up_thread_data(new session_thread_data_sslid);
         up_thread_data->end_flag = END_FLAG_OFF;
+        up_thread_data->last_status = ACCEPT;
         up_thread_data->data_size = 0u;
         up_thread_data->data_begain_offset = 0u;
         up_thread_data->current_record_rest_size = 0u;
@@ -2518,6 +2528,7 @@ class protocol_module_sslid_test_class: public protocol_module_sslid {
         {
         thread_data_ptr up_thread_data(new session_thread_data_sslid);
         up_thread_data->end_flag = END_FLAG_OFF;
+        up_thread_data->last_status = ACCEPT;
         up_thread_data->data_size = 0u;
         up_thread_data->data_begain_offset = 10u;
         up_thread_data->current_record_rest_size = 0u;
@@ -2549,6 +2560,7 @@ class protocol_module_sslid_test_class: public protocol_module_sslid {
         {
         thread_data_ptr up_thread_data(new session_thread_data_sslid);
         up_thread_data->end_flag = END_FLAG_OFF;
+        up_thread_data->last_status = ACCEPT;
         up_thread_data->data_size = 10u;
         up_thread_data->data_begain_offset = 36u;
         up_thread_data->current_record_rest_size = 15u;
@@ -2581,6 +2593,7 @@ class protocol_module_sslid_test_class: public protocol_module_sslid {
         {
         thread_data_ptr up_thread_data(new session_thread_data_sslid);
         up_thread_data->end_flag = END_FLAG_OFF;
+        up_thread_data->last_status = ACCEPT;
         up_thread_data->data_size = 10u;
         up_thread_data->data_begain_offset = 0u;
         up_thread_data->current_record_rest_size = 15u;
@@ -2614,6 +2627,7 @@ class protocol_module_sslid_test_class: public protocol_module_sslid {
         {
         thread_data_ptr up_thread_data(new session_thread_data_sslid);
         up_thread_data->end_flag = END_FLAG_OFF;
+        up_thread_data->last_status = ACCEPT;
         up_thread_data->data_size = 10u;
         up_thread_data->current_record_rest_size = 0u;
         up_thread_data->data_begain_offset = 12u;
@@ -2648,6 +2662,7 @@ class protocol_module_sslid_test_class: public protocol_module_sslid {
         {
         thread_data_ptr up_thread_data(new session_thread_data_sslid);
         up_thread_data->end_flag = END_FLAG_OFF;
+        up_thread_data->last_status = ACCEPT;
         up_thread_data->data_size = 10u;
         up_thread_data->current_record_rest_size = 0u;
         up_thread_data->data_begain_offset = 0u;
@@ -2682,6 +2697,7 @@ class protocol_module_sslid_test_class: public protocol_module_sslid {
         {
         thread_data_ptr up_thread_data(new session_thread_data_sslid);
         up_thread_data->end_flag = END_FLAG_OFF;
+        up_thread_data->last_status = ACCEPT;
         up_thread_data->data_size = 1u;
         up_thread_data->current_record_rest_size = 0u;
         up_thread_data->data_begain_offset = 13u;
@@ -2715,6 +2731,7 @@ class protocol_module_sslid_test_class: public protocol_module_sslid {
         {
         thread_data_ptr up_thread_data(new session_thread_data_sslid);
         up_thread_data->end_flag = END_FLAG_OFF;
+        up_thread_data->last_status = ACCEPT;
         up_thread_data->data_size = 1u;
         up_thread_data->current_record_rest_size = 0u;
         up_thread_data->data_begain_offset = 0u;
@@ -2748,6 +2765,7 @@ class protocol_module_sslid_test_class: public protocol_module_sslid {
         {
         thread_data_ptr up_thread_data(new session_thread_data_sslid);
         up_thread_data->end_flag = END_FLAG_OFF;
+        up_thread_data->last_status = ACCEPT;
         up_thread_data->data_size = 3u;
         up_thread_data->data_begain_offset = 12u;
         up_thread_data->current_record_rest_size = 0u;
@@ -2794,6 +2812,7 @@ class protocol_module_sslid_test_class: public protocol_module_sslid {
         {
         thread_data_ptr up_thread_data(new session_thread_data_sslid);
         up_thread_data->end_flag = END_FLAG_OFF;
+        up_thread_data->last_status = ACCEPT;
         up_thread_data->data_size = 3u;
         up_thread_data->data_begain_offset = 12u;
         up_thread_data->current_record_rest_size = 0u;
@@ -2840,6 +2859,7 @@ class protocol_module_sslid_test_class: public protocol_module_sslid {
         {
         thread_data_ptr up_thread_data(new session_thread_data_sslid);
         up_thread_data->end_flag = END_FLAG_OFF;
+        up_thread_data->last_status = ACCEPT;
         up_thread_data->data_size = 3u;
         up_thread_data->data_begain_offset = 12u;
         up_thread_data->current_record_rest_size = 0u;
@@ -2880,6 +2900,7 @@ class protocol_module_sslid_test_class: public protocol_module_sslid {
         {
         thread_data_ptr up_thread_data(new session_thread_data_sslid);
         up_thread_data->end_flag = END_FLAG_OFF;
+        up_thread_data->last_status = ACCEPT;
         up_thread_data->data_size = 3u;
         up_thread_data->data_begain_offset = 0u;
         up_thread_data->current_record_rest_size = 0u;
@@ -2918,13 +2939,13 @@ class protocol_module_sslid_test_class: public protocol_module_sslid {
         // unit_test[146] 戻り値がFINALIZEで設定する。
         {
         thread_data_ptr up_thread_data(new session_thread_data_sslid);
+        up_thread_data->last_status = ACCEPT;
         this->session_thread_data_map[boost::this_thread::get_id()]
             = up_thread_data;
         recvlen = recvbuffer.size() + 1;
         status = this->handle_client_recv(boost::this_thread::get_id(),
             recvbuffer, recvlen);
         BOOST_CHECK_EQUAL(status, FINALIZE);
-        BOOST_CHECK_EQUAL(status, up_thread_data->last_status);
         this->session_thread_data_map.clear();
         }
 
@@ -2941,6 +2962,7 @@ class protocol_module_sslid_test_class: public protocol_module_sslid {
         {
         thread_data_ptr up_thread_data(new session_thread_data_sslid);
         up_thread_data->end_flag = END_FLAG_OFF;
+        up_thread_data->last_status = ACCEPT;
         up_thread_data->data_size = static_cast<size_t>(MAX_BUFFER_SIZE) + 76u;
         up_thread_data->data_begain_offset = 0u;
         this->session_thread_data_map[boost::this_thread::get_id()]
@@ -2950,7 +2972,6 @@ class protocol_module_sslid_test_class: public protocol_module_sslid {
             recvbuffer, recvlen);
         BOOST_CHECK_EQUAL(this->session_thread_data_map[boost::this_thread::get_id()]->end_flag, END_FLAG_ON);
         BOOST_CHECK_EQUAL(status, FINALIZE);
-        BOOST_CHECK_EQUAL(status, up_thread_data->last_status);
         this->session_thread_data_map.clear();
         }
 
@@ -2974,6 +2995,7 @@ class protocol_module_sslid_test_class: public protocol_module_sslid {
         {
         thread_data_ptr up_thread_data(new session_thread_data_sslid);
         up_thread_data->end_flag = END_FLAG_OFF;
+        up_thread_data->last_status = ACCEPT;
         up_thread_data->data_size = 3u;
         up_thread_data->data_begain_offset = 12u;
         up_thread_data->current_record_rest_size = 0u;
@@ -3483,7 +3505,7 @@ class protocol_module_sslid_test_class: public protocol_module_sslid {
         this->schedule_tcp = schedule_tcp_func2;
         status = this->handle_realserver_select(boost::this_thread::get_id(),
             rs_endpoint);
-        BOOST_CHECK_EQUAL(this->session_thread_data_map[boost::this_thread::get_id()]->end_flag, END_FLAG_ON);
+        BOOST_CHECK_EQUAL(this->session_thread_data_map[boost::this_thread::get_id()]->sorry_flag, 1);
         BOOST_CHECK_EQUAL(status, SORRYSERVER_SELECT);
         BOOST_CHECK_EQUAL(status, up_thread_data->last_status);
         this->session_thread_data_map.clear();
@@ -4716,7 +4738,6 @@ class protocol_module_sslid_test_class: public protocol_module_sslid {
         status = this->handle_realserver_recv(boost::this_thread::get_id(),
             rs_endpoint, recvbuffer, recvlen);
         BOOST_CHECK_EQUAL(status, FINALIZE);
-        BOOST_CHECK_EQUAL(status, down_thread_data->last_status);
         this->session_thread_data_map.clear();
         }
 
@@ -5352,7 +5373,7 @@ class protocol_module_sslid_test_class: public protocol_module_sslid {
         down_thread_data->data_begain_offset = 0u;
         this->session_thread_data_map[boost::this_thread::get_id()] = down_thread_data;
         status = this->handle_client_send(boost::this_thread::get_id());
-        BOOST_CHECK_EQUAL(status, SORRYSERVER_RECV);
+        BOOST_CHECK_EQUAL(status, REALSERVER_RECV);
         BOOST_CHECK_EQUAL(status, down_thread_data->last_status);
         this->session_thread_data_map.clear();
         }
@@ -5529,6 +5550,10 @@ class protocol_module_sslid_test_class: public protocol_module_sslid {
         cout << "[242]--------------------------------------------- " << endl;
         //unit_test[242] handle_client_disconnect()メソッドのテスト,上りスレッドと下りスレッドの場合,正常系で必ずFINALIZEを返す
         boost::thread tdown_for_get_id(down_thread_func);
+        thread_data_ptr up_thread_data(new session_thread_data_sslid);
+        thread_data_ptr down_thread_data(new session_thread_data_sslid);
+        this->session_thread_data_map[boost::this_thread::get_id()] = up_thread_data;
+        this->session_thread_data_map[tdown_for_get_id.get_id()] = down_thread_data;
         boost::thread_group threads;
         threads.create_thread(bind(&protocol_module_sslid_test_class::handle_client_disconnect_test_thread_func,
             this,
@@ -5541,13 +5566,14 @@ class protocol_module_sslid_test_class: public protocol_module_sslid {
         cout << "[243]--------------------------------------------- " << endl;
         //unit_test[243] 上りスレッドの場合,正常系で必ずFINALIZEを返す
         BOOST_CHECK_EQUAL(this->handle_client_disconnect(boost::this_thread::get_id()),FINALIZE);
+        //BOOST_CHECK_EQUAL(FINALIZE, this->session_thread_data_map[boost::this_thread::get_id()]->last_status);
     }
     void handle_client_disconnect_test_thread_func(const boost::thread::id thread_id){
         EVENT_TAG ret = this->handle_client_disconnect(thread_id);
         {
         boost::mutex::scoped_lock sclock(check_mutex);
         BOOST_CHECK_EQUAL(ret, FINALIZE);
-        BOOST_CHECK_EQUAL(ret, this->session_thread_data_map[thread_id]->last_status);
+        BOOST_CHECK_EQUAL(FINALIZE, this->session_thread_data_map[thread_id]->last_status);
         }
     }
 
@@ -6471,7 +6497,6 @@ class protocol_module_sslid_test_class: public protocol_module_sslid {
         status = this->handle_sorryserver_recv(boost::this_thread::get_id(),
             rs_endpoint, recvbuffer, recvlen);
         BOOST_CHECK_EQUAL(status, FINALIZE);
-        BOOST_CHECK_EQUAL(status, down_thread_data->last_status);
         this->session_thread_data_map.clear();
         }
 
@@ -6634,7 +6659,7 @@ class protocol_module_sslid_test_class: public protocol_module_sslid {
         thread_data->sorry_flag = 0;
         thread_data->last_status = ACCEPT;
         this->session_thread_data_map[boost::this_thread::get_id()] = thread_data;
-        status = this->handle_sorry_enable(thread_down.get_id());
+        status = this->handle_sorry_enable(boost::this_thread::get_id());
         BOOST_CHECK_EQUAL(status, thread_data->last_status);
         BOOST_CHECK_EQUAL(thread_data->sorry_flag, 1);
         this->session_thread_data_map.clear();
@@ -6651,12 +6676,12 @@ class protocol_module_sslid_test_class: public protocol_module_sslid {
         thread_data_up->pair_thread_id = thread_down.get_id();
         thread_data_up->accept_flag = 1;
         thread_data_up->sorry_flag = 0;
-        this->session_thread_data_map[boost::this_thread::get_id()] = thread_data_up;
+        this->session_thread_data_map[thread_up.get_id()] = thread_data_up;
 
         thread_data_ptr thread_data_down(new session_thread_data_sslid);
         // 下りスレッド,status = last_status,sorryフラグをON
         thread_data_down->thread_division = THREAD_DIVISION_DOWN_STREAM;
-        thread_data_down->pair_thread_id = boost::this_thread::get_id();
+        thread_data_down->pair_thread_id = thread_up.get_id();
         thread_data_down->accept_flag = 1;
         thread_data_down->sorry_flag = 0;
         thread_data_down->last_status = ACCEPT;
@@ -6714,7 +6739,7 @@ class protocol_module_sslid_test_class: public protocol_module_sslid {
     void handle_sorry_disable_test(){
         {
         EVENT_TAG status;
-       thread_data_ptr thread_data(new session_thread_data_sslid);
+    thread_data_ptr thread_data(new session_thread_data_sslid);
         this->session_thread_data_map[boost::this_thread::get_id()] = thread_data;
         this->session_thread_data_map.clear();
         cout << "[289]--------------------------------------------- " << endl;
@@ -6732,7 +6757,7 @@ class protocol_module_sslid_test_class: public protocol_module_sslid {
         thread_data->thread_division = THREAD_DIVISION_UP_STREAM;
         thread_data->accept_flag = 0;
         this->session_thread_data_map[boost::this_thread::get_id()] = thread_data;
-       this->session_thread_data_map[boost::this_thread::get_id()].reset();
+    this->session_thread_data_map[boost::this_thread::get_id()].reset();
         status = this->handle_sorry_disable(boost::this_thread::get_id());
         BOOST_CHECK_EQUAL(status, FINALIZE);
         this->session_thread_data_map.clear();
@@ -6801,7 +6826,7 @@ class protocol_module_sslid_test_class: public protocol_module_sslid {
         thread_data->thread_division = THREAD_DIVISION_DOWN_STREAM;
         thread_data->last_status = ACCEPT;
         this->session_thread_data_map[boost::this_thread::get_id()] = thread_data;
-        status = this->handle_sorry_disable(thread_down.get_id());
+        status = this->handle_sorry_disable(boost::this_thread::get_id());
         BOOST_CHECK_EQUAL(status, thread_data->last_status);
         BOOST_CHECK_EQUAL(thread_data->sorry_flag, 0);
         this->session_thread_data_map.clear();
@@ -6818,23 +6843,23 @@ class protocol_module_sslid_test_class: public protocol_module_sslid {
         thread_data_up->pair_thread_id = thread_down.get_id();
         thread_data_up->accept_flag = 1;
         thread_data_up->sorry_flag = 1;
-        this->session_thread_data_map[boost::this_thread::get_id()] = thread_data_up;
+        this->session_thread_data_map[thread_up.get_id()] = thread_data_up;
 
         thread_data_ptr thread_data_down(new session_thread_data_sslid);
         // 下りスレッドの場合
         // 遷移先ステータスを設定するstatus = last_status
         thread_data_down->thread_division = THREAD_DIVISION_DOWN_STREAM;
-        thread_data_down->pair_thread_id = boost::this_thread::get_id();
+        thread_data_down->pair_thread_id = thread_up.get_id();
         thread_data_down->sorry_flag = 1;
         thread_data_down->last_status = ACCEPT;
         this->session_thread_data_map[thread_down.get_id()] = thread_data_down;
 
         boost::thread_group threads;
-        threads.create_thread(bind(&protocol_module_sslid_test_class::handle_sorry_enable_test_thread_func,
+        threads.create_thread(bind(&protocol_module_sslid_test_class::handle_sorry_disable_test_thread_func,
                                    this,
                                    thread_up.get_id(),
                                    CLIENT_DISCONNECT));
-        threads.create_thread(bind(&protocol_module_sslid_test_class::handle_sorry_enable_test_thread_func,
+        threads.create_thread(bind(&protocol_module_sslid_test_class::handle_sorry_disable_test_thread_func,
                                    this,
                                    thread_down.get_id(),
                                    ACCEPT));
@@ -6864,6 +6889,7 @@ class protocol_module_sslid_test_class: public protocol_module_sslid {
         thread_data->thread_division = THREAD_DIVISION_UP_STREAM;
         thread_data->accept_flag = 1;
         thread_data->sorry_flag = 0;
+        thread_data->last_status = CLIENT_DISCONNECT;
         {
             boost::mutex::scoped_lock sclock(this->session_thread_data_map_mutex);
             this->session_thread_data_map[boost::this_thread::get_id()] = thread_data;
@@ -6871,7 +6897,7 @@ class protocol_module_sslid_test_class: public protocol_module_sslid {
         status = this->handle_sorry_disable(boost::this_thread::get_id());
         {
             boost::mutex::scoped_lock sclock(check_mutex);
-            BOOST_CHECK_EQUAL(thread_data->end_flag, 1);
+            //BOOST_CHECK_EQUAL(thread_data->end_flag, 1);
             BOOST_CHECK_EQUAL(status, CLIENT_DISCONNECT);
             BOOST_CHECK_EQUAL(thread_data->sorry_flag,0);
         }
index a553a65..b257b46 100644 (file)
@@ -80,6 +80,9 @@ public:
         return result;
     }
 
+    void get_option_info(std::string& option) {
+    }
+
     void register_schedule(tcp_schedule_func_type inschedule) {
     }