OSDN Git Service

#286
authorokada <okada@1ed66053-1c2d-0410-8867-f7571e6e31d3>
Mon, 23 Feb 2009 08:17:43 +0000 (08:17 +0000)
committerokada <okada@1ed66053-1c2d-0410-8867-f7571e6e31d3>
Mon, 23 Feb 2009 08:17:43 +0000 (08:17 +0000)
20090221.zipのJHCソースをマージ

git-svn-id: http://10.144.169.20/repos/um/branches/l7vsd-3.x-shamshel-IT@7148 1ed66053-1c2d-0410-8867-f7571e6e31d3

module/protocol/protocol_module_sessionless.cpp
module/protocol/protocol_module_sslid.cpp
module/protocol/sslid_replication_data_processor.cpp
module/protocol/sslid_session_data_processor.cpp
unit_tests/sessionless/sessionless_ut.cpp
unit_tests/sslid/protocol_module_sslid_test.cpp
unit_tests/sslid/ssl_protocol_module_base_test.cpp
unit_tests/sslid/sslid_replication_data_processor_test.cpp
unit_tests/sslid/sslid_session_data_processor_test.cpp
unit_tests/sslid/sslid_to_be_test_file.h
unit_tests/sslid/sslid_ut.cpp

index ed6996c..0630420 100644 (file)
@@ -296,6 +296,7 @@ protocol_module_base::check_message_result protocol_module_sessionless::check_pa
         for (std::vector<std::string>::const_iterator it = args.begin(); it != args.end(); ++it)
         {
             argsdump += *it;
+            argsdump += " ";
         }
         formatter % argsdump;
         putLogDebug(10013, formatter.str(), __FILE__, __LINE__ );
@@ -474,6 +475,7 @@ protocol_module_base::check_message_result protocol_module_sessionless::set_para
         for (std::vector<std::string>::const_iterator it = args.begin(); it != args.end(); ++it)
         {
             argsdump += *it;
+            argsdump += " ";
         }
         formatter % argsdump;
         putLogDebug(10015, formatter.str(), __FILE__, __LINE__ );
@@ -668,6 +670,7 @@ protocol_module_base::check_message_result protocol_module_sessionless::add_para
         for (std::vector<std::string>::const_iterator it = args.begin(); it != args.end(); ++it)
         {
             argsdump += *it;
+            argsdump += " ";
         }
         formatter % argsdump;
         putLogDebug(10017, formatter.str(), __FILE__, __LINE__ );
@@ -850,24 +853,28 @@ protocol_module_base::EVENT_TAG protocol_module_sessionless::handle_session_init
     catch (const std::bad_alloc&)
     {
         std::cerr << "protocol_module_sessionless::handle_session_initialize() : exception : Could not allocate memory." << std::endl;
-        putLogError(17017, "Could not allocate memory.", __FILE__, __LINE__ );
+        boost::format formatter("Could not allocate memory. thread id : %d.");
+        formatter % boost::this_thread::get_id();
+        putLogError(17017, formatter.str(), __FILE__, __LINE__ );
         status = FINALIZE;
     }
     catch (const std::exception& ex)
     {
         std::cerr << "protocol_module_sessionless::handle_session_initialize() : exception : error = " << ex.what() << "." << std::endl;
         boost::format formatter("function : protocol_module_base::EVENT_TAG protocol_module_sessionless::"
-                                "handle_session_initialize() : exception : error = %s.");
-        formatter % ex.what();
+                                "handle_session_initialize() : exception : error = %s. thread id : %d.");
+        formatter % ex.what() % boost::this_thread::get_id();
         putLogError(17018, formatter.str(), __FILE__, __LINE__ );
         status = FINALIZE;
     }
     catch (...)
     {
         std::cerr << "protocol_module_sessionless::handle_session_initialize() : Unknown exception." << std::endl;
-        putLogError(17019, "function : protocol_module_base::check_message_result "
-                    "protocol_module_sessionless::handle_session_initialize() : "
-                    "Unknown exception.", __FILE__, __LINE__ );
+        boost::format formatter("function : protocol_module_base::check_message_result "
+                                "protocol_module_sessionless::handle_session_initialize() : "
+                                "Unknown exception. thread id : %d.");
+        formatter % boost::this_thread::get_id();
+        putLogError(17019, formatter.str(), __FILE__, __LINE__ );
 
         status = FINALIZE;
     }
@@ -878,8 +885,8 @@ protocol_module_base::EVENT_TAG protocol_module_sessionless::handle_session_init
         boost::format formatter("out_function : protocol_module_base::EVENT_TAG protocol_module_sessionless::"
                                 "handle_session_initialize(const boost::thread::id up_thread_id, "
                                 "const boost::thread::id down_thread_id, const boost::asio::ip::tcp::endpoint& client_endpoint_tcp, "
-                                "const boost::asio::ip::udp::endpoint& client_endpoint_udp) : return_value = %d.");
-        formatter % status;
+                                "const boost::asio::ip::udp::endpoint& client_endpoint_udp) : return_value = %d. thread id : %d.");
+        formatter % status % boost::this_thread::get_id();
         putLogDebug(10027, formatter.str(), __FILE__, __LINE__ );
     }
     /*------DEBUG LOG END------*/
@@ -952,17 +959,19 @@ protocol_module_base::EVENT_TAG protocol_module_sessionless::handle_session_fina
     {
         std::cerr << "protocol_module_sessionless::handle_session_finalize() : exception : error = " << ex.what() << "." << std::endl;
         boost::format formatter("function : protocol_module_base::EVENT_TAG protocol_module_sessionless::"
-                                "handle_session_finalize() : exception : error = %s.");
-        formatter % ex.what();
+                                "handle_session_finalize() : exception : error = %s. thread id : %d.");
+        formatter % ex.what() % boost::this_thread::get_id();
         putLogError(17020, formatter.str(), __FILE__, __LINE__ );
         status = STOP;
     }
     catch (...)
     {
         std::cerr << "protocol_module_sessionless::handle_session_finalize() : Unknown exception." << std::endl;
-        putLogError(17021, "function : protocol_module_base::EVENT_TAG protocol_module_sessionless::"
-                    "handle_session_finalize() : "
-                    "Unknown exception.", __FILE__, __LINE__ );
+        boost::format formatter("function : protocol_module_base::EVENT_TAG protocol_module_sessionless::"
+                                "handle_session_finalize() : "
+                                "Unknown exception. thread id : %d.");
+        formatter % boost::this_thread::get_id();
+        putLogError(17021, formatter.str(), __FILE__, __LINE__ );
         status = STOP;
     }
 
@@ -971,8 +980,8 @@ protocol_module_base::EVENT_TAG protocol_module_sessionless::handle_session_fina
     {
         boost::format formatter("out_function : protocol_module_base::EVENT_TAG protocol_module_sessionless::"
                                 "handle_session_finalize(const boost::thread::id up_thread_id, "
-                                "const boost::thread::id down_thread_id) : return_value = %d.");
-        formatter % status;
+                                "const boost::thread::id down_thread_id) : return_value = %d. thread id : %d.");
+        formatter % status % boost::this_thread::get_id();
         putLogDebug(10031, formatter.str(), __FILE__, __LINE__ );
     }
     /*------DEBUG LOG END------*/
@@ -1006,7 +1015,9 @@ protocol_module_base::EVENT_TAG protocol_module_sessionless::handle_accept(const
         session_thread_it = session_thread_data_map.find(thread_id);
         if (session_thread_it == session_thread_data_map.end() || session_thread_it->second == NULL)
         {
-            putLogError(17022, "Invalid thread id.", __FILE__, __LINE__ );
+            boost::format formatter("Invalid thread id. thread id : %d.");
+            formatter % boost::this_thread::get_id();
+            putLogError(17022, formatter.str(), __FILE__, __LINE__ );
             throw -1;
         }
 
@@ -1017,8 +1028,10 @@ protocol_module_base::EVENT_TAG protocol_module_sessionless::handle_accept(const
         /*-------- DEBUG LOG --------*/
         if (LOG_LV_DEBUG == getloglevel())
         {
-            putLogDebug(10033, "function : protocol_module_base::EVENT_TAG protocol_module_sessionless::"
-                        "handle_accept(const boost::thread::id thread_id) : ACCEPT_END_FLAG_ON.", __FILE__, __LINE__ );
+            boost::format formatter("function : protocol_module_base::EVENT_TAG protocol_module_sessionless::"
+                                    "handle_accept(const boost::thread::id thread_id) : ACCEPT_END_FLAG_ON. thread id : %d.");
+            formatter % boost::this_thread::get_id();
+            putLogDebug(10033, formatter.str(), __FILE__, __LINE__ );
         }
         /*------DEBUG LOG END------*/
 
@@ -1041,8 +1054,8 @@ protocol_module_base::EVENT_TAG protocol_module_sessionless::handle_accept(const
         if (LOG_LV_DEBUG == getloglevel())
         {
             boost::format formatter("function : protocol_module_base::EVENT_TAG protocol_module_sessionless::"
-                                    "handle_accept() : catch exception e = %d.");
-            formatter % e;
+                                    "handle_accept() : catch exception e = %d. thread id : %d.");
+            formatter % e % boost::this_thread::get_id();
             putLogDebug(10034, formatter.str(), __FILE__, __LINE__ );
         }
         status = FINALIZE;
@@ -1052,8 +1065,8 @@ protocol_module_base::EVENT_TAG protocol_module_sessionless::handle_accept(const
     {
         std::cerr << "protocol_module_sessionless::handle_accept() : exception : error = " << ex.what() << "." << std::endl;
         boost::format formatter("function : protocol_module_base::EVENT_TAG protocol_module_sessionless::"
-                                "handle_accept() : exception : error = %s.");
-        formatter % ex.what();
+                                "handle_accept() : exception : error = %s. thread id : %d.");
+        formatter % ex.what() % boost::this_thread::get_id();
         putLogError(17023, formatter.str(), __FILE__, __LINE__ );
 
         status = FINALIZE;
@@ -1061,9 +1074,11 @@ protocol_module_base::EVENT_TAG protocol_module_sessionless::handle_accept(const
     catch (...)
     {
         std::cerr << "protocol_module_sessionless::handle_accept() : Unknown exception." << std::endl;
-        putLogError(17024, "function : protocol_module_base::EVENT_TAG "
-                    "protocol_module_sessionless::handle_accept() : "
-                    "Unknown exception.", __FILE__, __LINE__ );
+        boost::format formatter("function : protocol_module_base::EVENT_TAG "
+                                "protocol_module_sessionless::handle_accept() : "
+                                "Unknown exception. thread id : %d.");
+        formatter % boost::this_thread::get_id();
+        putLogError(17024, formatter.str(), __FILE__, __LINE__ );
         status = FINALIZE;
     }
 
@@ -1071,8 +1086,8 @@ protocol_module_base::EVENT_TAG protocol_module_sessionless::handle_accept(const
     if (LOG_LV_DEBUG == getloglevel())
     {
         boost::format formatter("out_function : protocol_module_base::EVENT_TAG protocol_module_sessionless::"
-                                "handle_accept(const boost::thread::id thread_id) : return_value = %d.");
-        formatter % status;
+                                "handle_accept(const boost::thread::id thread_id) : return_value = %d. thread id : %d.");
+        formatter % status % boost::this_thread::get_id();
         putLogDebug(10035, formatter.str(), __FILE__, __LINE__ );
     }
     /*------DEBUG LOG END------*/
@@ -1128,16 +1143,17 @@ protocol_module_base::EVENT_TAG protocol_module_sessionless::handle_client_recv(
     if (recvlen > recvbuffer.size())
     {
         std::cerr << "protocol_module_sessionless::handle_client_recv() : Data size bigger than buffer size." << std::endl;
-        putLogError(17025, "Data size bigger than buffer size.", __FILE__,
-                    __LINE__ );
+        boost::format formatter("Data size bigger than buffer size. thread id : %d.");
+        formatter % boost::this_thread::get_id();
+        putLogError(17025, formatter.str(), __FILE__, __LINE__ );
         /*-------- DEBUG LOG --------*/
         if (LOG_LV_DEBUG == getloglevel())
         {
             boost::format formatter("out_function : protocol_module_base::EVENT_TAG protocol_module_sessionless::"
                                     "handle_client_recv(const boost::thread::id thread_id, "
                                     "const boost::array<char,MAX_BUFFER_SIZE>& recvbuffer, "
-                                    "const size_t recvlen) : return_value = %d.");
-            formatter % FINALIZE;
+                                    "const size_t recvlen) : return_value = %d. thread id : %d.");
+            formatter % FINALIZE % boost::this_thread::get_id();
             putLogDebug(10037, formatter.str(), __FILE__, __LINE__ );
         }
         /*------DEBUG LOG END------*/
@@ -1152,7 +1168,9 @@ protocol_module_base::EVENT_TAG protocol_module_sessionless::handle_client_recv(
             session_thread_it = session_thread_data_map.find(thread_id);
             if (session_thread_it == session_thread_data_map.end() || session_thread_it->second == NULL)
             {
-                putLogError(17026, "Invalid thread id.", __FILE__, __LINE__ );
+                boost::format formatter("Invalid thread id. thread id : %d.");
+                formatter % boost::this_thread::get_id();
+                putLogError(17026, formatter.str(), __FILE__, __LINE__ );
                 throw -1;
             }
 
@@ -1170,7 +1188,9 @@ protocol_module_base::EVENT_TAG protocol_module_sessionless::handle_client_recv(
             recive_data_it = session_data->recive_data_map.find(session_data->client_endpoint_tcp);
             if (recive_data_it == session_data->recive_data_map.end())
             {
-                putLogError(17027, "Invalid endpoint.", __FILE__, __LINE__ );
+                boost::format formatter("Invalid endpoint. thread id : %d.");
+                formatter % boost::this_thread::get_id();
+                putLogError(17027, formatter.str(), __FILE__, __LINE__ );
                 throw -1;
             }
 
@@ -1183,7 +1203,9 @@ protocol_module_base::EVENT_TAG protocol_module_sessionless::handle_client_recv(
             it = std::find_if(it, it_end, data_send_ok());
             if (it != it_end)
             {
-                putLogError(17028, "Sending data is not correct.", __FILE__, __LINE__ );
+                boost::format formatter("Sending data is not correct. thread id : %d.");
+                formatter % boost::this_thread::get_id();
+                putLogError(17028, formatter.str(), __FILE__, __LINE__ );
                 throw -1;
             }
 
@@ -1192,7 +1214,9 @@ protocol_module_base::EVENT_TAG protocol_module_sessionless::handle_client_recv(
             it = std::adjacent_find(it, it_end, data_send_repeated());
             if (it != it_end)
             {
-                putLogError(17029, "Sending data is not correct.", __FILE__, __LINE__ );
+                boost::format formatter("Sending data is not correct. thread id : %d.");
+                formatter % boost::this_thread::get_id();
+                putLogError(17029, formatter.str(), __FILE__, __LINE__ );
                 throw -1;
             }
 
@@ -1205,17 +1229,17 @@ protocol_module_base::EVENT_TAG protocol_module_sessionless::handle_client_recv(
                                         "send_offset = %d, unsend_size = %d, edit_division = %d.");
                 int i = 0;
                 for (it = recv_data.send_status_list.begin();
-                     it != recv_data.send_status_list.end();
-                     ++it, ++i)
+                        it != recv_data.send_status_list.end();
+                        ++it, ++i)
                 {
                     formatter % i % it->status % it->send_end_size
-                              % it->send_rest_size % it->send_possible_size
-                              % it->send_offset % it->unsend_size % it->edit_division;
+                    % it->send_rest_size % it->send_possible_size
+                    % it->send_offset % it->unsend_size % it->edit_division;
                     datadump += formatter.str();
                 }
 
                 formatter.parse("function : protocol_module_base::EVENT_TAG protocol_module_sessionless::"
-                            "handle_client_recv() : send status list dump : send status list size = %d.%s");
+                                "handle_client_recv() : send status list dump : send status list size = %d.%s");
 
                 formatter % recv_data.send_status_list.size() % datadump;
                 putLogDebug(10038, formatter.str(), __FILE__, __LINE__ );
@@ -1259,17 +1283,17 @@ protocol_module_base::EVENT_TAG protocol_module_sessionless::handle_client_recv(
                                         "send_offset = %d, unsend_size = %d, edit_division = %d.");
                 int i = 0;
                 for (it = recv_data.send_status_list.begin();
-                     it != recv_data.send_status_list.end();
-                     ++it, ++i)
+                        it != recv_data.send_status_list.end();
+                        ++it, ++i)
                 {
                     formatter % i % it->status % it->send_end_size
-                              % it->send_rest_size % it->send_possible_size
-                              % it->send_offset % it->unsend_size % it->edit_division;
+                    % it->send_rest_size % it->send_possible_size
+                    % it->send_offset % it->unsend_size % it->edit_division;
                     datadump += formatter.str();
                 }
 
                 formatter.parse("function : protocol_module_base::EVENT_TAG protocol_module_sessionless::"
-                            "handle_client_recv() : send status list dump : send status list size = %d.%s");
+                                "handle_client_recv() : send status list dump : send status list size = %d.%s");
 
                 formatter % recv_data.send_status_list.size() % datadump;
                 putLogDebug(10039, formatter.str(), __FILE__, __LINE__ );
@@ -1409,7 +1433,9 @@ protocol_module_base::EVENT_TAG protocol_module_sessionless::handle_client_recv(
                     //pointer valid check
                     if (recv_data.recive_buffer1 == NULL || recv_data.recive_buffer2 == NULL)
                     {
-                        putLogError(17030, "Invalid pointer.", __FILE__, __LINE__ );
+                        boost::format formatter("Invalid pointer. thread id : %d.");
+                        formatter % boost::this_thread::get_id();
+                        putLogError(17030, formatter.str(), __FILE__, __LINE__ );
                         throw -1;
                     }
                     //using buffer is buffer1
@@ -1561,7 +1587,9 @@ protocol_module_base::EVENT_TAG protocol_module_sessionless::handle_client_recv(
                 //pointer valid check
                 if (recv_data.recive_buffer == NULL)
                 {
-                    putLogError(17031, "Invalid pointer.", __FILE__, __LINE__ );
+                    boost::format formatter("Invalid pointer. thread id : %d.");
+                    formatter % boost::this_thread::get_id();
+                    putLogError(17031, formatter.str(), __FILE__, __LINE__ );
                     throw -1;
                 }
                 /*-------- DEBUG LOG --------*/
@@ -1650,8 +1678,8 @@ protocol_module_base::EVENT_TAG protocol_module_sessionless::handle_client_recv(
                     {
                         boost::format formatter("function : protocol_module_base::EVENT_TAG protocol_module_sessionless::"
                                                 "handle_client_recv() : call check_http_method : "
-                                                "return_value = %d.");
-                        formatter % check_result;
+                                                "return_value = %d. thread id : %d.");
+                        formatter % check_result % boost::this_thread::get_id();
                         putLogDebug(10058, formatter.str(), __FILE__, __LINE__ );
                     }
                     /*------DEBUG LOG END------*/
@@ -1665,8 +1693,8 @@ protocol_module_base::EVENT_TAG protocol_module_sessionless::handle_client_recv(
                         {
                             boost::format formatter("function : protocol_module_base::EVENT_TAG protocol_module_sessionless::"
                                                     "handle_client_recv() : call check_http_version : "
-                                                    "return_value = %d.");
-                            formatter % check_result;
+                                                    "return_value = %d. thread id : %d.");
+                            formatter % check_result % boost::this_thread::get_id();
                             putLogDebug(10059, formatter.str(), __FILE__, __LINE__ );
                         }
                         /*------DEBUG LOG END------*/
@@ -1682,8 +1710,8 @@ protocol_module_base::EVENT_TAG protocol_module_sessionless::handle_client_recv(
                         {
                             boost::format formatter("function : protocol_module_base::EVENT_TAG protocol_module_sessionless::"
                                                     "handle_client_recv() : call find_http_header : "
-                                                    "return_value = %d.");
-                            formatter % static_cast<int>(bret);
+                                                    "return_value = %d. thread id : %d.");
+                            formatter % static_cast<int>(bret) % boost::this_thread::get_id();
                             putLogDebug(10060, formatter.str(), __FILE__, __LINE__ );
                         }
                         /*------DEBUG LOG END------*/
@@ -1698,8 +1726,8 @@ protocol_module_base::EVENT_TAG protocol_module_sessionless::handle_client_recv(
                             {
                                 boost::format formatter("function : protocol_module_base::EVENT_TAG protocol_module_sessionless::"
                                                         "handle_client_recv() : call find_http_header : "
-                                                        "return_value = %d.");
-                                formatter % static_cast<int>(bret);
+                                                        "return_value = %d. thread id : %d.");
+                                formatter % static_cast<int>(bret) % boost::this_thread::get_id();
                                 putLogDebug(10061, formatter.str(), __FILE__, __LINE__ );
                             }
                             /*------DEBUG LOG END------*/
@@ -1817,17 +1845,17 @@ protocol_module_base::EVENT_TAG protocol_module_sessionless::handle_client_recv(
                                         "send_offset = %d, unsend_size = %d, edit_division = %d.");
                 int i = 0;
                 for (it = recv_data.send_status_list.begin();
-                     it != recv_data.send_status_list.end();
-                     ++it, ++i)
+                        it != recv_data.send_status_list.end();
+                        ++it, ++i)
                 {
                     formatter % i % it->status % it->send_end_size
-                              % it->send_rest_size % it->send_possible_size
-                              % it->send_offset % it->unsend_size % it->edit_division;
+                    % it->send_rest_size % it->send_possible_size
+                    % it->send_offset % it->unsend_size % it->edit_division;
                     datadump += formatter.str();
                 }
 
                 formatter.parse("function : protocol_module_base::EVENT_TAG protocol_module_sessionless::"
-                            "handle_client_recv() : send status list dump : send status list size = %d.%s");
+                                "handle_client_recv() : send status list dump : send status list size = %d.%s");
 
                 formatter % recv_data.send_status_list.size() % datadump;
                 putLogDebug(10062, formatter.str(), __FILE__, __LINE__ );
@@ -1863,8 +1891,8 @@ protocol_module_base::EVENT_TAG protocol_module_sessionless::handle_client_recv(
                 {
                     boost::format formatter("function : protocol_module_base::EVENT_TAG protocol_module_sessionless::"
                                             "handle_client_recv() : call check_http_method : "
-                                            "return_value = %d.");
-                    formatter % check_result;
+                                            "return_value = %d. thread id : %d.");
+                    formatter % check_result % boost::this_thread::get_id();
                     putLogDebug(10063, formatter.str(), __FILE__, __LINE__ );
                 }
                 /*------DEBUG LOG END------*/
@@ -1879,8 +1907,8 @@ protocol_module_base::EVENT_TAG protocol_module_sessionless::handle_client_recv(
                     {
                         boost::format formatter("function : protocol_module_base::EVENT_TAG protocol_module_sessionless::"
                                                 "handle_client_recv() : call check_http_version : "
-                                                "return_value = %d.");
-                        formatter % check_result;
+                                                "return_value = %d. thread id : %d.");
+                        formatter % check_result % boost::this_thread::get_id();
                         putLogDebug(10064, formatter.str(), __FILE__, __LINE__ );
                     }
                     /*------DEBUG LOG END------*/
@@ -1896,8 +1924,8 @@ protocol_module_base::EVENT_TAG protocol_module_sessionless::handle_client_recv(
                     {
                         boost::format formatter("function : protocol_module_base::EVENT_TAG protocol_module_sessionless::"
                                                 "handle_client_recv() : call find_http_header : "
-                                                "return_value = %d.");
-                        formatter % check_result;
+                                                "return_value = %d. thread id : %d.");
+                        formatter % check_result % boost::this_thread::get_id();
                         putLogDebug(10065, formatter.str(), __FILE__, __LINE__ );
                     }
                     /*------DEBUG LOG END------*/
@@ -1912,8 +1940,8 @@ protocol_module_base::EVENT_TAG protocol_module_sessionless::handle_client_recv(
                         {
                             boost::format formatter("function : protocol_module_base::EVENT_TAG protocol_module_sessionless::"
                                                     "handle_client_recv() : call find_http_header : "
-                                                    "return_value = %d.");
-                            formatter % static_cast<int>(bret);
+                                                    "return_value = %d. thread id : %d.");
+                            formatter % static_cast<int>(bret) % boost::this_thread::get_id();
                             putLogDebug(10066, formatter.str(), __FILE__, __LINE__ );
                         }
                         /*------DEBUG LOG END------*/
@@ -2020,17 +2048,17 @@ protocol_module_base::EVENT_TAG protocol_module_sessionless::handle_client_recv(
                                         "send_offset = %d, unsend_size = %d, edit_division = %d.");
                 int i = 0;
                 for (it = recv_data.send_status_list.begin();
-                     it != recv_data.send_status_list.end();
-                     ++it, ++i)
+                        it != recv_data.send_status_list.end();
+                        ++it, ++i)
                 {
                     formatter % i % it->status % it->send_end_size
-                              % it->send_rest_size % it->send_possible_size
-                              % it->send_offset % it->unsend_size % it->edit_division;
+                    % it->send_rest_size % it->send_possible_size
+                    % it->send_offset % it->unsend_size % it->edit_division;
                     datadump += formatter.str();
                 }
 
                 formatter.parse("function : protocol_module_base::EVENT_TAG protocol_module_sessionless::"
-                            "handle_client_recv() : send status list dump : send status list size = %d.%s");
+                                "handle_client_recv() : send status list dump : send status list size = %d.%s");
 
                 formatter % recv_data.send_status_list.size() % datadump;
                 putLogDebug(10067, formatter.str(), __FILE__, __LINE__ );
@@ -2066,8 +2094,8 @@ protocol_module_base::EVENT_TAG protocol_module_sessionless::handle_client_recv(
         if (LOG_LV_DEBUG == getloglevel())
         {
             boost::format formatter("function : protocol_module_base::EVENT_TAG protocol_module_sessionless::"
-                                    "handle_client_recv() : catch exception e = %d.");
-            formatter % e;
+                                    "handle_client_recv() : catch exception e = %d. thread id : %d.");
+            formatter % e % boost::this_thread::get_id();
             putLogDebug(10068, formatter.str(), __FILE__, __LINE__ );
         }
         /*------DEBUG LOG END------*/
@@ -2076,21 +2104,25 @@ protocol_module_base::EVENT_TAG protocol_module_sessionless::handle_client_recv(
     catch (const std::string& ex)
     {
         std::cerr << "protocol_module_sessionless::handle_client_recv() : exception : " << ex << std::endl;
-        putLogError(17032, ex.c_str(), __FILE__, __LINE__ );
+        boost::format formatter("protocol_module_sessionless::handle_client_recv() : exception :  %s. thread id : %d.");
+        formatter % ex.c_str() % boost::this_thread::get_id();
+        putLogError(17032, formatter.str(), __FILE__, __LINE__ );
         status = FINALIZE;
     }
     catch (const std::bad_alloc&)
     {
         std::cerr << "protocol_module_sessionless::handle_client_recv() : exception : Could not allocate memory." << std::endl;
-        putLogError(17033, "Could not allocate memory.", __FILE__, __LINE__ );
+        boost::format formatter("Could not allocate memory. thread id : %d.");
+        formatter % boost::this_thread::get_id();
+        putLogError(17033, formatter.str(), __FILE__, __LINE__ );
         status = FINALIZE;
     }
     catch (const std::exception& ex)
     {
         std::cerr << "protocol_module_sessionless::handle_client_recv() : exception : error = " << ex.what() << "." << std::endl;
         boost::format formatter("function : protocol_module_base::EVENT_TAG protocol_module_sessionless::"
-                                "handle_client_recv() : exception : error = %s.");
-        formatter % ex.what();
+                                "handle_client_recv() : exception : error = %s. thread id : %d.");
+        formatter % ex.what() % boost::this_thread::get_id();
         putLogError(17034, formatter.str(), __FILE__, __LINE__ );
 
         status = FINALIZE;
@@ -2098,9 +2130,11 @@ protocol_module_base::EVENT_TAG protocol_module_sessionless::handle_client_recv(
     catch (...)
     {
         std::cerr << "protocol_module_sessionless::handle_client_recv() : Unknown exception." << std::endl;
-        putLogError(17035, "function : protocol_module_base::EVENT_TAG "
-                    "protocol_module_sessionless::handle_client_recv() : "
-                    "Unknown exception.", __FILE__, __LINE__ );
+        boost::format formatter("function : protocol_module_base::EVENT_TAG "
+                                "protocol_module_sessionless::handle_client_recv() : "
+                                "Unknown exception. thread id : %d.");
+        formatter % boost::this_thread::get_id();
+        putLogError(17035, formatter.str(), __FILE__, __LINE__ );
         status = FINALIZE;
     }
 
@@ -2110,8 +2144,8 @@ protocol_module_base::EVENT_TAG protocol_module_sessionless::handle_client_recv(
         boost::format formatter("out_function : protocol_module_base::EVENT_TAG protocol_module_sessionless::"
                                 "handle_client_recv(const boost::thread::id thread_id, "
                                 "const boost::array<char,MAX_BUFFER_SIZE>& recvbuffer, "
-                                "const size_t recvlen) : return_value = %d.");
-        formatter % status;
+                                "const size_t recvlen) : return_value = %d. thread id : %d.");
+        formatter % status % boost::this_thread::get_id();
         putLogDebug(10069, formatter.str(), __FILE__, __LINE__ );
     }
     /*------DEBUG LOG END------*/
@@ -2146,15 +2180,17 @@ protocol_module_base::EVENT_TAG protocol_module_sessionless::handle_realserver_s
     if (schedule_tcp.empty())
     {
         std::cerr << "protocol_module_sessionless::handle_realserver_select() : Schedule_tcp function is empty." << std::endl;
-        putLogError(17036, "Schedule_tcp function is empty.", __FILE__, __LINE__ );
+        boost::format formatter("Schedule_tcp function is empty. thread id : %d.");
+        formatter % boost::this_thread::get_id();
+        putLogError(17036, formatter.str(), __FILE__, __LINE__ );
         /*-------- DEBUG LOG --------*/
         if (LOG_LV_DEBUG == getloglevel())
         {
             boost::format formatter("out_function : protocol_module_base::EVENT_TAG protocol_module_sessionless::"
                                     "handle_realserver_select(const boost::thread::id thread_id, "
                                     "boost::asio::ip::tcp::endpoint & rs_endpoint)"
-                                    " : return_value = %d.");
-            formatter % FINALIZE;
+                                    " : return_value = %d. thread id : %d.");
+            formatter % FINALIZE % boost::this_thread::get_id();
             putLogDebug(10071, formatter.str(), __FILE__, __LINE__ );
         }
         /*------DEBUG LOG END------*/
@@ -2169,7 +2205,9 @@ protocol_module_base::EVENT_TAG protocol_module_sessionless::handle_realserver_s
             session_thread_it = session_thread_data_map.find(thread_id);
             if (session_thread_it == session_thread_data_map.end() || session_thread_it->second == NULL)
             {
-                putLogError(17037, "Invalid thread id.", __FILE__, __LINE__ );
+                boost::format formatter("Invalid thread id. thread id : %d.");
+                formatter % boost::this_thread::get_id();
+                putLogError(17037, formatter.str(), __FILE__, __LINE__ );
                 throw -1;
             }
 
@@ -2183,8 +2221,8 @@ protocol_module_base::EVENT_TAG protocol_module_sessionless::handle_realserver_s
         {
             boost::format formatter("function : protocol_module_base::EVENT_TAG protocol_module_sessionless::"
                                     "handle_realserver_select() : call schedule_tcp : "
-                                    "rs_endpoint = [%s]:%d.");
-            formatter % rs_endpoint.address().to_string() % rs_endpoint.port();
+                                    "rs_endpoint = [%s]:%d. thread id : %d.");
+            formatter % rs_endpoint.address().to_string() % rs_endpoint.port() % boost::this_thread::get_id();
             putLogDebug(10072, formatter.str(), __FILE__, __LINE__ );
         }
         /*------DEBUG LOG END------*/
@@ -2204,8 +2242,10 @@ protocol_module_base::EVENT_TAG protocol_module_sessionless::handle_realserver_s
             /*-------- DEBUG LOG --------*/
             if (LOG_LV_DEBUG == getloglevel())
             {
-                putLogDebug(10073, "function : protocol_module_base::EVENT_TAG protocol_module_sessionless::"
-                            "handle_realserver_select() : END_FLAG_ON.", __FILE__, __LINE__ );
+                boost::format formatter("function : protocol_module_base::EVENT_TAG protocol_module_sessionless::"
+                                        "handle_realserver_select() : END_FLAG_ON. thread id : %d.");
+                formatter % boost::this_thread::get_id();
+                putLogDebug(10073, formatter.str(), __FILE__, __LINE__ );
             }
             /*------DEBUG LOG END------*/
             status = CLIENT_DISCONNECT;
@@ -2217,8 +2257,8 @@ protocol_module_base::EVENT_TAG protocol_module_sessionless::handle_realserver_s
         if (LOG_LV_DEBUG == getloglevel())
         {
             boost::format formatter("function : protocol_module_base::EVENT_TAG protocol_module_sessionless::"
-                                    "handle_realserver_select() : catch exception e = %d.");
-            formatter % e;
+                                    "handle_realserver_select() : catch exception e = %d. thread id : %d.");
+            formatter % e % boost::this_thread::get_id();
             putLogDebug(10074, formatter.str(), __FILE__, __LINE__ );
         }
         status = FINALIZE;
@@ -2228,17 +2268,19 @@ protocol_module_base::EVENT_TAG protocol_module_sessionless::handle_realserver_s
     {
         std::cerr << "protocol_module_sessionless::handle_realserver_select() : exception : error = " << ex.what() << "." << std::endl;
         boost::format formatter("function : protocol_module_base::EVENT_TAG protocol_module_sessionless::"
-                                "handle_realserver_select() : exception : error = %s.");
-        formatter % ex.what();
+                                "handle_realserver_select() : exception : error = %s. thread id : %d.");
+        formatter % ex.what() % boost::this_thread::get_id();
         putLogError(17038, formatter.str(), __FILE__, __LINE__ );
         status = FINALIZE;
     }
     catch (...)
     {
         std::cerr << "protocol_module_sessionless::handle_realserver_select() : Unknown exception." << std::endl;
-        putLogError(17039, "function : protocol_module_base::EVENT_TAG "
-                    "protocol_module_sessionless::handle_realserver_select() : "
-                    "Unknown exception.", __FILE__, __LINE__ );
+        boost::format formatter("function : protocol_module_base::EVENT_TAG "
+                                "protocol_module_sessionless::handle_realserver_select() : "
+                                "Unknown exception. thread id : %d.");
+        formatter % boost::this_thread::get_id();
+        putLogError(17039, formatter.str(), __FILE__, __LINE__ );
         status = FINALIZE;
     }
 
@@ -2248,8 +2290,8 @@ protocol_module_base::EVENT_TAG protocol_module_sessionless::handle_realserver_s
         boost::format formatter("out_function : protocol_module_base::EVENT_TAG protocol_module_sessionless::"
                                 "handle_realserver_select(const boost::thread::id thread_id, "
                                 "boost::asio::ip::tcp::endpoint & rs_endpoint)"
-                                " : return_value = %d.");
-        formatter % status;
+                                " : return_value = %d. thread id : %d.");
+        formatter % status % boost::this_thread::get_id();
         putLogDebug(10075, formatter.str(), __FILE__, __LINE__ );
     }
     /*------DEBUG LOG END------*/
@@ -2274,8 +2316,8 @@ protocol_module_base::EVENT_TAG protocol_module_sessionless::handle_realserver_s
                                 "handle_realserver_select(const boost::thread::id thread_id, "
                                 "boost::asio::ip::udp::endpoint& rs_endpoint, boost::array<char,MAX_BUFFER_SIZE>& sendbuffer, "
                                 "size_t& datalen) : "
-                                "return_value = %d.");
-        formatter % STOP;
+                                "return_value = %d. thread id : %d.");
+        formatter % STOP % boost::this_thread::get_id();
         putLogDebug(10076, formatter.str(), __FILE__, __LINE__ );
     }
     /*------DEBUG LOG END------*/
@@ -2323,7 +2365,9 @@ protocol_module_base::EVENT_TAG protocol_module_sessionless::handle_realserver_c
             session_thread_it = session_thread_data_map.find(thread_id);
             if (session_thread_it == session_thread_data_map.end() || session_thread_it->second == NULL)
             {
-                putLogError(17040, "Invalid thread id.", __FILE__, __LINE__ );
+                boost::format formatter("Invalid thread id. thread id : %d.");
+                formatter % boost::this_thread::get_id();
+                putLogError(17040, formatter.str(), __FILE__, __LINE__ );
                 throw -1;
             }
 
@@ -2334,7 +2378,9 @@ protocol_module_base::EVENT_TAG protocol_module_sessionless::handle_realserver_c
         recive_data_it = session_data->recive_data_map.find(session_data->client_endpoint_tcp);
         if (recive_data_it == session_data->recive_data_map.end())
         {
-            putLogError(17041, "Invalid endpoint.", __FILE__, __LINE__ );
+            boost::format formatter("Invalid endpoint. thread id : %d.");
+            formatter % boost::this_thread::get_id();
+            putLogError(17041, formatter.str(), __FILE__, __LINE__ );
             throw -1;
         }
 
@@ -2342,7 +2388,9 @@ protocol_module_base::EVENT_TAG protocol_module_sessionless::handle_realserver_c
         recive_data& recv_data = recive_data_it->second;
         if (recv_data.recive_buffer == NULL)
         {
-            putLogError(17042, "Invalid pointer.", __FILE__, __LINE__ );
+            boost::format formatter("Invalid pointer. thread id : %d.");
+            formatter % boost::this_thread::get_id();
+            putLogError(17042, formatter.str(), __FILE__, __LINE__ );
             throw -1;
         }
 
@@ -2352,7 +2400,9 @@ protocol_module_base::EVENT_TAG protocol_module_sessionless::handle_realserver_c
         it = find_if(it, it_end, data_send_possible());
         if (it == it_end)
         {
-            putLogError(17043, "Sending possible data is not existed.", __FILE__, __LINE__ );
+            boost::format formatter("Sending possible data is not existed. thread id : %d.");
+            formatter % boost::this_thread::get_id();
+            putLogError(17043, formatter.str(), __FILE__, __LINE__ );
             throw -1;
         }
 
@@ -2378,8 +2428,8 @@ protocol_module_base::EVENT_TAG protocol_module_sessionless::handle_realserver_c
                 {
                     boost::format formatter("function : protocol_module_base::EVENT_TAG protocol_module_sessionless::"
                                             "handle_realserver_connect() : call find_http_header : "
-                                            "return_value = %d.");
-                    formatter % static_cast<int>(ret);
+                                            "return_value = %d. thread id : %d.");
+                    formatter % static_cast<int>(ret) % boost::this_thread::get_id();
                     putLogDebug(10078, formatter.str(), __FILE__, __LINE__ );
                 }
                 /*------DEBUG LOG END------*/
