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__ );
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__ );
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__ );
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;
}
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------*/
{
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;
}
{
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------*/
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;
}
/*-------- 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------*/
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;
{
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;
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;
}
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------*/
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------*/
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;
}
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;
}
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;
}
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;
}
"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__ );
"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__ );
//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
//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 --------*/
{
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------*/
{
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------*/
{
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------*/
{
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------*/
"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__ );
{
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------*/
{
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------*/
{
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------*/
{
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------*/
"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__ );
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------*/
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;
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;
}
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------*/
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------*/
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;
}
{
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------*/
/*-------- 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;
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;
{
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;
}
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------*/
"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------*/
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;
}
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;
}
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;
}
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;
}
{
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------*/
{
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------*/
/*-------- 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)
/*-------- 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------*/
}
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;
{
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;
}
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------*/
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;
}
/*-------- 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;
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;
{
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;
}
{
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------*/
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;
}
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;
}
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;
}
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;
}
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;
{
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;
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;
}
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------*/
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;
}
//set sorry_endpoint
session_data->target_endpoint = sorry_endpoint;
- status = SORRYSERVER_CONNECT;
+ status = CLIENT_RECV;
}
catch (int e)
{
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;
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;
}
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------*/
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;
}
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;
}
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;
}
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;
}
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------*/
{
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------*/
{
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------*/
/*-------- 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)
/*-------- 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------*/
}
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;
{
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;
}
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------*/
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;
}
/*-------- 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------*/
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;
{
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;
}
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------*/
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;
}
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;
}
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;
}
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;
}
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;
{
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;
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;
}
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------*/
"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------*/
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())
{
"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------*/
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;
}
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;
}
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;
}
"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__ );
"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__ );
//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
//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 --------*/
{
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------*/
{
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------*/
{
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------*/
{
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------*/
"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__ );
{
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------*/
{
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------*/
{
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------*/
{
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------*/
"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__ );
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------*/
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;
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;
}
"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------*/
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())
"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------*/
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;
}
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;
}
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;
}
"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__ );
"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__ );
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())
{
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())
//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
//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 --------*/
{
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------*/
{
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------*/
{
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------*/
{
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------*/
"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__ );
{
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------*/
{
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------*/
{
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------*/
{
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------*/
"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__ );
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------*/
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;
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;
}
"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------*/
{
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------*/
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;
}
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;
}
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;
}
/*------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;
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------*/
{
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;
}
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------*/
"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------*/
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;
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;
}
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
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;
}
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------*/
{
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;
}
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------*/
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------*/
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;
}
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;
+ }
}
}
}
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;
{
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;
}
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------*/
"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;
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
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)
{
}
}
}
- //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)
{
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;
{
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;
}
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------*/
"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
{
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;
}
/*-------- 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;
/*-------- 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
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;
{
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;
}
{
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------*/
"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
{
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;
}
/*-------- 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;
/*-------- 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
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;
{
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;
}
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------*/
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;
}
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;
}
{
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------*/
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;
}
{
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;
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;
}
"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------*/
{
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 --------*/
{
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------*/
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;
}
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;
}
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;
}
/*-------- 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------*/
/*-------- 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------*/
}
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------*/
{
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;
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;
}
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------*/
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;
}
/*-------- 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------*/
/*-------- 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------*/
/*-------- 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------*/
}
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------*/
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------*/
/*-------- 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------*/
}
/*-------- 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------*/
/*-------- 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------*/
}
/*-------- 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------*/
}
/*-------- 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------*/
}
/*-------- 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------*/
}
/*-------- 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------*/
}
{
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__);
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__);
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------*/
"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------*/
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
{
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;
}
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------*/
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------*/
/*-------- 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------*/
}
{
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;
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;
}
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------*/
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------*/
/*-------- 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------*/
/*-------- 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------*/
}
{
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;
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;
}
{
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------*/
{
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------*/
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------*/
{
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------*/
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------*/
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())
{
"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------*/
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())
{
"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------*/
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())
"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------*/
/*-------- 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------*/
/*-------- 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------*/
}
{
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;
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;
}
"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------*/
"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------*/
"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------*/
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------*/
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())
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------*/
"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------*/
/*-------- 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------*/
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
/*-------- 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------*/
}
{
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;
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;
}
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------*/
"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------*/
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------*/
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------*/
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------*/
{
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------*/
/*-------- 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------*/
{
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;
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;
}
{
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------*/
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------*/
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------*/
{
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------*/
{
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------*/
{
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------*/
/*-------- 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)
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------*/
}
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------*/
/*-------- 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
/*-------- 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------*/
/*-------- 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------*/
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------*/
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
+/*
+ * @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;
// 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,
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,
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());
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;
// 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,
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());
}
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));
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
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';
// 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';
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';
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();
}
}
- 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;
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;
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;
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;
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;
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;
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();
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();
}
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();
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);
// 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);
// 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);
// 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';
// 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';
// 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);
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();
// 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();
// 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);
// 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';
// 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;
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
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);
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);
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;
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);
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);
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;
// 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);
// 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();
// 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);
}