@@ -2408,22 +2458,24 @@ protocol_module_base::EVENT_TAG protocol_module_sessionless::handle_realserver_c
                     {
                         boost::format formatter("function : protocol_module_base::EVENT_TAG protocol_module_sessionless::"
                                                 "handle_realserver_connect() : call find_http_header : "
-                                                "return_value = %d.");
-                        formatter % static_cast<int>(ret);
+                                                "return_value = %d. thread id : %d.");
+                        formatter % static_cast<int>(ret) % boost::this_thread::get_id();
                         putLogDebug(10079, formatter.str(), __FILE__, __LINE__ );
                     }
                     /*------DEBUG LOG END------*/
                     if (!ret)
                     {
-                        putLogError(17044, "find_http_header() function failure.", __FILE__, __LINE__ );
+                        boost::format formatter("find_http_header() function failure. thread id : %d.");
+                        formatter % boost::this_thread::get_id();
+                        putLogError(17044, formatter.str(), __FILE__, __LINE__ );
                         /*-------- DEBUG LOG --------*/
                         if (LOG_LV_DEBUG == getloglevel())
                         {
                             boost::format formatter("out_function : protocol_module_base::EVENT_TAG protocol_module_sessionless::"
                                                     "handle_realserver_connect(const boost::thread::id thread_id, "
                                                     "boost::array<char,MAX_BUFFER_SIZE>& sendbuffer, "
-                                                    "size_t& datalen) : return_value = %d.");
-                            formatter % FINALIZE;
+                                                    "size_t& datalen) : return_value = %d. thread id : %d.");
+                            formatter % FINALIZE % boost::this_thread::get_id();
                             putLogDebug(10080, formatter.str(), __FILE__, __LINE__ );
                         }
                         /*------DEBUG LOG END------*/
@@ -2449,8 +2501,10 @@ protocol_module_base::EVENT_TAG protocol_module_sessionless::handle_realserver_c
             /*-------- DEBUG LOG --------*/
             if (LOG_LV_DEBUG == getloglevel())
             {
-                putLogDebug(10081, "function : protocol_module_base::EVENT_TAG protocol_module_sessionless::"
-                            "handle_realserver_connect() : Copy data loop start.", __FILE__, __LINE__ );
+                boost::format formatter("function : protocol_module_base::EVENT_TAG protocol_module_sessionless::"
+                                        "handle_realserver_connect() : Copy data loop start. thread id : %d.");
+                formatter % boost::this_thread::get_id();
+                putLogDebug(10081, formatter.str(), __FILE__, __LINE__ );
             }
             /*------DEBUG LOG END------*/
             while (true)
@@ -2698,8 +2752,10 @@ protocol_module_base::EVENT_TAG protocol_module_sessionless::handle_realserver_c
             /*-------- DEBUG LOG --------*/
             if (LOG_LV_DEBUG == getloglevel())
             {
-                putLogDebug(10092, "function : protocol_module_base::EVENT_TAG protocol_module_sessionless::"
-                            "handle_realserver_connect() : Copy data loop end.", __FILE__, __LINE__ );
+                boost::format formatter("function : protocol_module_base::EVENT_TAG protocol_module_sessionless::"
+                                        "handle_realserver_connect() : Copy data loop end. thread id : %d.");
+                formatter % boost::this_thread::get_id();
+                putLogDebug(10092, formatter.str(), __FILE__, __LINE__ );
             }
             /*------DEBUG LOG END------*/
         }
@@ -2794,8 +2850,8 @@ protocol_module_base::EVENT_TAG protocol_module_sessionless::handle_realserver_c
         if (LOG_LV_DEBUG == getloglevel())
         {
             boost::format formatter("function : protocol_module_base::EVENT_TAG protocol_module_sessionless::"
-                                    "handle_realserver_connect() : catch exception e = %d.");
-            formatter % e;
+                                    "handle_realserver_connect() : catch exception e = %d. thread id : %d.");
+            formatter % e % boost::this_thread::get_id();
             putLogDebug(10097, formatter.str(), __FILE__, __LINE__ );
         }
         status = FINALIZE;
@@ -2805,16 +2861,18 @@ protocol_module_base::EVENT_TAG protocol_module_sessionless::handle_realserver_c
     {
         std::cerr << "protocol_module_sessionless::handle_realserver_connect() : exception : error = " << ex.what() << "." << std::endl;
         boost::format formatter("function : protocol_module_base::EVENT_TAG protocol_module_sessionless::"
-                                "handle_realserver_connect() : exception : error = %s.");
-        formatter % ex.what();
+                                "handle_realserver_connect() : exception : error = %s. thread id : %d.");
+        formatter % ex.what() % boost::this_thread::get_id();
         putLogError(17045, formatter.str(), __FILE__, __LINE__ );
         status = FINALIZE;
     }
     catch (...)
     {
         std::cerr << "protocol_module_sessionless::handle_realserver_connect() : Unknown exception." << std::endl;
-        putLogError(17046, "function : protocol_module_base::EVENT_TAG protocol_module_sessionless::"
-                    "handle_realserver_connect() : Unknown exception.", __FILE__, __LINE__ );
+        boost::format formatter("function : protocol_module_base::EVENT_TAG protocol_module_sessionless::"
+                                "handle_realserver_connect() : Unknown exception. thread id : %d.");
+        formatter % boost::this_thread::get_id();
+        putLogError(17046, formatter.str(), __FILE__, __LINE__ );
         status = FINALIZE;
     }
 
@@ -2824,8 +2882,8 @@ protocol_module_base::EVENT_TAG protocol_module_sessionless::handle_realserver_c
         boost::format formatter("out_function : protocol_module_base::EVENT_TAG protocol_module_sessionless::"
                                 "handle_realserver_connect(const boost::thread::id thread_id, "
                                 "boost::array<char,MAX_BUFFER_SIZE>& sendbuffer, "
-                                "size_t& datalen) : return_value = %d.");
-        formatter % status;
+                                "size_t& datalen) : return_value = %d. thread id : %d.");
+        formatter % status % boost::this_thread::get_id();
         putLogDebug(10098, formatter.str(), __FILE__, __LINE__ );
     }
     /*------DEBUG LOG END------*/
@@ -2863,7 +2921,9 @@ protocol_module_base::EVENT_TAG protocol_module_sessionless::handle_realserver_c
         session_thread_it = session_thread_data_map.find(thread_id);
         if (session_thread_it == session_thread_data_map.end() || session_thread_it->second == NULL)
         {
-            putLogError(17047, "Invalid thread id.", __FILE__, __LINE__ );
+            boost::format formatter("Invalid thread id. thread id : %d.");
+            formatter % boost::this_thread::get_id();
+            putLogError(17047, formatter.str(), __FILE__, __LINE__ );
             throw -1;
         }
 
@@ -2874,8 +2934,10 @@ protocol_module_base::EVENT_TAG protocol_module_sessionless::handle_realserver_c
         /*-------- DEBUG LOG --------*/
         if (LOG_LV_DEBUG == getloglevel())
         {
-            putLogDebug(10100, "function : protocol_module_base::EVENT_TAG protocol_module_sessionless::"
-                        "handle_realserver_connection_fail() : END_FLAG_ON.", __FILE__, __LINE__ );
+            boost::format formatter("function : protocol_module_base::EVENT_TAG protocol_module_sessionless::"
+                                    "handle_realserver_connection_fail() : END_FLAG_ON. thread id : %d.");
+            formatter % boost::this_thread::get_id();
+            putLogDebug(10100, formatter.str(), __FILE__, __LINE__ );
         }
         /*------DEBUG LOG END------*/
         status = CLIENT_DISCONNECT;
@@ -2886,8 +2948,8 @@ protocol_module_base::EVENT_TAG protocol_module_sessionless::handle_realserver_c
         if (LOG_LV_DEBUG == getloglevel())
         {
             boost::format formatter("function : protocol_module_base::EVENT_TAG protocol_module_sessionless::"
-                                    "handle_realserver_connection_fail() : catch exception e = %d.");
-            formatter % e;
+                                    "handle_realserver_connection_fail() : catch exception e = %d. thread id : %d.");
+            formatter % e % boost::this_thread::get_id();
             putLogDebug(10101, formatter.str(), __FILE__, __LINE__ );
         }
         status = FINALIZE;
@@ -2897,16 +2959,18 @@ protocol_module_base::EVENT_TAG protocol_module_sessionless::handle_realserver_c
     {
         std::cerr << "protocol_module_sessionless::handle_realserver_connection_fail() : exception : error = " << ex.what() << "." << std::endl;
         boost::format formatter("function : protocol_module_base::EVENT_TAG protocol_module_sessionless::"
-                                "handle_realserver_connection_fail() : exception : error = %s.");
-        formatter % ex.what();
+                                "handle_realserver_connection_fail() : exception : error = %s. thread id : %d.");
+        formatter % ex.what() % boost::this_thread::get_id();
         putLogError(17048, formatter.str(), __FILE__, __LINE__ );
         status = FINALIZE;
     }
     catch (...)
     {
         std::cerr << "protocol_module_sessionless::handle_realserver_connection_fail() : Unknown exception." << std::endl;
-        putLogError(17049, "function : protocol_module_base::EVENT_TAG protocol_module_sessionless::"
-                    "handle_realserver_connection_fail() : Unknown exception.", __FILE__, __LINE__ );
+        boost::format formatter("function : protocol_module_base::EVENT_TAG protocol_module_sessionless::"
+                                "handle_realserver_connection_fail() : Unknown exception. thread id : %d.");
+        formatter % boost::this_thread::get_id();
+        putLogError(17049, formatter.str(), __FILE__, __LINE__ );
         status = FINALIZE;
     }
 
@@ -2915,8 +2979,8 @@ protocol_module_base::EVENT_TAG protocol_module_sessionless::handle_realserver_c
     {
         boost::format formatter("out_function : protocol_module_base::EVENT_TAG protocol_module_sessionless::"
                                 "handle_realserver_connection_fail(const boost::thread::id thread_id, "
-                                "const boost::asio::ip::tcp::endpoint & rs_endpoint) : return_value = %d.");
-        formatter % status;
+                                "const boost::asio::ip::tcp::endpoint & rs_endpoint) : return_value = %d. thread id : %d.");
+        formatter % status % boost::this_thread::get_id();
         putLogDebug(10102, formatter.str(), __FILE__, __LINE__ );
     }
     /*------DEBUG LOG END------*/
@@ -2952,7 +3016,9 @@ protocol_module_base::EVENT_TAG protocol_module_sessionless::handle_realserver_s
             session_thread_it = session_thread_data_map.find(thread_id);
             if (session_thread_it == session_thread_data_map.end() || session_thread_it->second == NULL)
             {
-                putLogError(17050, "Invalid thread id.", __FILE__, __LINE__ );
+                boost::format formatter("Invalid thread id. thread id : %d.");
+                formatter % boost::this_thread::get_id();
+                putLogError(17050, formatter.str(), __FILE__, __LINE__ );
                 throw -1;
             }
 
@@ -2963,7 +3029,9 @@ protocol_module_base::EVENT_TAG protocol_module_sessionless::handle_realserver_s
         recive_data_it = session_data->recive_data_map.find(session_data->client_endpoint_tcp);
         if (recive_data_it == session_data->recive_data_map.end())
         {
-            putLogError(17051, "Invalid endpoint.", __FILE__, __LINE__ );
+            boost::format formatter("Invalid endpoint. thread id : %d.");
+            formatter % boost::this_thread::get_id();
+            putLogError(17051, formatter.str(), __FILE__, __LINE__ );
             throw -1;
         }
 
@@ -2976,7 +3044,9 @@ protocol_module_base::EVENT_TAG protocol_module_sessionless::handle_realserver_s
         it = std::adjacent_find(it, it_end, data_send_list_incorrect());
         if (it != it_end)
         {
-            putLogError(17052, "Sending possible data is invalid.", __FILE__, __LINE__ );
+            boost::format formatter("Sending possible data is invalid. thread id : %d.");
+            formatter % boost::this_thread::get_id();
+            putLogError(17052, formatter.str(), __FILE__, __LINE__ );
             throw -1;
         }
 
@@ -2985,7 +3055,9 @@ protocol_module_base::EVENT_TAG protocol_module_sessionless::handle_realserver_s
         it = std::find_if(it, it_end, data_send_ok());
         if (it == it_end)
         {
-            putLogError(17053, "Sending possible data is not existed.", __FILE__, __LINE__ );
+            boost::format formatter("Sending possible data is not existed. thread id : %d.");
+            formatter % boost::this_thread::get_id();
+            putLogError(17053, formatter.str(), __FILE__, __LINE__ );
             throw -1;
         }
 
@@ -3044,8 +3116,8 @@ protocol_module_base::EVENT_TAG protocol_module_sessionless::handle_realserver_s
         if (LOG_LV_DEBUG == getloglevel())
         {
             boost::format formatter("function : protocol_module_base::EVENT_TAG protocol_module_sessionless::"
-                                    "handle_realserver_send() : catch exception e = %d.");
-            formatter % e;
+                                    "handle_realserver_send() : catch exception e = %d. thread id : %d.");
+            formatter % e % boost::this_thread::get_id();
             putLogDebug(10104, formatter.str(), __FILE__, __LINE__ );
         }
         status = FINALIZE;
@@ -3055,8 +3127,8 @@ protocol_module_base::EVENT_TAG protocol_module_sessionless::handle_realserver_s
     {
         std::cerr << "protocol_module_sessionless::handle_realserver_send() : exception : error = " << ex.what() << "." << std::endl;
         boost::format formatter("function : protocol_module_base::EVENT_TAG protocol_module_sessionless::"
-                                "handle_realserver_send() : exception : error = %s.");
-        formatter % ex.what();
+                                "handle_realserver_send() : exception : error = %s. thread id : %d.");
+        formatter % ex.what() % boost::this_thread::get_id();
         putLogError(17054, formatter.str(), __FILE__, __LINE__ );
 
         status = FINALIZE;
@@ -3064,8 +3136,10 @@ protocol_module_base::EVENT_TAG protocol_module_sessionless::handle_realserver_s
     catch (...)
     {
         std::cerr << "protocol_module_sessionless::handle_realserver_send() : Unknown exception." << std::endl;
-        putLogError(17055, "function : protocol_module_base::EVENT_TAG protocol_module_sessionless::"
-                    "handle_realserver_send() : Unknown exception.", __FILE__, __LINE__ );
+        boost::format formatter("function : protocol_module_base::EVENT_TAG protocol_module_sessionless::"
+                                "handle_realserver_send() : Unknown exception. thread id : %d.");
+        formatter % boost::this_thread::get_id();
+        putLogError(17055, formatter.str(), __FILE__, __LINE__ );
         status = FINALIZE;
     }
 
@@ -3073,8 +3147,8 @@ protocol_module_base::EVENT_TAG protocol_module_sessionless::handle_realserver_s
     if (LOG_LV_DEBUG == getloglevel())
     {
         boost::format formatter("out_function : protocol_module_base::EVENT_TAG protocol_module_sessionless::"
-                                "handle_realserver_send(const boost::thread::id thread_id) : return_value = %d.");
-        formatter % status;
+                                "handle_realserver_send(const boost::thread::id thread_id) : return_value = %d. thread id : %d.");
+        formatter % status % boost::this_thread::get_id();
         putLogDebug(10105, formatter.str(), __FILE__, __LINE__ );
     }
     /*------DEBUG LOG END------*/
@@ -3114,7 +3188,9 @@ protocol_module_base::EVENT_TAG protocol_module_sessionless::handle_sorryserver_
         session_thread_it = session_thread_data_map.find(thread_id);
         if (session_thread_it == session_thread_data_map.end() || session_thread_it->second== NULL)
         {
-            putLogError(17056, "Invalid thread id.", __FILE__, __LINE__ );
+            boost::format formatter("Invalid thread id. thread id : %d.");
+            formatter % boost::this_thread::get_id();
+            putLogError(17056, formatter.str(), __FILE__, __LINE__ );
             throw -1;
         }
 
@@ -3122,7 +3198,7 @@ protocol_module_base::EVENT_TAG protocol_module_sessionless::handle_sorryserver_
         //set sorry_endpoint
         session_data->target_endpoint = sorry_endpoint;
 
-        status = SORRYSERVER_CONNECT;
+        status = CLIENT_RECV;
     }
     catch (int e)
     {
@@ -3130,8 +3206,8 @@ protocol_module_base::EVENT_TAG protocol_module_sessionless::handle_sorryserver_
         if (LOG_LV_DEBUG == getloglevel())
         {
             boost::format formatter("function : protocol_module_base::EVENT_TAG protocol_module_sessionless::"
-                                    "handle_sorryserver_select() : catch exception e = %d.");
-            formatter % e;
+                                    "handle_sorryserver_select() : catch exception e = %d. thread id : %d.");
+            formatter % e % boost::this_thread::get_id();
             putLogDebug(10107, formatter.str(), __FILE__, __LINE__ );
         }
         status = FINALIZE;
@@ -3140,23 +3216,27 @@ protocol_module_base::EVENT_TAG protocol_module_sessionless::handle_sorryserver_
     catch (const std::bad_alloc& ex)
     {
         std::cerr << "protocol_module_sessionless::handle_sorryserver_select() : exception : Could not allocate memory." << std::endl;
-        putLogError(17057, "Could not allocate memory.", __FILE__, __LINE__ );
+        boost::format formatter("Could not allocate memory. thread id : %d.");
+        formatter % boost::this_thread::get_id();
+        putLogError(17057, formatter.str(), __FILE__, __LINE__ );
         status = FINALIZE;
     }
     catch (const std::exception& ex)
     {
         std::cerr << "protocol_module_sessionless::handle_sorryserver_select() : exception : error = " << ex.what() << "." << std::endl;
         boost::format formatter("function : protocol_module_base::EVENT_TAG protocol_module_sessionless::"
-                                "handle_sorryserver_select() : exception : error = %s.");
-        formatter % ex.what();
+                                "handle_sorryserver_select() : exception : error = %s. thread id : %d.");
+        formatter % ex.what() % boost::this_thread::get_id();
         putLogError(17058, formatter.str(), __FILE__, __LINE__ );
         status = FINALIZE;
     }
     catch (...)
     {
         std::cerr << "protocol_module_sessionless::handle_sorryserver_select() : Unknown exception." << std::endl;
-        putLogError(17059, "function : protocol_module_base::EVENT_TAG protocol_module_sessionless::"
-                    "handle_sorryserver_select() : Unknown exception.", __FILE__, __LINE__ );
+        boost::format formatter("function : protocol_module_base::EVENT_TAG protocol_module_sessionless::"
+                                "handle_sorryserver_select() : Unknown exception. thread id : %d.");
+        formatter % boost::this_thread::get_id();
+        putLogError(17059, formatter.str(), __FILE__, __LINE__ );
         status = FINALIZE;
     }
 
@@ -3166,8 +3246,9 @@ protocol_module_base::EVENT_TAG protocol_module_sessionless::handle_sorryserver_
         boost::format
         formatter(
             "out_function : protocol_module_base::EVENT_TAG protocol_module_sessionless::"
-            "handle_sorryserver_select(const boost::thread::id thread_id, boost::asio::ip::tcp::endpoint& sorry_endpoint) : return_value = %d.");
-        formatter % status;
+            "handle_sorryserver_select(const boost::thread::id thread_id, boost::asio::ip::tcp::endpoint& sorry_endpoint) : return_value = %d."
+            " thread id : %d.");
+        formatter % status % boost::this_thread::get_id();
         putLogDebug(10108, formatter.str(), __FILE__, __LINE__ );
     }
     /*------DEBUG LOG END------*/
@@ -3217,7 +3298,9 @@ protocol_module_base::EVENT_TAG protocol_module_sessionless::handle_sorryserver_
             session_thread_it = session_thread_data_map.find(thread_id);
             if (session_thread_it == session_thread_data_map.end() || session_thread_it->second == NULL)
             {
-                putLogError(17060, "Invalid thread id.", __FILE__, __LINE__ );
+                boost::format formatter("Invalid thread id. thread id : %d.");
+                formatter % boost::this_thread::get_id();
+                putLogError(17060, formatter.str(), __FILE__, __LINE__ );
                 throw -1;
             }
 
@@ -3229,7 +3312,9 @@ protocol_module_base::EVENT_TAG protocol_module_sessionless::handle_sorryserver_
         if (recive_data_it
                 == session_data->recive_data_map.end())
         {
-            putLogError(17061, "Invalid endpoint.", __FILE__, __LINE__ );
+            boost::format formatter("Invalid endpoint. thread id : %d.");
+            formatter % boost::this_thread::get_id();
+            putLogError(17061, formatter.str(), __FILE__, __LINE__ );
             throw -1;
         }
 
@@ -3237,7 +3322,9 @@ protocol_module_base::EVENT_TAG protocol_module_sessionless::handle_sorryserver_
         recive_data& recv_data = recive_data_it->second;
         if (recv_data.recive_buffer == NULL)
         {
-            putLogError(17062, "Invalid pointer.", __FILE__, __LINE__ );
+            boost::format formatter("Invalid pointer. thread id : %d.");
+            formatter % boost::this_thread::get_id();
+            putLogError(17062, formatter.str(), __FILE__, __LINE__ );
             throw -1;
         }
 
@@ -3248,7 +3335,9 @@ protocol_module_base::EVENT_TAG protocol_module_sessionless::handle_sorryserver_
         it = find_if(it, it_end, data_send_possible());
         if (it == it_end)
         {
-            putLogError(17063, "Sending possible data is not existed.", __FILE__, __LINE__ );
+            boost::format formatter("Sending possible data is not existed. thread id : %d.");
+            formatter % boost::this_thread::get_id();
+            putLogError(17063, formatter.str(), __FILE__, __LINE__ );
             throw -1;
         }
 
@@ -3270,14 +3359,14 @@ protocol_module_base::EVENT_TAG protocol_module_sessionless::handle_sorryserver_
                 if (strlen(sorry_uri.data()) > 0)
                 {
                     ret = find_uri(recv_data.recive_buffer + it->send_offset, it->send_possible_size, url_offset,
-                               url_offset_len);
+                                   url_offset_len);
                     /*-------- DEBUG LOG --------*/
                     if (LOG_LV_DEBUG == getloglevel())
                     {
                         boost::format formatter("function : protocol_module_base::EVENT_TAG protocol_module_sessionless::"
                                                 "handle_sorryserver_connect() : call find_uri : "
-                                                "return_value = %d.");
-                        formatter % static_cast<int>(ret);
+                                                "return_value = %d. thread id : %d.");
+                        formatter % static_cast<int>(ret) % boost::this_thread::get_id();
                         putLogDebug(10110, formatter.str(), __FILE__, __LINE__ );
                     }
                     /*------DEBUG LOG END------*/
@@ -3307,8 +3396,8 @@ protocol_module_base::EVENT_TAG protocol_module_sessionless::handle_sorryserver_
                     {
                         boost::format formatter("function : protocol_module_base::EVENT_TAG protocol_module_sessionless::"
                                                 "handle_sorryserver_connect() : call find_http_header : "
-                                                "return_value = %d.");
-                        formatter % static_cast<int>(ret);
+                                                "return_value = %d. thread id : %d.");
+                        formatter % static_cast<int>(ret) % boost::this_thread::get_id();
                         putLogDebug(10111, formatter.str(), __FILE__, __LINE__ );
                     }
                     /*------DEBUG LOG END------*/
@@ -3338,22 +3427,24 @@ protocol_module_base::EVENT_TAG protocol_module_sessionless::handle_sorryserver_
                         {
                             boost::format formatter("function : protocol_module_base::EVENT_TAG protocol_module_sessionless::"
                                                     "handle_sorryserver_connect() : call find_http_header : "
-                                                    "return_value = %d.");
-                            formatter % static_cast<int>(ret);
+                                                    "return_value = %d. thread id : %d.");
+                            formatter % static_cast<int>(ret) % boost::this_thread::get_id();
                             putLogDebug(10112, formatter.str(), __FILE__, __LINE__ );
                         }
                         /*------DEBUG LOG END------*/
                         if (!ret)
                         {
-                            putLogError(17064, "find_http_header() function failure.", __FILE__, __LINE__ );
+                            boost::format formatter("find_http_header() function failure. thread id : %d.");
+                            formatter % boost::this_thread::get_id();
+                            putLogError(17064, formatter.str(), __FILE__, __LINE__ );
                             /*-------- DEBUG LOG --------*/
                             if (LOG_LV_DEBUG == getloglevel())
                             {
                                 boost::format formatter("out_function : protocol_module_base::EVENT_TAG protocol_module_sessionless::"
                                                         "handle_sorryserver_connect(const boost::thread::id thread_id, "
                                                         "boost::array<char,MAX_BUFFER_SIZE>& sendbuffer, "
-                                                        "size_t& datalen) : return_value = %d.");
-                                formatter % FINALIZE;
+                                                        "size_t& datalen) : return_value = %d. thread id : %d.");
+                                formatter % FINALIZE % boost::this_thread::get_id();
                                 putLogDebug(10113, formatter.str(), __FILE__, __LINE__ );
                             }
                             /*------DEBUG LOG END------*/
@@ -3380,8 +3471,10 @@ protocol_module_base::EVENT_TAG protocol_module_sessionless::handle_sorryserver_
             /*-------- DEBUG LOG --------*/
             if (LOG_LV_DEBUG == getloglevel())
             {
-                putLogDebug(10114, "function : protocol_module_base::EVENT_TAG protocol_module_sessionless::"
-                            "handle_sorryserver_connect() : Copy data loop start.", __FILE__, __LINE__ );
+                boost::format formatter("function : protocol_module_base::EVENT_TAG protocol_module_sessionless::"
+                                        "handle_sorryserver_connect() : Copy data loop start. thread id : %d.");
+                formatter % boost::this_thread::get_id();
+                putLogDebug(10114, formatter.str(), __FILE__, __LINE__ );
             }
             /*------DEBUG LOG END------*/
             while (true)
@@ -3625,8 +3718,10 @@ protocol_module_base::EVENT_TAG protocol_module_sessionless::handle_sorryserver_
             /*-------- DEBUG LOG --------*/
             if (LOG_LV_DEBUG == getloglevel())
             {
-                putLogDebug(10125, "function : protocol_module_base::EVENT_TAG protocol_module_sessionless::"
-                            "handle_sorryserver_connect() : Copy data loop end.", __FILE__, __LINE__ );
+                boost::format formatter("function : protocol_module_base::EVENT_TAG protocol_module_sessionless::"
+                                        "handle_sorryserver_connect() : Copy data loop end. thread id : %d.");
+                formatter % boost::this_thread::get_id();
+                putLogDebug(10125, formatter.str(), __FILE__, __LINE__ );
             }
             /*------DEBUG LOG END------*/
         }
@@ -3727,8 +3822,8 @@ protocol_module_base::EVENT_TAG protocol_module_sessionless::handle_sorryserver_
         if (LOG_LV_DEBUG == getloglevel())
         {
             boost::format formatter("function : protocol_module_base::EVENT_TAG protocol_module_sessionless::"
-                                    "handle_sorryserver_connect() : catch exception e = %d.");
-            formatter % e;
+                                    "handle_sorryserver_connect() : catch exception e = %d. thread id : %d.");
+            formatter % e % boost::this_thread::get_id();
             putLogDebug(10130, formatter.str(), __FILE__, __LINE__ );
         }
         status = FINALIZE;
@@ -3738,16 +3833,18 @@ protocol_module_base::EVENT_TAG protocol_module_sessionless::handle_sorryserver_
     {
         std::cerr << "protocol_module_sessionless::handle_sorryserver_connect() : exception : error = " << ex.what() << "." << std::endl;
         boost::format formatter("function : protocol_module_base::EVENT_TAG protocol_module_sessionless::"
-                                "handle_sorryserver_connect() : exception : error = %s.");
-        formatter % ex.what();
+                                "handle_sorryserver_connect() : exception : error = %s. thread id : %d.");
+        formatter % ex.what() % boost::this_thread::get_id();
         putLogError(17065, formatter.str(), __FILE__, __LINE__ );
         status = FINALIZE;
     }
     catch (...)
     {
         std::cerr << "protocol_module_sessionless::handle_sorryserver_connect() : Unknown exception." << std::endl;
-        putLogError(17066, "function : protocol_module_base::EVENT_TAG protocol_module_sessionless::"
-                    "handle_sorryserver_connect() : Unknown exception.", __FILE__, __LINE__ );
+        boost::format formatter("function : protocol_module_base::EVENT_TAG protocol_module_sessionless::"
+                                "handle_sorryserver_connect() : Unknown exception. thread id : %d.");
+        formatter % boost::this_thread::get_id();
+        putLogError(17066, formatter.str(), __FILE__, __LINE__ );
         status = FINALIZE;
     }
 
@@ -3757,8 +3854,8 @@ protocol_module_base::EVENT_TAG protocol_module_sessionless::handle_sorryserver_
         boost::format formatter("out_function : protocol_module_base::EVENT_TAG protocol_module_sessionless::"
                                 "handle_sorryserver_connect(const boost::thread::id thread_id, "
                                 "boost::array<char,MAX_BUFFER_SIZE>& sendbuffer, "
-                                "size_t& datalen) : return_value = %d.");
-        formatter % status;
+                                "size_t& datalen) : return_value = %d. thread id : %d.");
+        formatter % status % boost::this_thread::get_id();
         putLogDebug(10131, formatter.str(), __FILE__, __LINE__ );
     }
     /*------DEBUG LOG END------*/
@@ -3796,7 +3893,9 @@ protocol_module_base::EVENT_TAG protocol_module_sessionless::handle_sorryserver_
         session_thread_it = session_thread_data_map.find(thread_id);
         if (session_thread_it == session_thread_data_map.end() || session_thread_it->second == NULL)
         {
-            putLogError(17067, "Invalid thread id.", __FILE__, __LINE__ );
+            boost::format formatter("Invalid thread id. thread id : %d.");
+            formatter % boost::this_thread::get_id();
+            putLogError(17067, formatter.str(), __FILE__, __LINE__ );
             throw -1;
         }
 
@@ -3807,8 +3906,10 @@ protocol_module_base::EVENT_TAG protocol_module_sessionless::handle_sorryserver_
         /*-------- DEBUG LOG --------*/
         if (LOG_LV_DEBUG == getloglevel())
         {
-            putLogDebug(10133, "function : protocol_module_base::EVENT_TAG protocol_module_sessionless::"
-                        "handle_sorryserver_connection_fail() : END_FLAG_ON.", __FILE__, __LINE__ );
+            boost::format formatter("function : protocol_module_base::EVENT_TAG protocol_module_sessionless::"
+                                    "handle_sorryserver_connection_fail() : END_FLAG_ON. thread id : %d.");
+            formatter % boost::this_thread::get_id();
+            putLogDebug(10133, formatter.str(), __FILE__, __LINE__ );
         }
         /*------DEBUG LOG END------*/
 
@@ -3820,8 +3921,8 @@ protocol_module_base::EVENT_TAG protocol_module_sessionless::handle_sorryserver_
         if (LOG_LV_DEBUG == getloglevel())
         {
             boost::format formatter("function : protocol_module_base::EVENT_TAG protocol_module_sessionless::"
-                                    "handle_sorryserver_connection_fail() : catch exception e = %d.");
-            formatter % e;
+                                    "handle_sorryserver_connection_fail() : catch exception e = %d. thread id : %d.");
+            formatter % e % boost::this_thread::get_id();
             putLogDebug(10134, formatter.str(), __FILE__, __LINE__ );
         }
         status = FINALIZE;
@@ -3831,16 +3932,18 @@ protocol_module_base::EVENT_TAG protocol_module_sessionless::handle_sorryserver_
     {
         std::cerr << "protocol_module_sessionless::handle_sorryserver_connection_fail() : exception : error=" << ex.what() << "." << std::endl;
         boost::format formatter("function : protocol_module_base::EVENT_TAG protocol_module_sessionless::"
-                                "handle_sorryserver_connection_fail() : exception : error = %s.");
-        formatter % ex.what();
+                                "handle_sorryserver_connection_fail() : exception : error = %s. thread id : %d.");
+        formatter % ex.what() % boost::this_thread::get_id();
         putLogError(17068, formatter.str(), __FILE__, __LINE__ );
         status = FINALIZE;
     }
     catch (...)
     {
         std::cerr << "protocol_module_sessionless::handle_sorryserver_connection_fail() : Unknown exception." << std::endl;
-        putLogError(17069, "function : protocol_module_base::EVENT_TAG protocol_module_sessionless::"
-                    "handle_sorryserver_connection_fail() : Unknown exception.", __FILE__, __LINE__ );
+        boost::format formatter("function : protocol_module_base::EVENT_TAG protocol_module_sessionless::"
+                                "handle_sorryserver_connection_fail() : Unknown exception. thread id : %d.");
+        formatter % boost::this_thread::get_id();
+        putLogError(17069, formatter.str(), __FILE__, __LINE__ );
         status = FINALIZE;
     }
 
@@ -3850,8 +3953,9 @@ protocol_module_base::EVENT_TAG protocol_module_sessionless::handle_sorryserver_
         boost::format
         formatter(
             "out_function : protocol_module_base::EVENT_TAG protocol_module_sessionless::"
-            "handle_sorryserver_connection_fail( const boost::thread::id thread_id, const boost::asio::ip::tcp::endpoint & sorry_endpoint) : return_value = %d.");
-        formatter % status;
+            "handle_sorryserver_connection_fail( const boost::thread::id thread_id, const boost::asio::ip::tcp::endpoint & sorry_endpoint) : return_value = %d."
+            " thread id : %d.");
+        formatter % status % boost::this_thread::get_id();
         putLogDebug(10135, formatter.str(), __FILE__, __LINE__ );
     }
     /*------DEBUG LOG END------*/
@@ -3888,7 +3992,9 @@ protocol_module_base::EVENT_TAG protocol_module_sessionless::handle_sorryserver_
             session_thread_it = session_thread_data_map.find(thread_id);
             if (session_thread_it == session_thread_data_map.end() || session_thread_it->second == NULL)
             {
-                putLogError(17070, "Invalid thread id.", __FILE__, __LINE__ );
+                boost::format formatter("Invalid thread id. thread id : %d.");
+                formatter % boost::this_thread::get_id();
+                putLogError(17070, formatter.str(), __FILE__, __LINE__ );
                 throw -1;
             }
 
@@ -3900,7 +4006,9 @@ protocol_module_base::EVENT_TAG protocol_module_sessionless::handle_sorryserver_
         if (recive_data_it
                 == session_data->recive_data_map.end())
         {
-            putLogError(17071, "Invalid endpoint.", __FILE__, __LINE__ );
+            boost::format formatter("Invalid endpoint. thread id : %d.");
+            formatter % boost::this_thread::get_id();
+            putLogError(17071, formatter.str(), __FILE__, __LINE__ );
             throw -1;
         }
 
@@ -3912,7 +4020,9 @@ protocol_module_base::EVENT_TAG protocol_module_sessionless::handle_sorryserver_
         it = std::adjacent_find(it, it_end, data_send_list_incorrect());
         if (it != it_end)
         {
-            putLogError(17072, "Sending possible data is invalid.", __FILE__, __LINE__ );
+            boost::format formatter("Sending possible data is invalid. thread id : %d.");
+            formatter % boost::this_thread::get_id();
+            putLogError(17072, formatter.str(), __FILE__, __LINE__ );
             throw -1;
         }
 
@@ -3921,7 +4031,9 @@ protocol_module_base::EVENT_TAG protocol_module_sessionless::handle_sorryserver_
         it = find_if(it, it_end, data_send_ok());
         if (it == it_end)
         {
-            putLogError(17073, "Sending possible data is not existed.", __FILE__, __LINE__ );
+            boost::format formatter("Sending possible data is not existed. thread id : %d.");
+            formatter % boost::this_thread::get_id();
+            putLogError(17073, formatter.str(), __FILE__, __LINE__ );
             throw -1;
         }
 
@@ -3980,8 +4092,8 @@ protocol_module_base::EVENT_TAG protocol_module_sessionless::handle_sorryserver_
         if (LOG_LV_DEBUG == getloglevel())
         {
             boost::format formatter("function : protocol_module_base::EVENT_TAG protocol_module_sessionless::"
-                                    "handle_sorryserver_send() : catch exception e = %d.");
-            formatter % e;
+                                    "handle_sorryserver_send() : catch exception e = %d. thread id : %d.");
+            formatter % e % boost::this_thread::get_id();
             putLogDebug(10137, formatter.str(), __FILE__, __LINE__ );
         }
         status = FINALIZE;
@@ -3991,8 +4103,8 @@ protocol_module_base::EVENT_TAG protocol_module_sessionless::handle_sorryserver_
     {
         std::cerr << "protocol_module_sessionless::handle_sorryserver_send() : exception : error = " << ex.what() << "." << std::endl;
         boost::format formatter("function : protocol_module_base::EVENT_TAG protocol_module_sessionless::"
-                                "handle_sorryserver_send() : exception : error = %s.");
-        formatter % ex.what();
+                                "handle_sorryserver_send() : exception : error = %s. thread id : %d.");
+        formatter % ex.what() % boost::this_thread::get_id();
         putLogError(17074, formatter.str(), __FILE__, __LINE__ );
 
         status = FINALIZE;
@@ -4000,8 +4112,10 @@ protocol_module_base::EVENT_TAG protocol_module_sessionless::handle_sorryserver_
     catch (...)
     {
         std::cerr << "protocol_module_sessionless::handle_sorryserver_send() : Unknown exception." << std::endl;
-        putLogError(17075, "function : protocol_module_base::EVENT_TAG protocol_module_sessionless::"
-                    "handle_sorryserver_send() : Unknown exception.", __FILE__, __LINE__ );
+        boost::format formatter("function : protocol_module_base::EVENT_TAG protocol_module_sessionless::"
+                                "handle_sorryserver_send() : Unknown exception. thread id : %d.");
+        formatter % boost::this_thread::get_id();
+        putLogError(17075, formatter.str(), __FILE__, __LINE__ );
         status = FINALIZE;
     }
 
@@ -4009,8 +4123,8 @@ protocol_module_base::EVENT_TAG protocol_module_sessionless::handle_sorryserver_
     if (LOG_LV_DEBUG == getloglevel())
     {
         boost::format formatter("out_function : protocol_module_base::EVENT_TAG protocol_module_sessionless::"
-                                "handle_sorryserver_send(const boost::thread::id thread_id) : return_value = %d.");
-        formatter % status;
+                                "handle_sorryserver_send(const boost::thread::id thread_id) : return_value = %d. thread id : %d.");
+        formatter % status % boost::this_thread::get_id();
         putLogDebug(10138, formatter.str(), __FILE__, __LINE__ );
     }
     /*------DEBUG LOG END------*/
@@ -4036,8 +4150,8 @@ protocol_module_base::EVENT_TAG protocol_module_sessionless::handle_realserver_r
                                 "const boost::asio::ip::udp::endpoint& rs_endpoint, "
                                 "const boost::array<char,MAX_BUFFER_SIZE>& recvbuffer, "
                                 "const size_t recvlen) : "
-                                "return_value = %d.");
-        formatter % STOP;
+                                "return_value = %d. thread id : %d.");
+        formatter % STOP % boost::this_thread::get_id();
         putLogDebug(10139, formatter.str(), __FILE__, __LINE__ );
     }
     /*------DEBUG LOG END------*/
@@ -4097,8 +4211,9 @@ protocol_module_base::EVENT_TAG protocol_module_sessionless::handle_realserver_r
     if (recvlen > recvbuffer.size())
     {
         std::cerr << "protocol_module_sessionless::handle_realserver_recv() : Data size bigger than buffer size." << std::endl;
-        putLogError(17076, "Data size bigger than buffer size.", __FILE__,
-                    __LINE__ );
+        boost::format formatter("Data size bigger than buffer size. thread id : %d.");
+        formatter % boost::this_thread::get_id();
+        putLogError(17076, formatter.str(), __FILE__, __LINE__ );
         /*-------- DEBUG LOG --------*/
         if (LOG_LV_DEBUG == getloglevel())
         {
@@ -4106,8 +4221,8 @@ protocol_module_base::EVENT_TAG protocol_module_sessionless::handle_realserver_r
                                     "handle_realserver_recv(const boost::thread::id thread_id, "
                                     "const boost::asio::ip::tcp::endpoint& rs_endpoint, "
                                     "const boost::array<char,MAX_BUFFER_SIZE>& recvbuffer, "
-                                    "const size_t recvlen) : return_value = %d.");
-            formatter % FINALIZE;
+                                    "const size_t recvlen) : return_value = %d. thread id : %d.");
+            formatter % FINALIZE % boost::this_thread::get_id();
             putLogDebug(10141, formatter.str(), __FILE__, __LINE__ );
         }
         /*------DEBUG LOG END------*/
@@ -4123,7 +4238,9 @@ protocol_module_base::EVENT_TAG protocol_module_sessionless::handle_realserver_r
             if (session_thread_it == session_thread_data_map.end()
                     ||session_thread_it->second == NULL)
             {
-                putLogError(17077, "Invalid thread id.", __FILE__, __LINE__ );
+                boost::format formatter("Invalid thread id. thread id : %d.");
+                formatter % boost::this_thread::get_id();
+                putLogError(17077, formatter.str(), __FILE__, __LINE__ );
                 throw -1;
             }
 
@@ -4147,7 +4264,9 @@ protocol_module_base::EVENT_TAG protocol_module_sessionless::handle_realserver_r
         it = std::find_if(it, it_end, data_send_ok());
         if (it != it_end)
         {
-            putLogError(17078, "Sending data is not correct.", __FILE__, __LINE__ );
+            boost::format formatter("Sending data is not correct. thread id : %d.");
+            formatter % boost::this_thread::get_id();
+            putLogError(17078, formatter.str(), __FILE__, __LINE__ );
             throw -1;
         }
 
@@ -4156,7 +4275,9 @@ protocol_module_base::EVENT_TAG protocol_module_sessionless::handle_realserver_r
         it = std::adjacent_find(it, it_end, data_send_repeated());
         if (it != it_end)
         {
-            putLogError(17079, "Sending data is not correct.", __FILE__, __LINE__ );
+            boost::format formatter("Sending data is not correct. thread id : %d.");
+            formatter % boost::this_thread::get_id();
+            putLogError(17079, formatter.str(), __FILE__, __LINE__ );
             throw -1;
         }
 
@@ -4169,17 +4290,17 @@ protocol_module_base::EVENT_TAG protocol_module_sessionless::handle_realserver_r
                                     "send_offset = %d, unsend_size = %d, edit_division = %d.");
             int i = 0;
             for (it = recv_data.send_status_list.begin();
-                 it != recv_data.send_status_list.end();
-                 ++it, ++i)
+                    it != recv_data.send_status_list.end();
+                    ++it, ++i)
             {
                 formatter % i % it->status % it->send_end_size
-                          % it->send_rest_size % it->send_possible_size
-                          % it->send_offset % it->unsend_size % it->edit_division;
+                % it->send_rest_size % it->send_possible_size
+                % it->send_offset % it->unsend_size % it->edit_division;
                 datadump += formatter.str();
             }
 
             formatter.parse("function : protocol_module_base::EVENT_TAG protocol_module_sessionless::"
-                        "handle_realserver_recv() : send status list dump : send status list size = %d.%s");
+                            "handle_realserver_recv() : send status list dump : send status list size = %d.%s");
 
             formatter % recv_data.send_status_list.size() % datadump;
             putLogDebug(10142, formatter.str(), __FILE__, __LINE__ );
@@ -4222,17 +4343,17 @@ protocol_module_base::EVENT_TAG protocol_module_sessionless::handle_realserver_r
                                     "send_offset = %d, unsend_size = %d, edit_division = %d.");
             int i = 0;
             for (it = recv_data.send_status_list.begin();
-                 it != recv_data.send_status_list.end();
-                 ++it, ++i)
+                    it != recv_data.send_status_list.end();
+                    ++it, ++i)
             {
                 formatter % i % it->status % it->send_end_size
-                          % it->send_rest_size % it->send_possible_size
-                          % it->send_offset % it->unsend_size % it->edit_division;
+                % it->send_rest_size % it->send_possible_size
+                % it->send_offset % it->unsend_size % it->edit_division;
                 datadump += formatter.str();
             }
 
             formatter.parse("function : protocol_module_base::EVENT_TAG protocol_module_sessionless::"
-                        "handle_realserver_recv() : send status list dump : send status list size = %d.%s");
+                            "handle_realserver_recv() : send status list dump : send status list size = %d.%s");
 
             formatter % recv_data.send_status_list.size() % datadump;
             putLogDebug(10143, formatter.str(), __FILE__, __LINE__ );
@@ -4373,7 +4494,9 @@ protocol_module_base::EVENT_TAG protocol_module_sessionless::handle_realserver_r
                 //pointer valid check
                 if (recv_data.recive_buffer1 == NULL || recv_data.recive_buffer2 == NULL)
                 {
-                    putLogError(17080, "Invalid pointer.", __FILE__, __LINE__ );
+                    boost::format formatter("Invalid pointer. thread id : %d.");
+                    formatter % boost::this_thread::get_id();
+                    putLogError(17080, formatter.str(), __FILE__, __LINE__ );
                     throw -1;
                 }
                 //using buffer is buffer1
@@ -4530,7 +4653,9 @@ protocol_module_base::EVENT_TAG protocol_module_sessionless::handle_realserver_r
             //pointer valid check
             if (recv_data.recive_buffer == NULL)
             {
-                putLogError(17081, "Invalid pointer.", __FILE__, __LINE__ );
+                boost::format formatter("Invalid pointer. thread id : %d.");
+                formatter % boost::this_thread::get_id();
+                putLogError(17081, formatter.str(), __FILE__, __LINE__ );
                 throw -1;
             }
             /*-------- DEBUG LOG --------*/
@@ -4616,8 +4741,8 @@ protocol_module_base::EVENT_TAG protocol_module_sessionless::handle_realserver_r
                 {
                     boost::format formatter("function : protocol_module_base::EVENT_TAG protocol_module_sessionless::"
                                             "handle_realserver_recv() : call check_http_method : "
-                                            "return_value = %d.");
-                    formatter % check_result;
+                                            "return_value = %d. thread id : %d.");
+                    formatter % check_result % boost::this_thread::get_id();
                     putLogDebug(10162, formatter.str(), __FILE__, __LINE__ );
                 }
                 /*------DEBUG LOG END------*/
@@ -4631,8 +4756,8 @@ protocol_module_base::EVENT_TAG protocol_module_sessionless::handle_realserver_r
                     {
                         boost::format formatter("function : protocol_module_base::EVENT_TAG protocol_module_sessionless::"
                                                 "handle_realserver_recv() : call check_http_version : "
-                                                "return_value = %d.");
-                        formatter % check_result;
+                                                "return_value = %d. thread id : %d.");
+                        formatter % check_result % boost::this_thread::get_id();
                         putLogDebug(10163, formatter.str(), __FILE__, __LINE__ );
                     }
                     /*------DEBUG LOG END------*/
@@ -4648,8 +4773,8 @@ protocol_module_base::EVENT_TAG protocol_module_sessionless::handle_realserver_r
                     {
                         boost::format formatter("function : protocol_module_base::EVENT_TAG protocol_module_sessionless::"
                                                 "handle_realserver_recv() : call find_http_header : "
-                                                "return_value = %d.");
-                        formatter % static_cast<int>(bret);
+                                                "return_value = %d. thread id : %d.");
+                        formatter % static_cast<int>(bret) % boost::this_thread::get_id();
                         putLogDebug(10164, formatter.str(), __FILE__, __LINE__ );
                     }
                     /*------DEBUG LOG END------*/
@@ -4664,8 +4789,8 @@ protocol_module_base::EVENT_TAG protocol_module_sessionless::handle_realserver_r
                         {
                             boost::format formatter("function : protocol_module_base::EVENT_TAG protocol_module_sessionless::"
                                                     "handle_realserver_recv() : call find_http_header : "
-                                                    "return_value = %d.");
-                            formatter % static_cast<int>(bret);
+                                                    "return_value = %d. thread id : %d.");
+                            formatter % static_cast<int>(bret) % boost::this_thread::get_id();
                             putLogDebug(10165, formatter.str(), __FILE__, __LINE__ );
                         }
                         /*------DEBUG LOG END------*/
@@ -4776,17 +4901,17 @@ protocol_module_base::EVENT_TAG protocol_module_sessionless::handle_realserver_r
                                     "send_offset = %d, unsend_size = %d, edit_division = %d.");
             int i = 0;
             for (it = recv_data.send_status_list.begin();
-                 it != recv_data.send_status_list.end();
-                 ++it, ++i)
+                    it != recv_data.send_status_list.end();
+                    ++it, ++i)
             {
                 formatter % i % it->status % it->send_end_size
-                          % it->send_rest_size % it->send_possible_size
-                          % it->send_offset % it->unsend_size % it->edit_division;
+                % it->send_rest_size % it->send_possible_size
+                % it->send_offset % it->unsend_size % it->edit_division;
                 datadump += formatter.str();
             }
 
             formatter.parse("function : protocol_module_base::EVENT_TAG protocol_module_sessionless::"
-                        "handle_realserver_recv() : send status list dump : send status list size = %d.%s");
+                            "handle_realserver_recv() : send status list dump : send status list size = %d.%s");
 
             formatter % recv_data.send_status_list.size() % datadump;
             putLogDebug(10166, formatter.str(), __FILE__, __LINE__ );
@@ -4821,8 +4946,8 @@ protocol_module_base::EVENT_TAG protocol_module_sessionless::handle_realserver_r
             {
                 boost::format formatter("function : protocol_module_base::EVENT_TAG protocol_module_sessionless::"
                                         "handle_realserver_recv() : call check_http_method : "
-                                        "return_value = %d.");
-                formatter % check_result;
+                                        "return_value = %d. thread id : %d.");
+                formatter % check_result % boost::this_thread::get_id();
                 putLogDebug(10167, formatter.str(), __FILE__, __LINE__ );
             }
             /*------DEBUG LOG END------*/
@@ -4837,8 +4962,8 @@ protocol_module_base::EVENT_TAG protocol_module_sessionless::handle_realserver_r
                 {
                     boost::format formatter("function : protocol_module_base::EVENT_TAG protocol_module_sessionless::"
                                             "handle_realserver_recv() : call check_http_version : "
-                                            "return_value = %d.");
-                    formatter % check_result;
+                                            "return_value = %d. thread id : %d.");
+                    formatter % check_result % boost::this_thread::get_id();
                     putLogDebug(10168, formatter.str(), __FILE__, __LINE__ );
                 }
                 /*------DEBUG LOG END------*/
@@ -4854,8 +4979,8 @@ protocol_module_base::EVENT_TAG protocol_module_sessionless::handle_realserver_r
                 {
                     boost::format formatter("function : protocol_module_base::EVENT_TAG protocol_module_sessionless::"
                                             "handle_realserver_recv() : call find_http_header : "
-                                            "return_value = %d.");
-                    formatter % static_cast<int>(bret);
+                                            "return_value = %d. thread id : %d.");
+                    formatter % static_cast<int>(bret) % boost::this_thread::get_id();
                     putLogDebug(10169, formatter.str(), __FILE__, __LINE__ );
                 }
                 /*------DEBUG LOG END------*/
@@ -4870,8 +4995,8 @@ protocol_module_base::EVENT_TAG protocol_module_sessionless::handle_realserver_r
                     {
                         boost::format formatter("function : protocol_module_base::EVENT_TAG protocol_module_sessionless::"
                                                 "handle_realserver_recv() : call find_http_header : "
-                                                "return_value = %d.");
-                        formatter % static_cast<int>(bret);
+                                                "return_value = %d. thread id : %d.");
+                        formatter % static_cast<int>(bret) % boost::this_thread::get_id();
                         putLogDebug(10170, formatter.str(), __FILE__, __LINE__ );
                     }
                     /*------DEBUG LOG END------*/
@@ -4973,17 +5098,17 @@ protocol_module_base::EVENT_TAG protocol_module_sessionless::handle_realserver_r
                                     "send_offset = %d, unsend_size = %d, edit_division = %d.");
             int i = 0;
             for (it = recv_data.send_status_list.begin();
-                 it != recv_data.send_status_list.end();
-                 ++it, ++i)
+                    it != recv_data.send_status_list.end();
+                    ++it, ++i)
             {
                 formatter % i % it->status % it->send_end_size
-                          % it->send_rest_size % it->send_possible_size
-                          % it->send_offset % it->unsend_size % it->edit_division;
+                % it->send_rest_size % it->send_possible_size
+                % it->send_offset % it->unsend_size % it->edit_division;
                 datadump += formatter.str();
             }
 
             formatter.parse("function : protocol_module_base::EVENT_TAG protocol_module_sessionless::"
-                        "handle_realserver_recv() : send status list dump : send status list size = %d.%s");
+                            "handle_realserver_recv() : send status list dump : send status list size = %d.%s");
 
             formatter % recv_data.send_status_list.size() % datadump;
             putLogDebug(10171, formatter.str(), __FILE__, __LINE__ );
@@ -5010,8 +5135,8 @@ protocol_module_base::EVENT_TAG protocol_module_sessionless::handle_realserver_r
         if (LOG_LV_DEBUG == getloglevel())
         {
             boost::format formatter("function : protocol_module_base::EVENT_TAG protocol_module_sessionless::"
-                                    "handle_realserver_recv() : catch exception e = %d.");
-            formatter % e;
+                                    "handle_realserver_recv() : catch exception e = %d. thread id : %d.");
+            formatter % e % boost::this_thread::get_id();
             putLogDebug(10172, formatter.str(), __FILE__, __LINE__ );
         }
         /*------DEBUG LOG END------*/
@@ -5020,21 +5145,25 @@ protocol_module_base::EVENT_TAG protocol_module_sessionless::handle_realserver_r
     catch (const std::string& ex)
     {
         std::cerr << "protocol_module_sessionless::handle_realserver_recv() : exception : " << ex << std::endl;
-        putLogError(17082, ex.c_str(), __FILE__, __LINE__ );
+        boost::format formatter("protocol_module_sessionless::handle_realserver_recv() : exception : %s. thread id : %d.");
+        formatter % ex.c_str() % boost::this_thread::get_id();
+        putLogError(17082, formatter.str(), __FILE__, __LINE__ );
         status = FINALIZE;
     }
     catch (const std::bad_alloc&)
     {
         std::cerr << "protocol_module_sessionless::handle_realserver_recv() : exception : Could not allocate memory." << std::endl;
-        putLogError(17083, "Could not allocate memory.", __FILE__, __LINE__ );
+        boost::format formatter("Could not allocate memory. thread id : %d.");
+        formatter % boost::this_thread::get_id();
+        putLogError(17083, formatter.str(), __FILE__, __LINE__ );
         status = FINALIZE;
     }
     catch (const std::exception& ex)
     {
         std::cerr << "protocol_module_sessionless::handle_realserver_recv() : exception : error = " << ex.what() << "." << std::endl;
         boost::format formatter("function : protocol_module_base::EVENT_TAG protocol_module_sessionless::"
-                                "handle_realserver_recv() : exception : error = %s.");
-        formatter % ex.what();
+                                "handle_realserver_recv() : exception : error = %s. thread id : %d.");
+        formatter % ex.what() % boost::this_thread::get_id();
         putLogError(17084, formatter.str(), __FILE__, __LINE__ );
 
         status = FINALIZE;
@@ -5042,9 +5171,11 @@ protocol_module_base::EVENT_TAG protocol_module_sessionless::handle_realserver_r
     catch (...)
     {
         std::cerr << "protocol_module_sessionless::handle_realserver_recv() : Unknown exception." << std::endl;
-        putLogError(17085, "function : protocol_module_base::EVENT_TAG "
-                    "protocol_module_sessionless::handle_realserver_recv() : "
-                    "Unknown exception.", __FILE__, __LINE__ );
+        boost::format formatter("function : protocol_module_base::EVENT_TAG "
+                                "protocol_module_sessionless::handle_realserver_recv() : "
+                                "Unknown exception. thread id : %d.");
+        formatter % boost::this_thread::get_id();
+        putLogError(17085, formatter.str(), __FILE__, __LINE__ );
         status = FINALIZE;
     }
 
@@ -5055,8 +5186,8 @@ protocol_module_base::EVENT_TAG protocol_module_sessionless::handle_realserver_r
                                 "handle_realserver_recv(const boost::thread::id thread_id, "
                                 "const boost::asio::ip::tcp::endpoint& rs_endpoint, "
                                 "const boost::array<char,MAX_BUFFER_SIZE>& recvbuffer, "
-                                "const size_t recvlen) : return_value = %d.");
-        formatter % status;
+                                "const size_t recvlen) : return_value = %d. thread id : %d.");
+        formatter % status % boost::this_thread::get_id();
         putLogDebug(10173, formatter.str(), __FILE__, __LINE__ );
     }
     /*------DEBUG LOG END------*/
@@ -5119,7 +5250,9 @@ protocol_module_base::EVENT_TAG protocol_module_sessionless::handle_sorryserver_
     if (recvlen > recvbuffer.size())
     {
         std::cerr << "protocol_module_sessionless::handle_sorryserver_recv() : Data size bigger than buffer size." << std::endl;
-        putLogError(17086, "Data size bigger than buffer size.", __FILE__,
+        boost::format formatter("Data size bigger than buffer size. thread id : %d.");
+        formatter % boost::this_thread::get_id();
+        putLogError(17086, formatter.str(), __FILE__,
                     __LINE__ );
         /*-------- DEBUG LOG --------*/
         if (LOG_LV_DEBUG == getloglevel())
@@ -5128,8 +5261,8 @@ protocol_module_base::EVENT_TAG protocol_module_sessionless::handle_sorryserver_
                                     "handle_sorryserver_recv(const boost::thread::id thread_id, "
                                     "const boost::asio::ip::tcp::endpoint& sorry_endpoint, "
                                     "const boost::array<char,MAX_BUFFER_SIZE>& recvbuffer, "
-                                    "const size_t recvlen) : return_value = %d.");
-            formatter % FINALIZE;
+                                    "const size_t recvlen) : return_value = %d. thread id : %d.");
+            formatter % FINALIZE % boost::this_thread::get_id();
             putLogDebug(10175, formatter.str(), __FILE__, __LINE__ );
         }
         /*------DEBUG LOG END------*/
@@ -5144,7 +5277,9 @@ protocol_module_base::EVENT_TAG protocol_module_sessionless::handle_sorryserver_
             session_thread_it = session_thread_data_map.find(thread_id);
             if (session_thread_it == session_thread_data_map.end() || session_thread_it->second == NULL)
             {
-                putLogError(17087, "Invalid thread id.", __FILE__, __LINE__ );
+                boost::format formatter("Invalid thread id. thread id : %d.");
+                formatter % boost::this_thread::get_id();
+                putLogError(17087, formatter.str(), __FILE__, __LINE__ );
                 throw -1;
             }
 
@@ -5167,7 +5302,9 @@ protocol_module_base::EVENT_TAG protocol_module_sessionless::handle_sorryserver_
         it = std::find_if(it, it_end, data_send_ok());
         if (it != it_end)
         {
-            putLogError(17088, "Sending data is invalid.", __FILE__, __LINE__ );
+            boost::format formatter("Sending data is invalid. thread id : %d.");
+            formatter % boost::this_thread::get_id();
+            putLogError(17088, formatter.str(), __FILE__, __LINE__ );
             throw -1;
         }
 
@@ -5176,7 +5313,9 @@ protocol_module_base::EVENT_TAG protocol_module_sessionless::handle_sorryserver_
         it = std::adjacent_find(it, it_end, data_send_repeated());
         if (it != it_end)
         {
-            putLogError(17089, "Sending data is invalid.", __FILE__, __LINE__ );
+            boost::format formatter("Sending data is invalid. thread id : %d.");
+            formatter % boost::this_thread::get_id();
+            putLogError(17089, formatter.str(), __FILE__, __LINE__ );
             throw -1;
         }
 
@@ -5189,17 +5328,17 @@ protocol_module_base::EVENT_TAG protocol_module_sessionless::handle_sorryserver_
                                     "send_offset = %d, unsend_size = %d, edit_division = %d.");
             int i = 0;
             for (it = recv_data.send_status_list.begin();
-                 it != recv_data.send_status_list.end();
-                 ++it, ++i)
+                    it != recv_data.send_status_list.end();
+                    ++it, ++i)
             {
                 formatter % i % it->status % it->send_end_size
-                          % it->send_rest_size % it->send_possible_size
-                          % it->send_offset % it->unsend_size % it->edit_division;
+                % it->send_rest_size % it->send_possible_size
+                % it->send_offset % it->unsend_size % it->edit_division;
                 datadump += formatter.str();
             }
 
             formatter.parse("function : protocol_module_base::EVENT_TAG protocol_module_sessionless::"
-                        "handle_sorryserver_recv() : send status list dump : send status list size = %d.%s");
+                            "handle_sorryserver_recv() : send status list dump : send status list size = %d.%s");
 
             formatter % recv_data.send_status_list.size() % datadump;
             putLogDebug(10176, formatter.str(), __FILE__, __LINE__ );
@@ -5243,17 +5382,17 @@ protocol_module_base::EVENT_TAG protocol_module_sessionless::handle_sorryserver_
                                     "send_offset = %d, unsend_size = %d, edit_division = %d.");
             int i = 0;
             for (it = recv_data.send_status_list.begin();
-                 it != recv_data.send_status_list.end();
-                 ++it, ++i)
+                    it != recv_data.send_status_list.end();
+                    ++it, ++i)
             {
                 formatter % i % it->status % it->send_end_size
-                          % it->send_rest_size % it->send_possible_size
-                          % it->send_offset % it->unsend_size % it->edit_division;
+                % it->send_rest_size % it->send_possible_size
+                % it->send_offset % it->unsend_size % it->edit_division;
                 datadump += formatter.str();
             }
 
             formatter.parse("function : protocol_module_base::EVENT_TAG protocol_module_sessionless::"
-                        "handle_sorryserver_recv() : send status list dump : send status list size = %d.%s");
+                            "handle_sorryserver_recv() : send status list dump : send status list size = %d.%s");
 
             formatter % recv_data.send_status_list.size() % datadump;
             putLogDebug(10177, formatter.str(), __FILE__, __LINE__ );
@@ -5278,9 +5417,9 @@ protocol_module_base::EVENT_TAG protocol_module_sessionless::handle_sorryserver_
                     putLogDebug(10178, formatter.str(), __FILE__, __LINE__ );
                 }
                 /*-------- DEBUG LOG --------*/
-                memset(buffer1, 0, data_remain_size + recvlen);
+                memset(buffer1, 0, buffer_size);
                 //recive_buffer2's memory allocate and initialization
-                buffer2 = new char[data_remain_size + recvlen];
+                buffer2 = new char[buffer_size];
                 /*-------- DEBUG LOG --------*/
                 if (LOG_LV_DEBUG == getloglevel())
                 {
@@ -5289,7 +5428,7 @@ protocol_module_base::EVENT_TAG protocol_module_sessionless::handle_sorryserver_
                     putLogDebug(10179, formatter.str(), __FILE__, __LINE__ );
                 }
                 /*-------- DEBUG LOG END--------*/
-                memset(buffer2, 0, data_remain_size + recvlen);
+                memset(buffer2, 0, buffer_size);
 
                 /*-------- DEBUG LOG --------*/
                 if (LOG_LV_DEBUG == getloglevel())
@@ -5392,7 +5531,9 @@ protocol_module_base::EVENT_TAG protocol_module_sessionless::handle_sorryserver_
                 //pointer valid check
                 if (recv_data.recive_buffer1 == NULL || recv_data.recive_buffer2 == NULL)
                 {
-                    putLogError(17090, "Invalid pointer.", __FILE__, __LINE__ );
+                    boost::format formatter("Invalid pointer. thread id : %d.");
+                    formatter % boost::this_thread::get_id();
+                    putLogError(17090, formatter.str(), __FILE__, __LINE__ );
                     throw -1;
                 }
                 //using buffer is buffer1
@@ -5545,7 +5686,9 @@ protocol_module_base::EVENT_TAG protocol_module_sessionless::handle_sorryserver_
             //pointer valid check
             if (recv_data.recive_buffer == NULL)
             {
-                putLogError(17091, "Invalid pointer.", __FILE__, __LINE__ );
+                boost::format formatter("Invalid pointer. thread id : %d");
+                formatter % boost::this_thread::get_id();
+                putLogError(17091, formatter.str(), __FILE__, __LINE__ );
                 throw -1;
             }
             /*-------- DEBUG LOG --------*/
@@ -5623,8 +5766,8 @@ protocol_module_base::EVENT_TAG protocol_module_sessionless::handle_sorryserver_
                 {
                     boost::format formatter("function : protocol_module_base::EVENT_TAG protocol_module_sessionless::"
                                             "handle_sorryserver_recv() : call check_status_code : "
-                                            "return_value = %d.");
-                    formatter % check_result;
+                                            "return_value = %d. thread id : %d.");
+                    formatter % check_result % boost::this_thread::get_id();
                     putLogDebug(10196, formatter.str(), __FILE__, __LINE__ );
                 }
                 /*------DEBUG LOG END------*/
@@ -5638,8 +5781,8 @@ protocol_module_base::EVENT_TAG protocol_module_sessionless::handle_sorryserver_
                     {
                         boost::format formatter("function : protocol_module_base::EVENT_TAG protocol_module_sessionless::"
                                                 "handle_sorryserver_recv() : call check_http_version : "
-                                                "return_value = %d.");
-                        formatter % check_result;
+                                                "return_value = %d. thread id : %d.");
+                        formatter % check_result % boost::this_thread::get_id();
                         putLogDebug(10197, formatter.str(), __FILE__, __LINE__ );
                     }
                     /*------DEBUG LOG END------*/
@@ -5655,8 +5798,8 @@ protocol_module_base::EVENT_TAG protocol_module_sessionless::handle_sorryserver_
                     {
                         boost::format formatter("function : protocol_module_base::EVENT_TAG protocol_module_sessionless::"
                                                 "handle_sorryserver_recv() : call find_http_header : "
-                                                "return_value = %d.");
-                        formatter % static_cast<int>(bret);
+                                                "return_value = %d. thread id : %d.");
+                        formatter % static_cast<int>(bret) % boost::this_thread::get_id();
                         putLogDebug(10198, formatter.str(), __FILE__, __LINE__ );
                     }
                     /*------DEBUG LOG END------*/
@@ -5671,8 +5814,8 @@ protocol_module_base::EVENT_TAG protocol_module_sessionless::handle_sorryserver_
                         {
                             boost::format formatter("function : protocol_module_base::EVENT_TAG protocol_module_sessionless::"
                                                     "handle_sorryserver_recv() : call find_http_header : "
-                                                    "return_value = %d.");
-                            formatter % static_cast<int>(bret);
+                                                    "return_value = %d. thread id : %d.");
+                            formatter % static_cast<int>(bret) %boost::this_thread::get_id();
                             putLogDebug(10199, formatter.str(), __FILE__, __LINE__ );
                         }
                         /*------DEBUG LOG END------*/
@@ -5781,17 +5924,17 @@ protocol_module_base::EVENT_TAG protocol_module_sessionless::handle_sorryserver_
                                     "send_offset = %d, unsend_size = %d, edit_division = %d.");
             int i = 0;
             for (it = recv_data.send_status_list.begin();
-                 it != recv_data.send_status_list.end();
-                 ++it, ++i)
+                    it != recv_data.send_status_list.end();
+                    ++it, ++i)
             {
                 formatter % i % it->status % it->send_end_size
-                          % it->send_rest_size % it->send_possible_size
-                          % it->send_offset % it->unsend_size % it->edit_division;
+                % it->send_rest_size % it->send_possible_size
+                % it->send_offset % it->unsend_size % it->edit_division;
                 datadump += formatter.str();
             }
 
             formatter.parse("function : protocol_module_base::EVENT_TAG protocol_module_sessionless::"
-                        "handle_sorryserver_recv() : send status list dump : send status list size = %d.%s");
+                            "handle_sorryserver_recv() : send status list dump : send status list size = %d.%s");
 
             formatter % recv_data.send_status_list.size() % datadump;
             putLogDebug(10200, formatter.str(), __FILE__, __LINE__ );
@@ -5827,8 +5970,8 @@ protocol_module_base::EVENT_TAG protocol_module_sessionless::handle_sorryserver_
             {
                 boost::format formatter("function : protocol_module_base::EVENT_TAG protocol_module_sessionless::"
                                         "handle_sorryserver_recv() : call check_status_code : "
-                                        "return_value = %d.");
-                formatter % check_result;
+                                        "return_value = %d. thread id : %d.");
+                formatter % check_result % boost::this_thread::get_id();
                 putLogDebug(10201, formatter.str(), __FILE__, __LINE__ );
             }
             /*------DEBUG LOG END------*/
@@ -5843,8 +5986,8 @@ protocol_module_base::EVENT_TAG protocol_module_sessionless::handle_sorryserver_
                 {
                     boost::format formatter("function : protocol_module_base::EVENT_TAG protocol_module_sessionless::"
                                             "handle_sorryserver_recv() : call check_http_version : "
-                                            "return_value = %d.");
-                    formatter % check_result;
+                                            "return_value = %d. thread id : %d.");
+                    formatter % check_result % boost::this_thread::get_id();
                     putLogDebug(10202, formatter.str(), __FILE__, __LINE__ );
                 }
                 /*------DEBUG LOG END------*/
@@ -5860,8 +6003,8 @@ protocol_module_base::EVENT_TAG protocol_module_sessionless::handle_sorryserver_
                 {
                     boost::format formatter("function : protocol_module_base::EVENT_TAG protocol_module_sessionless::"
                                             "handle_sorryserver_recv() : call find_http_header : "
-                                            "return_value = %d.");
-                    formatter % static_cast<int>(bret);
+                                            "return_value = %d. thread id : %d.");
+                    formatter % static_cast<int>(bret) % boost::this_thread::get_id();
                     putLogDebug(10203, formatter.str(), __FILE__, __LINE__ );
                 }
                 /*------DEBUG LOG END------*/
@@ -5876,8 +6019,8 @@ protocol_module_base::EVENT_TAG protocol_module_sessionless::handle_sorryserver_
                     {
                         boost::format formatter("function : protocol_module_base::EVENT_TAG protocol_module_sessionless::"
                                                 "handle_sorryserver_recv() : call find_http_header : "
-                                                "return_value = %d.");
-                        formatter % static_cast<int>(bret);
+                                                "return_value = %d. thread id : %d.");
+                        formatter % static_cast<int>(bret) % boost::this_thread::get_id();
                         putLogDebug(10204, formatter.str(), __FILE__, __LINE__ );
                     }
                     /*------DEBUG LOG END------*/
@@ -5977,17 +6120,17 @@ protocol_module_base::EVENT_TAG protocol_module_sessionless::handle_sorryserver_
                                     "send_offset = %d, unsend_size = %d, edit_division = %d.");
             int i = 0;
             for (it = recv_data.send_status_list.begin();
-                 it != recv_data.send_status_list.end();
-                 ++it, ++i)
+                    it != recv_data.send_status_list.end();
+                    ++it, ++i)
             {
                 formatter % i % it->status % it->send_end_size
-                          % it->send_rest_size % it->send_possible_size
-                          % it->send_offset % it->unsend_size % it->edit_division;
+                % it->send_rest_size % it->send_possible_size
+                % it->send_offset % it->unsend_size % it->edit_division;
                 datadump += formatter.str();
             }
 
             formatter.parse("function : protocol_module_base::EVENT_TAG protocol_module_sessionless::"
-                        "handle_sorryserver_recv() : send status list dump : send status list size = %d.%s");
+                            "handle_sorryserver_recv() : send status list dump : send status list size = %d.%s");
 
             formatter % recv_data.send_status_list.size() % datadump;
             putLogDebug(10205, formatter.str(), __FILE__, __LINE__ );
@@ -6014,8 +6157,8 @@ protocol_module_base::EVENT_TAG protocol_module_sessionless::handle_sorryserver_
         if (LOG_LV_DEBUG == getloglevel())
         {
             boost::format formatter("function : protocol_module_base::EVENT_TAG protocol_module_sessionless::"
-                                    "handle_sorryserver_recv() : catch exception e = %d.");
-            formatter % e;
+                                    "handle_sorryserver_recv() : catch exception e = %d. thread id : %d.");
+            formatter % e % boost::this_thread::get_id();
             putLogDebug(10206, formatter.str(), __FILE__, __LINE__ );
         }
         /*------DEBUG LOG END------*/
@@ -6024,21 +6167,25 @@ protocol_module_base::EVENT_TAG protocol_module_sessionless::handle_sorryserver_
     catch (const std::string& ex)
     {
         std::cerr << "protocol_module_sessionless::handle_sorryserver_recv() : exception : " << ex << std::endl;
-        putLogError(17092, ex.c_str(), __FILE__, __LINE__ );
+        boost::format formatter("protocol_module_sessionless::handle_sorryserver_recv() : exception : %s. thread id : %d.");
+        formatter % ex.c_str() % boost::this_thread::get_id();
+        putLogError(17092, formatter.str(), __FILE__, __LINE__ );
         status = FINALIZE;
     }
     catch (const std::bad_alloc&)
     {
         std::cerr << "protocol_module_sessionless::handle_sorryserver_recv() : exception : Could not allocate memory." << std::endl;
-        putLogError(17093, "Could not allocate memory.", __FILE__, __LINE__ );
+        boost::format formatter("Could not allocate memory. thread id : %d.");
+        formatter % boost::this_thread::get_id();
+        putLogError(17093, formatter.str(), __FILE__, __LINE__ );
         status = FINALIZE;
     }
     catch (const std::exception& ex)
     {
         std::cerr << "protocol_module_sessionless::handle_sorryserver_recv() : exception : error = " << ex.what() << "." << std::endl;
         boost::format formatter("function : protocol_module_base::EVENT_TAG protocol_module_sessionless::"
-                                "handle_sorryserver_recv() : exception : error = %s.");
-        formatter % ex.what();
+                                "handle_sorryserver_recv() : exception : error = %s. thread id : %d.");
+        formatter % ex.what() % boost::this_thread::get_id();
         putLogError(17094, formatter.str(), __FILE__, __LINE__ );
 
         status = FINALIZE;
@@ -6046,9 +6193,11 @@ protocol_module_base::EVENT_TAG protocol_module_sessionless::handle_sorryserver_
     catch (...)
     {
         std::cerr << "protocol_module_sessionless::handle_sorryserver_recv() : Unknown exception." << std::endl;
-        putLogError(17095, "function : protocol_module_base::EVENT_TAG "
-                    "protocol_module_sessionless::handle_sorryserver_recv() : "
-                    "Unknown exception.", __FILE__, __LINE__ );
+        boost::format formatter("function : protocol_module_base::EVENT_TAG "
+                                "protocol_module_sessionless::handle_sorryserver_recv() : "
+                                "Unknown exception. thread id : %d.");
+        formatter % boost::this_thread::get_id();
+        putLogError(17095, formatter.str(), __FILE__, __LINE__ );
         status = FINALIZE;
     }
 
@@ -6059,8 +6208,8 @@ protocol_module_base::EVENT_TAG protocol_module_sessionless::handle_sorryserver_
                                 "handle_sorryserver_recv(const boost::thread::id thread_id, "
                                 "const boost::asio::ip::tcp::endpoint& sorry_endpoint, "
                                 "const boost::array<char,MAX_BUFFER_SIZE>& recvbuffer, "
-                                "const size_t recvlen) : return_value = %d.");
-        formatter % status;
+                                "const size_t recvlen) : return_value = %d. thread id : %d.");
+        formatter % status % boost::this_thread::get_id();
         putLogDebug(10207, formatter.str(), __FILE__, __LINE__ );
     }
     /*------DEBUG LOG END------*/
@@ -6079,8 +6228,8 @@ protocol_module_base::EVENT_TAG protocol_module_sessionless::handle_response_sen
     {
         boost::format formatter("in/out_function : protocol_module_base::EVENT_TAG protocol_module_sessionless::"
                                 "handle_response_send_inform(const boost::thread::id thread_id) : "
-                                "return_value = %d.");
-        formatter % STOP;
+                                "return_value = %d. thread id : %d.");
+        formatter % STOP % boost::this_thread::get_id();
         putLogDebug(10208, formatter.str(), __FILE__, __LINE__ );
     }
     /*------DEBUG LOG END------*/
@@ -6122,7 +6271,9 @@ protocol_module_base::EVENT_TAG protocol_module_sessionless::handle_client_conne
             session_thread_it = session_thread_data_map.find(thread_id);
             if (session_thread_it == session_thread_data_map.end() || session_thread_it->second == NULL)
             {
-                putLogError(17096, "Invalid thread id.", __FILE__, __LINE__ );
+                boost::format formatter("Invalid thread id. thread id : %d.");
+                formatter % boost::this_thread::get_id();
+                putLogError(17096, formatter.str(), __FILE__, __LINE__ );
                 throw -1;
             }
 
@@ -6132,7 +6283,9 @@ protocol_module_base::EVENT_TAG protocol_module_sessionless::handle_client_conne
         recive_data_it = session_data->recive_data_map.find(session_data->target_endpoint);
         if (recive_data_it == session_data->recive_data_map.end())
         {
-            putLogError(17097, "Invalid endpoint.", __FILE__, __LINE__ );
+            boost::format formatter("Invalid endpoint. thread id : %d.");
+            formatter % boost::this_thread::get_id();
+            putLogError(17097, formatter.str(), __FILE__, __LINE__ );
             throw -1;
         }
 
@@ -6143,7 +6296,9 @@ protocol_module_base::EVENT_TAG protocol_module_sessionless::handle_client_conne
                                     data_send_possible());
         if (it == recv_data.send_status_list.end())
         {
-            putLogError(17098, "Sending possible data is not existed.", __FILE__, __LINE__ );
+            boost::format formatter("Sending possible data is not existed. thread id : %d.");
+            formatter % boost::this_thread::get_id();
+            putLogError(17098, formatter.str(), __FILE__, __LINE__ );
             throw -1;
         }
 
@@ -6182,7 +6337,7 @@ protocol_module_base::EVENT_TAG protocol_module_sessionless::handle_client_conne
             /*------DEBUG LOG END------*/
             //send_end_size recalc
             it->send_end_size = it->send_possible_size;
-           //set copyed data length
+            //set copyed data length
             datalen = it->send_possible_size;
             //sending_possible size recalc
             it->send_possible_size = 0;
@@ -6236,8 +6391,8 @@ protocol_module_base::EVENT_TAG protocol_module_sessionless::handle_client_conne
         if (LOG_LV_DEBUG == getloglevel())
         {
             boost::format formatter("function : protocol_module_base::EVENT_TAG protocol_module_sessionless::"
-                                    "handle_client_connection_check() : catch exception e = %d.");
-            formatter % e;
+                                    "handle_client_connection_check() : catch exception e = %d. thread id : %d.");
+            formatter % e % boost::this_thread::get_id();
             putLogDebug(10214, formatter.str(), __FILE__, __LINE__ );
         }
         /*------DEBUG LOG END------*/
@@ -6247,16 +6402,18 @@ protocol_module_base::EVENT_TAG protocol_module_sessionless::handle_client_conne
     {
         std::cerr << "protocol_module_sessionless::handle_client_connection_check() : exception : error = " << ex.what() << "." << std::endl;
         boost::format formatter("function : protocol_module_base::EVENT_TAG protocol_module_sessionless::"
-                                "handle_client_connection_check() : exception : error = %s.");
-        formatter % ex.what();
+                                "handle_client_connection_check() : exception : error = %s. thread id : %d.");
+        formatter % ex.what() % boost::this_thread::get_id();
         putLogError(17099, formatter.str(), __FILE__, __LINE__ );
         status = FINALIZE;
     }
     catch (...)
     {
         std::cerr << "protocol_module_sessionless::handle_client_connection_check() : Unknown exception." << std::endl;
-        putLogError(17100, "function : protocol_module_base::EVENT_TAG protocol_module_sessionless::"
-                    "handle_client_connection_check() : Unknown exception.", __FILE__, __LINE__ );
+        boost::format formatter("function : protocol_module_base::EVENT_TAG protocol_module_sessionless::"
+                                "handle_client_connection_check() : Unknown exception. thread id : %d.");
+        formatter % boost::this_thread::get_id();
+        putLogError(17100, formatter.str(), __FILE__, __LINE__ );
         status = FINALIZE;
     }
 
@@ -6266,8 +6423,8 @@ protocol_module_base::EVENT_TAG protocol_module_sessionless::handle_client_conne
         boost::format formatter("out_function : protocol_module_base::EVENT_TAG protocol_module_sessionless::"
                                 "handle_client_connection_check(const boost::thread::id thread_id, "
                                 "boost::array<char, MAX_BUFFER_SIZE>& sendbuffer, size_t& datalen)"
-                                " : return_value = %d.");
-        formatter % status;
+                                " : return_value = %d. thread id : %d.");
+        formatter % status % boost::this_thread::get_id();
         putLogDebug(10215, formatter.str(), __FILE__, __LINE__ );
     }
     /*------DEBUG LOG END------*/
@@ -6292,8 +6449,8 @@ protocol_module_base::EVENT_TAG protocol_module_sessionless::handle_client_selec
                                 "boost::asio::ip::udp::endpoint& cl_endpoint, "
                                 "boost::array<char,MAX_BUFFER_SIZE>& sendbuffer, "
                                 "size_t& datalen) : "
-                                "return_value = %d.");
-        formatter % STOP;
+                                "return_value = %d. thread id : %d.");
+        formatter % STOP % boost::this_thread::get_id();
         putLogDebug(10216, formatter.str(), __FILE__, __LINE__ );
     }
     /*------DEBUG LOG END------*/
@@ -6329,7 +6486,9 @@ protocol_module_base::EVENT_TAG protocol_module_sessionless::handle_client_send(
             session_thread_it = session_thread_data_map.find(thread_id);
             if (session_thread_it == session_thread_data_map.end() || session_thread_it->second == NULL)
             {
-                putLogError(17101, "Invalid thread id.", __FILE__, __LINE__ );
+                boost::format formatter("Invalid thread id. thread id : %d.");
+                formatter % boost::this_thread::get_id();
+                putLogError(17101, formatter.str(), __FILE__, __LINE__ );
                 throw -1;
             }
             session_data = session_thread_it->second;
@@ -6338,7 +6497,9 @@ protocol_module_base::EVENT_TAG protocol_module_sessionless::handle_client_send(
         recive_data_it = session_data->recive_data_map.find(session_data->target_endpoint);
         if (recive_data_it == session_data->recive_data_map.end())
         {
-            putLogError(17102, "Invalid endpoint.", __FILE__, __LINE__ );
+            boost::format formatter("Invalid endpoint. thread id : %d.");
+            formatter % boost::this_thread::get_id();
+            putLogError(17102, formatter.str(), __FILE__, __LINE__ );
             throw -1;
         }
 
@@ -6351,7 +6512,9 @@ protocol_module_base::EVENT_TAG protocol_module_sessionless::handle_client_send(
         it = std::adjacent_find(it, it_end, data_send_list_incorrect());
         if (it != it_end)
         {
-            putLogError(17103, "Sending possible data is invalid.", __FILE__, __LINE__ );
+            boost::format formatter("Sending possible data is invalid. thread id : %d.");
+            formatter % boost::this_thread::get_id();
+            putLogError(17103, formatter.str(), __FILE__, __LINE__ );
             throw -1;
         }
         //status list check
@@ -6359,7 +6522,9 @@ protocol_module_base::EVENT_TAG protocol_module_sessionless::handle_client_send(
         it = find_if(it, it_end, data_send_ok());
         if (it == it_end)
         {
-            putLogError(17104, "Sending possible data is not existed.", __FILE__, __LINE__ );
+            boost::format formatter("Sending possible data is not existed. thread id : %d.");
+            formatter % boost::this_thread::get_id();
+            putLogError(17104, formatter.str(), __FILE__, __LINE__ );
             throw -1;
         }
 
@@ -6427,8 +6592,8 @@ protocol_module_base::EVENT_TAG protocol_module_sessionless::handle_client_send(
         if (LOG_LV_DEBUG == getloglevel())
         {
             boost::format formatter("function : protocol_module_base::EVENT_TAG protocol_module_sessionless::"
-                                    "handle_client_send() : catch exception e = %d.");
-            formatter % e;
+                                    "handle_client_send() : catch exception e = %d. thread id : %d.");
+            formatter % e % boost::this_thread::get_id();
             putLogDebug(10218, formatter.str(), __FILE__, __LINE__ );
         }
         /*------DEBUG LOG END------*/
@@ -6438,16 +6603,18 @@ protocol_module_base::EVENT_TAG protocol_module_sessionless::handle_client_send(
     {
         std::cerr << "protocol_module_sessionless::handle_client_send() : exception : error = " << ex.what() << "." << std::endl;
         boost::format formatter("function : protocol_module_base::EVENT_TAG protocol_module_sessionless::"
-                                "handle_client_send() : exception : error = %s.");
-        formatter % ex.what();
+                                "handle_client_send() : exception : error = %s. thread id : %d.");
+        formatter % ex.what() % boost::this_thread::get_id();
         putLogError(17105, formatter.str(), __FILE__, __LINE__ );
         status = FINALIZE;
     }
     catch (...)
     {
         std::cerr << "protocol_module_sessionless::handle_client_send() : Unknown exception." << std::endl;
-        putLogError(17106, "function : protocol_module_base::EVENT_TAG protocol_module_sessionless::"
-                    "handle_client_send() : Unknown exception.", __FILE__, __LINE__ );
+        boost::format formatter("function : protocol_module_base::EVENT_TAG protocol_module_sessionless::"
+                                "handle_client_send() : Unknown exception. thread id : %d.");
+        formatter % boost::this_thread::get_id();
+        putLogError(17106, formatter.str(), __FILE__, __LINE__ );
         status = FINALIZE;
     }
 
@@ -6455,8 +6622,8 @@ protocol_module_base::EVENT_TAG protocol_module_sessionless::handle_client_send(
     if (LOG_LV_DEBUG == getloglevel())
     {
         boost::format formatter("out_function : protocol_module_base::EVENT_TAG protocol_module_sessionless::"
-                                "handle_client_send(const boost::thread::id thread_id) : return_value = %d.");
-        formatter % status;
+                                "handle_client_send(const boost::thread::id thread_id) : return_value = %d. thread id : %d.");
+        formatter % status % boost::this_thread::get_id();
         putLogDebug(10219, formatter.str(), __FILE__, __LINE__ );
     }
     /*------DEBUG LOG END------*/
@@ -6474,8 +6641,8 @@ protocol_module_base::EVENT_TAG protocol_module_sessionless::handle_client_disco
     if (LOG_LV_DEBUG == getloglevel())
     {
         boost::format formatter("in/out_function : protocol_module_base::EVENT_TAG protocol_module_sessionless::"
-                                "handle_client_disconnect(const boost::thread::id thread_id) : return_value = %d.");
-        formatter % FINALIZE;
+                                "handle_client_disconnect(const boost::thread::id thread_id) : return_value = %d. thread id : %d.");
+        formatter % FINALIZE % boost::this_thread::get_id();
         putLogDebug(10220, formatter.str(), __FILE__, __LINE__ );
     }
     /*------DEBUG LOG END------*/
@@ -6516,7 +6683,9 @@ protocol_module_base::EVENT_TAG protocol_module_sessionless::handle_sorry_enable
             session_thread_it = session_thread_data_map.find(thread_id);
             if (session_thread_it == session_thread_data_map.end() || session_thread_it->second == NULL)
             {
-                putLogError(17107, "Invalid thread id.", __FILE__, __LINE__ );
+                boost::format formatter("Invalid thread id. thread id : %d.");
+                formatter % boost::this_thread::get_id();
+                putLogError(17107, formatter.str(), __FILE__, __LINE__ );
                 throw -1;
             }
 
@@ -6528,164 +6697,195 @@ protocol_module_base::EVENT_TAG protocol_module_sessionless::handle_sorry_enable
         recive_data_it = session_data->recive_data_map.find(endpoint);
         if (recive_data_it == session_data->recive_data_map.end())
         {
-            putLogError(17108, "Invalid endpoint.", __FILE__, __LINE__ );
-            throw -1;
+            //must be down thread
+            if (session_data->thread_division == THREAD_DIVISION_UP_STREAM)
+            {
+                boost::format formatter("Invalid endpoint. thread id : %d.");
+                formatter % boost::this_thread::get_id();
+                putLogError(17108, formatter.str(), __FILE__, __LINE__ );
+                throw -1;
+            }
+            session_data->sorry_flag = SORRY_FLAG_ON;
+            /*-------- DEBUG LOG --------*/
+            if (LOG_LV_DEBUG == getloglevel())
+            {
+                boost::format formatter("function : protocol_module_base::EVENT_TAG protocol_module_sessionless::"
+                                        "handle_sorry_enable() : SORRY_FLAG_ON. thread id : %d.");
+                formatter % boost::this_thread::get_id();
+                putLogDebug(10222, formatter.str(), __FILE__, __LINE__ );
+            }
+            /*------DEBUG LOG END------*/
+            status = SORRYSERVER_RECV;
         }
-
-        recive_data& recv_data = recive_data_it->second;
-
-        //get this thread sending possible data
-        send_status_it it = find_if(recv_data.send_status_list.begin(), recv_data.send_status_list.end(),
-                                    data_send_possible());
-        if (it != recv_data.send_status_list.end())
+        else
         {
-            send_possible = true;
-        }
+            recive_data& recv_data = recive_data_it->second;
 
-        it = find_if(recv_data.send_status_list.begin(), recv_data.send_status_list.end(), data_send_continue());
-        if (it != recv_data.send_status_list.end())
-        {
-            send_continue = true;
-        }
+            //get this thread sending possible data
+            send_status_it it = find_if(recv_data.send_status_list.begin(), recv_data.send_status_list.end(),
+                                        data_send_possible());
+            if (it != recv_data.send_status_list.end())
+            {
+                send_possible = true;
+            }
 
-        it = find_if(recv_data.send_status_list.begin(), recv_data.send_status_list.end(), data_send_disable());
-        if (it != recv_data.send_status_list.end())
-        {
-            send_disable = true;
-        }
+            it = find_if(recv_data.send_status_list.begin(), recv_data.send_status_list.end(), data_send_continue());
+            if (it != recv_data.send_status_list.end())
+            {
+                send_continue = true;
+            }
 
-        //up thread
-        if (session_data->thread_division == THREAD_DIVISION_UP_STREAM)
-        {
-            //accept_end_flag is off
-            if (session_data->accept_end_flag == ACCEPT_END_FLAG_OFF)
+            it = find_if(recv_data.send_status_list.begin(), recv_data.send_status_list.end(), data_send_disable());
+            if (it != recv_data.send_status_list.end())
             {
-                //set sorry flag on
-                session_data->sorry_flag = SORRY_FLAG_ON;
-                /*-------- DEBUG LOG --------*/
-                if (LOG_LV_DEBUG == getloglevel())
+                send_disable = true;
+            }
+
+            //up thread
+            if (session_data->thread_division == THREAD_DIVISION_UP_STREAM)
+            {
+                //accept_end_flag is off
+                if (session_data->accept_end_flag == ACCEPT_END_FLAG_OFF)
                 {
-                    putLogDebug(10222, "function : protocol_module_base::EVENT_TAG protocol_module_sessionless::"
-                                "handle_sorry_enable() : SORRY_FLAG_ON.", __FILE__, __LINE__ );
+                    //set sorry flag on
+                    session_data->sorry_flag = SORRY_FLAG_ON;
+                    /*-------- DEBUG LOG --------*/
+                    if (LOG_LV_DEBUG == getloglevel())
+                    {
+                        boost::format formatter("function : protocol_module_base::EVENT_TAG protocol_module_sessionless::"
+                                                "handle_sorry_enable() : SORRY_FLAG_ON. thread id : %d.");
+                        formatter % boost::this_thread::get_id();
+                        putLogDebug(10223, formatter.str(), __FILE__, __LINE__ );
+                    }
+                    /*------DEBUG LOG END------*/
+                    status = ACCEPT;
+                }
+                //accept_end_flag is on
+                else
+                {
+                    //set sorry flag on
+                    if (session_data->sorry_flag == SORRY_FLAG_ON)
+                    {
+                        //sending possible data is exist
+                        if (send_possible)
+                        {
+                            status = SORRYSERVER_SELECT;
+                        }
+                        //sending possible data is not exist
+                        else
+                        {
+                            status = CLIENT_RECV;
+                        }
+                    }
+                    //set sorry flag off
+                    else
+                    {
+                        //the data that can be sent continue is exist
+                        if (send_continue)
+                        {
+                            //set end flag on
+                            session_data->end_flag = END_FLAG_ON;
+                            /*-------- DEBUG LOG --------*/
+                            if (LOG_LV_DEBUG == getloglevel())
+                            {
+                                boost::format formatter("function : protocol_module_base::EVENT_TAG protocol_module_sessionless::"
+                                                        "handle_sorry_enable() : END_FLAG_ON. thread id : %d.");
+                                formatter % boost::this_thread::get_id();
+                                putLogDebug(10224, formatter.str(), __FILE__, __LINE__ );
+                            }
+                            /*------DEBUG LOG END------*/
+                            status = REALSERVER_DISCONNECT;
+                        }
+                        //the data that can be sent continue is not exist
+                        else
+                        {
+                            //set sorryserver_switch_flag on
+                            session_data->sorryserver_switch_flag = SORRYSERVER_SWITCH_FLAG_ON;
+                            /*-------- DEBUG LOG --------*/
+                            if (LOG_LV_DEBUG == getloglevel())
+                            {
+                                boost::format formatter("function : protocol_module_base::EVENT_TAG protocol_module_sessionless::"
+                                                        "handle_sorry_enable() : SORRYSERVER_SWITCH_FLAG_ON. thread id : %d.");
+                                formatter % boost::this_thread::get_id();
+                                putLogDebug(10225, formatter.str(), __FILE__, __LINE__ );
+                            }
+                            /*------DEBUG LOG END------*/
+                            //set sorry_flag on
+                            session_data->sorry_flag = SORRY_FLAG_ON;
+                            /*-------- DEBUG LOG --------*/
+                            if (LOG_LV_DEBUG == getloglevel())
+                            {
+                                boost::format formatter("function : protocol_module_base::EVENT_TAG protocol_module_sessionless::"
+                                                        "handle_sorry_enable() : SORRY_FLAG_ON. thread id : %d.");
+                                formatter % boost::this_thread::get_id();
+                                putLogDebug(10226, formatter.str(), __FILE__, __LINE__ );
+                            }
+                            /*------DEBUG LOG END------*/
+                            status = REALSERVER_DISCONNECT;
+                        }
+                    }
                 }
-                /*------DEBUG LOG END------*/
-                status = ACCEPT;
             }
-            //accept_end_flag is on
+            //down thread
             else
             {
-                //set sorry flag on
+                //sorry_flag is on
                 if (session_data->sorry_flag == SORRY_FLAG_ON)
                 {
                     //sending possible data is exist
                     if (send_possible)
                     {
-                        status = SORRYSERVER_SELECT;
+                        status = CLIENT_CONNECTION_CHECK;
                     }
                     //sending possible data is not exist
                     else
                     {
-                        status = CLIENT_RECV;
+                        status = SORRYSERVER_RECV;
                     }
                 }
-                //set sorry flag off
+                //sorry_flag is off
                 else
                 {
-                    //the data that can be sent continue is exist
-                    if (send_continue)
+                    //sending possible data is exist or send_rest_size > 0
+                    if (send_disable)
                     {
                         //set end flag on
                         session_data->end_flag = END_FLAG_ON;
                         /*-------- DEBUG LOG --------*/
                         if (LOG_LV_DEBUG == getloglevel())
                         {
-                            putLogDebug(10223, "function : protocol_module_base::EVENT_TAG protocol_module_sessionless::"
-                                        "handle_sorry_enable() : END_FLAG_ON.", __FILE__, __LINE__ );
+                            boost::format formatter("function : protocol_module_base::EVENT_TAG protocol_module_sessionless::"
+                                                    "handle_sorry_enable() : END_FLAG_ON. thread id : %d.");
+                            formatter % boost::this_thread::get_id();
+                            putLogDebug(10227, formatter.str(), __FILE__, __LINE__ );
                         }
                         /*------DEBUG LOG END------*/
                         status = REALSERVER_DISCONNECT;
                     }
-                    //the data that can be sent continue is not exist
+                    //
                     else
                     {
-                        //set sorryserver_switch_flag on
-                        session_data->sorryserver_switch_flag = SORRYSERVER_SWITCH_FLAG_ON;
-                        /*-------- DEBUG LOG --------*/
-                        if (LOG_LV_DEBUG == getloglevel())
-                        {
-                            putLogDebug(10224, "function : protocol_module_base::EVENT_TAG protocol_module_sessionless::"
-                                        "handle_sorry_enable() : SORRYSERVER_SWITCH_FLAG_ON.", __FILE__, __LINE__ );
-                        }
-                        /*------DEBUG LOG END------*/
                         //set sorry_flag on
                         session_data->sorry_flag = SORRY_FLAG_ON;
                         /*-------- DEBUG LOG --------*/
                         if (LOG_LV_DEBUG == getloglevel())
                         {
-                            putLogDebug(10225, "function : protocol_module_base::EVENT_TAG protocol_module_sessionless::"
-                                        "handle_sorry_enable() : SORRY_FLAG_ON.", __FILE__, __LINE__ );
+                            boost::format formatter("function : protocol_module_base::EVENT_TAG protocol_module_sessionless::"
+                                                    "handle_sorry_enable() : SORRY_FLAG_ON. thread id : %d.");
+                            formatter % boost::this_thread::get_id();
+                            putLogDebug(10228, formatter.str(), __FILE__, __LINE__ );
                         }
                         /*------DEBUG LOG END------*/
-                        status = REALSERVER_DISCONNECT;
-                    }
-                }
-            }
-        }
-        //down thread
-        else
-        {
-            //sorry_flag is on
-            if (session_data->sorry_flag == SORRY_FLAG_ON)
-            {
-                //sending possible data is exist
-                if (send_possible)
-                {
-                    status = CLIENT_CONNECTION_CHECK;
-                }
-                //sending possible data is not exist
-                else
-                {
-                    status = SORRYSERVER_RECV;
-                }
-            }
-            //sorry_flag is off
-            else
-            {
-                //sending possible data is exist or send_rest_size > 0
-                if (send_disable)
-                {
-                    //set end flag on
-                    session_data->end_flag = END_FLAG_ON;
-                    /*-------- DEBUG LOG --------*/
-                    if (LOG_LV_DEBUG == getloglevel())
-                    {
-                        putLogDebug(10226, "function : protocol_module_base::EVENT_TAG protocol_module_sessionless::"
-                                    "handle_sorry_enable() : END_FLAG_ON.", __FILE__, __LINE__ );
-                    }
-                    /*------DEBUG LOG END------*/
-                    status = REALSERVER_DISCONNECT;
-                }
-                //
-                else
-                {
-                    //set sorry_flag on
-                    session_data->sorry_flag = SORRY_FLAG_ON;
-                    /*-------- DEBUG LOG --------*/
-                    if (LOG_LV_DEBUG == getloglevel())
-                    {
-                        putLogDebug(10227, "function : protocol_module_base::EVENT_TAG protocol_module_sessionless::"
-                                    "handle_sorry_enable() : SORRY_FLAG_ON.", __FILE__, __LINE__ );
-                    }
-                    /*------DEBUG LOG END------*/
-                    //sending possible data is exist
-                    if (send_possible)
-                    {
-                        status = CLIENT_CONNECTION_CHECK;
-                    }
-                    //sending possible data is not exist
-                    else
-                    {
-                        status = SORRYSERVER_RECV;
+                        //sending possible data is exist
+                        if (send_possible)
+                        {
+                            status = CLIENT_CONNECTION_CHECK;
+                        }
+                        //sending possible data is not exist
+                        else
+                        {
+                            status = SORRYSERVER_RECV;
+                        }
                     }
                 }
             }
@@ -6697,9 +6897,9 @@ protocol_module_base::EVENT_TAG protocol_module_sessionless::handle_sorry_enable
         if (LOG_LV_DEBUG == getloglevel())
         {
             boost::format formatter("function : protocol_module_base::EVENT_TAG protocol_module_sessionless::"
-                                    "handle_sorry_enable() : catch exception e = %d.");
-            formatter % e;
-            putLogDebug(10228, formatter.str(), __FILE__, __LINE__ );
+                                    "handle_sorry_enable() : catch exception e = %d. thread id : %d.");
+            formatter % e % boost::this_thread::get_id();
+            putLogDebug(10229, formatter.str(), __FILE__, __LINE__ );
         }
         /*------DEBUG LOG END------*/
         status = FINALIZE;
@@ -6708,16 +6908,18 @@ protocol_module_base::EVENT_TAG protocol_module_sessionless::handle_sorry_enable
     {
         std::cerr << "protocol_module_sessionless::handle_sorry_enable() : exception : error = " << ex.what() << "." << std::endl;
         boost::format formatter("function : protocol_module_base::EVENT_TAG protocol_module_sessionless::"
-                                "handle_sorry_enable() : exception : error = %s.");
-        formatter % ex.what();
+                                "handle_sorry_enable() : exception : error = %s. thread id : %d.");
+        formatter % ex.what() % boost::this_thread::get_id();
         putLogError(17109, formatter.str(), __FILE__, __LINE__ );
         status = FINALIZE;
     }
     catch (...)
     {
         std::cerr << "protocol_module_sessionless::handle_sorry_enable() : Unknown exception." << std::endl;
-        putLogError(17110, "function : protocol_module_base::EVENT_TAG protocol_module_sessionless::"
-                    "handle_sorry_enable() : Unknown exception.", __FILE__, __LINE__ );
+        boost::format formatter("function : protocol_module_base::EVENT_TAG protocol_module_sessionless::"
+                                "handle_sorry_enable() : Unknown exception. thread id : %d.");
+        formatter % boost::this_thread::get_id();
+        putLogError(17110, formatter.str(), __FILE__, __LINE__ );
         status = FINALIZE;
     }
 
@@ -6725,9 +6927,9 @@ protocol_module_base::EVENT_TAG protocol_module_sessionless::handle_sorry_enable
     if (LOG_LV_DEBUG == getloglevel())
     {
         boost::format formatter("out_function : protocol_module_base::EVENT_TAG protocol_module_sessionless::"
-                                "handle_sorry_enable(const boost::thread::id thread_id) : return_value = %d.");
-        formatter % status;
-        putLogDebug(10229, formatter.str(), __FILE__, __LINE__ );
+                                "handle_sorry_enable(const boost::thread::id thread_id) : return_value = %d. thread id : %d.");
+        formatter % status % boost::this_thread::get_id();
+        putLogDebug(10230, formatter.str(), __FILE__, __LINE__ );
     }
     /*------DEBUG LOG END------*/
 
@@ -6747,7 +6949,7 @@ protocol_module_base::EVENT_TAG protocol_module_sessionless::handle_sorry_disabl
                                 "handle_sorry_disable(const boost::thread::id thread_id) : "
                                 "thread_id = %d.");
         formatter % thread_id;
-        putLogDebug(10230, formatter.str(), __FILE__, __LINE__ );
+        putLogDebug(10231, formatter.str(), __FILE__, __LINE__ );
     }
     /*------DEBUG LOG END------*/
     EVENT_TAG status = FINALIZE;
@@ -6765,7 +6967,9 @@ protocol_module_base::EVENT_TAG protocol_module_sessionless::handle_sorry_disabl
             session_thread_data_map_it session_thread_it = session_thread_data_map.find(thread_id);
             if (session_thread_it == session_thread_data_map.end() || session_thread_it->second == NULL)
             {
-                putLogError(17111, "Invalid thread id.", __FILE__, __LINE__ );
+                boost::format formatter("Invalid thread id. thread id : %d.");
+                formatter % boost::this_thread::get_id();
+                putLogError(17111, formatter.str(), __FILE__, __LINE__ );
                 throw -1;
             }
             //check pointer
@@ -6777,144 +6981,190 @@ protocol_module_base::EVENT_TAG protocol_module_sessionless::handle_sorry_disabl
         recive_data_map_it recive_data_it = session_data->recive_data_map.find(endpoint);
         if (recive_data_it == session_data->recive_data_map.end())
         {
-            putLogError(17112, "Invalid endpoint.", __FILE__, __LINE__ );
-            throw -1;
-        }
-
-        recive_data& recv_data = recive_data_it->second;
+            //must be down thread
+            if (session_data->thread_division == THREAD_DIVISION_UP_STREAM)
+            {
+                boost::format formatter("Invalid endpoint. thread id : %d.");
+                formatter % boost::this_thread::get_id();
+                putLogError(17112, formatter.str(), __FILE__, __LINE__ );
+                throw -1;
+            }
 
-        //get this thread sending possible data
-        send_status_it it = find_if(recv_data.send_status_list.begin(), recv_data.send_status_list.end(),
-                                    data_send_possible());
-        if (it != recv_data.send_status_list.end())
-        {
-            send_possible = true;
+            session_data->sorry_flag = SORRY_FLAG_OFF;
+            /*-------- DEBUG LOG --------*/
+            if (LOG_LV_DEBUG == getloglevel())
+            {
+                boost::format formatter("function : protocol_module_base::EVENT_TAG protocol_module_sessionless::"
+                                        "handle_sorry_disable() : SORRY_FLAG_OFF. thread id : %d.");
+                formatter % boost::this_thread::get_id();
+                putLogDebug(10232, formatter.str(), __FILE__, __LINE__ );
+            }
+            /*------DEBUG LOG END------*/
+            status = REALSERVER_RECV;
         }
-
-        //sending possible data is exist or send_rest_size > 0
-        it = find_if(recv_data.send_status_list.begin(), recv_data.send_status_list.end(), data_send_disable());
-        if (it != recv_data.send_status_list.end())
+        else
         {
-            send_disable = true;
-        }
+            recive_data& recv_data = recive_data_it->second;
 
-        //the data that can be sent continue is exist
-        it = find_if(recv_data.send_status_list.begin(), recv_data.send_status_list.end(), data_send_continue());
-        if (it != recv_data.send_status_list.end())
-        {
-            send_continue = true;
-        }
+            //get this thread sending possible data
+            send_status_it it = find_if(recv_data.send_status_list.begin(), recv_data.send_status_list.end(),
+                                        data_send_possible());
+            if (it != recv_data.send_status_list.end())
+            {
+                send_possible = true;
+            }
 
-        //up thread
-        if (session_data->thread_division == THREAD_DIVISION_UP_STREAM)
-        {
-            //accept_end_flag is off
-            if (session_data->accept_end_flag == ACCEPT_END_FLAG_OFF)
+            //sending possible data is exist or send_rest_size > 0
+            it = find_if(recv_data.send_status_list.begin(), recv_data.send_status_list.end(), data_send_disable());
+            if (it != recv_data.send_status_list.end())
             {
-                //set sorry flag off
-                session_data->sorry_flag = SORRY_FLAG_OFF;
-                /*-------- DEBUG LOG --------*/
-                if (LOG_LV_DEBUG == getloglevel())
+                send_disable = true;
+            }
+
+            //the data that can be sent continue is exist
+            it = find_if(recv_data.send_status_list.begin(), recv_data.send_status_list.end(), data_send_continue());
+            if (it != recv_data.send_status_list.end())
+            {
+                send_continue = true;
+            }
+
+            //up thread
+            if (session_data->thread_division == THREAD_DIVISION_UP_STREAM)
+            {
+                //accept_end_flag is off
+                if (session_data->accept_end_flag == ACCEPT_END_FLAG_OFF)
                 {
-                    putLogDebug(10231, "function : protocol_module_base::EVENT_TAG protocol_module_sessionless::"
-                                "handle_sorry_disable() : SORRY_FLAG_OFF.", __FILE__, __LINE__ );
-                }
-                /*------DEBUG LOG END------*/
+                    //set sorry flag off
+                    session_data->sorry_flag = SORRY_FLAG_OFF;
+                    /*-------- DEBUG LOG --------*/
+                    if (LOG_LV_DEBUG == getloglevel())
+                    {
+                        boost::format formatter("function : protocol_module_base::EVENT_TAG protocol_module_sessionless::"
+                                                "handle_sorry_disable() : SORRY_FLAG_OFF. thread id : %d.");
+                        formatter % boost::this_thread::get_id();
+                        putLogDebug(10233, formatter.str(), __FILE__, __LINE__ );
+                    }
+                    /*------DEBUG LOG END------*/
 
-                status = ACCEPT;
+                    status = ACCEPT;
+                }
+                //accept_end_flag is on
+                else
+                {
+                    //sorry flag is on
+                    if (session_data->sorry_flag == SORRY_FLAG_ON)
+                    {
+                        //the data that can be sent continue is exist
+                        if (send_continue)
+                        {
+                            //set end flag on
+                            session_data->end_flag = END_FLAG_ON;
+                            /*-------- DEBUG LOG --------*/
+                            if (LOG_LV_DEBUG == getloglevel())
+                            {
+                                boost::format formatter("function : protocol_module_base::EVENT_TAG protocol_module_sessionless::"
+                                                        "handle_sorry_disable() : END_FLAG_ON. thread id : %d.");
+                                formatter % boost::this_thread::get_id();
+                                putLogDebug(10234, formatter.str(), __FILE__, __LINE__ );
+                            }
+                            /*------DEBUG LOG END------*/
+                            status = SORRYSERVER_DISCONNECT;
+                        }
+                        //the data that can be sent continue is not exist
+                        else
+                        {
+                            //set realserver_switch_flag on
+                            session_data->realserver_switch_flag = REALSERVER_SWITCH_FLAG_ON;
+                            /*-------- DEBUG LOG --------*/
+                            if (LOG_LV_DEBUG == getloglevel())
+                            {
+                                boost::format formatter("function : protocol_module_base::EVENT_TAG protocol_module_sessionless::"
+                                                        "handle_sorry_disable() : REALSERVER_SWITCH_FLAG_ON. thread id : %d.");
+                                formatter % boost::this_thread::get_id();
+                                putLogDebug(10235, formatter.str(), __FILE__, __LINE__ );
+                            }
+                            /*------DEBUG LOG END------*/
+                            //set sorry_flag off
+                            session_data->sorry_flag = SORRY_FLAG_OFF;
+                            /*-------- DEBUG LOG --------*/
+                            if (LOG_LV_DEBUG == getloglevel())
+                            {
+                                boost::format formatter("function : protocol_module_base::EVENT_TAG protocol_module_sessionless::"
+                                                        "handle_sorry_disable() : SORRY_FLAG_OFF. thread id : %d.");
+                                formatter % boost::this_thread::get_id();
+                                putLogDebug(10236, formatter.str(), __FILE__, __LINE__ );
+                            }
+                            /*------DEBUG LOG END------*/
+                            status = SORRYSERVER_DISCONNECT;
+                        }
+                    }
+                    //sorry flag is off
+                    else
+                    {
+                        //the data that can be sent possible is exist
+                        if (send_possible)
+                        {
+                            status = REALSERVER_SELECT;
+                        }
+                        //the data that can be sent possible is not exist
+                        else
+                        {
+                            status = CLIENT_RECV;
+                        }
+                    }
+                }
             }
-            //accept_end_flag is on
+            //down thread
             else
             {
-                //sorry flag is on
+                //sorry_flag is on
                 if (session_data->sorry_flag == SORRY_FLAG_ON)
                 {
-                    //the data that can be sent continue is exist
-                    if (send_continue)
+                    //sending possible data is exist or send_rest_size > 0
+                    if (send_disable)
                     {
                         //set end flag on
                         session_data->end_flag = END_FLAG_ON;
                         /*-------- DEBUG LOG --------*/
                         if (LOG_LV_DEBUG == getloglevel())
                         {
-                            putLogDebug(10232, "function : protocol_module_base::EVENT_TAG protocol_module_sessionless::"
-                                        "handle_sorry_disable() : END_FLAG_ON.", __FILE__, __LINE__ );
+                            boost::format formatter("function : protocol_module_base::EVENT_TAG protocol_module_sessionless::"
+                                                    "handle_sorry_disable() : END_FLAG_ON. thread id : %d.");
+                            formatter % boost::this_thread::get_id();
+                            putLogDebug(10237, formatter.str(), __FILE__, __LINE__ );
                         }
                         /*------DEBUG LOG END------*/
                         status = SORRYSERVER_DISCONNECT;
                     }
-                    //the data that can be sent continue is not exist
+                    //
                     else
                     {
-                        //set realserver_switch_flag on
-                        session_data->realserver_switch_flag = REALSERVER_SWITCH_FLAG_ON;
-                        /*-------- DEBUG LOG --------*/
-                        if (LOG_LV_DEBUG == getloglevel())
-                        {
-                            putLogDebug(10233, "function : protocol_module_base::EVENT_TAG protocol_module_sessionless::"
-                                        "handle_sorry_disable() : REALSERVER_SWITCH_FLAG_ON.", __FILE__, __LINE__ );
-                        }
-                        /*------DEBUG LOG END------*/
                         //set sorry_flag off
                         session_data->sorry_flag = SORRY_FLAG_OFF;
                         /*-------- DEBUG LOG --------*/
                         if (LOG_LV_DEBUG == getloglevel())
                         {
-                            putLogDebug(10234, "function : protocol_module_base::EVENT_TAG protocol_module_sessionless::"
-                                        "handle_sorry_disable() : SORRY_FLAG_OFF.", __FILE__, __LINE__ );
+                            boost::format formatter("function : protocol_module_base::EVENT_TAG protocol_module_sessionless::"
+                                                    "handle_sorry_disable() : SORRY_FLAG_OFF. thread id : %d.");
+                            formatter % boost::this_thread::get_id();
+                            putLogDebug(10238, formatter.str(), __FILE__, __LINE__ );
                         }
                         /*------DEBUG LOG END------*/
-                        status = SORRYSERVER_DISCONNECT;
-                    }
-                }
-                //sorry flag is off
-                else
-                {
-                    //the data that can be sent possible is exist
-                    if (send_possible)
-                    {
-                        status = REALSERVER_SELECT;
-                    }
-                    //the data that can be sent possible is not exist
-                    else
-                    {
-                        status = CLIENT_RECV;
-                    }
-                }
-            }
-        }
-        //down thread
-        else
-        {
-            //sorry_flag is on
-            if (session_data->sorry_flag == SORRY_FLAG_ON)
-            {
-                //sending possible data is exist or send_rest_size > 0
-                if (send_disable)
-                {
-                    //set end flag on
-                    session_data->end_flag = END_FLAG_ON;
-                    /*-------- DEBUG LOG --------*/
-                    if (LOG_LV_DEBUG == getloglevel())
-                    {
-                        putLogDebug(10235, "function : protocol_module_base::EVENT_TAG protocol_module_sessionless::"
-                                    "handle_sorry_disable() : END_FLAG_ON.", __FILE__, __LINE__ );
+                        //sending possible data is exist
+                        if (send_possible)
+                        {
+                            status = CLIENT_CONNECTION_CHECK;
+                        }
+                        //sending possible data is not exist
+                        else
+                        {
+                            status = REALSERVER_RECV;
+                        }
                     }
-                    /*------DEBUG LOG END------*/
-                    status = SORRYSERVER_DISCONNECT;
                 }
-                //
+                //sorry_flag is off
                 else
                 {
-                    //set sorry_flag off
-                    session_data->sorry_flag = SORRY_FLAG_OFF;
-                    /*-------- DEBUG LOG --------*/
-                    if (LOG_LV_DEBUG == getloglevel())
-                    {
-                        putLogDebug(10236, "function : protocol_module_base::EVENT_TAG protocol_module_sessionless::"
-                                    "handle_sorry_disable() : SORRY_FLAG_OFF.", __FILE__, __LINE__ );
-                    }
-                    /*------DEBUG LOG END------*/
                     //sending possible data is exist
                     if (send_possible)
                     {
@@ -6927,21 +7177,9 @@ protocol_module_base::EVENT_TAG protocol_module_sessionless::handle_sorry_disabl
                     }
                 }
             }
-            //sorry_flag is off
-            else
-            {
-                //sending possible data is exist
-                if (send_possible)
-                {
-                    status = CLIENT_CONNECTION_CHECK;
-                }
-                //sending possible data is not exist
-                else
-                {
-                    status = REALSERVER_RECV;
-                }
-            }
         }
+
+
     }
     catch (int e)
     {
@@ -6949,9 +7187,9 @@ protocol_module_base::EVENT_TAG protocol_module_sessionless::handle_sorry_disabl
         if (LOG_LV_DEBUG == getloglevel())
         {
             boost::format formatter("function : protocol_module_base::EVENT_TAG protocol_module_sessionless::"
-                                    "handle_sorry_disable() : catch exception e = %d.");
-            formatter % e;
-            putLogDebug(10237, formatter.str(), __FILE__, __LINE__ );
+                                    "handle_sorry_disable() : catch exception e = %d. thread id : %d.");
+            formatter % e % boost::this_thread::get_id();
+            putLogDebug(10239, formatter.str(), __FILE__, __LINE__ );
         }
         /*------DEBUG LOG END------*/
         status = FINALIZE;
@@ -6960,16 +7198,18 @@ protocol_module_base::EVENT_TAG protocol_module_sessionless::handle_sorry_disabl
     {
         std::cerr << "protocol_module_sessionless::handle_sorry_disable() : exception : error = " << ex.what() << "." << std::endl;
         boost::format formatter("function : protocol_module_base::EVENT_TAG protocol_module_sessionless::"
-                                "handle_sorry_disable() : exception : error = %s.");
-        formatter % ex.what();
+                                "handle_sorry_disable() : exception : error = %s. thread id : %d.");
+        formatter % ex.what() % boost::this_thread::get_id();
         putLogError(17113, formatter.str(), __FILE__, __LINE__ );
         status = FINALIZE;
     }
     catch (...)
     {
         std::cerr << "protocol_module_sessionless::handle_sorry_disable() : Unknown exception." << std::endl;
-        putLogError(17114, "function : protocol_module_base::EVENT_TAG protocol_module_sessionless::"
-                    "handle_sorry_disable() : Unknown exception.", __FILE__, __LINE__ );
+        boost::format formatter("function : protocol_module_base::EVENT_TAG protocol_module_sessionless::"
+                                "handle_sorry_disable() : Unknown exception. thread id : %d.");
+        formatter % boost::this_thread::get_id();
+        putLogError(17114, formatter.str(), __FILE__, __LINE__ );
         status = FINALIZE;
     }
 
@@ -6977,9 +7217,9 @@ protocol_module_base::EVENT_TAG protocol_module_sessionless::handle_sorry_disabl
     if (LOG_LV_DEBUG == getloglevel())
     {
         boost::format formatter("out_function : protocol_module_base::EVENT_TAG protocol_module_sessionless::"
-                                "handle_sorry_disable(const boost::thread::id thread_id) : return_value = %d.");
-        formatter % status;
-        putLogDebug(10238, formatter.str(), __FILE__, __LINE__ );
+                                "handle_sorry_disable(const boost::thread::id thread_id) : return_value = %d. thread id : %d.");
+        formatter % status % boost::this_thread::get_id();
+        putLogDebug(10240, formatter.str(), __FILE__, __LINE__ );
     }
     /*------DEBUG LOG END------*/
 
@@ -7000,12 +7240,13 @@ protocol_module_base::EVENT_TAG protocol_module_sessionless::handle_realserver_d
                                 "handle_realserver_disconnect(const boost::thread::id thread_id, const boost::asio::ip::tcp::endpoint & rs_endpoint) : "
                                 "thread_id = %d, rs_endpoint = [%s]:%d.");
         formatter % thread_id % rs_endpoint.address().to_string() % rs_endpoint.port();
-        putLogDebug(10239, formatter.str(), __FILE__, __LINE__ );
+        putLogDebug(10241, formatter.str(), __FILE__, __LINE__ );
     }
     /*------DEBUG LOG END------*/
     EVENT_TAG status = FINALIZE;
     bool possible_flag = false;
     thread_data_ptr session_data;
+    boost::asio::ip::tcp::endpoint endpoint;
 
     try
     {
@@ -7015,17 +7256,23 @@ protocol_module_base::EVENT_TAG protocol_module_sessionless::handle_realserver_d
             session_thread_data_map_it session_thread_it = session_thread_data_map.find(thread_id);
             if (session_thread_it == session_thread_data_map.end() || session_thread_it->second == NULL)
             {
-                putLogError(17115, "Invalid thread id.", __FILE__, __LINE__ );
+                boost::format formatter("Invalid thread id. thread id : %d.");
+                formatter % boost::this_thread::get_id();
+                putLogError(17115, formatter.str(), __FILE__, __LINE__ );
                 throw -1;
             }
 
             session_data = session_thread_it->second;
         }
 
-        recive_data_map_it recive_data_it = session_data->recive_data_map.find(rs_endpoint);
+        endpoint = session_data->thread_division == THREAD_DIVISION_UP_STREAM ? session_data->client_endpoint_tcp
+                   : session_data->target_endpoint;
+        recive_data_map_it recive_data_it = session_data->recive_data_map.find(endpoint);
         if (recive_data_it == session_data->recive_data_map.end())
         {
-            putLogError(17116, "Invalid endpoint.", __FILE__, __LINE__ );
+            boost::format formatter("Invalid endpoint. thread id : %d.");
+            formatter % boost::this_thread::get_id();
+            putLogError(17116, formatter.str(), __FILE__, __LINE__ );
             throw -1;
         }
 
@@ -7072,8 +7319,10 @@ protocol_module_base::EVENT_TAG protocol_module_sessionless::handle_realserver_d
                     /*-------- DEBUG LOG --------*/
                     if (LOG_LV_DEBUG == getloglevel())
                     {
-                        putLogDebug(10240, "function : protocol_module_base::EVENT_TAG protocol_module_sessionless::"
-                                    "handle_realserver_disconnect() : END_FLAG_ON.", __FILE__, __LINE__ );
+                        boost::format formatter("function : protocol_module_base::EVENT_TAG protocol_module_sessionless::"
+                                                "handle_realserver_disconnect() : END_FLAG_ON. thread id : %d.");
+                        formatter % boost::this_thread::get_id();
+                        putLogDebug(10242, formatter.str(), __FILE__, __LINE__ );
                     }
                     /*------DEBUG LOG END------*/
                     status = CLIENT_RECV;
@@ -7088,8 +7337,10 @@ protocol_module_base::EVENT_TAG protocol_module_sessionless::handle_realserver_d
             /*-------- DEBUG LOG --------*/
             if (LOG_LV_DEBUG == getloglevel())
             {
-                putLogDebug(10241, "function : protocol_module_base::EVENT_TAG protocol_module_sessionless::"
-                            "handle_realserver_disconnect() : END_FLAG_ON.", __FILE__, __LINE__ );
+                boost::format formatter("function : protocol_module_base::EVENT_TAG protocol_module_sessionless::"
+                                        "handle_realserver_disconnect() : END_FLAG_ON. thread id : %d.");
+                formatter % boost::this_thread::get_id();
+                putLogDebug(10243, formatter.str(), __FILE__, __LINE__ );
             }
             /*------DEBUG LOG END------*/
             //the data that can be sent possible is exist
@@ -7110,9 +7361,9 @@ protocol_module_base::EVENT_TAG protocol_module_sessionless::handle_realserver_d
         if (LOG_LV_DEBUG == getloglevel())
         {
             boost::format formatter("function : protocol_module_base::EVENT_TAG protocol_module_sessionless::"
-                                    "handle_realserver_disconnect() : catch exception e = %d.");
-            formatter % e;
-            putLogDebug(10242, formatter.str(), __FILE__, __LINE__ );
+                                    "handle_realserver_disconnect() : catch exception e = %d. thread id : %d.");
+            formatter % e % boost::this_thread::get_id();
+            putLogDebug(10244, formatter.str(), __FILE__, __LINE__ );
         }
         /*------DEBUG LOG END------*/
         status = FINALIZE;
@@ -7121,16 +7372,18 @@ protocol_module_base::EVENT_TAG protocol_module_sessionless::handle_realserver_d
     {
         std::cerr << "protocol_module_sessionless::handle_realserver_disconnect() : exception: error = " << ex.what() << "." << std::endl;
         boost::format formatter("function : protocol_module_base::EVENT_TAG protocol_module_sessionless::"
-                                "handle_realserver_disconnect() : exception : error = %s.");
-        formatter % ex.what();
+                                "handle_realserver_disconnect() : exception : error = %s. thread id : %d.");
+        formatter % ex.what() % boost::this_thread::get_id();
         putLogError(17117, formatter.str(), __FILE__, __LINE__ );
         status = FINALIZE;
     }
     catch (...)
     {
         std::cerr << "protocol_module_sessionless::handle_realserver_disconnect() : Unknown exception." << std::endl;
-        putLogError(17118, "function : protocol_module_base::EVENT_TAG protocol_module_sessionless::"
-                    "handle_realserver_disconnect() : Unknown exception.", __FILE__, __LINE__ );
+        boost::format formatter("function : protocol_module_base::EVENT_TAG protocol_module_sessionless::"
+                                "handle_realserver_disconnect() : Unknown exception. thread id : %d.");
+        formatter % boost::this_thread::get_id();
+        putLogError(17118, formatter.str(), __FILE__, __LINE__ );
         status = FINALIZE;
     }
 
@@ -7139,9 +7392,9 @@ protocol_module_base::EVENT_TAG protocol_module_sessionless::handle_realserver_d
     {
         boost::format formatter("out_function : protocol_module_base::EVENT_TAG protocol_module_sessionless::"
                                 "handle_realserver_disconnect(const boost::thread::id thread_id, "
-                                "const boost::asio::ip::tcp::endpoint & rs_endpoint) : return_value = %d.");
-        formatter % status;
-        putLogDebug(10243, formatter.str(), __FILE__, __LINE__ );
+                                "const boost::asio::ip::tcp::endpoint & rs_endpoint) : return_value = %d. thread id : %d.");
+        formatter % status % boost::this_thread::get_id();
+        putLogDebug(10245, formatter.str(), __FILE__, __LINE__ );
     }
     /*------DEBUG LOG END------*/
 
@@ -7166,12 +7419,13 @@ protocol_module_base::EVENT_TAG protocol_module_sessionless::handle_sorryserver_
             "const boost::asio::ip::tcp::endpoint & sorry_endpoint) : "
             "thread_id = %d, sorry_endpoint = [%s]:%d.");
         formatter % thread_id % sorry_endpoint.address().to_string() % sorry_endpoint.port() ;
-        putLogDebug(10244, formatter.str(), __FILE__, __LINE__ );
+        putLogDebug(10246, formatter.str(), __FILE__, __LINE__ );
     }
     /*------DEBUG LOG END------*/
     EVENT_TAG status = FINALIZE;
     bool possible_flag = false;
     thread_data_ptr session_data;
+    boost::asio::ip::tcp::endpoint endpoint;
 
     try
     {
@@ -7181,17 +7435,23 @@ protocol_module_base::EVENT_TAG protocol_module_sessionless::handle_sorryserver_
             session_thread_data_map_it session_thread_it = session_thread_data_map.find(thread_id);
             if (session_thread_it == session_thread_data_map.end() || session_thread_it->second == NULL)
             {
-                putLogError(17119, "Invalid thread id.", __FILE__, __LINE__ );
+                boost::format formatter("Invalid thread id. thread id : %d.");
+                formatter % boost::this_thread::get_id();
+                putLogError(17119, formatter.str(), __FILE__, __LINE__ );
                 throw -1;
             }
 
             session_data = session_thread_it->second;
         }
 
-        recive_data_map_it recive_data_it = session_data->recive_data_map.find(session_data->target_endpoint);
+        endpoint = session_data->thread_division == THREAD_DIVISION_UP_STREAM ? session_data->client_endpoint_tcp
+                   : session_data->target_endpoint;
+        recive_data_map_it recive_data_it = session_data->recive_data_map.find(endpoint);
         if (recive_data_it == session_data->recive_data_map.end())
         {
-            putLogError(17120, "Invalid endpoint.", __FILE__, __LINE__ );
+            boost::format formatter("Invalid endpoint. thread id : %d.");
+            formatter % boost::this_thread::get_id();
+            putLogError(17120, formatter.str(), __FILE__, __LINE__ );
             throw -1;
         }
 
@@ -7238,8 +7498,10 @@ protocol_module_base::EVENT_TAG protocol_module_sessionless::handle_sorryserver_
                     /*-------- DEBUG LOG --------*/
                     if (LOG_LV_DEBUG == getloglevel())
                     {
-                        putLogDebug(10245, "function : protocol_module_base::EVENT_TAG protocol_module_sessionless::"
-                                    "handle_sorryserver_disconnect() : END_FLAG_ON.", __FILE__, __LINE__ );
+                        boost::format formatter("function : protocol_module_base::EVENT_TAG protocol_module_sessionless::"
+                                                "handle_sorryserver_disconnect() : END_FLAG_ON. thread id : %d.");
+                        formatter % boost::this_thread::get_id();
+                        putLogDebug(10247, formatter.str(), __FILE__, __LINE__ );
                     }
                     /*------DEBUG LOG END------*/
                     status = CLIENT_RECV;
@@ -7254,8 +7516,10 @@ protocol_module_base::EVENT_TAG protocol_module_sessionless::handle_sorryserver_
             /*-------- DEBUG LOG --------*/
             if (LOG_LV_DEBUG == getloglevel())
             {
-                putLogDebug(10246, "function : protocol_module_base::EVENT_TAG protocol_module_sessionless::"
-                            "handle_sorryserver_disconnect() : END_FLAG_ON.", __FILE__, __LINE__ );
+                boost::format formatter("function : protocol_module_base::EVENT_TAG protocol_module_sessionless::"
+                                        "handle_sorryserver_disconnect() : END_FLAG_ON. thread id : %d.");
+                formatter % boost::this_thread::get_id();
+                putLogDebug(10248, formatter.str(), __FILE__, __LINE__ );
             }
             /*------DEBUG LOG END------*/
             //the data that can be sent possible is exist
@@ -7276,9 +7540,9 @@ protocol_module_base::EVENT_TAG protocol_module_sessionless::handle_sorryserver_
         if (LOG_LV_DEBUG == getloglevel())
         {
             boost::format formatter("function : protocol_module_base::EVENT_TAG protocol_module_sessionless::"
-                                    "handle_sorryserver_disconnect() : catch exception e = %d.");
-            formatter % e;
-            putLogDebug(10247, formatter.str(), __FILE__, __LINE__ );
+                                    "handle_sorryserver_disconnect() : catch exception e = %d. thread id : %d.");
+            formatter % e % boost::this_thread::get_id();
+            putLogDebug(10249, formatter.str(), __FILE__, __LINE__ );
         }
         /*------DEBUG LOG END------*/
         status = FINALIZE;
@@ -7287,16 +7551,18 @@ protocol_module_base::EVENT_TAG protocol_module_sessionless::handle_sorryserver_
     {
         std::cerr << "protocol_module_sessionless::handle_sorryserver_disconnect() : exception : error = " << ex.what() << "." << std::endl;
         boost::format formatter("function : protocol_module_base::EVENT_TAG protocol_module_sessionless::"
-                                "handle_sorryserver_disconnect() : exception : error = %s.");
-        formatter % ex.what();
+                                "handle_sorryserver_disconnect() : exception : error = %s. thread id : %d.");
+        formatter % ex.what() % boost::this_thread::get_id();
         putLogError(17121, formatter.str(), __FILE__, __LINE__ );
         status = FINALIZE;
     }
     catch (...)
     {
         std::cerr << "protocol_module_sessionless::handle_sorryserver_disconnect() : Unknown exception." << std::endl;
-        putLogError(17122, "function : protocol_module_base::EVENT_TAG protocol_module_sessionless::"
-                    "handle_sorryserver_disconnect() : Unknown exception.", __FILE__, __LINE__ );
+        boost::format formatter("function : protocol_module_base::EVENT_TAG protocol_module_sessionless::"
+                                "handle_sorryserver_disconnect() : Unknown exception. thread id : %d.");
+        formatter % boost::this_thread::get_id();
+        putLogError(17122, formatter.str(), __FILE__, __LINE__ );
         status = FINALIZE;
     }
 
@@ -7307,9 +7573,9 @@ protocol_module_base::EVENT_TAG protocol_module_sessionless::handle_sorryserver_
         formatter(
             "out_function : protocol_module_base::EVENT_TAG protocol_module_sessionless::"
             "handle_sorryserver_disconnect(const boost::thread::id thread_id, "
-            "const boost::asio::ip::tcp::endpoint& sorry_endpoint) : return_value = %d.");
-        formatter % status;
-        putLogDebug(10248, formatter.str(), __FILE__, __LINE__ );
+            "const boost::asio::ip::tcp::endpoint& sorry_endpoint) : return_value = %d. thread id : %d.");
+        formatter % status % boost::this_thread::get_id();
+        putLogDebug(10250, formatter.str(), __FILE__, __LINE__ );
     }
     /*------DEBUG LOG END------*/
 
@@ -7329,9 +7595,9 @@ protocol_module_base::EVENT_TAG protocol_module_sessionless::handle_realserver_c
         boost::format formatter("in/out_function : protocol_module_base::EVENT_TAG protocol_module_sessionless::"
                                 "handle_realserver_close(const boost::thread::id thread_id, "
                                 "const boost::asio::ip::udp::endpoint & rs_endpoint) : "
-                                "return_value = %d.");
-        formatter % STOP;
-        putLogDebug(10249, formatter.str(), __FILE__, __LINE__ );
+                                "return_value = %d. thread id : %d.");
+        formatter % STOP % boost::this_thread::get_id();
+        putLogDebug(10251, formatter.str(), __FILE__, __LINE__ );
     }
     /*------DEBUG LOG END------*/
     return STOP;
@@ -7340,11 +7606,13 @@ protocol_module_base::EVENT_TAG protocol_module_sessionless::handle_realserver_c
 }
 
 extern "C" l7vs::protocol_module_base*
-create_module(){
-       return dynamic_cast<l7vs::protocol_module_base*>(new l7vs::protocol_module_sessionless());
+create_module()
+{
+    return dynamic_cast<l7vs::protocol_module_base*>(new l7vs::protocol_module_sessionless());
 }
 
 extern "C" void
-destroy_module( l7vs::protocol_module_base* in ){
-       delete in;
+destroy_module( l7vs::protocol_module_base* in )
+{
+    delete in;
 }
index c05da93..6e13b5f 100644 (file)
@@ -777,7 +777,7 @@ protocol_module_sslid::check_message_result protocol_module_sslid::set_parameter
         {
             boost::format formatter("new : address = &(%d), size = %lu.");
             formatter % static_cast<void*>(replication_data_processor)
-            % sizeof(sslid_session_data_processor);
+            % sizeof(sslid_replication_data_processor);
             putLogDebug(30019, formatter.str(), __FILE__, __LINE__);
         }
         /*------DEBUG LOG END------*/
@@ -1149,7 +1149,9 @@ protocol_module_base::EVENT_TAG protocol_module_sslid::handle_session_initialize
     catch (const std::bad_alloc& ba)
     {
         std::cerr << "protocol_module_sslid::handle_session_initialize() : exception : Could not allocate memory." << std::endl;
-        putLogError(37025, "Could not allocate memory.", __FILE__, __LINE__);
+        boost::format formatter("Could not allocate memory. thread id : %d.");
+        formatter % boost::this_thread::get_id();
+        putLogError(37025, formatter.str(), __FILE__, __LINE__);
 
         status = FINALIZE;
     }
@@ -1157,8 +1159,8 @@ protocol_module_base::EVENT_TAG protocol_module_sslid::handle_session_initialize
     {
         std::cerr << "protocol_module_sslid::handle_session_initialize() : exception : error = " << e.what() << "." << std::endl;
         boost::format formatter("function : protocol_module_base::EVENT_TAG protocol_module_sslid::"
-                                "handle_session_initialize() : exception : error = %s.");
-        formatter % e.what();
+                                "handle_session_initialize() : exception : error = %s. thread id : %d.");
+        formatter % e.what() % boost::this_thread::get_id();
         putLogError(37026, formatter.str(), __FILE__, __LINE__);
 
         status = FINALIZE;
@@ -1166,8 +1168,10 @@ protocol_module_base::EVENT_TAG protocol_module_sslid::handle_session_initialize
     catch (...)
     {
         std::cerr << "protocol_module_sslid::handle_session_initialize() : Unknown exception." << std::endl;
-        putLogError(37027, "function : protocol_module_base::EVENT_TAG protocol_module_sslid::"
-                    "handle_session_initialize() : Unknown exception.", __FILE__, __LINE__);
+        boost::format formatter("function : protocol_module_base::EVENT_TAG protocol_module_sslid::"
+                                "handle_session_initialize() : Unknown exception. thread id : %d.");
+        formatter % boost::this_thread::get_id();
+        putLogError(37027, formatter.str(), __FILE__, __LINE__);
 
         status = FINALIZE;
     }
@@ -1179,8 +1183,9 @@ protocol_module_base::EVENT_TAG protocol_module_sslid::handle_session_initialize
                                 "handle_session_initialize(const boost::thread::id up_thread_id, "
                                 "const boost::thread::id down_thread_id, "
                                 "const boost::asio::ip::tcp::endpoint& client_endpoint_tcp, "
-                                "const boost::asio::ip::udp::endpoint& client_endpoint_udp) : return_value = %d.");
-        formatter % status;
+                                "const boost::asio::ip::udp::endpoint& client_endpoint_udp) : return_value = %d. "
+                               "thread id : %d.");
+        formatter % status % boost::this_thread::get_id();
         putLogDebug(30039, formatter.str(), __FILE__, __LINE__);
     }
     /*------DEBUG LOG END------*/
@@ -1246,15 +1251,17 @@ protocol_module_base::EVENT_TAG protocol_module_sslid::handle_session_finalize(
     {
         std::cerr << "protocol_module_sslid::handle_session_finalize() : exception : error = " << e.what() << "." << std::endl;
         boost::format formatter("function : protocol_module_base::EVENT_TAG protocol_module_sslid::"
-                                "handle_session_finalize() : exception : error = %s.");
-        formatter % e.what();
+                                "handle_session_finalize() : exception : error = %s. thread id : %d.");
+        formatter % e.what() % boost::this_thread::get_id();
         putLogError(37028, formatter.str(), __FILE__, __LINE__);
     }
     catch (...)
     {
         std::cerr << "protocol_module_sslid::handle_session_finalize() : Unknown exception." << std::endl;
-        putLogError(37029, "function : protocol_module_base::EVENT_TAG protocol_module_sslid::"
-                    "handle_session_finalize() : Unknown exception.", __FILE__, __LINE__);
+        boost::format formatter("function : protocol_module_base::EVENT_TAG protocol_module_sslid::"
+                                "handle_session_finalize() : Unknown exception. thread id : %d.");
+        formatter % boost::this_thread::get_id();
+        putLogError(37029, formatter.str(), __FILE__, __LINE__);
     }
 
     /*-------- DEBUG LOG --------*/
@@ -1262,8 +1269,8 @@ protocol_module_base::EVENT_TAG protocol_module_sslid::handle_session_finalize(
     {
         boost::format formatter("out_function : protocol_module_base::EVENT_TAG protocol_module_sslid::"
                                 "handle_session_finalize(const boost::thread::id up_thread_id, "
-                                "const boost::thread::id down_thread_id) : return_value = %d.");
-        formatter % STOP;
+                                "const boost::thread::id down_thread_id) : return_value = %d. thread id : %d.");
+        formatter % STOP % boost::this_thread::get_id();
         putLogDebug(30043, formatter.str(), __FILE__, __LINE__);
     }
     /*------DEBUG LOG END------*/
@@ -1324,7 +1331,10 @@ protocol_module_base::EVENT_TAG protocol_module_sslid::handle_client_recv(
         if (recvlen > recvbuffer.size())
         {
             std::cerr << "protocol_module_sslid::handle_client_recv() : Data size bigger than buffer size." << std::endl;
-            putLogError(37030, "Data size bigger than buffer size.", __FILE__, __LINE__);
+            boost::format formatter("Data size bigger than buffer size. thread id : %d.");
+            formatter % boost::this_thread::get_id();
+            putLogError(37030, formatter.str(), __FILE__, __LINE__);
+
             throw -1;
         }
 
@@ -1333,7 +1343,9 @@ protocol_module_base::EVENT_TAG protocol_module_sslid::handle_client_recv(
             session_thread_data_map_type::iterator it = session_thread_data_map.find(thread_id);
             if (it == session_thread_data_map.end() || it->second == NULL)
             {
-                putLogError(37031, "Invalid thread id.", __FILE__, __LINE__);
+                boost::format formatter("Invalid thread id. thread id: % id.");
+                formatter % boost::this_thread::get_id();
+                putLogError(37031, formatter.str(), __FILE__, __LINE__);
 
                 throw -1;
             }
@@ -1355,7 +1367,9 @@ protocol_module_base::EVENT_TAG protocol_module_sslid::handle_client_recv(
             if (threaddata->data_size + recvlen > threaddata->data_buffer.size())
             {
                 std::cerr << "protocol_module_sslid::handle_client_recv() : Data size bigger than buffer size." << std::endl;
-                putLogError(37032, "Data size bigger than buffer size.", __FILE__, __LINE__);
+                boost::format formatter("Data size bigger than buffer size. thread id : % id.");
+                formatter % boost::this_thread::get_id();
+                putLogError(37032, formatter.str(), __FILE__, __LINE__);
                 threaddata->end_flag = END_FLAG_ON;
                 throw -1;
             }
@@ -1443,8 +1457,10 @@ protocol_module_base::EVENT_TAG protocol_module_sslid::handle_client_recv(
                 /*-------- DEBUG LOG --------*/
                 if (LOG_LV_DEBUG == getloglevel())
                 {
-                    putLogDebug(30050, "function : protocol_module_base::EVENT_TAG protocol_module_sslid::"
-                                "handle_client_recv() : check_ssl_record_sendable() end.", __FILE__, __LINE__);
+                    boost::format formatter("function : protocol_module_base::EVENT_TAG protocol_module_sslid::"
+                                            "handle_client_recv() : check_ssl_record_sendable() end. thread id : %d.");
+                    formatter % boost::this_thread::get_id();
+                    putLogDebug(30050, formatter.str(), __FILE__, __LINE__);
                 }
                 /*------DEBUG LOG END------*/
 
@@ -1456,8 +1472,10 @@ protocol_module_base::EVENT_TAG protocol_module_sslid::handle_client_recv(
                     /*-------- DEBUG LOG --------*/
                     if (LOG_LV_DEBUG == getloglevel())
                     {
-                        putLogDebug(30051, "function : protocol_module_base::EVENT_TAG protocol_module_sslid::"
-                                    "handle_client_recv() : END_FLAG_ON.", __FILE__, __LINE__);
+                        boost::format formatter("function : protocol_module_base::EVENT_TAG protocol_module_sslid::"
+                                                "handle_client_recv() : END_FLAG_ON. thread id : %d.");
+                        formatter % boost::this_thread::get_id();
+                        putLogDebug(30051, formatter.str(), __FILE__, __LINE__);
                     }
                     /*------DEBUG LOG END------*/
                 }
@@ -1488,8 +1506,8 @@ protocol_module_base::EVENT_TAG protocol_module_sslid::handle_client_recv(
         if (LOG_LV_DEBUG == getloglevel())
         {
             boost::format formatter("function : protocol_module_base::EVENT_TAG protocol_module_sslid::"
-                                    "handle_client_recv() : catch exception e = %d.");
-            formatter % e;
+                                    "handle_client_recv() : catch exception e = %d. thread id : %d.");
+            formatter % e % boost::this_thread::get_id();
             putLogDebug(30052, formatter.str(), __FILE__, __LINE__);
         }
         /*------DEBUG LOG END------*/
@@ -1499,8 +1517,8 @@ protocol_module_base::EVENT_TAG protocol_module_sslid::handle_client_recv(
     {
         std::cerr << "protocol_module_sslid::handle_client_recv() : error = " << e.what() << "." << std::endl;
         boost::format formatter("function : protocol_module_base::EVENT_TAG protocol_module_sslid::"
-                                "handle_client_recv() : exception : error = %s.");
-        formatter % e.what();
+                                "handle_client_recv() : exception : error = %s. thread id : %d.");
+        formatter % e.what() % boost::this_thread::get_id();
         putLogError(37033, formatter.str(), __FILE__, __LINE__);
 
         status = FINALIZE;
@@ -1508,8 +1526,11 @@ protocol_module_base::EVENT_TAG protocol_module_sslid::handle_client_recv(
     catch (...)
     {
         std::cerr << "protocol_module_sslid::handle_client_recv() : Unknown exception." << std::endl;
-        putLogError(37034, "function : protocol_module_base::EVENT_TAG "
-                    "protocol_module_sslid::handle_client_recv() : Unknown exception.", __FILE__, __LINE__);
+        boost::format formatter("function : protocol_module_base::EVENT_TAG "
+                                "protocol_module_sslid::handle_client_recv() "
+                                ": Unknown exception. thread id : %d");
+        formatter % boost::this_thread::get_id();
+        putLogError(37034, formatter.str(), __FILE__, __LINE__);
 
         status = FINALIZE;
     }
@@ -1520,8 +1541,8 @@ protocol_module_base::EVENT_TAG protocol_module_sslid::handle_client_recv(
         boost::format formatter("out_function : protocol_module_base::EVENT_TAG protocol_module_sslid::"
                                 "handle_client_recv(const boost::thread::id thread_id, "
                                 "const boost::array<char,MAX_BUFFER_SIZE>& recvbuffer, "
-                                "const size_t recvlen) : return_value = %d, end_flag = %d.");
-        formatter % status % (threaddata.get() ? threaddata->end_flag : END_FLAG_ON);
+                                "const size_t recvlen) : return_value = %d, end_flag = %d. thread id : %d.");
+        formatter % status % (threaddata.get() ? threaddata->end_flag : END_FLAG_ON) % boost::this_thread::get_id();
         putLogDebug(30053, formatter.str(), __FILE__, __LINE__);
     }
     /*------DEBUG LOG END------*/
@@ -1560,18 +1581,20 @@ protocol_module_base::EVENT_TAG protocol_module_sslid::handle_realserver_select(
             session_thread_data_map_type::iterator it = session_thread_data_map.find(thread_id);
             if (it == session_thread_data_map.end() || it->second == NULL)
             {
-                putLogError(37035, "Invalid thread id.", __FILE__, __LINE__);
+                boost::format formatter("Invalid thread id. thread id : %d.");
+                formatter % boost::this_thread::get_id();
+                putLogError(37035, formatter.str(), __FILE__, __LINE__);
                 /*-------- DEBUG LOG --------*/
                 if (LOG_LV_DEBUG == getloglevel())
                 {
                     boost::format formatter("out_function : protocol_module_base::EVENT_TAG protocol_module_sslid::"
                                             "handle_realserver_select(const boost::thread::id thread_id, "
-                                            "boost::asio::ip::tcp::endpoint& rs_endpoint) : return_value = %d.");
-                    formatter % FINALIZE;
+                                            "boost::asio::ip::tcp::endpoint& rs_endpoint) : return_value = %d. thread id : %d.");
+                    formatter % FINALIZE % boost::this_thread::get_id();
                     putLogDebug(30055, formatter.str(), __FILE__, __LINE__);
                 }
                 /*------DEBUG LOG END------*/
-                putLogInfo(35000, "Realserver decision failure.", __FILE__, __LINE__);
+                putLogInfo(35000, "Realserver decision failure. ", __FILE__, __LINE__);
 
                 return FINALIZE;
             }
@@ -1587,8 +1610,10 @@ protocol_module_base::EVENT_TAG protocol_module_sslid::handle_realserver_select(
                 /*-------- DEBUG LOG --------*/
                 if (LOG_LV_DEBUG == getloglevel())
                 {
-                    putLogDebug(30056, "function : protocol_module_base::EVENT_TAG protocol_module_sslid::"
-                                "handle_realserver_select() end.", __FILE__, __LINE__);
+                    boost::format formatter("function : protocol_module_base::EVENT_TAG protocol_module_sslid::"
+                                            "handle_realserver_select() end. thread id : %d.");
+                    formatter % boost::this_thread::get_id();
+                    putLogDebug(30056, formatter.str(), __FILE__, __LINE__);
                 }
                 /*------DEBUG LOG END------*/
 
@@ -1601,8 +1626,10 @@ protocol_module_base::EVENT_TAG protocol_module_sslid::handle_realserver_select(
                 /*-------- DEBUG LOG --------*/
                 if (LOG_LV_DEBUG == getloglevel())
                 {
-                    putLogDebug(30057, "function : protocol_module_base::EVENT_TAG protocol_module_sslid::"
-                                "handle_realserver_select() end.", __FILE__, __LINE__);
+                    boost::format formatter("function : protocol_module_base::EVENT_TAG protocol_module_sslid::"
+                                            "handle_realserver_select() end. thread id : %d.");
+                    formatter % boost::this_thread::get_id();
+                    putLogDebug(30057, formatter.str(), __FILE__, __LINE__);
                 }
                 /*------DEBUG LOG END------*/
 
@@ -1615,8 +1642,10 @@ protocol_module_base::EVENT_TAG protocol_module_sslid::handle_realserver_select(
                     /*-------- DEBUG LOG --------*/
                     if (LOG_LV_DEBUG == getloglevel())
                     {
-                        putLogDebug(30058, "function : protocol_module_base::EVENT_TAG protocol_module_sslid::"
-                                    "handle_realserver_select() : END_FLAG_ON.", __FILE__, __LINE__);
+                        boost::format formatter("function : protocol_module_base::EVENT_TAG protocol_module_sslid::"
+                                                "handle_realserver_select() : END_FLAG_ON. thread id : %d.");
+                        formatter % boost::this_thread::get_id();
+                        putLogDebug(30058, formatter.str(), __FILE__, __LINE__);
                     }
                     /*------DEBUG LOG END------*/
                 }
@@ -1633,8 +1662,9 @@ protocol_module_base::EVENT_TAG protocol_module_sslid::handle_realserver_select(
                             boost::format formatter("out_function : protocol_module_base::EVENT_TAG "
                                                     "protocol_module_sslid::handle_realserver_select("
                                                     "const boost::thread::id thread_id, boost::asio::"
-                                                    "ip::tcp::endpoint& rs_endpoint) : return_value = %d.");
-                            formatter % FINALIZE;
+                                                    "ip::tcp::endpoint& rs_endpoint) : return_value = %d. "
+                                                   "thread id : % id.");
+                            formatter % FINALIZE % boost::this_thread::get_id();
                             putLogDebug(30059, formatter.str(), __FILE__, __LINE__);
                         }
                         /*------DEBUG LOG END------*/
@@ -1651,8 +1681,9 @@ protocol_module_base::EVENT_TAG protocol_module_sslid::handle_realserver_select(
                         std::string buffer;
                         dump_session_id(session_id.c_str(), session_id.size(), buffer);
                         boost::format formatter("function : protocol_module_base::EVENT_TAG protocol_module_sslid::"
-                                    "handle_realserver_select() : get_ssl_session_id() session_id = %s end.");
-                        formatter % buffer;
+                                                "handle_realserver_select() : get_ssl_session_id() session_id = %s end. "
+                                                "thread id : %d.");
+                        formatter % buffer % boost::this_thread::get_id();
                         putLogDebug(30060, formatter.str(), __FILE__, __LINE__);
                     }
                     /*------DEBUG LOG END------*/
@@ -1680,8 +1711,11 @@ protocol_module_base::EVENT_TAG protocol_module_sslid::handle_realserver_select(
                             /*-------- DEBUG LOG --------*/
                             if (LOG_LV_DEBUG == getloglevel())
                             {
-                                putLogDebug(30061, "function : protocol_module_base::EVENT_TAG protocol_module_sslid::"
-                                            "handle_realserver_select() : END_FLAG_ON.", __FILE__, __LINE__);
+                                boost::format formatter("function : protocol_module_base::EVENT_TAG "
+                                                        "protocol_module_sslid::handle_realserver_select() : "
+                                                        "END_FLAG_ON. thread id : %d.");
+                                formatter % boost::this_thread::get_id();
+                                putLogDebug(30061, formatter.str(), __FILE__, __LINE__);
                             }
                             /*------DEBUG LOG END------*/
                         }
@@ -1696,9 +1730,11 @@ protocol_module_base::EVENT_TAG protocol_module_sslid::handle_realserver_select(
                         /*-------- DEBUG LOG --------*/
                         if (LOG_LV_DEBUG == getloglevel())
                         {
-                            putLogDebug(30062, "function : protocol_module_base::EVENT_TAG protocol_module_sslid::"
-                                        "handle_realserver_select() : get_endpoint_from_session_data() end.",
-                                        __FILE__, __LINE__);
+                            boost::format formatter("function : protocol_module_base::EVENT_TAG "
+                                                    "protocol_module_sslid::handle_realserver_select() : "
+                                                    "get_endpoint_from_session_data() end. thread id : %d.");
+                            formatter % boost::this_thread::get_id();
+                            putLogDebug(30062, formatter.str(), __FILE__, __LINE__);
                         }
                         /*------DEBUG LOG END------*/
 
@@ -1733,9 +1769,11 @@ protocol_module_base::EVENT_TAG protocol_module_sslid::handle_realserver_select(
                                     /*-------- DEBUG LOG --------*/
                                     if (LOG_LV_DEBUG == getloglevel())
                                     {
-                                        putLogDebug(30063, "function : protocol_module_base::EVENT_TAG "
-                                                    "protocol_module_sslid::handle_realserver_select() : "
-                                                    "END_FLAG_ON.", __FILE__, __LINE__);
+                                        boost::format formatter("function : protocol_module_base::EVENT_TAG "
+                                                                "protocol_module_sslid::handle_realserver_select() : "
+                                                                "END_FLAG_ON. thread id : %d.");
+                                        formatter % boost::this_thread::get_id();
+                                        putLogDebug(30063, formatter.str(), __FILE__, __LINE__);
                                     }
                                     /*------DEBUG LOG END------*/
                                 }
@@ -1749,9 +1787,11 @@ protocol_module_base::EVENT_TAG protocol_module_sslid::handle_realserver_select(
                                 /*-------- DEBUG LOG --------*/
                                 if (LOG_LV_DEBUG == getloglevel())
                                 {
-                                    putLogDebug(30064, "function : protocol_module_base::EVENT_TAG "
-                                                "protocol_module_sslid::handle_realserver_select() : END_FLAG_ON.",
-                                                __FILE__, __LINE__);
+                                    boost::format formatter("function : protocol_module_base::EVENT_TAG "
+                                                            "protocol_module_sslid::handle_realserver_select() "
+                                                            ": END_FLAG_ON. thread id : %d.");
+                                    formatter % boost::this_thread::get_id();
+                                    putLogDebug(30064, formatter.str(), __FILE__, __LINE__);
                                 }
                                 /*------DEBUG LOG END------*/
                             }
@@ -1785,8 +1825,10 @@ protocol_module_base::EVENT_TAG protocol_module_sslid::handle_realserver_select(
                     /*-------- DEBUG LOG --------*/
                     if (LOG_LV_DEBUG == getloglevel())
                     {
-                        putLogDebug(30065, "function : protocol_module_base::EVENT_TAG protocol_module_sslid::"
-                                    "handle_realserver_select() : END_FLAG_ON.", __FILE__, __LINE__);
+                        boost::format formatter("function : protocol_module_base::EVENT_TAG protocol_module_sslid::"
+                                                "handle_realserver_select() : END_FLAG_ON. thread id : %d.");
+                        formatter % boost::this_thread::get_id();
+                        putLogDebug(30065, formatter.str(), __FILE__, __LINE__);
                     }
                     /*------DEBUG LOG END------*/
                 }
@@ -1800,8 +1842,10 @@ protocol_module_base::EVENT_TAG protocol_module_sslid::handle_realserver_select(
                 /*-------- DEBUG LOG --------*/
                 if (LOG_LV_DEBUG == getloglevel())
                 {
-                    putLogDebug(30066, "function : protocol_module_base::EVENT_TAG protocol_module_sslid::"
-                                "handle_realserver_select() : END_FLAG_ON.", __FILE__, __LINE__);
+                    boost::format formatter("function : protocol_module_base::EVENT_TAG protocol_module_sslid::"
+                                            "handle_realserver_select() : END_FLAG_ON. thread id : %d.");
+                    formatter % boost::this_thread::get_id();
+                    putLogDebug(30066, formatter.str(), __FILE__, __LINE__);
                 }
                 /*------DEBUG LOG END------*/
             }
@@ -1815,8 +1859,10 @@ protocol_module_base::EVENT_TAG protocol_module_sslid::handle_realserver_select(
             /*-------- DEBUG LOG --------*/
             if (LOG_LV_DEBUG == getloglevel())
             {
-                putLogDebug(30067, "function : protocol_module_base::EVENT_TAG protocol_module_sslid::"
-                            "handle_realserver_select() : END_FLAG_ON.", __FILE__, __LINE__);
+                boost::format formatter("function : protocol_module_base::EVENT_TAG protocol_module_sslid::"
+                                        "handle_realserver_select() : END_FLAG_ON. thread id : %d.");
+                formatter % boost::this_thread::get_id();
+                putLogDebug(30067, formatter.str(), __FILE__, __LINE__);
             }
             /*------DEBUG LOG END------*/
         }
@@ -1825,8 +1871,8 @@ protocol_module_base::EVENT_TAG protocol_module_sslid::handle_realserver_select(
     {
         std::cerr << "protocol_module_sslid::handle_realserver_select() : exception : error = " << e.what() << "." << std::endl;
         boost::format formatter("function : protocol_module_base::EVENT_TAG protocol_module_sslid::"
-                                "handle_realserver_select() : exception : error = %s.");
-        formatter % e.what();
+                                "handle_realserver_select() : exception : error = %s. thread id : %d.");
+        formatter % e.what() % boost::this_thread::get_id();
         putLogError(37036, formatter.str(), __FILE__, __LINE__);
 
         putLogInfo(35002, "Realserver decision failure.", __FILE__, __LINE__);
@@ -1836,8 +1882,10 @@ protocol_module_base::EVENT_TAG protocol_module_sslid::handle_realserver_select(
     catch (...)
     {
         std::cerr << "protocol_module_sslid::handle_realserver_select() : Unknown exception." << std::endl;
-        putLogError(37037, "function : protocol_module_base::EVENT_TAG "
-                    "protocol_module_sslid::handle_realserver_select() : Unknown exception.", __FILE__, __LINE__);
+        boost::format formatter("function : protocol_module_base::EVENT_TAG protocol_module_sslid::"
+                               "handle_realserver_select() : Unknown exception. thread id : %d.");
+        formatter % boost::this_thread::get_id();
+        putLogError(37037, formatter.str(), __FILE__, __LINE__);
 
         putLogInfo(35003, "Realserver decision failure.", __FILE__, __LINE__);
 
@@ -1850,9 +1898,9 @@ protocol_module_base::EVENT_TAG protocol_module_sslid::handle_realserver_select(
         boost::format formatter("out_function : protocol_module_base::EVENT_TAG protocol_module_sslid::"
                                 "handle_realserver_select(const boost::thread::id thread_id, "
                                 "boost::asio::ip::tcp::endpoint& rs_endpoint) : return_value = %d, "
-                                "end_flag = %d, rs_endpoint = [%s]:%d.");
+                                "end_flag = %d, rs_endpoint = [%s]:%d. thread id : %d.");
         formatter % status % (threaddata.get() ? threaddata->end_flag : END_FLAG_ON)
-        % rs_endpoint.address().to_string() % rs_endpoint.port();
+                  % rs_endpoint.address().to_string() % rs_endpoint.port() % boost::this_thread::get_id();
         putLogDebug(30068, formatter.str(), __FILE__, __LINE__);
     }
     /*------DEBUG LOG END------*/
@@ -1879,8 +1927,8 @@ protocol_module_base::EVENT_TAG protocol_module_sslid::handle_realserver_select(
                                 "handle_realserver_select(const boost::thread::id thread_id, "
                                 "boost::asio::ip::udp::endpoint& rs_endpoint, "
                                 "boost::array<char,MAX_BUFFER_SIZE>& sendbuffer, size_t& datalen) : "
-                                "return_value = %d.");
-        formatter % STOP;
+                                "return_value = %d. thread id : %d.");
+        formatter % STOP % boost::this_thread::get_id();
         putLogDebug(30069, formatter.str(), __FILE__, __LINE__);
     }
     /*------DEBUG LOG END------*/
@@ -1925,7 +1973,9 @@ protocol_module_base::EVENT_TAG protocol_module_sslid::handle_realserver_connect
             session_thread_data_map_type::iterator it = session_thread_data_map.find(thread_id);
             if (it == session_thread_data_map.end())
             {
-                putLogError(37038, "Invalid thread id.", __FILE__, __LINE__);
+                boost::format formatter("Invalid thread id. thread id : %d.");
+                formatter % boost::this_thread::get_id();
+                putLogError(37038, formatter.str(), __FILE__, __LINE__);
                 status = FINALIZE;
             }
             else
@@ -1938,16 +1988,18 @@ protocol_module_base::EVENT_TAG protocol_module_sslid::handle_realserver_connect
     {
         std::cerr << "protocol_module_sslid::handle_realserver_connect() : exception : error = " << e.what() << "." << std::endl;
         boost::format formatter("function : protocol_module_base::EVENT_TAG protocol_module_sslid::"
-                                "handle_realserver_connect() exception : error = %s.");
-        formatter % e.what();
+                                "handle_realserver_connect() exception : error = %s. thread id : %d.");
+        formatter % e.what() % boost::this_thread::get_id();
         putLogError(37039, formatter.str(), __FILE__, __LINE__);
         status = FINALIZE;
     }
     catch (...)
     {
         std::cerr << "protocol_module_sslid::handle_realserver_connect() : Unknown exception." << std::endl;
-        putLogError(37040, "function : protocol_module_base::EVENT_TAG "
-                    "protocol_module_sslid::handle_realserver_connect() : Unknown exception.", __FILE__, __LINE__);
+        boost::format formatter("function : protocol_module_base::EVENT_TAG protocol_module_sslid::"
+                                "handle_realserver_connect() : Unknown exception. thread id : %d.");
+        formatter % boost::this_thread::get_id();
+        putLogError(37040, formatter.str(), __FILE__, __LINE__);
 
         status = FINALIZE;
     }
@@ -1958,8 +2010,8 @@ protocol_module_base::EVENT_TAG protocol_module_sslid::handle_realserver_connect
         boost::format formatter("out_function : protocol_module_base::EVENT_TAG protocol_module_sslid::"
                                 "handle_realserver_connect(const boost::thread::id thread_id, "
                                 "boost::array<char,MAX_BUFFER_SIZE>& sendbuffer, size_t& datalen) : "
-                                "return_value = %d.");
-        formatter % status;
+                                "return_value = %d. thread id : %d.");
+        formatter % status % boost::this_thread::get_id();
         putLogDebug(30071, formatter.str(), __FILE__, __LINE__);
     }
     /*------DEBUG LOG END------*/
@@ -1998,14 +2050,17 @@ protocol_module_base::EVENT_TAG protocol_module_sslid::handle_realserver_connect
             session_thread_data_map_type::iterator it = session_thread_data_map.find(thread_id);
             if (it == session_thread_data_map.end() || it->second == NULL)
             {
-                putLogError(37041, "Invalid thread id.", __FILE__, __LINE__);
+                boost::format formatter("Invalid thread id. thread id : %d.");
+                formatter % boost::this_thread::get_id();
+                putLogError(37041, formatter.str(), __FILE__, __LINE__);
                 /*-------- DEBUG LOG --------*/
                 if (LOG_LV_DEBUG == getloglevel())
                 {
                     boost::format formatter("out_function : protocol_module_base::EVENT_TAG protocol_module_sslid::"
                                             "handle_realserver_connection_fail(const boost::thread::id thread_id, "
-                                            "const boost::asio::ip::tcp::endpoint& rs_endpoint) : return_value = %d.");
-                    formatter % FINALIZE;
+                                            "const boost::asio::ip::tcp::endpoint& rs_endpoint) : return_value = %d. "
+                                           "thread id : %d.");
+                    formatter % FINALIZE % boost::this_thread::get_id();
                     putLogDebug(30073, formatter.str(), __FILE__, __LINE__);
                 }
                 /*------DEBUG LOG END------*/
@@ -2031,8 +2086,10 @@ protocol_module_base::EVENT_TAG protocol_module_sslid::handle_realserver_connect
             /*-------- DEBUG LOG --------*/
             if (LOG_LV_DEBUG == getloglevel())
             {
-                putLogDebug(30074, "function : protocol_module_base::EVENT_TAG protocol_module_sslid::"
-                            "handle_realserver_connection_fail() : END_FLAG_ON.", __FILE__, __LINE__);
+               boost::format formatter("function : protocol_module_base::EVENT_TAG protocol_module_sslid::"
+                                       "handle_realserver_connection_fail() : END_FLAG_ON. thread id : %d.");
+               formatter % boost::this_thread::get_id();
+                putLogDebug(30074, formatter.str(), __FILE__, __LINE__);
             }
             /*------DEBUG LOG END------*/
         }
@@ -2041,8 +2098,8 @@ protocol_module_base::EVENT_TAG protocol_module_sslid::handle_realserver_connect
     {
         std::cerr << "protocol_module_sslid::handle_realserver_connection_fail() : exception : error = " << e.what() << "." << std::endl;
         boost::format formatter("function : protocol_module_base::EVENT_TAG protocol_module_sslid::"
-                                "handle_realserver_connection_fail() : exception : error = %s.");
-        formatter % e.what();
+                                "handle_realserver_connection_fail() : exception : error = %s. thread id : %d.");
+        formatter % e.what() % boost::this_thread::get_id();
         putLogError(37042, formatter.str(), __FILE__, __LINE__);
 
         status = FINALIZE;
@@ -2050,9 +2107,10 @@ protocol_module_base::EVENT_TAG protocol_module_sslid::handle_realserver_connect
     catch (...)
     {
         std::cerr << "protocol_module_sslid::handle_realserver_connection_fail() : Unknown exception." << std::endl;
-        putLogError(37043, "function : protocol_module_base::EVENT_TAG "
-                    "protocol_module_sslid::handle_realserver_connection_fail() : Unknown exception.",
-                    __FILE__, __LINE__);
+        boost::format formatter("function : protocol_module_base::EVENT_TAG protocol_module_sslid::"
+                                "handle_realserver_connection_fail() : Unknown exception. thread id : %d.");
+        formatter % boost::this_thread::get_id();
+        putLogError(37043, formatter.str(), __FILE__, __LINE__);
 
         status = FINALIZE;
     }
@@ -2063,8 +2121,8 @@ protocol_module_base::EVENT_TAG protocol_module_sslid::handle_realserver_connect
         boost::format formatter("out_function : protocol_module_base::EVENT_TAG protocol_module_sslid::"
                                 "handle_realserver_connection_fail(const boost::thread::id thread_id, "
                                 "const boost::asio::ip::tcp::endpoint& rs_endpoint) : "
-                                "return_value = %d, end_flag = %d.");
-        formatter % status % (threaddata.get() ? threaddata->end_flag : END_FLAG_ON);
+                                "return_value = %d, end_flag = %d. thread id : %d.");
+        formatter % status % (threaddata.get() ? threaddata->end_flag : END_FLAG_ON) % boost::this_thread::get_id();
         putLogDebug(30075, formatter.str(), __FILE__, __LINE__);
     }
     /*------DEBUG LOG END------*/
@@ -2099,14 +2157,16 @@ protocol_module_base::EVENT_TAG protocol_module_sslid::handle_realserver_send(
             session_thread_data_map_type::iterator it = session_thread_data_map.find(thread_id);
             if (it == session_thread_data_map.end() || it->second == NULL)
             {
-                putLogError(37044, "Invalid thread id.", __FILE__, __LINE__);
+                boost::format formatter("Invalid thread id. thread id : %d.");
+                formatter % boost::this_thread::get_id();
+                putLogError(37044, formatter.str(), __FILE__, __LINE__);
                 /*-------- DEBUG LOG --------*/
                 if (LOG_LV_DEBUG == getloglevel())
                 {
                     boost::format formatter("out_function : protocol_module_base::EVENT_TAG protocol_module_sslid::"
                                             "handle_realserver_send(const boost::thread::id thread_id) : "
-                                            "return_value = %d.");
-                    formatter % FINALIZE;
+                                            "return_value = %d. thread id : %d.");
+                    formatter % FINALIZE % boost::this_thread::get_id();
                     putLogDebug(30077, formatter.str(), __FILE__, __LINE__);
                 }
                 /*------DEBUG LOG END------*/
@@ -2138,8 +2198,10 @@ protocol_module_base::EVENT_TAG protocol_module_sslid::handle_realserver_send(
                 /*-------- DEBUG LOG --------*/
                 if (LOG_LV_DEBUG == getloglevel())
                 {
-                    putLogDebug(30078, "function : protocol_module_base::EVENT_TAG protocol_module_sslid::"
-                                "handle_realserver_send() : check_ssl_record_sendable() end.", __FILE__, __LINE__);
+                    boost::format formatter("function : protocol_module_base::EVENT_TAG protocol_module_sslid::"
+                                            "handle_realserver_send() : check_ssl_record_sendable() end. thread id : %d.");
+                    formatter % boost::this_thread::get_id();
+                    putLogDebug(30078, formatter.str(), __FILE__, __LINE__);
                 }
                 /*------DEBUG LOG END------*/
 
@@ -2151,8 +2213,10 @@ protocol_module_base::EVENT_TAG protocol_module_sslid::handle_realserver_send(
                     /*-------- DEBUG LOG --------*/
                     if (LOG_LV_DEBUG == getloglevel())
                     {
-                        putLogDebug(30079, "function : protocol_module_base::EVENT_TAG protocol_module_sslid::"
-                                    "handle_realserver_send() : END_FLAG_ON.", __FILE__, __LINE__);
+                        boost::format formatter("function : protocol_module_base::EVENT_TAG protocol_module_sslid::"
+                                                "handle_realserver_send() : END_FLAG_ON. thread id : %d.");
+                        formatter % boost::this_thread::get_id();
+                        putLogDebug(30079, formatter.str(), __FILE__, __LINE__);
                     }
                     /*------DEBUG LOG END------*/
                 }
@@ -2180,8 +2244,8 @@ protocol_module_base::EVENT_TAG protocol_module_sslid::handle_realserver_send(
     {
         std::cerr << "protocol_module_sslid::handle_realserver_send() : exception : error = " << e.what() << "." << std::endl;
         boost::format formatter("function : protocol_module_base::EVENT_TAG protocol_module_sslid::"
-                                "handle_realserver_send() : exception : error = %s.");
-        formatter % e.what();
+                                "handle_realserver_send() : exception : error = %s. thread id : %d.");
+        formatter % e.what() % boost::this_thread::get_id();
         putLogError(37045, formatter.str(), __FILE__, __LINE__);
 
         status = FINALIZE;
@@ -2189,8 +2253,10 @@ protocol_module_base::EVENT_TAG protocol_module_sslid::handle_realserver_send(
     catch (...)
     {
         std::cerr << "protocol_module_sslid::handle_realserver_send() : Unknown exception." << std::endl;
-        putLogError(37046, "function : protocol_module_base::EVENT_TAG "
-                    "protocol_module_sslid::handle_realserver_send() : Unknown exception.", __FILE__, __LINE__);
+        boost::format formatter("function : protocol_module_base::EVENT_TAG protocol_module_sslid::"
+                                "handle_realserver_send() : Unknown exception. thread id : %d.");
+        formatter % boost::this_thread::get_id();
+        putLogError(37046, formatter.str(), __FILE__, __LINE__);
 
         status = FINALIZE;
     }
@@ -2200,8 +2266,8 @@ protocol_module_base::EVENT_TAG protocol_module_sslid::handle_realserver_send(
     {
         boost::format formatter("out_function : protocol_module_base::EVENT_TAG protocol_module_sslid::"
                                 "handle_realserver_send(const boost::thread::id thread_id) : "
-                                "return_value = %d, end_flag = %d.");
-        formatter % status % (threaddata.get() ? threaddata->end_flag : END_FLAG_ON);
+                                "return_value = %d, end_flag = %d. thread id : %d.");
+        formatter % status % (threaddata.get() ? threaddata->end_flag : END_FLAG_ON) % boost::this_thread::get_id();
         putLogDebug(30080, formatter.str(), __FILE__, __LINE__);
     }
     /*------DEBUG LOG END------*/
@@ -2222,8 +2288,8 @@ protocol_module_base::EVENT_TAG protocol_module_sslid::handle_sorryserver_select
     {
         boost::format formatter("in/out_function : protocol_module_base::EVENT_TAG protocol_module_sslid::"
                                 "handle_sorryserver_select(const boost::thread::id thread_id, "
-                                "boost::asio::ip::tcp::endpoint& sorry_endpoint) : return_value = %d.");
-        formatter % STOP;
+                                "boost::asio::ip::tcp::endpoint& sorry_endpoint) : return_value = %d. thread id : %d.");
+        formatter % STOP % boost::this_thread::get_id();
         putLogDebug(30081, formatter.str(), __FILE__, __LINE__);
     }
     /*------DEBUG LOG END------*/
@@ -2247,8 +2313,8 @@ protocol_module_base::EVENT_TAG protocol_module_sslid::handle_sorryserver_connec
         boost::format formatter("in/out_function : protocol_module_base::EVENT_TAG protocol_module_sslid::"
                                 "handle_sorryserver_connect(const boost::thread::id thread_id, "
                                 "boost::array<char,MAX_BUFFER_SIZE>& sendbuffer, size_t& datalen) : "
-                                "return_value = %d.");
-        formatter % STOP;
+                                "return_value = %d. thread id : %d.");
+        formatter % STOP % boost::this_thread::get_id();
         putLogDebug(30082, formatter.str(), __FILE__, __LINE__);
     }
     /*------DEBUG LOG END------*/
@@ -2269,8 +2335,9 @@ protocol_module_base::EVENT_TAG protocol_module_sslid::handle_sorryserver_connec
     {
         boost::format formatter("in/out_function : protocol_module_base::EVENT_TAG protocol_module_sslid::"
                                 "handle_sorryserver_connection_fail(const boost::thread::id thread_id, "
-                                "const boost::asio::ip::tcp::endpoint& sorry_endpoint) : return_value = %d.");
-        formatter % STOP;
+                                "const boost::asio::ip::tcp::endpoint& sorry_endpoint) : return_value = %d. "
+                               "thread id : %d.");
+        formatter % STOP % boost::this_thread::get_id();
         putLogDebug(30083, formatter.str(), __FILE__, __LINE__);
     }
     /*------DEBUG LOG END------*/
@@ -2288,8 +2355,9 @@ protocol_module_base::EVENT_TAG protocol_module_sslid::handle_sorryserver_send(
     if (LOG_LV_DEBUG == getloglevel())
     {
         boost::format formatter("in/out_function : protocol_module_base::EVENT_TAG protocol_module_sslid::"
-                                "handle_sorryserver_send(const boost::thread::id thread_id) : return_value = %d.");
-        formatter % STOP;
+                                "handle_sorryserver_send(const boost::thread::id thread_id) : return_value = %d."
+                               "thread id : %d.");
+        formatter % STOP % boost::this_thread::get_id();
         putLogDebug(30084, formatter.str(), __FILE__, __LINE__);
     }
     /*------DEBUG LOG END------*/
@@ -2331,7 +2399,9 @@ protocol_module_base::EVENT_TAG protocol_module_sslid::handle_realserver_recv(
     if (recvlen > recvbuffer.size())
     {
         std::cerr << "protocol_module_sslid::handle_realserver_recv() : Data size bigger than buffer size." << std::endl;
-        putLogError(37047, "Data size bigger than buffer size.", __FILE__, __LINE__);
+        boost::format formatter("Data size bigger than buffer size. thread id : %d.");
+        formatter % boost::this_thread::get_id();
+        putLogError(37047, formatter.str(), __FILE__, __LINE__);
         /*-------- DEBUG LOG --------*/
         if (LOG_LV_DEBUG == getloglevel())
         {
@@ -2339,8 +2409,8 @@ protocol_module_base::EVENT_TAG protocol_module_sslid::handle_realserver_recv(
                                     "handle_realserver_recv(const boost::thread::id thread_id, "
                                     "const boost::asio::ip::tcp::endpoint& rs_endpoint, "
                                     "const boost::array<char,MAX_BUFFER_SIZE>& recvbuffer, "
-                                    "const size_t recvlen) : return_value = %d.");
-            formatter % FINALIZE;
+                                    "const size_t recvlen) : return_value = %d. thread id : %d.");
+            formatter % FINALIZE % boost::this_thread::get_id();
             putLogDebug(30086, formatter.str(), __FILE__, __LINE__);
         }
         /*------DEBUG LOG END------*/
@@ -2359,7 +2429,9 @@ protocol_module_base::EVENT_TAG protocol_module_sslid::handle_realserver_recv(
             session_thread_data_map_type::iterator it = session_thread_data_map.find(thread_id);
             if (it == session_thread_data_map.end() || it->second == NULL)
             {
-                putLogError(37048, "Invalid thread id.", __FILE__, __LINE__);
+                boost::format formatter("Invalid thread id. thread id : %d.");
+                formatter % boost::this_thread::get_id();
+                putLogError(37048, formatter.str(), __FILE__, __LINE__);
                 /*-------- DEBUG LOG --------*/
                 if (LOG_LV_DEBUG == getloglevel())
                 {
@@ -2367,8 +2439,8 @@ protocol_module_base::EVENT_TAG protocol_module_sslid::handle_realserver_recv(
                                             "handle_realserver_recv(const boost::thread::id thread_id, "
                                             "const boost::asio::ip::tcp::endpoint& rs_endpoint, "
                                             "const boost::array<char,MAX_BUFFER_SIZE>& recvbuffer, "
-                                            "const size_t recvlen) : return_value = %d.");
-                    formatter % FINALIZE;
+                                            "const size_t recvlen) : return_value = %d. thread id : %d.");
+                    formatter % FINALIZE % boost::this_thread::get_id();
                     putLogDebug(30087, formatter.str(), __FILE__, __LINE__);
                 }
                 /*------DEBUG LOG END------*/
@@ -2387,7 +2459,9 @@ protocol_module_base::EVENT_TAG protocol_module_sslid::handle_realserver_recv(
         if (threaddata->data_size + recvlen > threaddata->data_buffer.size())
         {
             std::cerr << "protocol_module_sslid::handle_realserver_recv() : Data size bigger than buffer size." << std::endl;
-            putLogError(37049, "Data size bigger than buffer size.", __FILE__, __LINE__);
+            boost::format formatter("Data size bigger than buffer size. thread id : %d.");
+            formatter % boost::this_thread::get_id();
+            putLogError(37049, formatter.str(), __FILE__, __LINE__);
 
             /*-------- DEBUG LOG --------*/
             if (LOG_LV_DEBUG == getloglevel())
@@ -2396,8 +2470,8 @@ protocol_module_base::EVENT_TAG protocol_module_sslid::handle_realserver_recv(
                                         "handle_realserver_recv(const boost::thread::id thread_id, "
                                         "const boost::asio::ip::tcp::endpoint& rs_endpoint, "
                                         "const boost::array<char,MAX_BUFFER_SIZE>& recvbuffer, "
-                                        "const size_t recvlen) : return_value = %d.");
-                formatter % FINALIZE;
+                                        "const size_t recvlen) : return_value = %d. thread id : %d.");
+                formatter % FINALIZE % boost::this_thread::get_id();
                 putLogDebug(30088, formatter.str(), __FILE__, __LINE__);
             }
             /*------DEBUG LOG END------*/
@@ -2489,8 +2563,10 @@ protocol_module_base::EVENT_TAG protocol_module_sslid::handle_realserver_recv(
             /*-------- DEBUG LOG --------*/
             if (LOG_LV_DEBUG == getloglevel())
             {
-                putLogDebug(30093, "function : protocol_module_base::EVENT_TAG protocol_module_sslid::"
-                            "handle_realserver_recv() : check_ssl_record_sendable() END.", __FILE__, __LINE__);
+                boost::format formatter("function : protocol_module_base::EVENT_TAG protocol_module_sslid::"
+                                        "handle_realserver_recv() : check_ssl_record_sendable() END. thread id : %d.");
+                formatter % boost::this_thread::get_id();
+                putLogDebug(30093, formatter.str(), __FILE__, __LINE__);
             }
             /*------DEBUG LOG END------*/
 
@@ -2502,8 +2578,10 @@ protocol_module_base::EVENT_TAG protocol_module_sslid::handle_realserver_recv(
                 /*-------- DEBUG LOG --------*/
                 if (LOG_LV_DEBUG == getloglevel())
                 {
-                    putLogDebug(30094, "function : protocol_module_base::EVENT_TAG protocol_module_sslid::"
-                                "handle_realserver_recv() : END_FLAG_ON.", __FILE__, __LINE__);
+                    boost::format formatter("function : protocol_module_base::EVENT_TAG protocol_module_sslid::"
+                                            "handle_realserver_recv() : END_FLAG_ON. thread id : %d.");
+                    formatter % boost::this_thread::get_id();
+                    putLogDebug(30094, formatter.str(), __FILE__, __LINE__);
                 }
                 /*------DEBUG LOG END------*/
             }
@@ -2530,8 +2608,8 @@ protocol_module_base::EVENT_TAG protocol_module_sslid::handle_realserver_recv(
     {
         std::cerr << "protocol_module_sslid::handle_realserver_recv() : exception : error = " << e.what() << "." << std::endl;
         boost::format formatter("function : protocol_module_base::EVENT_TAG protocol_module_sslid::"
-                                "handle_realserver_recv() : exception : error = %s.");
-        formatter % e.what();
+                                "handle_realserver_recv() : exception : error = %s. thread id : %d.");
+        formatter % e.what() % boost::this_thread::get_id();
         putLogError(37050, formatter.str(), __FILE__, __LINE__);
 
         status = FINALIZE;
@@ -2539,8 +2617,10 @@ protocol_module_base::EVENT_TAG protocol_module_sslid::handle_realserver_recv(
     catch (...)
     {
         std::cerr << "protocol_module_sslid::handle_realserver_recv() : Unknown exception." << std::endl;
-        putLogError(37051, "function : protocol_module_base::EVENT_TAG "
-                    "protocol_module_sslid::handle_realserver_recv() : Unknown exception.", __FILE__, __LINE__);
+        boost::format formatter("function : protocol_module_base::EVENT_TAG protocol_module_sslid::"
+                                "handle_realserver_recv() : Unknown exception. thread id : %d.");
+        formatter % boost::this_thread::get_id();
+        putLogError(37051, formatter.str(), __FILE__, __LINE__);
 
         status = FINALIZE;
     }
@@ -2552,8 +2632,8 @@ protocol_module_base::EVENT_TAG protocol_module_sslid::handle_realserver_recv(
                                 "handle_realserver_recv(const boost::thread::id thread_id, "
                                 "const boost::asio::ip::tcp::endpoint& rs_endpoint, "
                                 "const boost::array<char,MAX_BUFFER_SIZE>& recvbuffer, "
-                                "const size_t recvlen) : return_value = %d, end_flag = %d.");
-        formatter % status % (threaddata.get() ? threaddata->end_flag : END_FLAG_ON);
+                                "const size_t recvlen) : return_value = %d, end_flag = %d. thread id : %d.");
+        formatter % status % (threaddata.get() ? threaddata->end_flag : END_FLAG_ON) % boost::this_thread::get_id();
         putLogDebug(30095, formatter.str(), __FILE__, __LINE__);
     }
     /*------DEBUG LOG END------*/
@@ -2580,8 +2660,8 @@ protocol_module_base::EVENT_TAG protocol_module_sslid::handle_realserver_recv(
                                 "handle_realserver_recv(const boost::thread::id thread_id, "
                                 "const boost::asio::ip::udp::endpoint& rs_endpoint, "
                                 "const boost::array<char,MAX_BUFFER_SIZE>& recvbuffer, "
-                                "const size_t recvlen) : return_value = %d.");
-        formatter % STOP;
+                                "const size_t recvlen) : return_value = %d. thread id : %d.");
+        formatter % STOP % boost::this_thread::get_id();
         putLogDebug(30096, formatter.str(), __FILE__, __LINE__);
     }
     /*------DEBUG LOG END------*/
@@ -2608,8 +2688,8 @@ protocol_module_base::EVENT_TAG protocol_module_sslid::handle_sorryserver_recv(
                                 "handle_sorryserver_recv(const boost::thread::id thread_id, "
                                 "const boost::asio::ip::tcp::endpoint& sorry_endpoint, "
                                 "const boost::array<char,MAX_BUFFER_SIZE>& recvbuffer, "
-                                "const size_t recvlen) : return_value = %d.");
-        formatter % STOP;
+                                "const size_t recvlen) : return_value = %d. thread id : %d.");
+        formatter % STOP % boost::this_thread::get_id();
         putLogDebug(30097, formatter.str(), __FILE__, __LINE__);
     }
     /*------DEBUG LOG END------*/
@@ -2627,8 +2707,9 @@ protocol_module_base::EVENT_TAG protocol_module_sslid::handle_response_send_info
     if (LOG_LV_DEBUG == getloglevel())
     {
         boost::format formatter("in/out_function : protocol_module_base::EVENT_TAG protocol_module_sslid::"
-                                "handle_response_send_inform(const boost::thread::id thread_id) : return_value = %d.");
-        formatter % STOP;
+                                "handle_response_send_inform(const boost::thread::id thread_id) : return_value = %d. "
+                               "thread id : %d.");
+        formatter % STOP % boost::this_thread::get_id();
         putLogDebug(30098, formatter.str(), __FILE__, __LINE__);
     }
     /*------DEBUG LOG END------*/
@@ -2669,7 +2750,9 @@ protocol_module_base::EVENT_TAG protocol_module_sslid::handle_client_connection_
             session_thread_data_map_type::iterator it = session_thread_data_map.find(thread_id);
             if (it == session_thread_data_map.end() || it->second == NULL)
             {
-                putLogError(37052, "Invalid thread id.", __FILE__, __LINE__);
+                boost::format formatter("Invalid thread id. thread id : %d.");
+                formatter % boost::this_thread::get_id();
+                putLogError(37052, formatter.str(), __FILE__, __LINE__);
 
                 /*-------- DEBUG LOG --------*/
                 if (LOG_LV_DEBUG == getloglevel())
@@ -2677,8 +2760,8 @@ protocol_module_base::EVENT_TAG protocol_module_sslid::handle_client_connection_
                     boost::format formatter("out_function : protocol_module_base::EVENT_TAG protocol_module_sslid::"
                                             "handle_client_connection_check(const boost::thread::id thread_id, "
                                             "boost::array<char,MAX_BUFFER_SIZE>& sendbuffer, "
-                                            "size_t& datalen) : return_value = %d.");
-                    formatter % FINALIZE;
+                                            "size_t& datalen) : return_value = %d. thread id : %d.");
+                    formatter % FINALIZE % boost::this_thread::get_id();
                     putLogDebug(30100, formatter.str(), __FILE__, __LINE__);
                 }
                 /*------DEBUG LOG END------*/
@@ -2706,8 +2789,8 @@ protocol_module_base::EVENT_TAG protocol_module_sslid::handle_client_connection_
                                             "protocol_module_sslid::handle_client_connection_check("
                                             "const boost::thread::id thread_id, "
                                             "boost::array<char,MAX_BUFFER_SIZE>& sendbuffer, "
-                                            "size_t& datalen) : return_value = %d.");
-                    formatter % FINALIZE;
+                                            "size_t& datalen) : return_value = %d. thread id : %d.");
+                    formatter % FINALIZE % boost::this_thread::get_id();
                     putLogDebug(30101, formatter.str(), __FILE__, __LINE__);
                 }
                 /*------DEBUG LOG END------*/
@@ -2719,8 +2802,10 @@ protocol_module_base::EVENT_TAG protocol_module_sslid::handle_client_connection_
             /*-------- DEBUG LOG --------*/
             if (LOG_LV_DEBUG == getloglevel())
             {
-                putLogDebug(30102, "function : protocol_module_base::EVENT_TAG protocol_module_sslid::"
-                            "handle_client_connection_check() : get_ssl_session_id() end.", __FILE__, __LINE__);
+                boost::format formatter("function : protocol_module_base::EVENT_TAG protocol_module_sslid::"
+                                        "handle_client_connection_check() : get_ssl_session_id() end. thread id : %d.");
+                formatter % boost::this_thread::get_id();
+                putLogDebug(30102, formatter.str(), __FILE__, __LINE__);
             }
             /*------DEBUG LOG END------*/
 
@@ -2740,15 +2825,15 @@ protocol_module_base::EVENT_TAG protocol_module_sslid::handle_client_connection_
                     dump_session_id(session_id.c_str(), session_id.size(), buffer);
                     boost::format formatter("function : protocol_module_base::EVENT_TAG protocol_module_sslid::"
                                             "handle_client_connection_check() : write_session_data() end."
-                                            "session_id = %s.");
-                    formatter % buffer;
+                                            "session_id = %s. thread id : %d.");
+                    formatter % buffer % boost::this_thread::get_id();
                     putLogDebug(30103, formatter.str(), __FILE__, __LINE__);
                 }
                 /*------DEBUG LOG END------*/
             }
         }
 
-        // put datao to send
+        // put data to send
         if (put_data_to_sendbuffer(thread_id, sendbuffer, datalen) == -1)
         {
             // can't find the thread from the thread map
@@ -2763,9 +2848,10 @@ protocol_module_base::EVENT_TAG protocol_module_sslid::handle_client_connection_
         /*-------- DEBUG LOG --------*/
         if (LOG_LV_DEBUG == getloglevel())
         {
-            putLogDebug(30104, "function : protocol_module_base::EVENT_TAG protocol_module_sslid::"
-                        "handle_client_connection_check() : put_data_to_sendbuffer() end.",
-                        __FILE__, __LINE__);
+            boost::format formatter("function : protocol_module_base::EVENT_TAG protocol_module_sslid::"
+                                    "handle_client_connection_check() : put_data_to_sendbuffer() end. thread id : %d.");
+            formatter % boost::this_thread::get_id();
+            putLogDebug(30104, formatter.str(), __FILE__, __LINE__);
         }
         /*------DEBUG LOG END------*/
     }
@@ -2773,8 +2859,8 @@ protocol_module_base::EVENT_TAG protocol_module_sslid::handle_client_connection_
     {
         std::cerr << "protocol_module_sslid::handle_client_connection_check() : exception : error = " << e.what() << "." << std::endl;
         boost::format formatter("function : protocol_module_base::EVENT_TAG protocol_module_sslid::"
-                                "handle_client_connection_check() : exception : error = %s.");
-        formatter % e.what();
+                                "handle_client_connection_check() : exception : error = %s. thread id : %d.");
+        formatter % e.what() % boost::this_thread::get_id();
         putLogError(37053, formatter.str(), __FILE__, __LINE__);
 
         status = FINALIZE;
@@ -2782,8 +2868,10 @@ protocol_module_base::EVENT_TAG protocol_module_sslid::handle_client_connection_
     catch (...)
     {
         std::cerr << "protocol_module_sslid::handle_client_connection_check() : Unknown exception." << std::endl;
-        putLogError(37054, "function : protocol_module_base::EVENT_TAG "
-                    "protocol_module_sslid::handle_client_connection_check() : Unknown exception.", __FILE__, __LINE__);
+        boost::format formatter("function : protocol_module_base::EVENT_TAG protocol_module_sslid::"
+                                "handle_client_connection_check() : Unknown exception. thread id : %d.");
+        formatter % boost::this_thread::get_id();
+        putLogError(37054, formatter.str(), __FILE__, __LINE__);
 
         status = FINALIZE;
     }
@@ -2794,8 +2882,8 @@ protocol_module_base::EVENT_TAG protocol_module_sslid::handle_client_connection_
         boost::format formatter("out_function : protocol_module_base::EVENT_TAG protocol_module_sslid::"
                                 "handle_client_connection_check(const boost::thread::id thread_id, "
                                 "boost::array<char,MAX_BUFFER_SIZE>& sendbuffer, size_t& datalen) : "
-                                "return_value = %d.");
-        formatter % status;
+                                "return_value = %d. thread id : %d.");
+        formatter % status % boost::this_thread::get_id();
         putLogDebug(30105, formatter.str(), __FILE__, __LINE__);
     }
     /*------DEBUG LOG END------*/
@@ -2822,8 +2910,8 @@ protocol_module_base::EVENT_TAG protocol_module_sslid::handle_client_select(
                                 "handle_client_select(const boost::thread::id thread_id, "
                                 "boost::asio::ip::udp::endpoint& cl_endpoint, "
                                 "boost::array<char,MAX_BUFFER_SIZE>& sendbuffer, "
-                                "size_t& datalen) : return_value = %d.");
-        formatter % STOP;
+                                "size_t& datalen) : return_value = %d. thread id : %d.");
+        formatter % STOP % boost::this_thread::get_id();
         putLogDebug(30106, formatter.str(), __FILE__, __LINE__);
     }
     /*------DEBUG LOG END------*/
@@ -2859,13 +2947,15 @@ protocol_module_base::EVENT_TAG protocol_module_sslid::handle_client_send(
             session_thread_data_map_type::iterator it = session_thread_data_map.find(thread_id);
             if (it == session_thread_data_map.end() || it->second == NULL)
             {
-                putLogError(37055, "Invalid thread id.", __FILE__, __LINE__);
+                boost::format formatter("Invalid thread id. thread id : %d.");
+                formatter % boost::this_thread::get_id();
+                putLogError(37055, formatter.str(), __FILE__, __LINE__);
                 /*-------- DEBUG LOG --------*/
                 if (LOG_LV_DEBUG == getloglevel())
                 {
                     boost::format formatter("out_function : protocol_module_base::EVENT_TAG protocol_module_sslid::"
-                                            "handle_client_send(const boost::thread::id thread_id) : return_value = %d.");
-                    formatter % FINALIZE;
+                                            "handle_client_send(const boost::thread::id thread_id) : return_value = %d. thread id : %d.");
+                    formatter % FINALIZE % boost::this_thread::get_id();
                     putLogDebug(30108, formatter.str(), __FILE__, __LINE__);
                 }
                 /*------DEBUG LOG END------*/
@@ -2882,8 +2972,8 @@ protocol_module_base::EVENT_TAG protocol_module_sslid::handle_client_send(
             if (LOG_LV_DEBUG == getloglevel())
             {
                 boost::format formatter("function : protocol_module_base::EVENT_TAG protocol_module_sslid::"
-                                        "handle_client_send() : data_size = %d, end_flag = %d.");
-                formatter % threaddata->data_size % threaddata->end_flag;
+                                        "handle_client_send() : data_size = %d, end_flag = %d. thread id : %d.");
+                formatter % threaddata->data_size % threaddata->end_flag % boost::this_thread::get_id();
                 putLogDebug(30109, formatter.str(), __FILE__, __LINE__);
             }
             /*------DEBUG LOG END------*/
@@ -2906,8 +2996,8 @@ protocol_module_base::EVENT_TAG protocol_module_sslid::handle_client_send(
             if (LOG_LV_DEBUG == getloglevel())
             {
                 boost::format formatter("function : protocol_module_base::EVENT_TAG protocol_module_sslid::"
-                                        "handle_client_send() : data_size = %d, current_record_rest_size = %d.");
-                formatter % threaddata->data_size % threaddata->current_record_rest_size;
+                                        "handle_client_send() : data_size = %d, current_record_rest_size = %d. thread id : %d.");
+                formatter % threaddata->data_size % threaddata->current_record_rest_size % boost::this_thread::get_id();
                 putLogDebug(30110, formatter.str(), __FILE__, __LINE__);
             }
             /*------DEBUG LOG END------*/
@@ -2928,8 +3018,8 @@ protocol_module_base::EVENT_TAG protocol_module_sslid::handle_client_send(
                 {
                     boost::format formatter("function : protocol_module_base::EVENT_TAG protocol_module_sslid::"
                                             "handle_client_send() : check_ssl_record_sendable() end. "
-                                            "return_value = %d.");
-                    formatter % ret;
+                                            "return_value = %d. thread id : %d.");
+                    formatter % ret % boost::this_thread::get_id();
                     putLogDebug(30111, formatter.str(), __FILE__, __LINE__);
                 }
                 /*------DEBUG LOG END------*/
@@ -2941,8 +3031,10 @@ protocol_module_base::EVENT_TAG protocol_module_sslid::handle_client_send(
                     /*-------- DEBUG LOG --------*/
                     if (LOG_LV_DEBUG == getloglevel())
                     {
-                        putLogDebug(30112, "function : protocol_module_base::EVENT_TAG protocol_module_sslid::"
-                                    "handle_client_send() : END_FLAG_ON.", __FILE__, __LINE__);
+                        boost::format formatter("function : protocol_module_base::EVENT_TAG protocol_module_sslid::"
+                                                "handle_client_send() : END_FLAG_ON. thread id : %d.");
+                        formatter % boost::this_thread::get_id();
+                        putLogDebug(30112, formatter.str(), __FILE__, __LINE__);
                     }
                     /*------DEBUG LOG END------*/
 
@@ -2982,8 +3074,8 @@ protocol_module_base::EVENT_TAG protocol_module_sslid::handle_client_send(
     {
         std::cerr << "protocol_module_sslid::handle_client_send() : exception : error = " << e.what() << "." << std::endl;
         boost::format formatter("function : protocol_module_base::EVENT_TAG protocol_module_sslid::"
-                                "handle_client_send() : exception : error = %s.");
-        formatter % e.what();
+                                "handle_client_send() : exception : error = %s. thread id : %d.");
+        formatter % e.what() % boost::this_thread::get_id();
         putLogError(37056, formatter.str(), __FILE__, __LINE__);
 
         status = FINALIZE;
@@ -2991,8 +3083,10 @@ protocol_module_base::EVENT_TAG protocol_module_sslid::handle_client_send(
     catch (...)
     {
         std::cerr << "protocol_module_sslid::handle_client_send() : Unknown exception." << std::endl;
-        putLogError(37057, "function : protocol_module_base::EVENT_TAG "
-                    "protocol_module_sslid::handle_client_send() : Unknown exception.", __FILE__, __LINE__);
+        boost::format formatter("function : protocol_module_base::EVENT_TAG protocol_module_sslid::"
+                                "handle_client_send() : Unknown exception. thread id : %d.");
+        formatter % boost::this_thread::get_id();
+        putLogError(37057, formatter.str(), __FILE__, __LINE__);
 
         status = FINALIZE;
     }
@@ -3002,8 +3096,8 @@ protocol_module_base::EVENT_TAG protocol_module_sslid::handle_client_send(
     {
         boost::format formatter("out_function : protocol_module_base::EVENT_TAG protocol_module_sslid::"
                                 "handle_client_send(const boost::thread::id thread_id) : "
-                                "return_value = %d, end_flag = %d.");
-        formatter % status % (threaddata.get() ? threaddata->end_flag : END_FLAG_ON);
+                                "return_value = %d, end_flag = %d. thread id : %d.");
+        formatter % status % (threaddata.get() ? threaddata->end_flag : END_FLAG_ON) % boost::this_thread::get_id();
         putLogDebug(30113, formatter.str(), __FILE__, __LINE__);
     }
     /*------DEBUG LOG END------*/
@@ -3041,8 +3135,8 @@ protocol_module_base::EVENT_TAG protocol_module_sslid::handle_sorry_enable(
     if (LOG_LV_DEBUG == getloglevel())
     {
         boost::format formatter("in/out_function : protocol_module_base::EVENT_TAG protocol_module_sslid::"
-                                "handle_sorry_enable(const boost::thread::id thread_id) : return_value = %d.");
-        formatter % STOP;
+                                "handle_sorry_enable(const boost::thread::id thread_id) : return_value = %d. thread id : %d.");
+        formatter % STOP % boost::this_thread::get_id();
         putLogDebug(30115, formatter.str(), __FILE__, __LINE__);
     }
     /*------DEBUG LOG END------*/
@@ -3060,8 +3154,8 @@ protocol_module_base::EVENT_TAG protocol_module_sslid::handle_sorry_disable(
     if (LOG_LV_DEBUG == getloglevel())
     {
         boost::format formatter("in/out_function : protocol_module_base::EVENT_TAG protocol_module_sslid::"
-                                "handle_sorry_disable(const boost::thread::id thread_id) : return_value = %d.");
-        formatter % STOP;
+                                "handle_sorry_disable(const boost::thread::id thread_id) : return_value = %d. thread id : %d.");
+        formatter % STOP % boost::this_thread::get_id();
         putLogDebug(30116, formatter.str(), __FILE__, __LINE__);
     }
     /*------DEBUG LOG END------*/
@@ -3082,8 +3176,8 @@ protocol_module_base::EVENT_TAG protocol_module_sslid::handle_realserver_disconn
     {
         boost::format formatter("in/out_function : protocol_module_base::EVENT_TAG protocol_module_sslid::"
                                 "handle_realserver_disconnect(const boost::thread::id thread_id, "
-                                "const boost::asio::ip::tcp::endpoint& rs_endpoint) : return_value = %d.");
-        formatter % STOP;
+                                "const boost::asio::ip::tcp::endpoint& rs_endpoint) : return_value = %d. thread id : %d.");
+        formatter % STOP % boost::this_thread::get_id();
         putLogDebug(30117, formatter.str(), __FILE__, __LINE__);
     }
     /*------DEBUG LOG END------*/
@@ -3104,8 +3198,8 @@ protocol_module_base::EVENT_TAG protocol_module_sslid::handle_sorryserver_discon
     {
         boost::format formatter("in/out_function : protocol_module_base::EVENT_TAG protocol_module_sslid::"
                                 "handle_sorryserver_disconnect(const boost::thread::id thread_id, "
-                                "const boost::asio::ip::tcp::endpoint& sorry_endpoint) : return_value = %d.");
-        formatter % STOP;
+                                "const boost::asio::ip::tcp::endpoint& sorry_endpoint) : return_value = %d. thread id : %d.");
+        formatter % STOP % boost::this_thread::get_id();
         putLogDebug(30118, formatter.str(), __FILE__, __LINE__);
     }
     /*------DEBUG LOG END------*/
@@ -3126,8 +3220,8 @@ protocol_module_base::EVENT_TAG protocol_module_sslid::handle_realserver_close(
     {
         boost::format formatter("in/out_function : protocol_module_base::EVENT_TAG protocol_module_sslid::"
                                 "handle_realserver_close(const boost::thread::id thread_id, "
-                                "const boost::asio::ip::udp::endpoint& rs_endpoint) : return_value = %d.");
-        formatter % STOP;
+                                "const boost::asio::ip::udp::endpoint& rs_endpoint) : return_value = %d. thread id : %d.");
+        formatter % STOP % boost::this_thread::get_id();
         putLogDebug(30119, formatter.str(), __FILE__, __LINE__);
     }
     /*------DEBUG LOG END------*/
@@ -3142,8 +3236,7 @@ void protocol_module_sslid::replication_interrupt()
     /*-------- DEBUG LOG --------*/
     if (LOG_LV_DEBUG == getloglevel())
     {
-        putLogDebug(30120, "in_function : void protocol_module_sslid::replication_interrupt().",
-                    __FILE__, __LINE__);
+        putLogDebug(30120, "in_function : void protocol_module_sslid::replication_interrupt().", __FILE__, __LINE__);
     }
     /*------DEBUG LOG END------*/
     if (replication_data_processor)
@@ -3153,15 +3246,14 @@ void protocol_module_sslid::replication_interrupt()
         if (LOG_LV_DEBUG == getloglevel())
         {
             putLogDebug(30121, "function : void protocol_module_sslid::replication_interrupt() : "
-                        "write_replication_area() end.", __FILE__, __LINE__);
+                                "write_replication_area() end.", __FILE__, __LINE__);
         }
         /*------DEBUG LOG END------*/
     }
     /*-------- DEBUG LOG --------*/
     if (LOG_LV_DEBUG == getloglevel())
     {
-        putLogDebug(30122, "out_function : void protocol_module_sslid::replication_interrupt().",
-                    __FILE__, __LINE__);
+        putLogDebug(30122, "out_function : void protocol_module_sslid::replication_interrupt().", __FILE__, __LINE__);
     }
     /*------DEBUG LOG END------*/
 }
@@ -3198,15 +3290,19 @@ int protocol_module_sslid::put_data_to_sendbuffer(
         session_thread_data_map_type::iterator it = session_thread_data_map.find(thread_id);
         if (it == session_thread_data_map.end() || it->second == NULL)
         {
-            putLogError(37058, "Invalid thread id.", __FILE__, __LINE__);
+            boost::format formatter("Invalid thread id. thread id : %d.");
+            formatter % boost::this_thread::get_id();
+            putLogError(37058, formatter.str(), __FILE__, __LINE__);
 
             /*-------- DEBUG LOG --------*/
             if (LOG_LV_DEBUG == getloglevel())
             {
-                putLogDebug(30124, "out_function : int protocol_module_sslid::put_data_to_sendbuffer("
-                            "const boost::thread::id& thread_id, "
-                            "boost::array<char,MAX_BUFFER_SIZE>& sendbuffer, "
-                            "size_t& datalen) : return_value = -1.", __FILE__, __LINE__);
+                boost::format formatter("out_function : int protocol_module_sslid::put_data_to_sendbuffer("
+                                        "const boost::thread::id& thread_id, "
+                                        "boost::array<char,MAX_BUFFER_SIZE>& sendbuffer, "
+                                        "size_t& datalen) : return_value = -1. thread id : %d.");
+                formatter % boost::this_thread::get_id();
+                putLogDebug(30124, formatter.str(), __FILE__, __LINE__);
             }
             /*------DEBUG LOG END------*/
 
@@ -3225,9 +3321,10 @@ int protocol_module_sslid::put_data_to_sendbuffer(
         /*-------- DEBUG LOG --------*/
         if (LOG_LV_DEBUG == getloglevel())
         {
-            putLogDebug(30125, "function : int protocol_module_sslid::"
-                        "put_data_to_sendbuffer() : current_record_rest_size >= data_size.",
-                        __FILE__, __LINE__);
+            boost::format formatter("function : int protocol_module_sslid::put_data_to_sendbuffer() "
+                                    ": current_record_rest_size >= data_size. thread id : %d.");
+            formatter % boost::this_thread::get_id();
+            putLogDebug(30125, formatter.str(), __FILE__, __LINE__);
         }
 
         // remain data size greater than all data size
@@ -3338,9 +3435,10 @@ int protocol_module_sslid::put_data_to_sendbuffer(
         /*-------- DEBUG LOG --------*/
         if (LOG_LV_DEBUG == getloglevel())
         {
-            putLogDebug(30130, "function : int protocol_module_sslid::"
-                        "put_data_to_sendbuffer() : current_record_rest_size < data_size.",
-                        __FILE__, __LINE__);
+            boost::format formatter("function : int protocol_module_sslid::put_data_to_sendbuffer() "
+                                    ": current_record_rest_size < data_size. thread id : %d.");
+            formatter % boost::this_thread::get_id();
+            putLogDebug(30130, formatter.str(), __FILE__, __LINE__);
         }
         /*------DEBUG LOG END------*/
 
@@ -3450,10 +3548,12 @@ int protocol_module_sslid::put_data_to_sendbuffer(
     /*-------- DEBUG LOG --------*/
     if (LOG_LV_DEBUG == getloglevel())
     {
-        putLogDebug(30135, "out_function : int protocol_module_sslid::put_data_to_sendbuffer("
-                    "const boost::thread::id& thread_id, "
-                    "boost::array<char,MAX_BUFFER_SIZE>& sendbuffer, "
-                    "size_t& datalen) : return_value = 0.", __FILE__, __LINE__);
+        boost::format formatter("out_function : int protocol_module_sslid::put_data_to_sendbuffer("
+                                "const boost::thread::id& thread_id, "
+                                "boost::array<char,MAX_BUFFER_SIZE>& sendbuffer, "
+                                "size_t& datalen) : return_value = 0. thread id : %d.");
+        formatter % boost::this_thread::get_id();
+        putLogDebug(30135, formatter.str(), __FILE__, __LINE__);
     }
     /*------DEBUG LOG END------*/
 
@@ -3483,8 +3583,8 @@ bool protocol_module_sslid::realserver_selected(const boost::asio::ip::tcp::endp
         if (LOG_LV_DEBUG == getloglevel())
         {
             putLogDebug(30137, "out_function : bool protocol_module_sslid::realserver_selected("
-                        "const boost::asio::ip::tcp::endpoint& rs_endpoint) : return_value = false.",
-                        __FILE__, __LINE__);
+                                "const boost::asio::ip::tcp::endpoint& rs_endpoint) : return_value = false."
+                                , __FILE__, __LINE__);
         }
         /*------DEBUG LOG END------*/
 
@@ -3497,8 +3597,8 @@ bool protocol_module_sslid::realserver_selected(const boost::asio::ip::tcp::endp
         if (LOG_LV_DEBUG == getloglevel())
         {
             putLogDebug(30138, "out_function : bool protocol_module_sslid::realserver_selected("
-                        "const boost::asio::ip::tcp::endpoint& rs_endpoint) : return_value = true.",
-                        __FILE__, __LINE__);
+                                "const boost::asio::ip::tcp::endpoint& rs_endpoint) : return_value = true."
+                                , __FILE__, __LINE__);
         }
         /*------DEBUG LOG END------*/
         // already connected
index 1499796..71450d0 100644 (file)
@@ -252,7 +252,7 @@ sslid_replication_data_processor::sslid_replication_data_processor(
             else
             {
                 // restore session data from replication direct
-                head->size = maxlist * sizeof(sslid_replication_data_header);
+                head->size = maxlist * sizeof(sslid_replication_data);
                 /*-------- DEBUG LOG --------*/
                 if (LOG_LV_DEBUG == getloglevel())
                 {
@@ -263,6 +263,8 @@ sslid_replication_data_processor::sslid_replication_data_processor(
                     putLogDebug(30149, formatter.str(), __FILE__, __LINE__);
                 }
                 /*------DEBUG LOG END------*/
+                replication_area = reinterpret_cast<sslid_replication_data*>(sslid_replication_area_begain +
+                                    head->offset);
             }
         }
 
index 7eb41da..d98bf86 100644 (file)
@@ -293,8 +293,24 @@ int sslid_session_data_processor::write_session_data(
         if (itendpoint != session_endpoint_map.end())
         {
             // endpoint exist
+            time_t oldtime = session_lasttime_map[session_id];
             session_endpoint_map[session_id] = endpoint;
             session_lasttime_map[session_id] = now_time;
+            // delete session from the map
+            std::multimap<time_t, std::string>::iterator itbegin;
+            std::multimap<time_t, std::string>::iterator itend;
+            itbegin = lasttime_session_map.lower_bound(oldtime);
+            itend = lasttime_session_map.upper_bound(oldtime);
+
+            while (itbegin != itend)
+            {
+                if (itbegin->first == oldtime && itbegin->second == session_id)
+                {
+                    lasttime_session_map.erase(itbegin);
+                    break;
+                }
+                ++itbegin;
+            }
             lasttime_session_map.insert(std::make_pair(now_time, session_id));
 
             sclock.unlock();
index 205fd0d..a7eba1e 100644 (file)
@@ -1,3 +1,27 @@
+/*
+ * @file  sessionless_ut.cpp
+ * @brief protocol module sessionless test file.
+ *
+ * L7VSD: Linux Virtual Server for Layer7 Load Balancing
+ * Copyright (C) 2009  NTT COMWARE Corporation.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA
+ *
+ **********************************************************************/
+
 #include <boost/test/included/unit_test.hpp>
 #include "../../module/protocol/http_protocol_module_base.cpp"
 #include "../../module/protocol/protocol_module_sessionless.cpp"
@@ -4773,8 +4797,8 @@ void handle_sorryserver_select_test(){
 
     //送信先endpointにendpointを設定する
     BOOST_CHECK_EQUAL(dataup->target_endpoint, ep);
-    //遷移先ステータス status = SORRYSERVER_CONNECT
-    BOOST_CHECK_EQUAL(ret, SORRYSERVER_CONNECT);
+    //遷移先ステータス status = CLIENT_RECV
+    BOOST_CHECK_EQUAL(ret, CLIENT_RECV);
 
     cout << "[211]------------------------------------------" << endl;
     //unit_test[211]   session_thread_data_map中に上りスレッド中にThreadID対応のデータがない
@@ -4807,8 +4831,8 @@ void handle_sorryserver_select_test(){
     ret = this->handle_sorryserver_select(boost::this_thread::get_id(), ep);
     //送信先endpointにendpointを設定する
     BOOST_CHECK_EQUAL(dataup->target_endpoint, ep);
-    //遷移先ステータス status = SORRYSERVER_CONNECT
-    BOOST_CHECK_EQUAL(ret, SORRYSERVER_CONNECT);
+    //遷移先ステータス status = CLIENT_RECV
+    BOOST_CHECK_EQUAL(ret, CLIENT_RECV);
 }
 
 
@@ -4847,8 +4871,8 @@ void handle_sorryserver_select_test_thread(){
         boost::mutex::scoped_lock sclock(check_mutex);
         //送信先endpointにendpointを設定する
         BOOST_CHECK_EQUAL(dataup->target_endpoint, ep);
-        //遷移先ステータス status = SORRYSERVER_CONNECT
-        BOOST_CHECK_EQUAL(ret, SORRYSERVER_CONNECT);
+        //遷移先ステータス status = CLIENT_RECV
+        BOOST_CHECK_EQUAL(ret, CLIENT_RECV);
     }
 }
 
@@ -11148,7 +11172,7 @@ void handle_sorry_enable_test() {
        this->session_thread_data_map[boost::this_thread::get_id()]->recive_data_map.clear();
 
     cout << "[486]------------------------------------------" << endl;
-       // unit_test[486] endpoint対応のrecive_dataなし場合,status = FINALIZE
+       // unit_test[486] 下りスレッドのendpoint対応のrecive_dataなし場合,status = SORRYSERVER_RECV
        init_send_status(sendstatus);
        init_recive_data(receivedata);
        this->session_thread_data_map[boost::this_thread::get_id()]->recive_data_map.insert(
@@ -11156,7 +11180,7 @@ void handle_sorry_enable_test() {
                                                string_to_endpoint<boost::asio::ip::tcp> ("192.168.120.1:8800"),
                                                receivedata));
        status = this->handle_sorry_enable(boost::this_thread::get_id());
-       BOOST_CHECK_EQUAL(status, FINALIZE);
+       BOOST_CHECK_EQUAL(status, SORRYSERVER_RECV);
        this->session_thread_data_map[boost::this_thread::get_id()]->recive_data_map.clear();
 
     cout << "[487]------------------------------------------" << endl;
@@ -11559,7 +11583,7 @@ void handle_sorry_disable_test(){
        this->session_thread_data_map[boost::this_thread::get_id()]->recive_data_map.clear();
 
     cout << "[506]------------------------------------------" << endl;
-       // unit_test[506] endpoint対応のrecive_dataなし場合,status = FINALIZE
+       // unit_test[506] 下りスレッドのendpoint対応のrecive_dataなし場合,status = REALSERVER_RECV
        init_send_status(sendstatus);
        init_recive_data(receivedata);
        this->session_thread_data_map[boost::this_thread::get_id()]->recive_data_map.insert(
@@ -11567,7 +11591,7 @@ void handle_sorry_disable_test(){
                                                string_to_endpoint<boost::asio::ip::tcp> ("192.168.120.1:8800"),
                                                receivedata));
        status = this->handle_sorry_disable(boost::this_thread::get_id());
-       BOOST_CHECK_EQUAL(status, FINALIZE);
+       BOOST_CHECK_EQUAL(status, REALSERVER_RECV);
        this->session_thread_data_map[boost::this_thread::get_id()]->recive_data_map.clear();
 
     cout << "[507]------------------------------------------" << endl;
index fe9c0ea..dcd8be8 100644 (file)
@@ -1,3 +1,27 @@
+/*
+ * @file  protocol_module_sslid_test.cpp
+ * @brief protocol module sslid test file.
+ *
+ * L7VSD: Linux Virtual Server for Layer7 Load Balancing
+ * Copyright (C) 2009  NTT COMWARE Corporation.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA
+ *
+ **********************************************************************/
+
 #include "sslid_to_be_test_file.h"
 #include "../../include/protocol_module_base.h"
 #include <string.h>
@@ -2716,14 +2740,14 @@ void handle_client_recv_test() {
     }
 
     cout << "[143]------------------------------------------" << endl;
-    // unit_test[143] 終了フラグがOFFで、 且つ データサイズ > 0、且つ新SSLレコードで、且つdata_begain_offset = 0
+    // unit_test[143] 終了フラグがOFFで、 且つ データサイズ > 0、且つ新SSLレコードで、且つdata_begain_offset = 12
     // unit_test[143] 且つheck_ssl_record_sendable()の戻り値が0(送信可能)の場合
     // unit_test[143] 戻り値がREALSERVER_SELECTで設定する。
     {
         thread_data_ptr up_thread_data(new session_thread_data_sslid);
         up_thread_data->end_flag = END_FLAG_OFF;
         up_thread_data->data_size = 3u;
-        up_thread_data->data_begain_offset = 0u;
+        up_thread_data->data_begain_offset = 12u;
         up_thread_data->current_record_rest_size = 0u;
         up_thread_data->data_buffer[12] = 0x16;
         up_thread_data->data_buffer[13] = 0x03;
@@ -4544,6 +4568,7 @@ void handle_client_connection_check_test() {
         down_thread_data->current_record_rest_size = 10u;
        down_thread_data->hello_message_flag = true;
         down_thread_data->data_size = 76u;
+        down_thread_data->data_buffer[43] = 0x00;
         down_thread_data->data_begain_offset = 0u;
         this->session_thread_data_map[boost::this_thread::get_id()] = down_thread_data;
         status = this->handle_client_connection_check(boost::this_thread::get_id(),
@@ -4565,6 +4590,7 @@ void handle_client_connection_check_test() {
        down_thread_data->hello_message_flag = true;
         down_thread_data->data_size = 76u;
         down_thread_data->data_begain_offset = 10u;
+        down_thread_data->data_buffer[53] = 0x00;
         this->session_thread_data_map[boost::this_thread::get_id()] = down_thread_data;
         status = this->handle_client_connection_check(boost::this_thread::get_id(),
                 sendbuffer, datalen);
index 4b6a619..85352bb 100644 (file)
@@ -1,3 +1,27 @@
+/*
+ * @file  ssl_protocol_module_base_test.cpp
+ * @brief ssl protocol module base test file.
+ *
+ * L7VSD: Linux Virtual Server for Layer7 Load Balancing
+ * Copyright (C) 2009  NTT COMWARE Corporation.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA
+ *
+ **********************************************************************/
+
 #include "sslid_to_be_test_file.h"
 
 using namespace std;
@@ -1714,6 +1738,94 @@ public:
 
        }
 
+       void dump_session_id_test(){
+       struct check_condition
+       {
+               char memory[256];
+               size_t memory_size;
+               std::string out_string;
+       };
+
+       // テスト条件(正常系):
+       check_condition condition_empty_string[12] =
+       {
+           {"a", 0, ""},
+           {"a", 1, "61"},
+           {"ab", 2, "6162"},
+           {"abc", 3, "616263"},
+           {"abcd", 4, "61626364"},
+           {"abcde", 5, "6162636465"},
+           {"abcdefghijklmnopqrstuvwxyzABCDEF", 32,
+           "6162636465666768696A6B6C6D6E6F707172737475767778797A414243444546"},
+           {"abcdefghijklmnopqrstuvwxyzABCDEFG", 33,
+           "6162636465666768696A6B6C6D6E6F707172737475767778797A41424344454647"},
+           {"abcdefghijklmnopqrstuvwxyzABCDEFGH", 34,
+           "6162636465666768696A6B6C6D6E6F707172737475767778797A4142434445464748"},
+           {"abcdefghijklmnopqrstuvwxyzABCDEFGHI", 35,
+           "6162636465666768696A6B6C6D6E6F707172737475767778797A414243444546474849"},
+           {"abcdefghijklmnopqrstuvwxyzABCDEFabcdefghijklmnopqrstuvwxyzABCDEF", 64,
+           "6162636465666768696A6B6C6D6E6F707172737475767778797A414243444546"
+           "6162636465666768696A6B6C6D6E6F707172737475767778797A414243444546"},
+           {"abcdefghijklmnopqrstuvwxyzABCDEFabcdefghijklmnopqrstuvwxyzABCDEFG", 65,
+           "6162636465666768696A6B6C6D6E6F707172737475767778797A414243444546"
+           "6162636465666768696A6B6C6D6E6F707172737475767778797A41424344454647"},
+       };
+
+       // unit_test[1] ヌルポイントのテスト(異常系)
+    std::string out_string = "123";
+    std::string out_string_src(out_string);
+    protocol_module_base::dump_memory(NULL, 100, out_string);
+    BOOST_CHECK_EQUAL(out_string, out_string_src);
+    std::cout << "out_string = \n" <<  out_string << std::endl;
+    std::cout << "unit_test[1]-----------------------------\n" << std::endl;
+
+       // unit_test[2] ポイントの内容のサイズ < データサイズのテスト(異常系)
+    out_string = "";
+       char* less_data = "abcdefghij";
+    this->dump_session_id(less_data, 65, out_string);
+    BOOST_CHECK_EQUAL(out_string.size(), 130u );
+    std::cout << "out_string = \n" <<  out_string << std::endl;
+    std::cout << "unit_test[2]-----------------------------\n" << std::endl;
+
+       // 正常系テスト
+    for (size_t i = 0; i < 2; i++)
+    {
+        for (size_t j = 0; j < 12; j++)
+        {
+            out_string_src = "";
+
+            if (i == 0)
+            {
+                out_string = "";
+            }
+            else
+            {
+                out_string = "test";
+                out_string_src = out_string;
+            }
+            this->dump_session_id(condition_empty_string[j].memory,
+                                              condition_empty_string[j].memory_size,
+                                              out_string);
+            BOOST_CHECK_EQUAL(out_string, out_string_src + condition_empty_string[j].out_string);
+
+            std::cout << "condition[" << j << "].memory = " <<  condition_empty_string[j].memory << std::endl;
+            std::cout << "condition[" << j << "].memory_size = " <<  condition_empty_string[j].memory_size << std::endl;
+            std::cout << "condition[" << j << "].out_string = " <<  condition_empty_string[j].out_string << std::endl;
+
+            std::cout << "out_string = " <<  out_string << std::endl;
+
+            if ((j + 12 * i) >= 10)
+            {
+                std::cout << "unit_test[" << j + 12 * i + 3 << "]------------------------------------\n" << std::endl;
+            }
+            else
+            {
+                std::cout << "unit_test[" << j + 12 * i + 3 << "]-------------------------------------\n" << std::endl;
+            }
+        }
+    }
+    }
+
 };
 
 void get_ssl_session_id_test() {
@@ -1726,9 +1838,15 @@ void check_ssl_record_sendable_test() {
        obj.check_ssl_record_sendable_test();
 }
 
+void dump_session_id_test() {
+    ssl_protocol_module_base_test_class obj;
+    obj.dump_session_id_test();
+}
+
 void ssl_protocol_module_base_test_main() {
        test_suite* ts = BOOST_TEST_SUITE( "ssl_protocol_module_base_ut" );
        ts->add(BOOST_TEST_CASE( &get_ssl_session_id_test ));
        ts->add(BOOST_TEST_CASE( &check_ssl_record_sendable_test ));
+       ts->add(BOOST_TEST_CASE( &dump_session_id_test ));
        framework::master_test_suite().add(ts);
 }
index 02b71dd..2795fe8 100644 (file)
@@ -1,3 +1,27 @@
+/*
+ * @file  sslid_replication_data_processor_test.cpp
+ * @brief sslid replication data processor test file.
+ *
+ * L7VSD: Linux Virtual Server for Layer7 Load Balancing
+ * Copyright (C) 2009  NTT COMWARE Corporation.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA
+ *
+ **********************************************************************/
+
 #include "sslid_to_be_test_file.h"
 
 using namespace boost::unit_test;
@@ -323,9 +347,9 @@ public:
                // unit_test[6] sslid_replication_area_size < 0, 例外が発生する。
                exception_occured = false;
                try {
-                       memset(replication_data_area, 0, 128*sizeof(struct l7vs::sslid_replication_data_header));
+                       memset(replication_data_area, 0, 128*sizeof(l7vs::sslid_replication_data_header));
                        for(int i = 0; i < 128; i++){
-                               l7vs::sslid_replication_data_header* temp= ((l7vs::sslid_replication_data_header*)replication_data_area) + i;
+                               l7vs::sslid_replication_data_header* temp= reinterpret_cast<sslid_replication_data_header*>(replication_data_area) + i;
                                temp->size = static_cast<size_t>(2 * sizeof(l7vs::sslid_replication_data));
                        }
                        l7vs::sslid_replication_data_processor test_object2(2,
@@ -341,9 +365,9 @@ public:
        cout << "[7]------------------------------------------" << endl;
                // unit_test[7] sslid_replication_area_sizeが0の場合, 例外が発生しない。
                try {
-                       memset(replication_data_area, 0, 128*sizeof(struct l7vs::sslid_replication_data_header));
+                       memset(replication_data_area, 0, 128*sizeof(l7vs::sslid_replication_data_header));
                        for(int i = 0; i < 128; i++){
-                               l7vs::sslid_replication_data_header* temp= ((l7vs::sslid_replication_data_header*)replication_data_area) + i;
+                               l7vs::sslid_replication_data_header* temp= reinterpret_cast<sslid_replication_data_header*>(replication_data_area) + i;
                                temp->size = static_cast<size_t>(2 * sizeof(l7vs::sslid_replication_data));
                        }
                        l7vs::sslid_replication_data_processor test_object2(2,
@@ -375,14 +399,50 @@ public:
                                replication_inputLogInfo, replication_inputLogDebug);
                // the virtual service's size is resetted, check it
                size_t expecting_size = static_cast<size_t>(max_list_size * sizeof(l7vs::sslid_replication_data));
+               size_t expecting_offset = static_cast<size_t>(real_data_start_address - header_start_address + first_header->size);
+               sslid_replication_data* expecting_replication_data_area = reinterpret_cast<sslid_replication_data*>(header_start_address + first_header->offset);
                BOOST_CHECK_EQUAL((first_header+1)->size, expecting_size);
+               BOOST_CHECK_EQUAL((first_header+1)->offset, expecting_offset);
+               BOOST_CHECK_EQUAL(this->replication_area, expecting_replication_data_area);
 
        cout << "[9]------------------------------------------" << endl;
-               // unit_test[9] virtual service対応のreplicationデータヘッダーの情報を再設定して、ヘッダーエリアがfullの場合,処理を行わない。
+               // unit_test[9] virtual service が存在して、且つvirtual serviceのデータエリアが実際サイズより小さい、
+               // unit_test[9] 且つsslid replicationエリアが足りないの場合、処理を行わない。
+               virtual_service_ip = "192.168.120.102";
+               memset(replication_data_area, 0, data_area_size);
+               test_virtual_service_endpoint.address(boost::asio::ip::address::from_string(virtual_service_ip));
+               test_virtual_service_endpoint.port(80);
+               memcpy(first_header->virtualserver_ip, virtual_service_ip.c_str(),virtual_service_ip.length());
+               first_header->virtualserver_port = 80;
+               first_header->size = static_cast<size_t> ((max_list_size - 1) * sizeof(l7vs::sslid_replication_data));
+               first_header->offset = static_cast<size_t> (real_data_start_address - header_start_address);
+               unsigned old_port = first_header->virtualserver_port;
+               std::string old_virtual_service_ip(first_header->virtualserver_ip);
+               size_t old_size = first_header->size;
+               size_t old_offset = first_header->offset;
+               sslid_replication_data_header temp_old_data;
+               memcpy(&temp_old_data, first_header + 1, sizeof(sslid_replication_data_header));
+               l7vs::sslid_replication_data_processor temp_test_object(10000,
+                               replication_data_area, 20,
+                               test_virtual_service_endpoint, replication_ingetloglevel,
+                               replication_inputLogFatal, replication_inputLogError,
+                               replication_inputLogWarn, replication_inputLogInfo,
+                               replication_inputLogDebug);
+               // first_header not changed check
+               std::string new_virtual_service_ip(first_header->virtualserver_ip);
+               BOOST_CHECK_EQUAL(new_virtual_service_ip, old_virtual_service_ip);
+               BOOST_CHECK_EQUAL(first_header->virtualserver_port, old_port);
+               BOOST_CHECK_EQUAL(first_header->size, old_size);
+               BOOST_CHECK_EQUAL(first_header->offset, old_offset);
+               int compare_result = memcmp(first_header + 1, &temp_old_data, sizeof(sslid_replication_data_header));
+               BOOST_CHECK_EQUAL(compare_result, 0);
+
+       cout << "[10]------------------------------------------" << endl;
+               // unit_test[10] virtual service対応のreplicationデータヘッダーの情報を再設定して、ヘッダーエリアがfullの場合,処理を行わない。
                try {
-                       memset(replication_data_area, 0, 128*sizeof(struct l7vs::sslid_replication_data_header));
+                       memset(replication_data_area, 0, 128*sizeof(l7vs::sslid_replication_data_header));
                        for(int i = 0; i < 128; i++){
-                               l7vs::sslid_replication_data_header* temp= ((l7vs::sslid_replication_data_header*)replication_data_area) + i;
+                               l7vs::sslid_replication_data_header* temp= reinterpret_cast<sslid_replication_data_header*>(replication_data_area) + i;
                                temp->size = sizeof(l7vs::sslid_replication_data);
                        }
                        memcpy(first_header->virtualserver_ip, virtual_service_ip.c_str(), virtual_service_ip.length());
@@ -399,9 +459,9 @@ public:
                        BOOST_ERROR("exception: sslid_replication_data_processor");
                }
 
-       cout << "[10]------------------------------------------" << endl;
-               // unit_test[10] virtual service対応のreplicationデータヘッダーの情報を再設定する時, ヘッダーエリアがfullでない場合
-               // unit_test[10] replicationデータヘッダーの情報を変更する。
+       cout << "[11]------------------------------------------" << endl;
+               // unit_test[11] virtual service対応のreplicationデータヘッダーの情報を再設定する時, ヘッダーエリアがfullでない場合
+               // unit_test[11] replicationデータヘッダーの情報を変更する。
                memset(replication_data_area, 0, data_area_size);
                memcpy(first_header->virtualserver_ip, virtual_service_ip.c_str(), virtual_service_ip.length());
                first_header->virtualserver_port = 80;
@@ -416,40 +476,52 @@ public:
                // the virtual service information's size is resized, get it
                expecting_size = static_cast<size_t>(max_list_size * sizeof(l7vs::sslid_replication_data));
                // the virtual service information's offset is resized, get it
-               size_t expecting_offset = static_cast<size_t>(real_data_start_address - header_start_address + first_header->size);
+               expecting_offset = static_cast<size_t>(real_data_start_address - header_start_address + first_header->size);
+               expecting_replication_data_area = reinterpret_cast<sslid_replication_data*>(header_start_address + first_header->offset);
                // size check
                BOOST_CHECK_EQUAL((first_header+1)->size, expecting_size);
                // offset check
                BOOST_CHECK_EQUAL((first_header+1)->offset, expecting_offset);
+               BOOST_CHECK_EQUAL(this->replication_area, expecting_replication_data_area);
 
-       cout << "[11]------------------------------------------" << endl;
-               // unit_test[11] virtual service対応のreplicationデータヘッダーが存在しなくて、且つヘッダーエリアがfullでなく、且つ
-               // unit_test[11] replicationデータエリアの領域が足りない場合、処理を行わない。
+       cout << "[12]------------------------------------------" << endl;
+               // unit_test[12] virtual service対応のreplicationデータヘッダーが存在しなくて、且つヘッダーエリアがfullでなく、且つ
+               // unit_test[12] replicationデータエリアの領域が足りない場合、処理を行わない。
                try {
-                       memset(replication_data_area, 0, 128*sizeof(struct l7vs::sslid_replication_data_header));
+                       memset(replication_data_area, 0, 128*sizeof(l7vs::sslid_replication_data_header));
                        std::string temp_virtual_service_ip = "255.255.255.255";
-                       for(int i = 0; i < 128; i++){
-                               l7vs::sslid_replication_data_header* temp= ((l7vs::sslid_replication_data_header*)replication_data_area) + i;
-                               temp->size = static_cast<size_t>((max_list_size + 1) * sizeof(l7vs::sslid_replication_data));
+                       test_virtual_service_endpoint.address(boost::asio::ip::address::from_string("192.168.120.102"));
+                       test_virtual_service_endpoint.port(90);
+                       for(int i = 0; i < 127; i++){
+                               l7vs::sslid_replication_data_header* temp= reinterpret_cast<sslid_replication_data_header*>(replication_data_area) + i;
+                               temp->size = 0;
+                               temp->virtualserver_port = 80;
                                memcpy(temp->virtualserver_ip, temp_virtual_service_ip.c_str(), temp_virtual_service_ip.length());
-                               if(i == 127) {
-                                       temp->size = 0;
-                               }
                        }
+                       sslid_replication_data_header old_data;
+                       memcpy(&old_data, reinterpret_cast<sslid_replication_data_header*>(replication_data_area) + 127, sizeof(sslid_replication_data_header));
                        l7vs::sslid_replication_data_processor test_object6(
-                                       max_list_size, replication_data_area,
-                                       SECTION_NUMBER, test_virtual_service_endpoint,
+                                       10000, replication_data_area,
+                                       20, test_virtual_service_endpoint,
                                        replication_ingetloglevel, replication_inputLogFatal,
                                        replication_inputLogError, replication_inputLogWarn,
                                        replication_inputLogInfo, replication_inputLogDebug);
+                       compare_result = memcmp(reinterpret_cast<sslid_replication_data_header*>(replication_data_area) + 127, &old_data, sizeof(sslid_replication_data_header));
+                       BOOST_CHECK_EQUAL(compare_result, 0);
                } catch (...) {
                        BOOST_ERROR("exception: sslid_replication_data_processor");
                }
 
-       cout << "[12]------------------------------------------" << endl;
-               // unit_test[12] virtual service対応のreplicationデータヘッダーが存在しなくて、且つreplicationデータエリアの領域が足りる場合、
-               // unit_test[12] ヘッダーエリアに、virtual serviceを追加する。
-               memset(replication_data_area, 0, 128*sizeof(struct l7vs::sslid_replication_data_header));
+       cout << "[13]------------------------------------------" << endl;
+               // unit_test[13] virtual service対応のreplicationデータヘッダーが存在して、且つreplicationデータエリアの領域が足りる場合、
+               // unit_test[13] ヘッダーエリアに、virtual serviceを追加する。
+               memset(replication_data_area, 0, 128*sizeof(l7vs::sslid_replication_data_header));
+               test_virtual_service_endpoint.address(boost::asio::ip::address::from_string(virtual_service_ip));
+               test_virtual_service_endpoint.port(80);
+               memcpy(first_header->virtualserver_ip, virtual_service_ip.c_str(), virtual_service_ip.length());
+               first_header->virtualserver_port = 80;
+               first_header->offset = static_cast<size_t>(real_data_start_address - header_start_address);
+               first_header->size = (max_list_size + 1) * sizeof(sslid_replication_data);
                l7vs::sslid_replication_data_processor test_object7(
                                max_list_size, replication_data_area,
                                SECTION_NUMBER, test_virtual_service_endpoint,
@@ -458,18 +530,21 @@ public:
                                replication_inputLogInfo, replication_inputLogDebug);
                expecting_size = static_cast<size_t>(max_list_size * sizeof(l7vs::sslid_replication_data));
                expecting_offset = static_cast<size_t>(real_data_start_address - header_start_address);
+               expecting_replication_data_area = reinterpret_cast<sslid_replication_data*>(real_data_start_address);
                // session information's size check
                BOOST_CHECK_EQUAL(first_header->size, expecting_size);
                // session information's offset check
                BOOST_CHECK_EQUAL(first_header->offset, expecting_offset);
+               // replication_area check
+               BOOST_CHECK_EQUAL(replication_area, expecting_replication_data_area);
 
-       cout << "[13]------------------------------------------" << endl;
-               // unit_test[13] virtual serviceが存在しなくて、且つヘッダーエリアがfullの場合,処理を行わない。
+       cout << "[14]------------------------------------------" << endl;
+               // unit_test[14] virtual serviceが存在しなくて、且つヘッダーエリアがfullの場合,処理を行わない。
                try {
-                       memset(replication_data_area, 0, 128*sizeof(struct l7vs::sslid_replication_data_header));
+                       memset(replication_data_area, 0, 128*sizeof(l7vs::sslid_replication_data_header));
                        std::string temp_virtual_service_ip = "255.255.255.255";
                        for(int i = 0; i < 128; i++){
-                               l7vs::sslid_replication_data_header* temp= ((l7vs::sslid_replication_data_header*)replication_data_area) + i;
+                               l7vs::sslid_replication_data_header* temp= reinterpret_cast<sslid_replication_data_header*>(replication_data_area) + i;
                                temp->size = static_cast<size_t>(max_list_size * sizeof(l7vs::sslid_replication_data));
                                memcpy(temp->virtualserver_ip, temp_virtual_service_ip.c_str(), temp_virtual_service_ip.length());
                        }
@@ -483,9 +558,9 @@ public:
                        BOOST_ERROR("exception: sslid_replication_data_processor");
                }
 
-       cout << "[14]------------------------------------------" << endl;
-               // unit_test[14] virtual serviceのipがipv6で、virtual serviceが存在して、且つ
-               // unit_test[14] virtual service対応のデータ領域が足りない場合、virtual service対応のreplicationデータヘッダーの情報を再設定する。
+       cout << "[15]------------------------------------------" << endl;
+               // unit_test[15] virtual serviceのipがipv6で、virtual serviceが存在して、且つ
+               // unit_test[15] virtual service対応のデータ領域が足りない場合、virtual service対応のreplicationデータヘッダーの情報を再設定する。
                virtual_service_ip = "abcd:21d0:8936:4866:eefe:567d:3a4b:1230";
                memset(replication_data_area, 0, data_area_size);
                test_virtual_service_endpoint.address(boost::asio::ip::address::from_string(virtual_service_ip));
@@ -502,7 +577,11 @@ public:
                                replication_inputLogInfo, replication_inputLogDebug);
                // the virtual service's size is resetted, check it
                expecting_size = static_cast<size_t>(max_list_size * sizeof(l7vs::sslid_replication_data));
+               expecting_offset = static_cast<size_t>(real_data_start_address - header_start_address + first_header->size);
+               expecting_replication_data_area = reinterpret_cast<sslid_replication_data*>(real_data_start_address);
                BOOST_CHECK_EQUAL((first_header+1)->size, expecting_size);
+               BOOST_CHECK_EQUAL((first_header+1)->offset, expecting_offset);
+               BOOST_CHECK_EQUAL(this->replication_area, expecting_replication_data_area);
        }
 
        // put_into_temp_list_test
@@ -517,8 +596,8 @@ public:
                l7vs::sslid_replication_temp_data test_data2;
                l7vs::sslid_replication_temp_data test_data3;
 
-    cout << "[15]------------------------------------------" << endl;
-               // unit_test[15] 1つのアイテムの場合、temp_listにデータを追加する。
+    cout << "[16]------------------------------------------" << endl;
+               // unit_test[16] 1つのアイテムの場合、temp_listにデータを追加する。
                test_data1.session_id = session_id1;
                test_data1.last_time = last_time;
                test_data1.op_code = 'A';
@@ -536,8 +615,8 @@ public:
                // realserver_addr check
                BOOST_CHECK_EQUAL(put_into_data.realserver_addr, test_data1.realserver_addr);
 
-    cout << "[16]------------------------------------------" << endl;
-               // unit_test[16] 2つのアイテムの場合、temp_listにデータを追加する。
+    cout << "[17]------------------------------------------" << endl;
+               // unit_test[17] 2つのアイテムの場合、temp_listにデータを追加する。
                test_data1.session_id = session_id1;
                test_data1.last_time = last_time;
                test_data1.op_code = 'U';
@@ -565,8 +644,8 @@ public:
                BOOST_CHECK_EQUAL(first_put_into_data.realserver_addr, test_data1.realserver_addr);
                BOOST_CHECK_EQUAL(second_put_into_data.realserver_addr, test_data2.realserver_addr);
 
-    cout << "[17]------------------------------------------" << endl;
-               // unit_test[17] 3つのアイテムの場合、temp_listにデータを追加する。
+    cout << "[18]------------------------------------------" << endl;
+               // unit_test[18] 3つのアイテムの場合、temp_listにデータを追加する。
                test_data1.session_id = session_id1;
                test_data1.last_time = last_time;
                test_data1.op_code = 'U';
@@ -604,8 +683,8 @@ public:
                BOOST_CHECK_EQUAL(second_put_into_data.realserver_addr, test_data2.realserver_addr);
                BOOST_CHECK_EQUAL(third_put_into_data.realserver_addr, test_data3.realserver_addr);
 
-    cout << "[18]------------------------------------------" << endl;
-               // unit_test[18] マルチスレッドの場合、temp_listにデータを正常追加する。
+    cout << "[19]------------------------------------------" << endl;
+               // unit_test[19] マルチスレッドの場合、temp_listにデータを正常追加する。
                try{
                        boost::thread_group thread_group;
                        this->temp_list.clear();
@@ -644,8 +723,8 @@ public:
                        }
                }
 
-    cout << "[19]------------------------------------------" << endl;
-               // unit_test[19] マルチスレッド がつ temp_listのサイズが max_temp_listの場合、temp_listにデータを正常追加する。
+    cout << "[20]------------------------------------------" << endl;
+               // unit_test[20] マルチスレッド がつ temp_listのサイズが max_temp_listの場合、temp_listにデータを正常追加する。
                try{
                        boost::thread_group thread_group;
                        is_put_into_temp_list_test_thread4_waiting = false;
@@ -671,8 +750,8 @@ public:
                        BOOST_CHECK_EQUAL(temp.op_code, 'A');
                }
 
-    cout << "[20]------------------------------------------" << endl;
-               // unit_test[20] ルチスレッド がつ temp_list size > max_temp_listの場合、temp_listにデータを正常追加する。
+    cout << "[21]------------------------------------------" << endl;
+               // unit_test[21] ルチスレッド がつ temp_list size > max_temp_listの場合、temp_listにデータを正常追加する。
                try{
                        boost::thread_group thread_group;
                        is_put_into_temp_list_test_thread6_waiting = false;
@@ -698,8 +777,8 @@ public:
                        BOOST_CHECK_EQUAL(temp.op_code, 'A');
                }
 
-    cout << "[21]------------------------------------------" << endl;
-               // unit_test[21] temp_listがfullで、且1つのスレッドが待ち状態の場合、waitingフラグを待ちに設定する。
+    cout << "[22]------------------------------------------" << endl;
+               // unit_test[22] temp_listがfullで、且1つのスレッドが待ち状態の場合、waitingフラグを待ちに設定する。
                try{
                        boost::thread_group thread_group;
 
@@ -721,8 +800,8 @@ public:
                        BOOST_ERROR("exception: put_into_temp_list");
                }
 
-    cout << "[22]------------------------------------------" << endl;
-               // unit_test[22] temp_listがfullで、且2つのスレッドが待ち状態の場合、waitingフラグを待ちに設定する。
+    cout << "[23]------------------------------------------" << endl;
+               // unit_test[23] temp_listがfullで、且2つのスレッドが待ち状態の場合、waitingフラグを待ちに設定する。
                try{
                        boost::thread_group thread_group;
 
@@ -754,8 +833,8 @@ public:
                        BOOST_ERROR("exception: put_into_temp_list");
                }
 
-    cout << "[23]------------------------------------------" << endl;
-               // unit_test[23] temp_listがfullで、且3つのスレッドが待ち状態の場合、waitingフラグを待ちに設定する。
+    cout << "[24]------------------------------------------" << endl;
+               // unit_test[24] temp_listがfullで、且3つのスレッドが待ち状態の場合、waitingフラグを待ちに設定する。
                try{
                        boost::thread_group thread_group;
 
@@ -810,8 +889,8 @@ public:
                this->replication_area_lock = lock_function;
                this->replication_area_unlock = unlock_function;
 
-    cout << "[24]------------------------------------------" << endl;
-               // unit_test[24] maxlistが0の場合、例外が発生しない。
+    cout << "[25]------------------------------------------" << endl;
+               // unit_test[25] maxlistが0の場合、例外が発生しない。
                int old_maxlist = this->maxlist;
                try {
                        this->maxlist = 0;
@@ -820,8 +899,8 @@ public:
                        BOOST_ERROR("exception: write_replicaion_area");
                }
 
-       cout << "[25]------------------------------------------" << endl;
-               // unit_test[25] maxlist < 0の場合、例外が発生しない。
+       cout << "[26]------------------------------------------" << endl;
+               // unit_test[26] maxlist < 0の場合、例外が発生しない。
                try {
                        this->maxlist = -1;
                        this->write_replicaion_area();
@@ -831,8 +910,8 @@ public:
                this->maxlist = old_maxlist;
 
 
-       cout << "[26]------------------------------------------" << endl;
-               // unit_test[26] replication_area が NULLの場合、例外が発生しない。
+       cout << "[27]------------------------------------------" << endl;
+               // unit_test[27] replication_area が NULLの場合、例外が発生しない。
                sslid_replication_data* old_replication_area = this->replication_area;
                try {
                        this->temp_list.clear();
@@ -843,8 +922,8 @@ public:
                }
                this->replication_area = old_replication_area;
 
-       cout << "[27]------------------------------------------" << endl;
-               // unit_test[27] temp_listが空の場合、例外が発生しない。
+       cout << "[28]------------------------------------------" << endl;
+               // unit_test[28] temp_listが空の場合、例外が発生しない。
                try {
                        this->temp_list.clear();
                        this->write_replicaion_area();
@@ -852,10 +931,8 @@ public:
                        BOOST_ERROR("exception: write_replicaion_area");
                }
 
-    cout << "[28]------------------------------------------" << endl;
-               // unit_test[28] op_codeが「A」で、且つreplication_areaに1つのデータが存在する場合、新データを追加する。
-               is_lock_function_called = false;
-               is_unlock_function_called = false;
+    cout << "[29]------------------------------------------" << endl;
+               // unit_test[29] op_codeが「A」で、且つreplication_areaに1つのデータが存在する場合、新データを追加する。
                temp_session_id = "temp_id1rtrrrrtttttteeeeeeemmmmp";
                memset(this->replication_area, 0, this->maxlist*sizeof(struct l7vs::sslid_replication_data));
                temp_data.last_time = time(0);
@@ -898,10 +975,8 @@ public:
                // added realserver_addr port check
                BOOST_CHECK_EQUAL(added_address_port, test_data1.realserver_addr.port());
 
-    cout << "[29]------------------------------------------" << endl;
-               // unit_test[29] op_codeが「A」で、且つreplication_areaに2つのデータが存在して、且つ1つ目データのvalidフラグが0の場合、新のデータを追加する。
-               is_lock_function_called = false;
-               is_unlock_function_called = false;
+    cout << "[30]------------------------------------------" << endl;
+               // unit_test[30] op_codeが「A」で、且つreplication_areaに2つのデータが存在して、且つ1つ目データのvalidフラグが0の場合、新のデータを追加する。
                memset(this->replication_area, 0, this->maxlist*sizeof(struct l7vs::sslid_replication_data));
                temp_session_id = "temp_id2eeeeeetttteeeeeeemmmmuui";
                temp_data.last_time = time(0);
@@ -947,10 +1022,8 @@ public:
                // added realserver_addr port check
                BOOST_CHECK_EQUAL(added_address_port, test_data1.realserver_addr.port());
 
-    cout << "[30]------------------------------------------" << endl;
-               // unit_test[30] op_codeが「A」で、且つreplication_areaにデータが存在しない場合、新のデータを追加する。
-               is_lock_function_called = false;
-               is_unlock_function_called = false;
+    cout << "[31]------------------------------------------" << endl;
+               // unit_test[31] op_codeが「A」で、且つreplication_areaにデータが存在しない場合、新のデータを追加する。
                memset(this->replication_area, 0, this->maxlist*sizeof(struct l7vs::sslid_replication_data));
                realserver_addr.address(boost::asio::ip::address::from_string("192.168.120.102"));
                realserver_addr.port(80);
@@ -978,10 +1051,8 @@ public:
                // realserver_addr port check
                BOOST_CHECK_EQUAL(saved_address_port, 80);
 
-    cout << "[31]------------------------------------------" << endl;
-               // unit_test[31] op_codeが「U」で、且つセッションIDが存在している場合、該当データを更新する。
-               is_lock_function_called = false;
-               is_unlock_function_called = false;
+    cout << "[32]------------------------------------------" << endl;
+               // unit_test[32] op_codeが「U」で、且つセッションIDが存在している場合、該当データを更新する。
                realserver_addr.address(boost::asio::ip::address::from_string("255.255.255.255"));
                realserver_addr.port(port);
                test_data1.op_code = 'U';
@@ -1007,10 +1078,8 @@ public:
                // realserver_addr port is changed, check it
                BOOST_CHECK_EQUAL(saved_address_port, port);
 
-    cout << "[32]------------------------------------------" << endl;
-               // unit_test[32] op_codeが「D」で、且つセッションIDが存在している場合、該当データを削除する。
-               is_lock_function_called = false;
-               is_unlock_function_called = false;
+    cout << "[33]------------------------------------------" << endl;
+               // unit_test[33] op_codeが「D」で、且つセッションIDが存在している場合、該当データを削除する。
                realserver_addr.address(boost::asio::ip::address::from_string("192.168.120.102"));
                realserver_addr.port(80);
                test_data1.op_code = 'D';
@@ -1034,10 +1103,8 @@ public:
                // realserver_addr port is not changed, check it
                BOOST_CHECK_EQUAL(saved_address_port, port);
 
-    cout << "[33]------------------------------------------" << endl;
-               // unit_test[33] op_codeが「A」,「U」,「D」以外の場合、データを変更しない。
-               is_lock_function_called = false;
-               is_unlock_function_called = false;
+    cout << "[34]------------------------------------------" << endl;
+               // unit_test[34] op_codeが「A」,「U」,「D」以外の場合、データを変更しない。
                memset(this->replication_area, 0, this->maxlist*sizeof(struct l7vs::sslid_replication_data));
                realserver_addr.address(boost::asio::ip::address::from_string("192.168.120.102"));
                realserver_addr.port(port);
@@ -1056,10 +1123,8 @@ public:
                compare_result = memcmp(&old_session_data, this->replication_area, 3*sizeof(sslid_replication_data));
                BOOST_CHECK_EQUAL(compare_result, 0);
 
-    cout << "[34]------------------------------------------" << endl;
-               // unit_test[34] データを追加するの場合、replication_area_lock関数を呼び出す。
-               is_lock_function_called = false;
-               is_unlock_function_called = false;
+    cout << "[35]------------------------------------------" << endl;
+               // unit_test[35] データを追加するの場合、replication_area_lock関数を呼び出す。
                memset(this->replication_area, 0, this->maxlist*sizeof(struct l7vs::sslid_replication_data));
                test_data1.op_code = 'A';
                this->temp_list.clear();
@@ -1072,10 +1137,8 @@ public:
                // replication_area_lock function called check
                BOOST_CHECK(is_lock_function_called);
 
-    cout << "[35]------------------------------------------" << endl;
-               // unit_test[35] データを追加するの場合、replication_area_unlock関数を呼び出す。
-               is_lock_function_called = false;
-               is_unlock_function_called = false;
+    cout << "[36]------------------------------------------" << endl;
+               // unit_test[36] データを追加するの場合、replication_area_unlock関数を呼び出す。
                memset(this->replication_area, 0, this->maxlist*sizeof(struct l7vs::sslid_replication_data));
                test_data1.op_code = 'A';
                this->temp_list.clear();
@@ -1088,10 +1151,8 @@ public:
                // replication_area_unlock function called check
                BOOST_CHECK(is_unlock_function_called);
 
-    cout << "[36]------------------------------------------" << endl;
-               // unit_test[36] endpointがipv6で、replicationエリアにデータがなくて、該当ipv6のendpointを追加する。
-               is_lock_function_called = false;
-       is_unlock_function_called = false;
+    cout << "[37]------------------------------------------" << endl;
+               // unit_test[37] endpointがipv6で、replicationエリアにデータがなくて、該当ipv6のendpointを追加する。
                memset(this->replication_area, 0, this->maxlist*sizeof(struct l7vs::sslid_replication_data));
                realserver_addr.address(boost::asio::ip::address::from_string("abcd:21d0:8936:4866:eefe:567d:3a4b:1230"));
                realserver_addr.port(80);
@@ -1118,10 +1179,8 @@ public:
                // realserver_addr port check
                BOOST_CHECK_EQUAL(saved_address_port, 80);
 
-    cout << "[37]------------------------------------------" << endl;
-               // unit_test[37] op_codeが「U」で、endpointがipv6で、replicationエリアにデータがある場合、該当ipv6のendpointを更新する。
-               is_lock_function_called = false;
-               is_unlock_function_called = false;
+    cout << "[38]------------------------------------------" << endl;
+               // unit_test[38] op_codeが「U」で、endpointがipv6で、replicationエリアにデータがある場合、該当ipv6のendpointを更新する。
                realserver_addr.address(boost::asio::ip::address::from_string("1:21d0:1:4866:1:1:3a4b:1230"));
                realserver_addr.port(port);
                test_data1.op_code = 'U';
@@ -1138,10 +1197,8 @@ public:
                // realserver_addr port check
                BOOST_CHECK_EQUAL(saved_address_port, port);
 
-    cout << "[38]------------------------------------------" << endl;
-               // unit_test[38] op_codeが「D」で、endpointがipv6で、replicationエリアにデータがある場合、該当ipv6のendpointを変更しない、validに0を設定する。
-               is_lock_function_called = false;
-               is_unlock_function_called = false;
+    cout << "[39]------------------------------------------" << endl;
+               // unit_test[39] op_codeが「D」で、endpointがipv6で、replicationエリアにデータがある場合、該当ipv6のendpointを変更しない、validに0を設定する。
                realserver_addr.address(boost::asio::ip::address::from_string("ffff:ffff:ffff:ffff:ffff:ffff:ffff:ffff"));
                test_data1.op_code = 'D';
                test_data1.last_time = delete_time;
@@ -1160,6 +1217,69 @@ public:
                BOOST_CHECK_EQUAL(saved_address_ip, std::string("1:21d0:1:4866:1:1:3a4b:1230"));
                // realserver_addr port is not changed, check it
                BOOST_CHECK_EQUAL(saved_address_port, port);
+
+       cout << "[40]------------------------------------------" << endl;
+               // unit_test[40] op_codeが「A」で、session_idが"00000000000000000000000000000000"で、該当のデータを追加する。
+               std::string zero_string = "00000000000000000000000000000000";
+               memset(this->replication_area, 0, this->maxlist*sizeof(struct l7vs::sslid_replication_data));
+               test_data1.session_id = zero_string;
+               test_data1.op_code = 'A';
+               test_data1.last_time = last_time;
+               test_data1.realserver_addr = realserver_addr;
+               this->temp_list.clear();
+               this->put_into_temp_list(test_data1);
+               this->write_replicaion_area();
+               memset(session_id_array, 0, SSLID_LENGTH + 1);
+               memcpy(session_id_array, this->replication_area->session_id, SSLID_LENGTH);
+               saved_session_id = std::string(session_id_array);
+               saved_address_ip = std::string(this->replication_area->realserver_ip);
+               saved_address_port = this->replication_area->realserver_port;
+               BOOST_CHECK_EQUAL(this->replication_area->valid, 1);
+               BOOST_CHECK_EQUAL(this->replication_area->last_time, last_time);
+               BOOST_CHECK_EQUAL(saved_address_ip, realserver_addr.address().to_string());
+               BOOST_CHECK_EQUAL(saved_address_port, realserver_addr.port());
+               BOOST_CHECK_EQUAL(saved_session_id, zero_string);
+
+       cout << "[41]------------------------------------------" << endl;
+               // unit_test[41] op_codeが「U」で、session_idが"00000000000000000000000000000000"で、該当のデータを更新する。
+               realserver_addr.address(boost::asio::ip::address::from_string("255.255.255.0"));
+               test_data1.session_id = zero_string;
+               test_data1.op_code = 'U';
+               test_data1.last_time = update_time;
+               test_data1.realserver_addr = realserver_addr;
+               this->temp_list.clear();
+               this->put_into_temp_list(test_data1);
+               this->write_replicaion_area();
+               memset(session_id_array, 0, SSLID_LENGTH + 1);
+               memcpy(session_id_array, this->replication_area->session_id, SSLID_LENGTH);
+               saved_session_id = std::string(session_id_array);
+               saved_address_ip = std::string(this->replication_area->realserver_ip);
+               saved_address_port = this->replication_area->realserver_port;
+               BOOST_CHECK_EQUAL(this->replication_area->valid, 1);
+               BOOST_CHECK_EQUAL(this->replication_area->last_time, update_time);
+               BOOST_CHECK_EQUAL(saved_address_ip, realserver_addr.address().to_string());
+               BOOST_CHECK_EQUAL(saved_address_port, realserver_addr.port());
+               BOOST_CHECK_EQUAL(saved_session_id, zero_string);
+
+       cout << "[42]------------------------------------------" << endl;
+               // unit_test[42] op_codeが「D」で、session_idが"00000000000000000000000000000000"で、該当のデータを削除する。
+               test_data1.op_code = 'D';
+               test_data1.session_id = zero_string;
+               test_data1.last_time = delete_time;
+               this->temp_list.clear();
+               this->put_into_temp_list(test_data1);
+               this->write_replicaion_area();
+               // get saved information
+               memset(session_id_array, 0, SSLID_LENGTH + 1);
+               memcpy(session_id_array, this->replication_area->session_id, SSLID_LENGTH);
+               saved_session_id = std::string(session_id_array);
+               saved_address_ip = std::string(this->replication_area->realserver_ip);
+               saved_address_port = this->replication_area->realserver_port;
+               BOOST_CHECK_EQUAL(this->replication_area->valid, 0);
+               BOOST_CHECK_EQUAL(this->replication_area->last_time, delete_time);
+               BOOST_CHECK_EQUAL(saved_address_ip, realserver_addr.address().to_string());
+               BOOST_CHECK_EQUAL(saved_address_port, realserver_addr.port());
+               BOOST_CHECK_EQUAL(saved_session_id, zero_string);
        }
 
        // register_replication_area_lock_test
@@ -1167,13 +1287,13 @@ public:
 
                boost::function<void(void)> register_function = &lock_function;
 
-    cout << "[39]------------------------------------------" << endl;
-               // unit_test[39] register_replication_area_lock()関数のパラメータがNULLの場合、replication_area_lockがNULLある。
+    cout << "[43]------------------------------------------" << endl;
+               // unit_test[43] register_replication_area_lock()関数のパラメータがNULLの場合、replication_area_lockがNULLある。
                this->register_replication_area_lock(NULL);
                BOOST_CHECK_EQUAL(this->replication_area_lock.empty(), true);
 
-    cout << "[40]------------------------------------------" << endl;
-               // unit_test[40] register_replication_area_lock()関数のパラメータがNULLでない場合、replication_area_lockがパラメータと一致する。
+    cout << "[44]------------------------------------------" << endl;
+               // unit_test[44] register_replication_area_lock()関数のパラメータがNULLでない場合、replication_area_lockがパラメータと一致する。
                this->register_replication_area_lock(register_function);
                // function registered correctly check;
                BOOST_CHECK_EQUAL(this->replication_area_lock, lock_function);
@@ -1184,14 +1304,14 @@ public:
 
                boost::function<void(void)> register_function = &unlock_function;
 
-    cout << "[41]------------------------------------------" << endl;
-               // unit_test[41] register_replication_area_unlock()関数のパラメータがNULLの場合、replication_area_unlockがNULLある。
+    cout << "[45]------------------------------------------" << endl;
+               // unit_test[45] register_replication_area_unlock()関数のパラメータがNULLの場合、replication_area_unlockがNULLある。
                this->register_replication_area_unlock(NULL);
                // function registered correctly check;
                BOOST_CHECK_EQUAL(this->replication_area_unlock.empty(), true);
 
-    cout << "[42]------------------------------------------" << endl;
-               // unit_test[42] register_replication_area_unlock()関数のパラメータがNULLでない場合、replication_area_unlockがパラメータと一致する。
+    cout << "[46]------------------------------------------" << endl;
+               // unit_test[46] register_replication_area_unlock()関数のパラメータがNULLでない場合、replication_area_unlockがパラメータと一致する。
                this->register_replication_area_unlock(register_function);
                // function registered correctly check;
                BOOST_CHECK_EQUAL(this->replication_area_unlock, unlock_function);
@@ -1206,14 +1326,14 @@ public:
                l7vs::sslid_replication_temp_data get_data;
                boost::asio::ip::tcp::endpoint endpoint;
 
-    cout << "[43]------------------------------------------" << endl;
-               // unit_test[43] temp_listのサイズが0の場合、戻り値が失敗(-1)で設定する。
+    cout << "[47]------------------------------------------" << endl;
+               // unit_test[47] temp_listのサイズが0の場合、戻り値が失敗(-1)で設定する。
                this->temp_list.clear();
                result = this->get_from_temp_list(get_data);
                BOOST_CHECK_EQUAL(result, -1);
 
-       cout << "[44]------------------------------------------" << endl;
-               // unit_test[44] temp_listのサイズが1の場合、戻り値が正常(0)で設定する。
+       cout << "[48]------------------------------------------" << endl;
+               // unit_test[48] temp_listのサイズが1の場合、戻り値が正常(0)で設定する。
                test_data1.session_id = "test_id123456789abcdefghijklmnop";
                test_data1.op_code = 'A';
                test_data1.realserver_addr = endpoint;
@@ -1223,8 +1343,8 @@ public:
                result = this->get_from_temp_list(get_data);
                BOOST_CHECK_EQUAL(result, 0);
 
-       cout << "[45]------------------------------------------" << endl;
-               // unit_test[45] temp_listのサイズが3の場合、戻り値が正常(0)で設定する。
+       cout << "[49]------------------------------------------" << endl;
+               // unit_test[49] temp_listのサイズが3の場合、戻り値が正常(0)で設定する。
                this->temp_list.clear();
                this->temp_list.push_back(test_data1);
                this->temp_list.push_back(test_data1);
@@ -1232,8 +1352,8 @@ public:
                result = this->get_from_temp_list(get_data);
                BOOST_CHECK_EQUAL(result, 0);
 
-    cout << "[46]------------------------------------------" << endl;
-               // unit_test[46] マルチスレッドの場合、temp_listにデータを正常取得する。
+    cout << "[50]------------------------------------------" << endl;
+               // unit_test[50] マルチスレッドの場合、temp_listにデータを正常取得する。
                try {
                        this->temp_list.clear();
                        this->temp_list.push_back(test_data1);
@@ -1249,8 +1369,8 @@ public:
                        BOOST_ERROR("exception: get_from_temp_list");
                }
 
-    cout << "[47]------------------------------------------" << endl;
-               // unit_test[47] temp_listにデータがある場合、1つ目のデータを削除する。
+    cout << "[51]------------------------------------------" << endl;
+               // unit_test[51] temp_listにデータがある場合、1つ目のデータを削除する。
                test_data1.session_id = "test_id123456789abcdefghijklmnop";
                test_data1.op_code = 'T';
                test_data1.realserver_addr = endpoint;
@@ -1275,8 +1395,8 @@ public:
                // last_time check
                BOOST_CHECK_EQUAL(leave_data.last_time, test_data2.last_time);
 
-    cout << "[48]------------------------------------------" << endl;
-               // unit_test[48] temp_listに1つデータがある場合、get_from_temp_list()で取得したデータがtemp_listの内容と一致する。
+    cout << "[52]------------------------------------------" << endl;
+               // unit_test[52] temp_listに1つデータがある場合、get_from_temp_list()で取得したデータがtemp_listの内容と一致する。
                test_data1.op_code = 'A';
                this->temp_list.clear();
                this->temp_list.push_back(test_data1);
@@ -1291,8 +1411,8 @@ public:
                // last_time check
                BOOST_CHECK_EQUAL(get_data.last_time, test_data1.last_time);
 
-    cout << "[49]------------------------------------------" << endl;
-               // unit_test[49] temp_listに2つデータがある場合、get_from_temp_list()で取得したデータがtemp_listの1つ目の内容と一致する。
+    cout << "[53]------------------------------------------" << endl;
+               // unit_test[53] temp_listに2つデータがある場合、get_from_temp_list()で取得したデータがtemp_listの1つ目の内容と一致する。
                test_data1.op_code = 'U';
                test_data2.op_code = 'D';
                this->temp_list.clear();
@@ -1313,8 +1433,8 @@ public:
        // get_replication_area_test
        void get_replication_area_test(sslid_replication_data* expecting_sslid_replication_data) {
 
-    cout << "[50]------------------------------------------" << endl;
-               // unit_test[50] get_replication_area()関数の戻り値はコンストラクタが正常に生成する値と一致する。
+    cout << "[54]------------------------------------------" << endl;
+               // unit_test[54] get_replication_area()関数の戻り値はコンストラクタが正常に生成する値と一致する。
                sslid_replication_data* get_data = this->get_replication_area();
                BOOST_CHECK_EQUAL(get_data, expecting_sslid_replication_data);
        }
index 9811983..d767700 100644 (file)
@@ -1,3 +1,27 @@
+/*
+ * @file  sslid_session_data_processor_test.cpp
+ * @brief sslid session data processor test file.
+ *
+ * L7VSD: Linux Virtual Server for Layer7 Load Balancing
+ * Copyright (C) 2009  NTT COMWARE Corporation.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA
+ *
+ **********************************************************************/
+
 #include "sslid_to_be_test_file.h"
 
 using namespace boost::unit_test;
@@ -481,6 +505,7 @@ public:
                boost::asio::ip::tcp::endpoint old_saved_endpoint;
                boost::asio::ip::tcp::endpoint new_saved_endpoint;
                std::multimap<time_t, std::string>::iterator lasttime_session_map_iterator;
+               std::multimap<time_t, std::string>::iterator delete_item_iterator;
                sslid_replication_temp_data temp_list_data;
                sslid_replication_data_processor_replacement *this_replication_data_processor =
                        dynamic_cast<sslid_replication_data_processor_replacement *> (this->replication_data_processor);
@@ -545,6 +570,7 @@ public:
                BOOST_CHECK_EQUAL(this->session_lasttime_map[session_id], write_time);
                // lasttime_session_map is setted check
                BOOST_CHECK_EQUAL(lasttime_session_map_iterator->second, session_id);
+               BOOST_CHECK_EQUAL(this->lasttime_session_map.size(), 1u);
                // function result check
                BOOST_CHECK_EQUAL(result, 0);
                // the item which put into the temp_list check
@@ -568,6 +594,7 @@ public:
                this->lasttime_session_map.insert(std::make_pair(last_time, temp_session_id));
                result = this->write_session_data(session_id, new_saved_endpoint, write_time);
                lasttime_session_map_iterator = this->lasttime_session_map.find(write_time);
+               delete_item_iterator = this->lasttime_session_map.begin();
                // get the item which put into the temp_list
                this_replication_data_processor->to_get_from_temp_list(temp_list_data);
                // session_endpoint_map is setted check
@@ -576,6 +603,13 @@ public:
                BOOST_CHECK_EQUAL(this->session_lasttime_map[session_id], write_time);
                // lasttime_session_map is setted check
                BOOST_CHECK_EQUAL(lasttime_session_map_iterator->second, session_id);
+               BOOST_CHECK_EQUAL(this->lasttime_session_map.size(), 2u);
+               for(;delete_item_iterator != this->lasttime_session_map.end(); delete_item_iterator++){
+                       if(delete_item_iterator->first == last_time
+                                       && delete_item_iterator->second == session_id){
+                               BOOST_ERROR("error: write_session_data");
+                       }
+               }
                // function result check
                BOOST_CHECK_EQUAL(result, 0);
                // the item which put into the temp_list check
@@ -602,6 +636,7 @@ public:
                this->lasttime_session_map.insert(std::make_pair(last_time, temp_session_id1));
                result = this->write_session_data(session_id, new_saved_endpoint, write_time);
                lasttime_session_map_iterator = this->lasttime_session_map.find(write_time);
+               delete_item_iterator = this->lasttime_session_map.begin();
                // get the item which put into the temp_list
                this_replication_data_processor->to_get_from_temp_list(temp_list_data);
                // session_endpoint_map is setted check
@@ -610,6 +645,13 @@ public:
                BOOST_CHECK_EQUAL(this->session_lasttime_map[session_id], write_time);
                // lasttime_session_map is setted check
                BOOST_CHECK_EQUAL(lasttime_session_map_iterator->second, session_id);
+               BOOST_CHECK_EQUAL(this->lasttime_session_map.size(), 3u);
+               for(;delete_item_iterator != this->lasttime_session_map.end(); delete_item_iterator++){
+                       if(delete_item_iterator->first == last_time
+                                       && delete_item_iterator->second == session_id){
+                               BOOST_ERROR("error: write_session_data");
+                       }
+               }
                // function result check
                BOOST_CHECK_EQUAL(result, 0);
                // the item which put into the temp_list check
@@ -1044,11 +1086,13 @@ public:
                unsigned short port3 = 333;
                unsigned short port4 = 444;
                unsigned short port5 = 555;
+               unsigned short port6 = 666;
                time_t last_time1 = time(0);
                time_t last_time2 = last_time1 - 10;
                time_t last_time3 = last_time2 - 10;
                time_t last_time4 = last_time3 - 10;
                time_t last_time5 = last_time4 - 10;
+               time_t last_time6 = last_time5 - 10;
                std::map<std::string, boost::asio::ip::tcp::endpoint>::iterator it1;
                std::map<std::string, time_t>::iterator it2;
                std::multimap<time_t, std::string>::iterator it3;
@@ -1102,6 +1146,15 @@ public:
                (first_real_data + 4)->realserver_port = port5;
                (first_real_data + 4)->last_time = last_time5;
 
+               // set the real data area(the sixth data)
+               std::string session_id6 = "00000000000000000000000000000000";
+               std::string realserver_ip6 = "0.0.0.0";
+               memcpy((first_real_data + 5)->session_id, session_id6.c_str(), session_id6.length());
+               memcpy((first_real_data + 5)->realserver_ip, realserver_ip6.c_str(), realserver_ip6.length());
+               (first_real_data + 5)->valid = 1;
+               (first_real_data + 5)->realserver_port = port6;
+               (first_real_data + 5)->last_time = last_time6;
+
     cout << "[35]------------------------------------------" << endl;
                // unit_test[35] パラメータがNULLの場合、戻り値が異常(-1)で設定する。
                result = 10;
@@ -1372,6 +1425,32 @@ public:
                it1 = this->session_endpoint_map.begin();
                BOOST_CHECK_EQUAL(it1->second.address().to_string(), realserver_ipv6_ip1);
                BOOST_CHECK_EQUAL(it1->second.port(), port1);
+
+       cout << "[43]------------------------------------------" << endl;
+               // unit_test[43] session_idが"00000000000000000000000000000000"の場合、取得のデータが正しいです。
+               result = 10;
+               this->maxlist = 1;
+               this->session_endpoint_map.clear();
+               this->session_lasttime_map.clear();
+               this->lasttime_session_map.clear();
+               result = this->read_session_data_from_replication_area(first_real_data + 5);
+               it1 = this->session_endpoint_map.begin();
+               it2 = this->session_lasttime_map.begin();
+               it3 = this->lasttime_session_map.begin();
+               BOOST_CHECK_EQUAL(result, 0);
+               // session_endpoint_map check
+               BOOST_CHECK_EQUAL(this->session_endpoint_map.size(), 1u);
+               BOOST_CHECK_EQUAL(it1->first, session_id6);
+               BOOST_CHECK_EQUAL(it1->second.address().to_string(), realserver_ip6);
+               BOOST_CHECK_EQUAL(it1->second.port(), port6);
+               // session_lasttime_map check(only maxlist
+               BOOST_CHECK_EQUAL(this->session_lasttime_map.size(), 1u);
+               BOOST_CHECK_EQUAL(it2->first, session_id6);
+               BOOST_CHECK_EQUAL(it2->second, last_time6);
+               // lasttime_session_map check
+               BOOST_CHECK_EQUAL(this->lasttime_session_map.size(), 1u);
+               BOOST_CHECK_EQUAL(it3->first, last_time6);
+               BOOST_CHECK_EQUAL(it3->second, session_id6);
        }
 };
 
index 74547a3..99c6f0d 100644 (file)
@@ -1,3 +1,27 @@
+/*
+ * @file  sslid_to_be_test_file.h
+ * @brief sslid test header file.
+ *
+ * L7VSD: Linux Virtual Server for Layer7 Load Balancing
+ * Copyright (C) 2009  NTT COMWARE Corporation.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA
+ *
+ **********************************************************************/
+
 #ifndef SSLID_TO_BE_TEST_FILE_H_
 #define SSLID_TO_BE_TEST_FILE_H_
 
index a3301ab..7d0ed42 100755 (executable)
@@ -1,3 +1,27 @@
+/*
+ * @file  sslid_ut.cpp
+ * @brief sslid test main file.
+ *
+ * L7VSD: Linux Virtual Server for Layer7 Load Balancing
+ * Copyright (C) 2009  NTT COMWARE Corporation.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA
+ *
+ **********************************************************************/
+
 #include <boost/test/included/unit_test.hpp>
 
 #include "protocol_module_sslid_test.cpp"