namespace l7vs
{
const std::string protocol_module_sslid::MODULE_NAME = "sslid";
-const int protocol_module_sslid::REALSERVER_CONNECT_FAILED_MAX_COUNT = 3;
const int protocol_module_sslid::THREAD_DIVISION_UP_STREAM = 0; // up thread
const int protocol_module_sslid::THREAD_DIVISION_DOWN_STREAM = 1; // down thread
const int protocol_module_sslid::END_FLAG_ON = 1; // end flag ON
//! constructor
protocol_module_sslid::protocol_module_sslid()
:ssl_protocol_module_base(MODULE_NAME),
- realserver_connect_failed_max_count(REALSERVER_CONNECT_FAILED_MAX_COUNT),
replication_data_processor(NULL),
session_data_processor(NULL)
{
return result;
}
+//! get option info
+//! @param[out] module paramter string
+void protocol_module_sslid::get_option_info(std::string& option)
+{
+ /*-------- DEBUG LOG --------*/
+ if (unlikely(LOG_LV_DEBUG == getloglevel()))
+ {
+ putLogDebug(300030, "in_function : void protocol_module_sslid::get_option_info("
+ "std::string& option).", __FILE__, __LINE__);
+ }
+ /*------DEBUG LOG END------*/
+
+ boost::format option_formatter("--timeout %d --maxlist %d %s");
+ option_formatter % timeout % maxlist % (reschedule ? "--reschedule" : "--no-reschedule");
+ option.assign(option_formatter.str());
+
+ /*-------- DEBUG LOG --------*/
+ if (unlikely(LOG_LV_DEBUG == getloglevel()))
+ {
+ boost::format formatter("out_function : void protocol_module_sslid::get_option_info("
+ "std::string& option) : option = %s.");
+ formatter % option;
+ putLogDebug(300031, formatter.str(), __FILE__, __LINE__);
+ }
+ /*------DEBUG LOG END------*/
+}
+
//! realserver list update event
void protocol_module_sslid::handle_rslist_update()
{
/*-------- DEBUG LOG --------*/
if (unlikely(LOG_LV_DEBUG == getloglevel()))
{
- putLogDebug(300030, "in/out_function : void protocol_module_sslid::handle_rslist_update().",
+ putLogDebug(300032, "in/out_function : void protocol_module_sslid::handle_rslist_update().",
__FILE__, __LINE__);
}
/*------DEBUG LOG END------*/
/*-------- DEBUG LOG --------*/
if (unlikely(LOG_LV_DEBUG == getloglevel()))
{
- putLogDebug(300031, "in_function : void protocol_module_sslid::register_schedule("
+ putLogDebug(300033, "in_function : void protocol_module_sslid::register_schedule("
"tcp_schedule_func_type inschedule).", __FILE__, __LINE__);
}
/*------DEBUG LOG END------*/
/*-------- DEBUG LOG --------*/
if (unlikely(LOG_LV_DEBUG == getloglevel()))
{
- putLogDebug(300032, "out_function : void protocol_module_sslid::register_schedule("
+ putLogDebug(300034, "out_function : void protocol_module_sslid::register_schedule("
"tcp_schedule_func_type inschedule).", __FILE__, __LINE__);
}
/*------DEBUG LOG END------*/
/*-------- DEBUG LOG --------*/
if (unlikely(LOG_LV_DEBUG == getloglevel()))
{
- putLogDebug(300033, "in/out_function : void protocol_module_sslid::register_schedule("
+ putLogDebug(300035, "in/out_function : void protocol_module_sslid::register_schedule("
"udp_schedule_func_type inschedule).", __FILE__, __LINE__);
}
/*------DEBUG LOG END------*/
"const boost::asio::ip::udp::endpoint& client_endpoint_udp) : "
"up_thread_id = %d, down_thread_id = %d.");
formatter % up_thread_id % down_thread_id;
- putLogDebug(300034, formatter.str(), __FILE__, __LINE__);
+ putLogDebug(300036, formatter.str(), __FILE__, __LINE__);
}
/*------DEBUG LOG END------*/
{
boost::format formatter("new : address = &(%d), size = %lu.");
formatter % static_cast<void*>(threaddata_up.get()) % sizeof(session_thread_data_sslid);
- putLogDebug(300035, formatter.str(), __FILE__, __LINE__);
+ putLogDebug(300037, formatter.str(), __FILE__, __LINE__);
}
/*------DEBUG LOG END------*/
// initialize the up/down thread data
- threaddata_up->realserver_connect_failed_count = 0;
threaddata_up->data_begain_offset = 0;
threaddata_up->data_size = 0;
threaddata_up->current_record_rest_size = 0;
// data dump
boost::format formatter("function : protocol_module_base::EVENT_TAG protocol_module_sslid::"
"handle_session_initialize() : session_thread_data_sslid(upthread) : "
- "realserver_connect_failed_count = %d, data_begain_offset = %d, "
+ "data_begain_offset = %d, "
"data_size = %d, current_record_rest_size = %d, hello_message_flag = %d, "
"end_flag = %d, thread_division = %d, pair_thread_id = %d.");
- formatter % threaddata_up->realserver_connect_failed_count
- % threaddata_up->data_begain_offset
+ formatter % threaddata_up->data_begain_offset
% threaddata_up->data_size
% threaddata_up->current_record_rest_size
% threaddata_up->hello_message_flag
% threaddata_up->end_flag
% threaddata_up->thread_division
% threaddata_up->pair_thread_id;
- putLogDebug(300036, formatter.str(), __FILE__, __LINE__);
+ putLogDebug(300038, formatter.str(), __FILE__, __LINE__);
}
/*------DEBUG LOG END------*/
{
boost::format formatter("new : address = &(%d), size = %lu.");
formatter % static_cast<void*>(threaddata_down.get()) % sizeof(session_thread_data_sslid);
- putLogDebug(300037, formatter.str(), __FILE__, __LINE__);
+ putLogDebug(300039, formatter.str(), __FILE__, __LINE__);
}
/*------DEBUG LOG END------*/
- threaddata_down->realserver_connect_failed_count = 0;
threaddata_down->data_begain_offset = 0;
threaddata_down->data_size = 0;
threaddata_down->current_record_rest_size = 0;
// data_dump
boost::format formatter("function : protocol_module_base::EVENT_TAG protocol_module_sslid::"
"handle_session_initialize() : session_thread_data_sslid(downthread) : "
- "realserver_connect_failed_count = %d, data_begain_offset = %d, "
+ "data_begain_offset = %d, "
"data_size = %d, current_record_rest_size = %d, hello_message_flag = %d, "
"end_flag = %d, thread_division = %d, pair_thread_id = %d.");
- formatter % threaddata_down->realserver_connect_failed_count
- % threaddata_down->data_begain_offset
+ formatter % threaddata_down->data_begain_offset
% threaddata_down->data_size
% threaddata_down->current_record_rest_size
% threaddata_down->hello_message_flag
% threaddata_down->end_flag
% threaddata_down->thread_division
% threaddata_down->pair_thread_id;
- putLogDebug(300038, formatter.str(), __FILE__, __LINE__);
+ putLogDebug(300040, formatter.str(), __FILE__, __LINE__);
}
/*------DEBUG LOG END------*/
"const boost::asio::ip::udp::endpoint& client_endpoint_udp) : return_value = %d. "
"thread id : %d.");
formatter % status % boost::this_thread::get_id();
- putLogDebug(300039, formatter.str(), __FILE__, __LINE__);
+ putLogDebug(300041, formatter.str(), __FILE__, __LINE__);
}
/*------DEBUG LOG END------*/
"const boost::thread::id down_thread_id) : "
"up_thread_id = %d, down_thread_id = %d.");
formatter % up_thread_id % down_thread_id;
- putLogDebug(300040, formatter.str(), __FILE__, __LINE__);
+ putLogDebug(300042, formatter.str(), __FILE__, __LINE__);
}
/*------DEBUG LOG END------*/
{
boost::format formatter("delete : address = &(%d).");
formatter % static_cast<void*>(itthread->second.get());
- putLogDebug(300041, formatter.str(), __FILE__, __LINE__);
+ putLogDebug(300043, formatter.str(), __FILE__, __LINE__);
}
/*------DEBUG LOG END------*/
session_thread_data_map.erase(itthread);
{
boost::format formatter("delete : address = &(%d).");
formatter % static_cast<void*>(itthread->second.get());
- putLogDebug(300042, formatter.str(), __FILE__, __LINE__);
+ putLogDebug(300044, formatter.str(), __FILE__, __LINE__);
}
/*------DEBUG LOG END------*/
session_thread_data_map.erase(itthread);
"handle_session_finalize(const boost::thread::id up_thread_id, "
"const boost::thread::id down_thread_id) : return_value = %d. thread id : %d.");
formatter % STOP % boost::this_thread::get_id();
- putLogDebug(300043, formatter.str(), __FILE__, __LINE__);
+ putLogDebug(300045, formatter.str(), __FILE__, __LINE__);
}
/*------DEBUG LOG END------*/
boost::format formatter("in/out_function : protocol_module_base::EVENT_TAG protocol_module_sslid::"
"handle_accept(const boost::thread::id thread_id) : thread_id = %d, return_value = %d.");
formatter % thread_id % CLIENT_RECV;
- putLogDebug(300044, formatter.str(), __FILE__, __LINE__);
+ putLogDebug(300046, formatter.str(), __FILE__, __LINE__);
}
/*------DEBUG LOG END------*/
"const boost::array<char,MAX_BUFFER_SIZE>& recvbuffer, "
"const size_t recvlen) : thread_id = %d, recvbuffer = %s, recvlen = %d.");
formatter % thread_id % buffer % recvlen;
- putLogDebug(300045, formatter.str(), __FILE__, __LINE__);
+ putLogDebug(300047, formatter.str(), __FILE__, __LINE__);
}
/*------DEBUG LOG END------*/
"handle_client_recv() : before memmove (data dump) : "
"data begin = %d, data_size = %d, data = %s");
formatter % threaddata->data_begain_offset % threaddata->data_size % datadump;
- putLogDebug(300046, formatter.str(), __FILE__, __LINE__);
+ putLogDebug(300048, formatter.str(), __FILE__, __LINE__);
}
/*------DEBUG LOG END------*/
"handle_client_recv() : after memmove (data dump) : "
"data begin = 0, data_size = %d, data = %s");
formatter % threaddata->data_size % datadump;
- putLogDebug(300047, formatter.str(), __FILE__, __LINE__);
+ putLogDebug(300049, formatter.str(), __FILE__, __LINE__);
}
/*------DEBUG LOG END------*/
}
"handle_client_recv() : before memcpy (data dump) : "
"data begin = 0, data_size = %d, data = %s");
formatter % recvlen % datadump;
- putLogDebug(300048, formatter.str(), __FILE__, __LINE__);
+ putLogDebug(300050, formatter.str(), __FILE__, __LINE__);
}
/*------DEBUG LOG END------*/
"handle_client_recv() : after memcpy (data dump) : "
"data begin = 0, data_size = %d, data = %s");
formatter % recvlen % datadump;
- putLogDebug(300049, formatter.str(), __FILE__, __LINE__);
+ putLogDebug(300051, formatter.str(), __FILE__, __LINE__);
}
/*------DEBUG LOG END------*/
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(300050, formatter.str(), __FILE__, __LINE__);
+ putLogDebug(300052, formatter.str(), __FILE__, __LINE__);
}
/*------DEBUG LOG END------*/
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(300051, formatter.str(), __FILE__, __LINE__);
+ putLogDebug(300053, formatter.str(), __FILE__, __LINE__);
}
/*------DEBUG LOG END------*/
}
boost::format formatter("function : protocol_module_base::EVENT_TAG protocol_module_sslid::"
"handle_client_recv() : catch exception e = %d. thread id : %d.");
formatter % e % boost::this_thread::get_id();
- putLogDebug(300052, formatter.str(), __FILE__, __LINE__);
+ putLogDebug(300054, formatter.str(), __FILE__, __LINE__);
}
/*------DEBUG LOG END------*/
status = FINALIZE;
"const boost::array<char,MAX_BUFFER_SIZE>& recvbuffer, "
"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(300053, formatter.str(), __FILE__, __LINE__);
+ putLogDebug(300055, formatter.str(), __FILE__, __LINE__);
}
/*------DEBUG LOG END------*/
"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(300054, formatter.str(), __FILE__, __LINE__);
+ putLogDebug(300056, formatter.str(), __FILE__, __LINE__);
}
/*------DEBUG LOG END------*/
"handle_realserver_select(const boost::thread::id thread_id, "
"boost::asio::ip::tcp::endpoint& rs_endpoint) : return_value = %d. thread id : %d.");
formatter % FINALIZE % boost::this_thread::get_id();
- putLogDebug(300055, formatter.str(), __FILE__, __LINE__);
+ putLogDebug(300057, formatter.str(), __FILE__, __LINE__);
}
/*------DEBUG LOG END------*/
putLogInfo(300000, "Realserver decision failure. ", __FILE__, __LINE__);
threaddata = it->second;
}
- if (threaddata->realserver_connect_failed_count <= 0)
+ // the first connection or connected successful
+ if (realserver_selected(threaddata->selected_realserver))
{
- // the first connection or connected successful
- if (realserver_selected(threaddata->selected_realserver))
+ /*-------- DEBUG LOG --------*/
+ if (unlikely(LOG_LV_DEBUG == getloglevel()))
{
- /*-------- DEBUG LOG --------*/
- if (unlikely(LOG_LV_DEBUG == getloglevel()))
- {
- 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(300056, formatter.str(), __FILE__, __LINE__);
- }
- /*------DEBUG LOG END------*/
+ 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(300058, formatter.str(), __FILE__, __LINE__);
+ }
+ /*------DEBUG LOG END------*/
- // realserver already connected
- rs_endpoint = threaddata->selected_realserver;
- status = REALSERVER_CONNECT;
+ // realserver already connected
+ rs_endpoint = threaddata->selected_realserver;
+ status = REALSERVER_CONNECT;
+ }
+ else
+ {
+ /*-------- DEBUG LOG --------*/
+ if (unlikely(LOG_LV_DEBUG == getloglevel()))
+ {
+ 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(300059, formatter.str(), __FILE__, __LINE__);
}
- else
+ /*------DEBUG LOG END------*/
+
+ // first connection
+ if (!threaddata->hello_message_flag)
{
+ // the first connection, the theaddata must be hellomessage
+ threaddata->end_flag = END_FLAG_ON;
+ status = FINALIZE;
/*-------- DEBUG LOG --------*/
if (unlikely(LOG_LV_DEBUG == getloglevel()))
{
boost::format formatter("function : protocol_module_base::EVENT_TAG protocol_module_sslid::"
- "handle_realserver_select() end. thread id : %d.");
+ "handle_realserver_select() : END_FLAG_ON. thread id : %d.");
formatter % boost::this_thread::get_id();
- putLogDebug(300057, formatter.str(), __FILE__, __LINE__);
+ putLogDebug(300060, formatter.str(), __FILE__, __LINE__);
}
/*------DEBUG LOG END------*/
-
- // first connection
- if (!threaddata->hello_message_flag)
+ }
+ else
+ {
+ // get sessionid from the data buffer
+ std::string session_id;
+ if (get_ssl_session_id(threaddata->data_buffer.data()+threaddata->data_begain_offset,
+ threaddata->data_size, session_id) == -1)
{
- // the first connection, the theaddata must be hellomessage
- threaddata->end_flag = END_FLAG_ON;
- status = FINALIZE;
/*-------- DEBUG LOG --------*/
if (unlikely(LOG_LV_DEBUG == getloglevel()))
{
- 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(300058, formatter.str(), __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. "
+ "thread id : %d.");
+ formatter % FINALIZE % boost::this_thread::get_id();
+ putLogDebug(300061, formatter.str(), __FILE__, __LINE__);
}
/*------DEBUG LOG END------*/
- }
- else
- {
- // get sessionid from the data buffer
- std::string session_id;
- if (get_ssl_session_id(threaddata->data_buffer.data()+threaddata->data_begain_offset,
- threaddata->data_size, session_id) == -1)
- {
- /*-------- DEBUG LOG --------*/
- if (unlikely(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. "
- "thread id : %d.");
- formatter % FINALIZE % boost::this_thread::get_id();
- putLogDebug(300059, formatter.str(), __FILE__, __LINE__);
- }
- /*------DEBUG LOG END------*/
- putLogInfo(300001, "Realserver decision failure.", __FILE__, __LINE__);
+ putLogInfo(300001, "Realserver decision failure.", __FILE__, __LINE__);
- threaddata->end_flag = END_FLAG_ON;
- return FINALIZE;
- }
+ threaddata->end_flag = END_FLAG_ON;
+ return FINALIZE;
+ }
- /*-------- DEBUG LOG --------*/
- if (unlikely(LOG_LV_DEBUG == getloglevel()))
- {
- 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. "
- "thread id : %d.");
- formatter % buffer % boost::this_thread::get_id();
- putLogDebug(300060, formatter.str(), __FILE__, __LINE__);
- }
- /*------DEBUG LOG END------*/
+ /*-------- DEBUG LOG --------*/
+ if (unlikely(LOG_LV_DEBUG == getloglevel()))
+ {
+ 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. "
+ "thread id : %d.");
+ formatter % buffer % boost::this_thread::get_id();
+ putLogDebug(300062, formatter.str(), __FILE__, __LINE__);
+ }
+ /*------DEBUG LOG END------*/
- if (session_id.empty())
+ if (session_id.empty())
+ {
+ // no session id in hellomesseage
+ // schedule the endpoint
+ boost::asio::ip::tcp::endpoint temp_endpoint;
+ boost::asio::ip::tcp::endpoint comp_endpoint; // for compare the endpoint
+ schedule_tcp(thread_id, rs_list_begin, rs_list_end, rs_list_next, temp_endpoint);
+ if (temp_endpoint != comp_endpoint)
{
- // no session id in hellomesseage
- // schedule the endpoint
- boost::asio::ip::tcp::endpoint temp_endpoint;
- boost::asio::ip::tcp::endpoint comp_endpoint; // for compare the endpoint
- schedule_tcp(thread_id, rs_list_begin, rs_list_end, rs_list_next, temp_endpoint);
- if (temp_endpoint != comp_endpoint)
- {
- // success for get the endpoint by reschedule
- threaddata->selected_realserver = temp_endpoint;
- rs_endpoint = temp_endpoint;
- status = REALSERVER_CONNECT;
- }
- else
- {
- // failed to get the endpoint by reschedule
- // set end_flag ON, and turn the status to CLIENT_DISCONNECT
- threaddata->end_flag = END_FLAG_ON;
- status = CLIENT_DISCONNECT;
- /*-------- DEBUG LOG --------*/
- if (unlikely(LOG_LV_DEBUG == getloglevel()))
- {
- 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(300061, formatter.str(), __FILE__, __LINE__);
- }
- /*------DEBUG LOG END------*/
- }
+ // success for get the endpoint by reschedule
+ threaddata->selected_realserver = temp_endpoint;
+ rs_endpoint = temp_endpoint;
+ status = REALSERVER_CONNECT;
}
else
{
- // the session id is in the hellomessage
- // try to get the endpoint from session data by session id
- int ret = session_data_processor->get_endpoint_from_session_data(
- session_id,
- threaddata->selected_realserver);
+ // failed to get the endpoint by reschedule
+ // set end_flag ON, and turn the status to CLIENT_DISCONNECT
+ threaddata->end_flag = END_FLAG_ON;
+ status = CLIENT_DISCONNECT;
/*-------- DEBUG LOG --------*/
if (unlikely(LOG_LV_DEBUG == getloglevel()))
{
boost::format formatter("function : protocol_module_base::EVENT_TAG "
"protocol_module_sslid::handle_realserver_select() : "
- "get_endpoint_from_session_data() end. thread id : %d.");
+ "END_FLAG_ON. thread id : %d.");
formatter % boost::this_thread::get_id();
- putLogDebug(300062, formatter.str(), __FILE__, __LINE__);
+ putLogDebug(300063, formatter.str(), __FILE__, __LINE__);
}
/*------DEBUG LOG END------*/
-
- if (ret == 0)
- {
- //find the rs_endpoint in the rs_list
- rs_list_lock();
-
- rs_list_itr = rs_list_begin();
- int is_match = 0;
-
- while (rs_list_itr != rs_list_end())
- {
- if (rs_list_itr->tcp_endpoint == threaddata->selected_realserver)
- {
- is_match = 1;
- break;
- }
-
- rs_list_itr = rs_list_next(rs_list_itr);
- }
-
- if (is_match)
- {
- // get the endpoint successfully
- rs_endpoint = threaddata->selected_realserver;
- status = REALSERVER_CONNECT;
+ }
}
else
{
- // failed to get the endpoint
- if (reschedule == 1)
- {
- // reschedule mode
- boost::asio::ip::tcp::endpoint temp_endpoint;
- boost::asio::ip::tcp::endpoint comp_endpoint; // for compare the endpoint
- schedule_tcp(thread_id, rs_list_begin, rs_list_end, rs_list_next, temp_endpoint);
- if (temp_endpoint != comp_endpoint)
- {
- // get the endpoint by reschedule successfully
- threaddata->selected_realserver = temp_endpoint;
- rs_endpoint = temp_endpoint;
- status = REALSERVER_CONNECT;
- }
- else
- {
- // failed to get the endpoint by reschedule
- // set end_flag ON, and set the status CLIENT_DISCONNECT
- threaddata->end_flag = END_FLAG_ON;
- status = CLIENT_DISCONNECT;
+ // the session id is in the hellomessage
+ // try to get the endpoint from session data by session id
+ int ret = session_data_processor->get_endpoint_from_session_data(
+ session_id,
+ threaddata->selected_realserver);
/*-------- DEBUG LOG --------*/
if (unlikely(LOG_LV_DEBUG == getloglevel()))
{
boost::format formatter("function : protocol_module_base::EVENT_TAG "
- "protocol_module_sslid::handle_realserver_select() : "
- "END_FLAG_ON. thread id : %d.");
+ "protocol_module_sslid::handle_realserver_select() : "
+ "get_endpoint_from_session_data() end. thread id : %d.");
formatter % boost::this_thread::get_id();
- putLogDebug(300063, formatter.str(), __FILE__, __LINE__);
+ putLogDebug(300064, formatter.str(), __FILE__, __LINE__);
}
/*------DEBUG LOG END------*/
- }
- }
- else
- {
- // no reschedule mode
- // set end_flag ON and disconnect the client
- threaddata->end_flag = END_FLAG_ON;
- status = CLIENT_DISCONNECT;
- /*-------- DEBUG LOG --------*/
- if (unlikely(LOG_LV_DEBUG == getloglevel()))
+
+ if (ret == 0)
{
- 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(300064, formatter.str(), __FILE__, __LINE__);
- }
- /*------DEBUG LOG END------*/
- }
- }
- }
- else
- {
- // failed to get the endpoint
- if (reschedule == 1)
- {
- // reschedule mode
- boost::asio::ip::tcp::endpoint temp_endpoint;
- boost::asio::ip::tcp::endpoint comp_endpoint; // for compare the endpoint
- schedule_tcp(thread_id, rs_list_begin, rs_list_end, rs_list_next, temp_endpoint);
- if (temp_endpoint != comp_endpoint)
- {
- // get the endpoint by reschedule successfully
- threaddata->selected_realserver = temp_endpoint;
- rs_endpoint = temp_endpoint;
- status = REALSERVER_CONNECT;
- }
- else
- {
- // failed to get the endpoint by reschedule
- // set end_flag ON, and set the status CLIENT_DISCONNECT
- threaddata->end_flag = END_FLAG_ON;
- status = CLIENT_DISCONNECT;
- /*-------- DEBUG LOG --------*/
- if (unlikely(LOG_LV_DEBUG == getloglevel()))
- {
- 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(300065, formatter.str(), __FILE__, __LINE__);
- }
- /*------DEBUG LOG END------*/
- }
- }
- else
- {
- // no reschedule mode
- // set end_flag ON and disconnect the client
- threaddata->end_flag = END_FLAG_ON;
- status = CLIENT_DISCONNECT;
- /*-------- DEBUG LOG --------*/
- if (unlikely(LOG_LV_DEBUG == getloglevel()))
- {
- 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(300066, formatter.str(), __FILE__, __LINE__);
- }
- /*------DEBUG LOG END------*/
- }
- }
- }
- }
+ //find the rs_endpoint in the rs_list
+ rs_list_lock();
+
+ rs_list_itr = rs_list_begin();
+ int is_match = 0;
+
+ while (rs_list_itr != rs_list_end())
+ {
+ if (rs_list_itr->tcp_endpoint == threaddata->selected_realserver)
+ {
+ is_match = 1;
+ break;
}
- }
- else if (threaddata->realserver_connect_failed_count < realserver_connect_failed_max_count)
- {
- // try multi times connect
+
+ rs_list_itr = rs_list_next(rs_list_itr);
+ }
+
+ if (is_match)
+ {
+ // get the endpoint successfully
+ rs_endpoint = threaddata->selected_realserver;
+ status = REALSERVER_CONNECT;
+ }
+ else
+ {
+ // failed to get the endpoint
if (reschedule == 1)
{
// reschedule mode
schedule_tcp(thread_id, rs_list_begin, rs_list_end, rs_list_next, temp_endpoint);
if (temp_endpoint != comp_endpoint)
{
- // get the endpoint by reschedule successfully
- threaddata->selected_realserver = temp_endpoint;
- rs_endpoint = temp_endpoint;
- status = REALSERVER_CONNECT;
+ // get the endpoint by reschedule successfully
+ threaddata->selected_realserver = temp_endpoint;
+ rs_endpoint = temp_endpoint;
+ status = REALSERVER_CONNECT;
}
else
{
- // failed to get the endpoint by reschedule
- // set end_flag ON, and set the status CLIENT_DISCONNECT
- threaddata->end_flag = END_FLAG_ON;
- status = CLIENT_DISCONNECT;
- /*-------- DEBUG LOG --------*/
- if (unlikely(LOG_LV_DEBUG == getloglevel()))
- {
- 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(300067, formatter.str(), __FILE__, __LINE__);
- }
- /*------DEBUG LOG END------*/
+ // failed to get the endpoint by reschedule
+ // set end_flag ON, and set the status CLIENT_DISCONNECT
+ threaddata->end_flag = END_FLAG_ON;
+ status = CLIENT_DISCONNECT;
+ /*-------- DEBUG LOG --------*/
+ if (unlikely(LOG_LV_DEBUG == getloglevel()))
+ {
+ 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(300065, formatter.str(), __FILE__, __LINE__);
+ }
+ /*------DEBUG LOG END------*/
}
}
else
/*-------- DEBUG LOG --------*/
if (unlikely(LOG_LV_DEBUG == getloglevel()))
{
- 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(300068, formatter.str(), __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(300066, formatter.str(), __FILE__, __LINE__);
}
/*------DEBUG LOG END------*/
}
- }
- else
- {
- // connect failed
- // set end_flag ON and disconnect the client
- threaddata->end_flag = END_FLAG_ON;
- status = CLIENT_DISCONNECT;
- /*-------- DEBUG LOG --------*/
- if (unlikely(LOG_LV_DEBUG == getloglevel()))
- {
- 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(300069, formatter.str(), __FILE__, __LINE__);
}
- /*------DEBUG LOG END------*/
+ }
+ else
+ {
+ // failed to get the endpoint
+ if (reschedule == 1)
+ {
+ // reschedule mode
+ boost::asio::ip::tcp::endpoint temp_endpoint;
+ boost::asio::ip::tcp::endpoint comp_endpoint; // for compare the endpoint
+ schedule_tcp(thread_id, rs_list_begin, rs_list_end, rs_list_next, temp_endpoint);
+ if (temp_endpoint != comp_endpoint)
+ {
+ // get the endpoint by reschedule successfully
+ threaddata->selected_realserver = temp_endpoint;
+ rs_endpoint = temp_endpoint;
+ status = REALSERVER_CONNECT;
+ }
+ else
+ {
+ // failed to get the endpoint by reschedule
+ // set end_flag ON, and set the status CLIENT_DISCONNECT
+ threaddata->end_flag = END_FLAG_ON;
+ status = CLIENT_DISCONNECT;
+ /*-------- DEBUG LOG --------*/
+ if (unlikely(LOG_LV_DEBUG == getloglevel()))
+ {
+ 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(300067, formatter.str(), __FILE__, __LINE__);
+ }
+ /*------DEBUG LOG END------*/
+ }
+ }
+ else
+ {
+ // no reschedule mode
+ // set end_flag ON and disconnect the client
+ threaddata->end_flag = END_FLAG_ON;
+ status = CLIENT_DISCONNECT;
+ /*-------- DEBUG LOG --------*/
+ if (unlikely(LOG_LV_DEBUG == getloglevel()))
+ {
+ 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(300068, formatter.str(), __FILE__, __LINE__);
+ }
+ /*------DEBUG LOG END------*/
+ }
+ }
+ }
+ }
}
}
catch (const std::exception& e)
"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() % boost::this_thread::get_id();
- putLogDebug(300070, formatter.str(), __FILE__, __LINE__);
+ putLogDebug(300069, formatter.str(), __FILE__, __LINE__);
}
/*------DEBUG LOG END------*/
"boost::array<char,MAX_BUFFER_SIZE>& sendbuffer, size_t& datalen) : "
"return_value = %d. thread id : %d.");
formatter % STOP % boost::this_thread::get_id();
- putLogDebug(300071, formatter.str(), __FILE__, __LINE__);
+ putLogDebug(300070, formatter.str(), __FILE__, __LINE__);
}
/*------DEBUG LOG END------*/
return STOP;
"boost::array<char,MAX_BUFFER_SIZE>& sendbuffer, size_t& datalen) : "
"thread_id = %d.");
formatter % thread_id;
- putLogDebug(300072, formatter.str(), __FILE__, __LINE__);
+ putLogDebug(300071, formatter.str(), __FILE__, __LINE__);
}
/*------DEBUG LOG END------*/
putLogError(300038, formatter.str(), __FILE__, __LINE__);
status = FINALIZE;
}
- else
- {
- it->second->realserver_connect_failed_count = 0;
- }
}
}
catch (const std::exception& e)
"boost::array<char,MAX_BUFFER_SIZE>& sendbuffer, size_t& datalen) : "
"return_value = %d. thread id : %d.");
formatter % status % boost::this_thread::get_id();
- putLogDebug(300073, formatter.str(), __FILE__, __LINE__);
+ putLogDebug(300072, formatter.str(), __FILE__, __LINE__);
}
/*------DEBUG LOG END------*/
"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(300074, formatter.str(), __FILE__, __LINE__);
+ putLogDebug(300073, formatter.str(), __FILE__, __LINE__);
}
/*------DEBUG LOG END------*/
"const boost::asio::ip::tcp::endpoint& rs_endpoint) : return_value = %d. "
"thread id : %d.");
formatter % FINALIZE % boost::this_thread::get_id();
- putLogDebug(300075, formatter.str(), __FILE__, __LINE__);
+ putLogDebug(300074, formatter.str(), __FILE__, __LINE__);
}
/*------DEBUG LOG END------*/
return FINALIZE;
threaddata = it->second;
}
- if (reschedule == 1)
- {
- // reschedule mode
- ++threaddata->realserver_connect_failed_count;
- status = REALSERVER_SELECT;
- }
- else
- {
- // no reschedule mode
- // set end_flag ON
- threaddata->end_flag = END_FLAG_ON;
- status = CLIENT_DISCONNECT;
+ // no reschedule mode
+ // set end_flag ON
+ threaddata->end_flag = END_FLAG_ON;
+ status = CLIENT_DISCONNECT;
- /*-------- DEBUG LOG --------*/
- if (unlikely(LOG_LV_DEBUG == getloglevel()))
- {
+ /*-------- DEBUG LOG --------*/
+ if (unlikely(LOG_LV_DEBUG == getloglevel()))
+ {
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(300076, formatter.str(), __FILE__, __LINE__);
- }
- /*------DEBUG LOG END------*/
+ putLogDebug(300075, formatter.str(), __FILE__, __LINE__);
}
+ /*------DEBUG LOG END------*/
}
catch (const std::exception& e)
{
"const boost::asio::ip::tcp::endpoint& rs_endpoint) : "
"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(300077, formatter.str(), __FILE__, __LINE__);
+ putLogDebug(300076, formatter.str(), __FILE__, __LINE__);
}
/*------DEBUG LOG END------*/
boost::format formatter("in_function : protocol_module_base::EVENT_TAG protocol_module_sslid::"
"handle_realserver_send(const boost::thread::id thread_id) : thread_id = %d.");
formatter % thread_id;
- putLogDebug(300078, formatter.str(), __FILE__, __LINE__);
+ putLogDebug(300077, formatter.str(), __FILE__, __LINE__);
}
/*------DEBUG LOG END------*/
"handle_realserver_send(const boost::thread::id thread_id) : "
"return_value = %d. thread id : %d.");
formatter % FINALIZE % boost::this_thread::get_id();
- putLogDebug(300079, formatter.str(), __FILE__, __LINE__);
+ putLogDebug(300078, formatter.str(), __FILE__, __LINE__);
}
/*------DEBUG LOG END------*/
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(300080, formatter.str(), __FILE__, __LINE__);
+ putLogDebug(300079, formatter.str(), __FILE__, __LINE__);
}
/*------DEBUG LOG END------*/
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(300081, formatter.str(), __FILE__, __LINE__);
+ putLogDebug(300080, formatter.str(), __FILE__, __LINE__);
}
/*------DEBUG LOG END------*/
}
"handle_realserver_send(const boost::thread::id thread_id) : "
"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(300082, formatter.str(), __FILE__, __LINE__);
+ putLogDebug(300081, formatter.str(), __FILE__, __LINE__);
}
/*------DEBUG LOG END------*/
"handle_sorryserver_select(const boost::thread::id thread_id, "
"boost::asio::ip::tcp::endpoint& sorry_endpoint) : return_value = %d. thread id : %d.");
formatter % STOP % boost::this_thread::get_id();
- putLogDebug(300083, formatter.str(), __FILE__, __LINE__);
+ putLogDebug(300082, formatter.str(), __FILE__, __LINE__);
}
/*------DEBUG LOG END------*/
"boost::array<char,MAX_BUFFER_SIZE>& sendbuffer, size_t& datalen) : "
"return_value = %d. thread id : %d.");
formatter % STOP % boost::this_thread::get_id();
- putLogDebug(300084, formatter.str(), __FILE__, __LINE__);
+ putLogDebug(300083, formatter.str(), __FILE__, __LINE__);
}
/*------DEBUG LOG END------*/
"const boost::asio::ip::tcp::endpoint& sorry_endpoint) : return_value = %d. "
"thread id : %d.");
formatter % STOP % boost::this_thread::get_id();
- putLogDebug(300085, formatter.str(), __FILE__, __LINE__);
+ putLogDebug(300084, formatter.str(), __FILE__, __LINE__);
}
/*------DEBUG LOG END------*/
"handle_sorryserver_send(const boost::thread::id thread_id) : return_value = %d."
"thread id : %d.");
formatter % STOP % boost::this_thread::get_id();
- putLogDebug(300086, formatter.str(), __FILE__, __LINE__);
+ putLogDebug(300085, formatter.str(), __FILE__, __LINE__);
}
/*------DEBUG LOG END------*/
"recvbuffer = %s, recvlen = %d.");
formatter % thread_id % rs_endpoint.address().to_string() % rs_endpoint.port() %
buffer % recvlen;
- putLogDebug(300087, formatter.str(), __FILE__, __LINE__);
+ putLogDebug(300086, formatter.str(), __FILE__, __LINE__);
}
/*------DEBUG LOG END------*/
"const boost::array<char,MAX_BUFFER_SIZE>& recvbuffer, "
"const size_t recvlen) : return_value = %d. thread id : %d.");
formatter % FINALIZE % boost::this_thread::get_id();
- putLogDebug(300088, formatter.str(), __FILE__, __LINE__);
+ putLogDebug(300087, formatter.str(), __FILE__, __LINE__);
}
/*------DEBUG LOG END------*/
"const boost::array<char,MAX_BUFFER_SIZE>& recvbuffer, "
"const size_t recvlen) : return_value = %d. thread id : %d.");
formatter % FINALIZE % boost::this_thread::get_id();
- putLogDebug(300089, formatter.str(), __FILE__, __LINE__);
+ putLogDebug(300088, formatter.str(), __FILE__, __LINE__);
}
/*------DEBUG LOG END------*/
"const boost::array<char,MAX_BUFFER_SIZE>& recvbuffer, "
"const size_t recvlen) : return_value = %d. thread id : %d.");
formatter % FINALIZE % boost::this_thread::get_id();
- putLogDebug(300090, formatter.str(), __FILE__, __LINE__);
+ putLogDebug(300089, formatter.str(), __FILE__, __LINE__);
}
/*------DEBUG LOG END------*/
"handle_realserver_recv() : before memmove (data dump) : "
"data begin = %d, data_size = %d, data = %s");
formatter % threaddata->data_begain_offset % threaddata->data_size % datadump;
- putLogDebug(300091, formatter.str(), __FILE__, __LINE__);
+ putLogDebug(300090, formatter.str(), __FILE__, __LINE__);
}
/*------DEBUG LOG END------*/
"handle_realserver_recv() : after memmove (data dump) : "
"data begin = 0, data_size = %d, data = %s");
formatter % threaddata->data_size % datadump;
- putLogDebug(300092, formatter.str(), __FILE__, __LINE__);
+ putLogDebug(300091, formatter.str(), __FILE__, __LINE__);
}
/*------DEBUG LOG END------*/
}
"handle_realserver_recv() : before memcpy (data dump) : "
"data begin = 0, data_size = %d, data = %s");
formatter % recvlen % datadump;
- putLogDebug(300093, formatter.str(), __FILE__, __LINE__);
+ putLogDebug(300092, formatter.str(), __FILE__, __LINE__);
}
/*------DEBUG LOG END------*/
"handle_realserver_recv() : after memcpy (data dump) : "
"data begin = 0, data_size = %d, data = %s");
formatter % recvlen % datadump;
- putLogDebug(300094, formatter.str(), __FILE__, __LINE__);
+ putLogDebug(300093, formatter.str(), __FILE__, __LINE__);
}
/*------DEBUG LOG END------*/
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(300095, formatter.str(), __FILE__, __LINE__);
+ putLogDebug(300094, formatter.str(), __FILE__, __LINE__);
}
/*------DEBUG LOG END------*/
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(300096, formatter.str(), __FILE__, __LINE__);
+ putLogDebug(300095, formatter.str(), __FILE__, __LINE__);
}
/*------DEBUG LOG END------*/
}
"const boost::array<char,MAX_BUFFER_SIZE>& recvbuffer, "
"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(300097, formatter.str(), __FILE__, __LINE__);
+ putLogDebug(300096, formatter.str(), __FILE__, __LINE__);
}
/*------DEBUG LOG END------*/
"const boost::array<char,MAX_BUFFER_SIZE>& recvbuffer, "
"const size_t recvlen) : return_value = %d. thread id : %d.");
formatter % STOP % boost::this_thread::get_id();
- putLogDebug(300098, formatter.str(), __FILE__, __LINE__);
+ putLogDebug(300097, formatter.str(), __FILE__, __LINE__);
}
/*------DEBUG LOG END------*/
"const boost::array<char,MAX_BUFFER_SIZE>& recvbuffer, "
"const size_t recvlen) : return_value = %d. thread id : %d.");
formatter % STOP % boost::this_thread::get_id();
- putLogDebug(300099, formatter.str(), __FILE__, __LINE__);
+ putLogDebug(300098, formatter.str(), __FILE__, __LINE__);
}
/*------DEBUG LOG END------*/
"handle_response_send_inform(const boost::thread::id thread_id) : return_value = %d. "
"thread id : %d.");
formatter % STOP % boost::this_thread::get_id();
- putLogDebug(300100, formatter.str(), __FILE__, __LINE__);
+ putLogDebug(300099, formatter.str(), __FILE__, __LINE__);
}
/*------DEBUG LOG END------*/
"boost::array<char,MAX_BUFFER_SIZE>& sendbuffer, "
"size_t& datalen) : thread_id = %d.");
formatter % thread_id;
- putLogDebug(300101, formatter.str(), __FILE__, __LINE__);
+ putLogDebug(300100, formatter.str(), __FILE__, __LINE__);
}
/*------DEBUG LOG END------*/
"boost::array<char,MAX_BUFFER_SIZE>& sendbuffer, "
"size_t& datalen) : return_value = %d. thread id : %d.");
formatter % FINALIZE % boost::this_thread::get_id();
- putLogDebug(300102, formatter.str(), __FILE__, __LINE__);
+ putLogDebug(300101, formatter.str(), __FILE__, __LINE__);
}
/*------DEBUG LOG END------*/
"boost::array<char,MAX_BUFFER_SIZE>& sendbuffer, "
"size_t& datalen) : return_value = %d. thread id : %d.");
formatter % FINALIZE % boost::this_thread::get_id();
- putLogDebug(300103, formatter.str(), __FILE__, __LINE__);
+ putLogDebug(300102, formatter.str(), __FILE__, __LINE__);
}
/*------DEBUG LOG END------*/
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(300104, formatter.str(), __FILE__, __LINE__);
+ putLogDebug(300103, formatter.str(), __FILE__, __LINE__);
}
/*------DEBUG LOG END------*/
"handle_client_connection_check() : write_session_data() end."
"session_id = %s. thread id : %d.");
formatter % buffer % boost::this_thread::get_id();
- putLogDebug(300105, formatter.str(), __FILE__, __LINE__);
+ putLogDebug(300104, formatter.str(), __FILE__, __LINE__);
}
/*------DEBUG LOG END------*/
}
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(300106, formatter.str(), __FILE__, __LINE__);
+ putLogDebug(300105, formatter.str(), __FILE__, __LINE__);
}
/*------DEBUG LOG END------*/
}
"boost::array<char,MAX_BUFFER_SIZE>& sendbuffer, size_t& datalen) : "
"return_value = %d. thread id : %d.");
formatter % status % boost::this_thread::get_id();
- putLogDebug(300107, formatter.str(), __FILE__, __LINE__);
+ putLogDebug(300106, formatter.str(), __FILE__, __LINE__);
}
/*------DEBUG LOG END------*/
"boost::array<char,MAX_BUFFER_SIZE>& sendbuffer, "
"size_t& datalen) : return_value = %d. thread id : %d.");
formatter % STOP % boost::this_thread::get_id();
- putLogDebug(300108, formatter.str(), __FILE__, __LINE__);
+ putLogDebug(300107, formatter.str(), __FILE__, __LINE__);
}
/*------DEBUG LOG END------*/
boost::format formatter("in_function : protocol_module_base::EVENT_TAG protocol_module_sslid::"
"handle_client_send(const boost::thread::id thread_id) : thread_id = %d.");
formatter % thread_id;
- putLogDebug(300109, formatter.str(), __FILE__, __LINE__);
+ putLogDebug(300108, formatter.str(), __FILE__, __LINE__);
}
/*------DEBUG LOG END------*/
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. thread id : %d.");
formatter % FINALIZE % boost::this_thread::get_id();
- putLogDebug(300110, formatter.str(), __FILE__, __LINE__);
+ putLogDebug(300109, formatter.str(), __FILE__, __LINE__);
}
/*------DEBUG LOG END------*/
boost::format formatter("function : protocol_module_base::EVENT_TAG protocol_module_sslid::"
"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(300111, formatter.str(), __FILE__, __LINE__);
+ putLogDebug(300110, formatter.str(), __FILE__, __LINE__);
}
/*------DEBUG LOG END------*/
boost::format formatter("function : protocol_module_base::EVENT_TAG protocol_module_sslid::"
"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(300112, formatter.str(), __FILE__, __LINE__);
+ putLogDebug(300111, formatter.str(), __FILE__, __LINE__);
}
/*------DEBUG LOG END------*/
"handle_client_send() : check_ssl_record_sendable() end. "
"return_value = %d. thread id : %d.");
formatter % ret % boost::this_thread::get_id();
- putLogDebug(300113, formatter.str(), __FILE__, __LINE__);
+ putLogDebug(300112, formatter.str(), __FILE__, __LINE__);
}
/*------DEBUG LOG END------*/
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(300114, formatter.str(), __FILE__, __LINE__);
+ putLogDebug(300113, formatter.str(), __FILE__, __LINE__);
}
/*------DEBUG LOG END------*/
"handle_client_send(const boost::thread::id thread_id) : "
"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(300115, formatter.str(), __FILE__, __LINE__);
+ putLogDebug(300114, formatter.str(), __FILE__, __LINE__);
}
/*------DEBUG LOG END------*/
"handle_client_disconnect(const boost::thread::id thread_id) : "
"thread_id = %d, return_value = %d.");
formatter % thread_id % FINALIZE;
- putLogDebug(300116, formatter.str(), __FILE__, __LINE__);
+ putLogDebug(300115, formatter.str(), __FILE__, __LINE__);
}
/*------DEBUG LOG END------*/
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. thread id : %d.");
formatter % STOP % boost::this_thread::get_id();
- putLogDebug(300117, formatter.str(), __FILE__, __LINE__);
+ putLogDebug(300116, formatter.str(), __FILE__, __LINE__);
}
/*------DEBUG LOG END------*/
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. thread id : %d.");
formatter % STOP % boost::this_thread::get_id();
- putLogDebug(300118, formatter.str(), __FILE__, __LINE__);
+ putLogDebug(300117, formatter.str(), __FILE__, __LINE__);
}
/*------DEBUG LOG END------*/
"handle_realserver_disconnect(const boost::thread::id thread_id, "
"const boost::asio::ip::tcp::endpoint& rs_endpoint) : return_value = %d. thread id : %d.");
formatter % STOP % boost::this_thread::get_id();
- putLogDebug(300119, formatter.str(), __FILE__, __LINE__);
+ putLogDebug(300118, formatter.str(), __FILE__, __LINE__);
}
/*------DEBUG LOG END------*/
"handle_sorryserver_disconnect(const boost::thread::id thread_id, "
"const boost::asio::ip::tcp::endpoint& sorry_endpoint) : return_value = %d. thread id : %d.");
formatter % STOP % boost::this_thread::get_id();
- putLogDebug(300120, formatter.str(), __FILE__, __LINE__);
+ putLogDebug(300119, formatter.str(), __FILE__, __LINE__);
}
/*------DEBUG LOG END------*/
"handle_realserver_close(const boost::thread::id thread_id, "
"const boost::asio::ip::udp::endpoint& rs_endpoint) : return_value = %d. thread id : %d.");
formatter % STOP % boost::this_thread::get_id();
- putLogDebug(300121, formatter.str(), __FILE__, __LINE__);
+ putLogDebug(300120, formatter.str(), __FILE__, __LINE__);
}
/*------DEBUG LOG END------*/
/*-------- DEBUG LOG --------*/
if (unlikely(LOG_LV_DEBUG == getloglevel()))
{
- putLogDebug(300122, "in_function : void protocol_module_sslid::replication_interrupt().", __FILE__, __LINE__);
+ putLogDebug(300121, "in_function : void protocol_module_sslid::replication_interrupt().", __FILE__, __LINE__);
}
/*------DEBUG LOG END------*/
if (replication_data_processor)
/*-------- DEBUG LOG --------*/
if (unlikely(LOG_LV_DEBUG == getloglevel()))
{
- putLogDebug(300123, "function : void protocol_module_sslid::replication_interrupt() : "
+ putLogDebug(300122, "function : void protocol_module_sslid::replication_interrupt() : "
"write_replication_area() end.", __FILE__, __LINE__);
}
/*------DEBUG LOG END------*/
/*-------- DEBUG LOG --------*/
if (unlikely(LOG_LV_DEBUG == getloglevel()))
{
- putLogDebug(300124, "out_function : void protocol_module_sslid::replication_interrupt().", __FILE__, __LINE__);
+ putLogDebug(300123, "out_function : void protocol_module_sslid::replication_interrupt().", __FILE__, __LINE__);
}
/*------DEBUG LOG END------*/
}
"boost::array<char,MAX_BUFFER_SIZE>& sendbuffer, "
"size_t& datalen) : thread_id = %d.");
formatter % thread_id;
- putLogDebug(300125, formatter.str(), __FILE__, __LINE__);
+ putLogDebug(300124, formatter.str(), __FILE__, __LINE__);
}
/*------DEBUG LOG END------*/
"boost::array<char,MAX_BUFFER_SIZE>& sendbuffer, "
"size_t& datalen) : return_value = -1. thread id : %d.");
formatter % boost::this_thread::get_id();
- putLogDebug(300126, formatter.str(), __FILE__, __LINE__);
+ putLogDebug(300125, formatter.str(), __FILE__, __LINE__);
}
/*------DEBUG LOG END------*/
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(300127, formatter.str(), __FILE__, __LINE__);
+ putLogDebug(300126, formatter.str(), __FILE__, __LINE__);
}
// remain data size greater than all data size
"dump data_size = %d, dump data = %s");
formatter % threaddata->data_begain_offset % threaddata->current_record_rest_size
% threaddata->data_size % datadump;
- putLogDebug(300128, formatter.str(), __FILE__, __LINE__);
+ putLogDebug(300127, formatter.str(), __FILE__, __LINE__);
}
/*------DEBUG LOG END------*/
"dump data_size = %d, dump data = %s");
formatter % threaddata->data_begain_offset % threaddata->current_record_rest_size
% datalen % datadump;
- putLogDebug(300129, formatter.str(), __FILE__, __LINE__);
+ putLogDebug(300128, formatter.str(), __FILE__, __LINE__);
}
/*------DEBUG LOG END------*/
}
"dump data_size = %d, dump data = %s");
formatter % threaddata->data_begain_offset % threaddata->current_record_rest_size
% sendbufsize % datadump;
- putLogDebug(300130, formatter.str(), __FILE__, __LINE__);
+ putLogDebug(300129, formatter.str(), __FILE__, __LINE__);
}
/*------DEBUG LOG END------*/
"dump data_size = %d, dump data = %s");
formatter % threaddata->data_begain_offset % threaddata->current_record_rest_size
% datalen % datadump;
- putLogDebug(300131, formatter.str(), __FILE__, __LINE__);
+ putLogDebug(300130, formatter.str(), __FILE__, __LINE__);
}
/*------DEBUG LOG END------*/
}
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(300132, formatter.str(), __FILE__, __LINE__);
+ putLogDebug(300131, formatter.str(), __FILE__, __LINE__);
}
/*------DEBUG LOG END------*/
"dump data_size = %d, dump data = %s");
formatter % threaddata->data_begain_offset % threaddata->current_record_rest_size
% threaddata->current_record_rest_size % datadump;
- putLogDebug(300133, formatter.str(), __FILE__, __LINE__);
+ putLogDebug(300132, formatter.str(), __FILE__, __LINE__);
}
/*------DEBUG LOG END------*/
"dump data_size = %d, dump data = %s");
formatter % threaddata->data_begain_offset % threaddata->current_record_rest_size
% datalen % datadump;
- putLogDebug(300134, formatter.str(), __FILE__, __LINE__);
+ putLogDebug(300133, formatter.str(), __FILE__, __LINE__);
}
/*------DEBUG LOG END------*/
}
"dump data_size = %d, dump data = %s");
formatter % threaddata->data_begain_offset % threaddata->current_record_rest_size
% sendbufsize % datadump;
- putLogDebug(300135, formatter.str(), __FILE__, __LINE__);
+ putLogDebug(300134, formatter.str(), __FILE__, __LINE__);
}
/*------DEBUG LOG END------*/
"dump data_size = %d, dump data = %s");
formatter % threaddata->data_begain_offset % threaddata->current_record_rest_size
% datalen % datadump;
- putLogDebug(300136, formatter.str(), __FILE__, __LINE__);
+ putLogDebug(300135, formatter.str(), __FILE__, __LINE__);
}
/*------DEBUG LOG END------*/
}
"boost::array<char,MAX_BUFFER_SIZE>& sendbuffer, "
"size_t& datalen) : return_value = 0. thread id : %d.");
formatter % boost::this_thread::get_id();
- putLogDebug(300137, formatter.str(), __FILE__, __LINE__);
+ putLogDebug(300136, formatter.str(), __FILE__, __LINE__);
}
/*------DEBUG LOG END------*/
boost::format formatter("in_function : bool protocol_module_sslid::realserver_selected("
"const boost::asio::ip::tcp::endpoint& rs_endpoint) : rs_endpoint = [%s]:%d.");
formatter % rs_endpoint.address().to_string() % rs_endpoint.port();
- putLogDebug(300138, formatter.str(), __FILE__, __LINE__);
+ putLogDebug(300137, formatter.str(), __FILE__, __LINE__);
}
/*------DEBUG LOG END------*/
/*-------- DEBUG LOG --------*/
if (unlikely(LOG_LV_DEBUG == getloglevel()))
{
- putLogDebug(300139, "out_function : bool protocol_module_sslid::realserver_selected("
+ putLogDebug(300138, "out_function : bool protocol_module_sslid::realserver_selected("
"const boost::asio::ip::tcp::endpoint& rs_endpoint) : return_value = false."
, __FILE__, __LINE__);
}
/*-------- DEBUG LOG --------*/
if (unlikely(LOG_LV_DEBUG == getloglevel()))
{
- putLogDebug(300140, "out_function : bool protocol_module_sslid::realserver_selected("
+ putLogDebug(300139, "out_function : bool protocol_module_sslid::realserver_selected("
"const boost::asio::ip::tcp::endpoint& rs_endpoint) : return_value = true."
, __FILE__, __LINE__);
}
BOOST_CHECK_EQUAL(itr->second->thread_division, THREAD_DIVISION_UP_STREAM);
BOOST_CHECK_EQUAL(itr->second->pair_thread_id, down_thread.get_id());
BOOST_CHECK_EQUAL(itr->second->end_flag, END_FLAG_OFF);
- BOOST_CHECK_EQUAL(itr->second->realserver_connect_failed_count, 0);
BOOST_CHECK_EQUAL(itr->second->data_begain_offset, 0u);
BOOST_CHECK_EQUAL(itr->second->data_size, 0u);
BOOST_CHECK_EQUAL(itr->second->current_record_rest_size, 0u);
BOOST_CHECK_EQUAL(itr->second->thread_division, THREAD_DIVISION_DOWN_STREAM);
BOOST_CHECK_EQUAL(itr->second->pair_thread_id, boost::this_thread::get_id());
BOOST_CHECK_EQUAL(itr->second->end_flag, END_FLAG_OFF);
- BOOST_CHECK_EQUAL(itr->second->realserver_connect_failed_count, 0);
BOOST_CHECK_EQUAL(itr->second->data_begain_offset, 0u);
BOOST_CHECK_EQUAL(itr->second->data_size, 0u);
BOOST_CHECK_EQUAL(itr->second->current_record_rest_size, 0u);
BOOST_CHECK_EQUAL(itr->second->thread_division, THREAD_DIVISION_UP_STREAM);
BOOST_CHECK_EQUAL(itr->second->pair_thread_id, down_thread.get_id());
BOOST_CHECK_EQUAL(itr->second->end_flag, END_FLAG_OFF);
- BOOST_CHECK_EQUAL(itr->second->realserver_connect_failed_count, 0);
BOOST_CHECK_EQUAL(itr->second->data_begain_offset, 0u);
BOOST_CHECK_EQUAL(itr->second->data_size, 0u);
BOOST_CHECK_EQUAL(itr->second->current_record_rest_size, 0u);
BOOST_CHECK_EQUAL(itr->second->thread_division, THREAD_DIVISION_DOWN_STREAM);
BOOST_CHECK_EQUAL(itr->second->pair_thread_id, boost::this_thread::get_id());
BOOST_CHECK_EQUAL(itr->second->end_flag, END_FLAG_OFF);
- BOOST_CHECK_EQUAL(itr->second->realserver_connect_failed_count, 0);
BOOST_CHECK_EQUAL(itr->second->data_begain_offset, 0u);
BOOST_CHECK_EQUAL(itr->second->data_size, 0u);
BOOST_CHECK_EQUAL(itr->second->current_record_rest_size, 0u);
boost::asio::ip::tcp::endpoint ep;
session_thread_data_sslid* thread_up_data_value = new session_thread_data_sslid;
thread_up_data_value->thread_division=THREAD_DIVISION_UP_STREAM;
- thread_up_data_value->realserver_connect_failed_count=0;
thread_up_data_value->data_begain_offset=0;
thread_up_data_value->data_size=0;
thread_up_data_value->current_record_rest_size=0;
boost::asio::ip::tcp::endpoint ep;
session_thread_data_sslid* thread_up_data_value = new session_thread_data_sslid;
thread_up_data_value->thread_division=THREAD_DIVISION_UP_STREAM;
- thread_up_data_value->realserver_connect_failed_count=0;
thread_up_data_value->data_begain_offset=0;
thread_up_data_value->data_size=0;
thread_up_data_value->current_record_rest_size=0;
this->rs_list_unlock = rslist_unlock_func;
- cout << "[150]--------------------------------------------- " << endl;
- // unit_test[150] realserver接続回数が最大回数の場合、戻り値がCLIENT_DISCONNECTで設定する。
- {
- thread_data_ptr up_thread_data(new session_thread_data_sslid);
- up_thread_data->realserver_connect_failed_count
- = this->realserver_connect_failed_max_count;
- this->session_thread_data_map[boost::this_thread::get_id()]
- = up_thread_data;
- status = this->handle_realserver_select(boost::this_thread::get_id(),
- rs_endpoint);
- BOOST_CHECK_EQUAL(this->session_thread_data_map[boost::this_thread::get_id()]->end_flag, END_FLAG_ON);
- BOOST_CHECK_EQUAL(status, CLIENT_DISCONNECT);
- this->session_thread_data_map.clear();
- }
-
- cout << "[151]--------------------------------------------- " << endl;
- // unit_test[151] realserver接続回数が最大回数を越える場合、戻り値がCLIENT_DISCONNECTで設定する。
- {
- thread_data_ptr up_thread_data(new session_thread_data_sslid);
- up_thread_data->realserver_connect_failed_count
- = this->realserver_connect_failed_max_count + 1;
- this->session_thread_data_map[boost::this_thread::get_id()]
- = up_thread_data;
- status = this->handle_realserver_select(boost::this_thread::get_id(),
- rs_endpoint);
- BOOST_CHECK_EQUAL(this->session_thread_data_map[boost::this_thread::get_id()]->end_flag, END_FLAG_ON);
- BOOST_CHECK_EQUAL(status, CLIENT_DISCONNECT);
- this->session_thread_data_map.clear();
- }
-
- cout << "[152]--------------------------------------------- " << endl;
- // unit_test[152] realserver接続回数が最大回数に未満で, reschedule が 1(ON)、endpointが決定の場合
- // unit_test[152] 戻り値が REALSERVER_CONNECTで設定する。
- {
- this->schedule_tcp = schedule_tcp_func1;
- thread_data_ptr up_thread_data(new session_thread_data_sslid);
- up_thread_data->realserver_connect_failed_count
- = this->realserver_connect_failed_max_count - 1;
- this->session_thread_data_map[boost::this_thread::get_id()]
- = up_thread_data;
- this->reschedule = 1;
- status = this->handle_realserver_select(boost::this_thread::get_id(),
- rs_endpoint);
- BOOST_CHECK(this->session_thread_data_map[boost::this_thread::get_id()]->selected_realserver != comp_endpoint);
- BOOST_CHECK_EQUAL(status, REALSERVER_CONNECT);
- this->session_thread_data_map.clear();
- }
-
- cout << "[153]--------------------------------------------- " << endl;
- // unit_test[153] realserver接続回数が最大回数に未満で, reschedule が 1(ON)、endpointが未決定の場合
- // unit_test[153] 戻り値が CLIENT_DISCONNECTで設定する。
- {
- this->schedule_tcp = schedule_tcp_func2;
- thread_data_ptr up_thread_data(new session_thread_data_sslid);
- up_thread_data->realserver_connect_failed_count
- = this->realserver_connect_failed_max_count - 1;
- this->session_thread_data_map[boost::this_thread::get_id()]
- = up_thread_data;
- this->reschedule = 1;
- status = this->handle_realserver_select(boost::this_thread::get_id(),
- rs_endpoint);
- BOOST_CHECK_EQUAL(this->session_thread_data_map[boost::this_thread::get_id()]->end_flag, END_FLAG_ON);
- BOOST_CHECK_EQUAL(status, CLIENT_DISCONNECT);
- this->session_thread_data_map.clear();
- }
-
- cout << "[154]--------------------------------------------- " << endl;
- // unit_test[154] realserver接続回数が最大回数に未満で, 且つreschedule が 0 (OFF)の場合
- // unit_test[154] 戻り値が CLIENT_DISCONNECTで設定する。
- {
- thread_data_ptr up_thread_data(new session_thread_data_sslid);
- up_thread_data->realserver_connect_failed_count
- = this->realserver_connect_failed_max_count - 1;
- this->session_thread_data_map[boost::this_thread::get_id()]
- = up_thread_data;
- this->reschedule = 0;
- status = this->handle_realserver_select(boost::this_thread::get_id(),
- rs_endpoint);
- BOOST_CHECK_EQUAL(this->session_thread_data_map[boost::this_thread::get_id()]->end_flag, END_FLAG_ON);
- BOOST_CHECK_EQUAL(status, CLIENT_DISCONNECT);
- this->session_thread_data_map.clear();
- }
+// cout << "[150]--------------------------------------------- " << endl;
+// // unit_test[150] realserver接続回数が最大回数の場合、戻り値がCLIENT_DISCONNECTで設定する。
+// {
+// thread_data_ptr up_thread_data(new session_thread_data_sslid);
+// up_thread_data->realserver_connect_failed_count
+// = this->realserver_connect_failed_max_count;
+// this->session_thread_data_map[boost::this_thread::get_id()]
+// = up_thread_data;
+// status = this->handle_realserver_select(boost::this_thread::get_id(),
+// rs_endpoint);
+// BOOST_CHECK_EQUAL(this->session_thread_data_map[boost::this_thread::get_id()]->end_flag, END_FLAG_ON);
+// BOOST_CHECK_EQUAL(status, CLIENT_DISCONNECT);
+// this->session_thread_data_map.clear();
+// }
+//
+// cout << "[151]--------------------------------------------- " << endl;
+// // unit_test[151] realserver接続回数が最大回数を越える場合、戻り値がCLIENT_DISCONNECTで設定する。
+// {
+// thread_data_ptr up_thread_data(new session_thread_data_sslid);
+// up_thread_data->realserver_connect_failed_count
+// = this->realserver_connect_failed_max_count + 1;
+// this->session_thread_data_map[boost::this_thread::get_id()]
+// = up_thread_data;
+// status = this->handle_realserver_select(boost::this_thread::get_id(),
+// rs_endpoint);
+// BOOST_CHECK_EQUAL(this->session_thread_data_map[boost::this_thread::get_id()]->end_flag, END_FLAG_ON);
+// BOOST_CHECK_EQUAL(status, CLIENT_DISCONNECT);
+// this->session_thread_data_map.clear();
+// }
+//
+// cout << "[152]--------------------------------------------- " << endl;
+// // unit_test[152] realserver接続回数が最大回数に未満で, reschedule が 1(ON)、endpointが決定の場合
+// // unit_test[152] 戻り値が REALSERVER_CONNECTで設定する。
+// {
+// this->schedule_tcp = schedule_tcp_func1;
+// thread_data_ptr up_thread_data(new session_thread_data_sslid);
+// up_thread_data->realserver_connect_failed_count
+// = this->realserver_connect_failed_max_count - 1;
+// this->session_thread_data_map[boost::this_thread::get_id()]
+// = up_thread_data;
+// this->reschedule = 1;
+// status = this->handle_realserver_select(boost::this_thread::get_id(),
+// rs_endpoint);
+// BOOST_CHECK(this->session_thread_data_map[boost::this_thread::get_id()]->selected_realserver != comp_endpoint);
+// BOOST_CHECK_EQUAL(status, REALSERVER_CONNECT);
+// this->session_thread_data_map.clear();
+// }
+//
+// cout << "[153]--------------------------------------------- " << endl;
+// // unit_test[153] realserver接続回数が最大回数に未満で, reschedule が 1(ON)、endpointが未決定の場合
+// // unit_test[153] 戻り値が CLIENT_DISCONNECTで設定する。
+// {
+// this->schedule_tcp = schedule_tcp_func2;
+// thread_data_ptr up_thread_data(new session_thread_data_sslid);
+// up_thread_data->realserver_connect_failed_count
+// = this->realserver_connect_failed_max_count - 1;
+// this->session_thread_data_map[boost::this_thread::get_id()]
+// = up_thread_data;
+// this->reschedule = 1;
+// status = this->handle_realserver_select(boost::this_thread::get_id(),
+// rs_endpoint);
+// BOOST_CHECK_EQUAL(this->session_thread_data_map[boost::this_thread::get_id()]->end_flag, END_FLAG_ON);
+// BOOST_CHECK_EQUAL(status, CLIENT_DISCONNECT);
+// this->session_thread_data_map.clear();
+// }
+//
+// cout << "[154]--------------------------------------------- " << endl;
+// // unit_test[154] realserver接続回数が最大回数に未満で, 且つreschedule が 0 (OFF)の場合
+// // unit_test[154] 戻り値が CLIENT_DISCONNECTで設定する。
+// {
+// thread_data_ptr up_thread_data(new session_thread_data_sslid);
+// up_thread_data->realserver_connect_failed_count
+// = this->realserver_connect_failed_max_count - 1;
+// this->session_thread_data_map[boost::this_thread::get_id()]
+// = up_thread_data;
+// this->reschedule = 0;
+// status = this->handle_realserver_select(boost::this_thread::get_id(),
+// rs_endpoint);
+// BOOST_CHECK_EQUAL(this->session_thread_data_map[boost::this_thread::get_id()]->end_flag, END_FLAG_ON);
+// BOOST_CHECK_EQUAL(status, CLIENT_DISCONNECT);
+// this->session_thread_data_map.clear();
+// }
cout << "[155]--------------------------------------------- " << endl;
- // unit_test[155] realserverの接続失敗回数が0, 且つselected_realserver が NULLでない場合
+ // unit_test[155] selected_realserver が NULLでない場合
// unit_test[155] 戻り値がREALSERVER_CONNECTで設定する。
{
thread_data_ptr up_thread_data(new session_thread_data_sslid);
- up_thread_data->realserver_connect_failed_count = 0;
up_thread_data->selected_realserver = ep1;
this->session_thread_data_map[boost::this_thread::get_id()]
= up_thread_data;
}
cout << "[156]--------------------------------------------- " << endl;
- // unit_test[156] realserverの接続失敗回数が0, 且つselected_realserver が NULLで、 且つhello_message_flagがfalseの場合
+ // unit_test[156] selected_realserver が NULLで、 且つhello_message_flagがfalseの場合
// unit_test[156] 戻り値がFINALIZEで設定する。
{
thread_data_ptr up_thread_data(new session_thread_data_sslid);
- up_thread_data->realserver_connect_failed_count = 0;
up_thread_data->selected_realserver = ep2;
up_thread_data->hello_message_flag = false;
up_thread_data->end_flag = END_FLAG_OFF;
}
cout << "[157]--------------------------------------------- " << endl;
- // unit_test[157] realserverの接続失敗回数が0, 且つselected_realserver が NULLで、 且つhello_message_flagがtrueで
+ // unit_test[157] selected_realserver が NULLで、 且つhello_message_flagがtrueで
// unit_test[157] 且つendpointが決定の場合
// unit_test[157] 戻り値がREALSERVER_CONNECTで設定する。
{
thread_data_ptr up_thread_data(new session_thread_data_sslid);
- up_thread_data->realserver_connect_failed_count = 0;
up_thread_data->selected_realserver = ep2;
up_thread_data->hello_message_flag = true;
up_thread_data->data_buffer[43] = 0x00;
}
cout << "[158]--------------------------------------------- " << endl;
- // unit_test[158] realserver接続失敗回数が0で, 且つselected_realserverがNULLで、且つhello_message_flagがtrueで
+ // unit_test[158] selected_realserverがNULLで、且つhello_message_flagがtrueで
// unit_test[158] 且つセッションIDがなくで、且つendpointが未決定の場合
// unit_test[158] 戻り値がCLIENT_DISCONNECTで設定する。
{
thread_data_ptr up_thread_data(new session_thread_data_sslid);
- up_thread_data->realserver_connect_failed_count = 0;
up_thread_data->selected_realserver = ep2;
up_thread_data->hello_message_flag = true;
up_thread_data->data_buffer[43] = 0x00;
}
cout << "[159]--------------------------------------------- " << endl;
- // unit_test[159] realserver接続失敗回数が0で, 且つselected_realserverがNULLで、且つhello_message_flagがtrueで
+ // unit_test[159] selected_realserverがNULLで、且つhello_message_flagがtrueで
// unit_test[159] 且つセッションIDがあるで, 且つendpointが決定の場合
// unit_test[159] rsリストを検索し、realserver endpoint が存在する場合
// unit_test[159] endpointでselected_realserverを設定する
// unit_test[159] 戻り値がREALSERVER_CONNECTで設定する。
{
thread_data_ptr up_thread_data(new session_thread_data_sslid);
- up_thread_data->realserver_connect_failed_count = 0;
up_thread_data->selected_realserver = ep2;
up_thread_data->hello_message_flag = true;
up_thread_data->data_buffer[43] = 0x20;
this->session_thread_data_map.clear();
}
cout << "[160]--------------------------------------------- " << endl;
- // unit_test[160] realserver接続失敗回数が0で, 且つselected_realserverがNULLで、且つhello_message_flagがtrueで
+ // unit_test[160] selected_realserverがNULLで、且つhello_message_flagがtrueで
// unit_test[160] 且つセッションIDがあるで, 且つendpointが決定の場合
// unit_test[160] rsリストを検索し、realserver endpoint が存在しない場合
// unit_test[160] rescheduleモード
// unit_test[160] 戻り値がREALSERVER_CONNECTで設定する。
{
thread_data_ptr up_thread_data(new session_thread_data_sslid);
- up_thread_data->realserver_connect_failed_count = 0;
up_thread_data->selected_realserver = ep2;
up_thread_data->hello_message_flag = true;
up_thread_data->data_buffer[43] = 0x20;
this->session_thread_data_map.clear();
}
cout << "[161]--------------------------------------------- " << endl;
- // unit_test[161] realserver接続失敗回数が0で, 且つselected_realserverがNULLで、且つhello_message_flagがtrueで
+ // unit_test[161] selected_realserverがNULLで、且つhello_message_flagがtrueで
// unit_test[161] 且つセッションIDがあるで, 且つendpointが決定の場合
// unit_test[161] rsリストを検索し、realserver endpoint が存在しない場合
// unit_test[161] rescheduleモード
// unit_test[161] 戻り値がCLIENT_DISCONNECTで設定する。
{
thread_data_ptr up_thread_data(new session_thread_data_sslid);
- up_thread_data->realserver_connect_failed_count = 0;
up_thread_data->selected_realserver = ep2;
up_thread_data->hello_message_flag = true;
up_thread_data->data_buffer[43] = 0x20;
this->session_thread_data_map.clear();
}
cout << "[162]--------------------------------------------- " << endl;
- // unit_test[162] realserver接続失敗回数が0で, 且つselected_realserverがNULLで、且つhello_message_flagがtrueで
+ // unit_test[162] selected_realserverがNULLで、且つhello_message_flagがtrueで
// unit_test[162] 且つセッションIDがあるで, 且つendpointが決定の場合
// unit_test[162] rsリストを検索し、realserver endpoint が存在しない場合
// unit_test[162] no rescheduleモード
// unit_test[162] 戻り値がCLIENT_DISCONNECTで設定する。
{
thread_data_ptr up_thread_data(new session_thread_data_sslid);
- up_thread_data->realserver_connect_failed_count = 0;
up_thread_data->selected_realserver = ep2;
up_thread_data->hello_message_flag = true;
up_thread_data->data_buffer[43] = 0x20;
this->session_thread_data_map.clear();
}
cout << "[163]--------------------------------------------- " << endl;
- // unit_test[163] realserver接続失敗回数が0で, 且つselected_realserverがNULLで、且つhello_message_flagがtrueで
+ // unit_test[163] selected_realserverがNULLで、且つhello_message_flagがtrueで
// unit_test[163] 且つセッションIDがあり, endpointが未決定で、reschedule後、endpointが決定の場合
// unit_test[163] 戻り値がREALSERVER_CONNECTで設定する。
{
this->schedule_tcp = schedule_tcp_func1;
thread_data_ptr up_thread_data(new session_thread_data_sslid);
- up_thread_data->realserver_connect_failed_count = 0;
up_thread_data->selected_realserver = ep2;
up_thread_data->hello_message_flag = true;
up_thread_data->data_buffer[43] = 0x20;
}
cout << "[164]--------------------------------------------- " << endl;
- // unit_test[164] realserver接続失敗回数が0で, 且つselected_realserverがNULLで、且つhello_message_flagがtrueで
+ // unit_test[164] selected_realserverがNULLで、且つhello_message_flagがtrueで
// unit_test[164] 且つセッションIDがあり, endpointが未決定で、reschedule後、endpointも未決定の場合
// unit_test[164] 戻り値がCLIENT_DISCONNECTで設定する。
{
this->schedule_tcp = schedule_tcp_func2;
thread_data_ptr up_thread_data(new session_thread_data_sslid);
- up_thread_data->realserver_connect_failed_count = 0;
up_thread_data->selected_realserver = ep2;
up_thread_data->hello_message_flag = true;
up_thread_data->data_buffer[43] = 0x20;
}
cout << "[165]--------------------------------------------- " << endl;
- // unit_test[165] realserver接続失敗回数が0で, 且つselected_realserverがNULLで, 且つhello_message_flagがtrueで
+ // unit_test[165] selected_realserverがNULLで, 且つhello_message_flagがtrueで
// unit_test[165] 且つセッションIDがあり, endpointが未決定で、且つ no rescheduleの場合
// unit_test[165] 戻り値がCLIENT_DISCONNECTで設定する。
{
thread_data_ptr up_thread_data(new session_thread_data_sslid);
- up_thread_data->realserver_connect_failed_count = 0;
up_thread_data->selected_realserver = ep2;
up_thread_data->hello_message_flag = true;
up_thread_data->data_buffer[43] = 0x20;
}
cout << "[166]--------------------------------------------- " << endl;
- // unit_test[166] realserver接続失敗回数が0で, 且つselected_realserver が NULLないの場合
+ // unit_test[166] selected_realserver が NULLないの場合
// unit_test[166] 戻り値がREALSERVER_CONNECTで設定する。
{
thread_data_ptr up_thread_data(new session_thread_data_sslid);
- up_thread_data->realserver_connect_failed_count = -1;
up_thread_data->selected_realserver = ep1;
this->session_thread_data_map[boost::this_thread::get_id()]
= up_thread_data;
}
cout << "[167]--------------------------------------------- " << endl;
- // unit_test[167] realserver接続失敗回数が0で, 且つselected_realserver が NULLで, 且つhello_message_flag が falseの場合
+ // unit_test[167] selected_realserver が NULLで, 且つhello_message_flag が falseの場合
// unit_test[167] 戻り値がFINALIZEで設定する。
{
thread_data_ptr up_thread_data(new session_thread_data_sslid);
- up_thread_data->realserver_connect_failed_count = -1;
up_thread_data->selected_realserver = ep2;
up_thread_data->hello_message_flag = false;
up_thread_data->end_flag = END_FLAG_OFF;
}
cout << "[168]--------------------------------------------- " << endl;
- // unit_test[168] realserver接続失敗回数 < 0で, 且つselected_realserver が NULLで, 且つhello_message_flag が trueで
+ // unit_test[168] selected_realserver が NULLで, 且つhello_message_flag が trueで
// unit_test[168] 且つセッションIDがなくで、且つendpointが決定の場合
// unit_test[168] 戻り値がREALSERVER_CONNECT設定する。
{
thread_data_ptr up_thread_data(new session_thread_data_sslid);
- up_thread_data->realserver_connect_failed_count = -1;
up_thread_data->selected_realserver = ep2;
up_thread_data->hello_message_flag = true;
up_thread_data->data_buffer[43] = 0x00;
}
cout << "[169]--------------------------------------------- " << endl;
- // unit_test[169] realserver接続失敗回数 < 0で, 且つselected_realserver が NULLで, 且つhello_message_flag が trueで
+ // unit_test[169] selected_realserver が NULLで, 且つhello_message_flag が trueで
// unit_test[169] 且つセッションIDがなくで、且つendpointが未決定の場合
// unit_test[169] 戻り値がCLIENT_DISCONNECTで設定する。
{
thread_data_ptr up_thread_data(new session_thread_data_sslid);
- up_thread_data->realserver_connect_failed_count = -1;
up_thread_data->selected_realserver = ep2;
up_thread_data->hello_message_flag = true;
up_thread_data->data_buffer[43] = 0x00;
}
cout << "[170]--------------------------------------------- " << endl;
- // unit_test[170] realserver接続失敗回数< 0で, 且つselected_realserverがNULLで、且つhello_message_flagがtrueで
+ // unit_test[170] selected_realserverがNULLで、且つhello_message_flagがtrueで
// unit_test[170] 且つセッションIDがあるで, 且つendpointが決定の場合
// unit_test[170] rsリストを検索し、realserver endpoint が存在する場合
// unit_test[170] endpointでselected_realserverを設定する
// unit_test[170] 戻り値がREALSERVER_CONNECTで設定する。
{
thread_data_ptr up_thread_data(new session_thread_data_sslid);
- up_thread_data->realserver_connect_failed_count = -1;
up_thread_data->selected_realserver = ep2;
up_thread_data->hello_message_flag = true;
up_thread_data->data_buffer[43] = 0x20;
this->session_thread_data_map.clear();
}
cout << "[171]--------------------------------------------- " << endl;
- // unit_test[171] realserver接続失敗回数< 0で, 且つselected_realserverがNULLで、且つhello_message_flagがtrueで
+ // unit_test[171] selected_realserverがNULLで、且つhello_message_flagがtrueで
// unit_test[171] 且つセッションIDがあるで, 且つendpointが決定の場合
// unit_test[171] rsリストを検索し、realserver endpoint が存在しない場合
// unit_test[171] rescheduleモード
// unit_test[171] 戻り値がREALSERVER_CONNECTで設定する。
{
thread_data_ptr up_thread_data(new session_thread_data_sslid);
- up_thread_data->realserver_connect_failed_count = -1;
up_thread_data->selected_realserver = ep2;
up_thread_data->hello_message_flag = true;
up_thread_data->data_buffer[43] = 0x20;
this->session_thread_data_map.clear();
}
cout << "[172]--------------------------------------------- " << endl;
- // unit_test[172] realserver接続失敗回数< 0で, 且つselected_realserverがNULLで、且つhello_message_flagがtrueで
+ // unit_test[172] selected_realserverがNULLで、且つhello_message_flagがtrueで
// unit_test[172] 且つセッションIDがあるで, 且つendpointが決定の場合
// unit_test[172] rsリストを検索し、realserver endpoint が存在しない場合
// unit_test[172] rescheduleモード
// unit_test[172] 戻り値がCLIENT_DISCONNECTで設定する。
{
thread_data_ptr up_thread_data(new session_thread_data_sslid);
- up_thread_data->realserver_connect_failed_count = -1;
up_thread_data->selected_realserver = ep2;
up_thread_data->hello_message_flag = true;
up_thread_data->data_buffer[43] = 0x20;
this->session_thread_data_map.clear();
}
cout << "[173]--------------------------------------------- " << endl;
- // unit_test[173] realserver接続失敗回数< 0で, 且つselected_realserverがNULLで、且つhello_message_flagがtrueで
+ // unit_test[173] selected_realserverがNULLで、且つhello_message_flagがtrueで
// unit_test[173] 且つセッションIDがあるで, 且つendpointが決定の場合
// unit_test[173] rsリストを検索し、realserver endpoint が存在しない場合
// unit_test[173] no rescheduleモード
// unit_test[173] 戻り値がCLIENT_DISCONNECTで設定する。
{
thread_data_ptr up_thread_data(new session_thread_data_sslid);
- up_thread_data->realserver_connect_failed_count = -1;
up_thread_data->selected_realserver = ep2;
up_thread_data->hello_message_flag = true;
up_thread_data->data_buffer[43] = 0x20;
}
cout << "[174]--------------------------------------------- " << endl;
- // unit_test[174] realserver接続失敗回数 < 0で, 且つselected_realserver が NULLで, 且つhello_message_flag が trueで
+ // unit_test[174] selected_realserver が NULLで, 且つhello_message_flag が trueで
// unit_test[174] 且つセッションIDがあるで, endpointが未決定で、reschedule後、endpointが決定の場合
// unit_test[174] 戻り値がREALSERVER_CONNECTで設定する。
{
this->schedule_tcp = schedule_tcp_func1;
thread_data_ptr up_thread_data(new session_thread_data_sslid);
- up_thread_data->realserver_connect_failed_count = -1;
up_thread_data->selected_realserver = ep2;
up_thread_data->hello_message_flag = true;
up_thread_data->data_buffer[43] = 0x20;
}
cout << "[175]--------------------------------------------- " << endl;
- // unit_test[175] realserver接続失敗回数 < 0で, 且つselected_realserver が NULLで, 且つhello_message_flag が trueで
+ // unit_test[175] selected_realserver が NULLで, 且つhello_message_flag が trueで
// unit_test[175] 且つセッションIDがあるで, endpointが未決定で、reschedule後、endpointも未決定の場合
// unit_test[175] 戻り値がCLIENT_DISCONNECTで設定する。
{
this->schedule_tcp = schedule_tcp_func2;
thread_data_ptr up_thread_data(new session_thread_data_sslid);
- up_thread_data->realserver_connect_failed_count = -1;
up_thread_data->selected_realserver = ep2;
up_thread_data->hello_message_flag = true;
up_thread_data->data_buffer[43] = 0x20;
}
cout << "[176]--------------------------------------------- " << endl;
- // unit_test[176] realserver接続失敗回数 < 0で, 且つselected_realserver が NULLで, 且つhello_message_flag が trueで
+ // unit_test[176] selected_realserver が NULLで, 且つhello_message_flag が trueで
// unit_test[176] セッションIDがあり、endpointが未決定でrescheduleしない場合
// unit_test[176] 戻り値がCLIENT_DISCONNECTで設定する。
{
thread_data_ptr up_thread_data(new session_thread_data_sslid);
- up_thread_data->realserver_connect_failed_count = -1;
up_thread_data->selected_realserver = ep2;
up_thread_data->hello_message_flag = true;
up_thread_data->data_buffer[43] = 0x20;
{
//this->schedule_tcp = schedule_tcp_func1;
thread_data_ptr up_thread_data(new session_thread_data_sslid);
- up_thread_data->realserver_connect_failed_count = -1;
up_thread_data->selected_realserver = ep2;
up_thread_data->hello_message_flag = true;
up_thread_data->data_buffer[43] = 0x20;
BOOST_CHECK_EQUAL(this->session_thread_data_map[boost::this_thread::get_id()]->current_record_rest_size, 10u);
BOOST_CHECK_EQUAL(this->session_thread_data_map[boost::this_thread::get_id()]->data_size, 0u);
BOOST_CHECK_EQUAL(status, REALSERVER_SEND);
- BOOST_CHECK_EQUAL(this->session_thread_data_map[boost::this_thread::get_id()]->realserver_connect_failed_count, 0);
BOOST_CHECK_EQUAL(datalen, 10u);
delete[] mem_cmp_buffer;
this->session_thread_data_map.clear();
BOOST_CHECK_EQUAL(this->session_thread_data_map[boost::this_thread::get_id()]->current_record_rest_size, 1u);
BOOST_CHECK_EQUAL(this->session_thread_data_map[boost::this_thread::get_id()]->data_size, 0u);
BOOST_CHECK_EQUAL(status, REALSERVER_SEND);
- BOOST_CHECK_EQUAL(this->session_thread_data_map[boost::this_thread::get_id()]->realserver_connect_failed_count, 0);
BOOST_CHECK_EQUAL(datalen, static_cast<size_t>(MAX_BUFFER_SIZE));
delete[] mem_cmp_buffer;
this->session_thread_data_map.clear();
BOOST_CHECK_EQUAL(this->session_thread_data_map[boost::this_thread::get_id()]->current_record_rest_size, 0u);
BOOST_CHECK_EQUAL(this->session_thread_data_map[boost::this_thread::get_id()]->data_size, 0u);
BOOST_CHECK_EQUAL(status, REALSERVER_SEND);
- BOOST_CHECK_EQUAL(this->session_thread_data_map[boost::this_thread::get_id()]->realserver_connect_failed_count, 0);
BOOST_CHECK_EQUAL(datalen, 10u);
delete[] mem_cmp_buffer;
this->session_thread_data_map.clear();
BOOST_CHECK_EQUAL(this->session_thread_data_map[boost::this_thread::get_id()]->current_record_rest_size, 0u);
BOOST_CHECK_EQUAL(this->session_thread_data_map[boost::this_thread::get_id()]->data_size, 0u);
BOOST_CHECK_EQUAL(status, REALSERVER_SEND);
- BOOST_CHECK_EQUAL(this->session_thread_data_map[boost::this_thread::get_id()]->realserver_connect_failed_count, 0);
BOOST_CHECK_EQUAL(datalen, static_cast<size_t>(MAX_BUFFER_SIZE));
delete[] mem_cmp_buffer;
this->session_thread_data_map.clear();
BOOST_CHECK_EQUAL(this->session_thread_data_map[boost::this_thread::get_id()]->current_record_rest_size, 10u);
BOOST_CHECK_EQUAL(this->session_thread_data_map[boost::this_thread::get_id()]->data_size, 5u);
BOOST_CHECK_EQUAL(status, REALSERVER_SEND);
- BOOST_CHECK_EQUAL(this->session_thread_data_map[boost::this_thread::get_id()]->realserver_connect_failed_count, 0);
BOOST_CHECK_EQUAL(datalen, static_cast<size_t>(MAX_BUFFER_SIZE));
delete[] mem_cmp_buffer;
this->session_thread_data_map.clear();
BOOST_CHECK_EQUAL(this->session_thread_data_map[boost::this_thread::get_id()]->current_record_rest_size, 10u);
BOOST_CHECK_EQUAL(this->session_thread_data_map[boost::this_thread::get_id()]->data_size, 10u);
BOOST_CHECK_EQUAL(status, REALSERVER_SEND);
- BOOST_CHECK_EQUAL(this->session_thread_data_map[boost::this_thread::get_id()]->realserver_connect_failed_count, 0);
BOOST_CHECK_EQUAL(datalen, static_cast<size_t>(MAX_BUFFER_SIZE));
delete[] mem_cmp_buffer;
this->session_thread_data_map.clear();
BOOST_CHECK_EQUAL(this->session_thread_data_map[boost::this_thread::get_id()]->current_record_rest_size, 0u);
BOOST_CHECK_EQUAL(this->session_thread_data_map[boost::this_thread::get_id()]->data_size, 10u);
BOOST_CHECK_EQUAL(status, REALSERVER_SEND);
- BOOST_CHECK_EQUAL(this->session_thread_data_map[boost::this_thread::get_id()]->realserver_connect_failed_count, 0);
BOOST_CHECK_EQUAL(datalen, 10u);
delete[] mem_cmp_buffer;
this->session_thread_data_map.clear();
BOOST_CHECK_EQUAL(this->session_thread_data_map[boost::this_thread::get_id()]->current_record_rest_size, 0u);
BOOST_CHECK_EQUAL(this->session_thread_data_map[boost::this_thread::get_id()]->data_size, 10u);
BOOST_CHECK_EQUAL(status, REALSERVER_SEND);
- BOOST_CHECK_EQUAL(this->session_thread_data_map[boost::this_thread::get_id()]->realserver_connect_failed_count, 0);
BOOST_CHECK_EQUAL(datalen, static_cast<size_t>(MAX_BUFFER_SIZE));
delete[] mem_cmp_buffer;
this->session_thread_data_map.clear();
BOOST_CHECK_EQUAL(this->session_thread_data_map[boost::this_thread::get_id()]->current_record_rest_size, 10u);
BOOST_CHECK_EQUAL(this->session_thread_data_map[boost::this_thread::get_id()]->data_size, 20u);
BOOST_CHECK_EQUAL(status, REALSERVER_SEND);
- BOOST_CHECK_EQUAL(this->session_thread_data_map[boost::this_thread::get_id()]->realserver_connect_failed_count, 0);
BOOST_CHECK_EQUAL(datalen, static_cast<size_t>(MAX_BUFFER_SIZE));
delete[] mem_cmp_buffer;
this->session_thread_data_map.clear();
BOOST_CHECK_EQUAL(this->session_thread_data_map[boost::this_thread::get_id()]->current_record_rest_size, 0u);
BOOST_CHECK_EQUAL(this->session_thread_data_map[boost::this_thread::get_id()]->data_size, 10u);
BOOST_CHECK_EQUAL(status, REALSERVER_SEND);
- BOOST_CHECK_EQUAL(this->session_thread_data_map[boost::this_thread::get_id()]->realserver_connect_failed_count, 0);
BOOST_CHECK_EQUAL(datalen, static_cast<size_t>(MAX_BUFFER_SIZE));
}
}
boost::asio::ip::tcp::endpoint ep;
session_thread_data_sslid* thread_up_data_value = new session_thread_data_sslid;
thread_up_data_value->thread_division=THREAD_DIVISION_UP_STREAM;
- thread_up_data_value->realserver_connect_failed_count=0;
thread_up_data_value->data_begain_offset=0;
thread_up_data_value->data_size=0;
thread_up_data_value->current_record_rest_size=0;
cout << "[189]--------------------------------------------- " << endl;
//unit_test[189] 終了フラグをON,遷移先ステータスを設定する,status = CLIENT_DISCONNECT
- //unit_test[189] test data:no rescheduleモード、初めて失敗するの場合
this->reschedule=0;
EVENT_TAG schedule=this->handle_realserver_connection_fail(boost::this_thread::get_id(), ep);
BOOST_CHECK_EQUAL(data->end_flag,END_FLAG_ON);
BOOST_CHECK_EQUAL(schedule, protocol_module_base::CLIENT_DISCONNECT);
- cout << "[190]--------------------------------------------- " << endl;
- //unit_test[190] realserver_connect_failed_count で1を加算する,遷移先ステータスを設定する,status = REALSERVER_SELECT
- //unit_test[190] test data:rescheduleモード、初めて失敗するの場合
- this->reschedule=1;
- schedule=this->handle_realserver_connection_fail(boost::this_thread::get_id(), ep);
- BOOST_CHECK_EQUAL(data->realserver_connect_failed_count,1);
- BOOST_CHECK_EQUAL(schedule, protocol_module_base::REALSERVER_SELECT);
-
- cout << "[191]--------------------------------------------- " << endl;
- //unit_test[191] realserver_connect_failed_count で1を加算する,遷移先ステータスにREALSERVER_SELECTを設定する
- //unit_test[191] test data:rescheduleモード、3目失敗するの場合
- this->reschedule=1;
- schedule=this->handle_realserver_connection_fail(boost::this_thread::get_id(), ep);
- schedule=this->handle_realserver_connection_fail(boost::this_thread::get_id(), ep);
- BOOST_CHECK_EQUAL(data->realserver_connect_failed_count,3);
- BOOST_CHECK_EQUAL(schedule, protocol_module_base::REALSERVER_SELECT);
-
- cout << "[192]--------------------------------------------- " << endl;
- //unit_test[192] 終了フラグをON,遷移先ステータスにCLIENT_DISCONNECTを設定する
- //unit_test[192] test data:no rescheduleモード、4目失敗するの場合
- this->reschedule=0;
- schedule=this->handle_realserver_connection_fail(boost::this_thread::get_id(), ep);
- BOOST_CHECK_EQUAL(data->end_flag,END_FLAG_ON);
- BOOST_CHECK_EQUAL(schedule, protocol_module_base::CLIENT_DISCONNECT);
+// cout << "[190]--------------------------------------------- " << endl;
+// //unit_test[190] realserver_connect_failed_count で1を加算する,遷移先ステータスを設定する,status = REALSERVER_SELECT
+// //unit_test[190] test data:rescheduleモード、初めて失敗するの場合
+// this->reschedule=1;
+// schedule=this->handle_realserver_connection_fail(boost::this_thread::get_id(), ep);
+// BOOST_CHECK_EQUAL(data->realserver_connect_failed_count,1);
+// BOOST_CHECK_EQUAL(schedule, protocol_module_base::REALSERVER_SELECT);
+//
+// cout << "[191]--------------------------------------------- " << endl;
+// //unit_test[191] realserver_connect_failed_count で1を加算する,遷移先ステータスにREALSERVER_SELECTを設定する
+// //unit_test[191] test data:rescheduleモード、3目失敗するの場合
+// this->reschedule=1;
+// schedule=this->handle_realserver_connection_fail(boost::this_thread::get_id(), ep);
+// schedule=this->handle_realserver_connection_fail(boost::this_thread::get_id(), ep);
+// BOOST_CHECK_EQUAL(data->realserver_connect_failed_count,3);
+// BOOST_CHECK_EQUAL(schedule, protocol_module_base::REALSERVER_SELECT);
+//
+// cout << "[192]--------------------------------------------- " << endl;
+// //unit_test[192] 終了フラグをON,遷移先ステータスにCLIENT_DISCONNECTを設定する
+// //unit_test[192] test data:no rescheduleモード、4目失敗するの場合
+// this->reschedule=0;
+// schedule=this->handle_realserver_connection_fail(boost::this_thread::get_id(), ep);
+// BOOST_CHECK_EQUAL(data->end_flag,END_FLAG_ON);
+// BOOST_CHECK_EQUAL(schedule, protocol_module_base::CLIENT_DISCONNECT);
this->session_thread_data_map.clear();
}
- void handle_realserver_connection_fail_test_thread_reschedule(){
- boost::asio::ip::tcp::endpoint ep;
- session_thread_data_sslid* thread_up_data_value = new session_thread_data_sslid;
- thread_up_data_value->thread_division=THREAD_DIVISION_UP_STREAM;
- thread_up_data_value->realserver_connect_failed_count=0;
- thread_up_data_value->data_begain_offset=0;
- thread_up_data_value->data_size=0;
- thread_up_data_value->current_record_rest_size=0;
- thread_up_data_value->hello_message_flag=false;
- thread_data_ptr thread_data(thread_up_data_value);
- thread_data_ptr data;
- {
- boost::mutex::scoped_lock sclock(this->session_thread_data_map_mutex);
- this->session_thread_data_map[boost::this_thread::get_id()]=thread_data;
- std::map<const boost::thread::id,thread_data_ptr>::iterator iter;
- iter=this->session_thread_data_map.find(boost::this_thread::get_id());
- data=iter->second;
- this->reschedule=1;
- }
-
- cout << "[193]--------------------------------------------- " << endl;
- //unit_test[193] realserver_connect_failed_count で3を加算する,遷移先ステータスにREALSERVER_SELECTを設定する
- //unit_test[193] test data:rescheduleモード、3目失敗する、マルチスレッドの場合
- EVENT_TAG schedule=this->handle_realserver_connection_fail(boost::this_thread::get_id(), ep);
- schedule=this->handle_realserver_connection_fail(boost::this_thread::get_id(), ep);
- schedule=this->handle_realserver_connection_fail(boost::this_thread::get_id(), ep);
- {
- boost::mutex::scoped_lock sclock(check_mutex);
- BOOST_CHECK_EQUAL(data->realserver_connect_failed_count,3);
- BOOST_CHECK_EQUAL(schedule, protocol_module_base::REALSERVER_SELECT);
- }
- }
+// void handle_realserver_connection_fail_test_thread_reschedule(){
+// boost::asio::ip::tcp::endpoint ep;
+// session_thread_data_sslid* thread_up_data_value = new session_thread_data_sslid;
+// thread_up_data_value->thread_division=THREAD_DIVISION_UP_STREAM;
+// thread_up_data_value->data_begain_offset=0;
+// thread_up_data_value->data_size=0;
+// thread_up_data_value->current_record_rest_size=0;
+// thread_up_data_value->hello_message_flag=false;
+// thread_data_ptr thread_data(thread_up_data_value);
+// thread_data_ptr data;
+// {
+// boost::mutex::scoped_lock sclock(this->session_thread_data_map_mutex);
+// this->session_thread_data_map[boost::this_thread::get_id()]=thread_data;
+// std::map<const boost::thread::id,thread_data_ptr>::iterator iter;
+// iter=this->session_thread_data_map.find(boost::this_thread::get_id());
+// data=iter->second;
+// this->reschedule=1;
+// }
+//
+// cout << "[193]--------------------------------------------- " << endl;
+// //unit_test[193] realserver_connect_failed_count で3を加算する,遷移先ステータスにREALSERVER_SELECTを設定する
+// //unit_test[193] test data:rescheduleモード、3目失敗する、マルチスレッドの場合
+// EVENT_TAG schedule=this->handle_realserver_connection_fail(boost::this_thread::get_id(), ep);
+// schedule=this->handle_realserver_connection_fail(boost::this_thread::get_id(), ep);
+// schedule=this->handle_realserver_connection_fail(boost::this_thread::get_id(), ep);
+// {
+// boost::mutex::scoped_lock sclock(check_mutex);
+// BOOST_CHECK_EQUAL(data->realserver_connect_failed_count,3);
+// BOOST_CHECK_EQUAL(schedule, protocol_module_base::REALSERVER_SELECT);
+// }
+// }
void handle_realserver_connection_fail_test_thread_noreschedule(){
boost::asio::ip::tcp::endpoint ep;
session_thread_data_sslid* thread_up_data_value = new session_thread_data_sslid;
thread_up_data_value->thread_division=THREAD_DIVISION_UP_STREAM;
- thread_up_data_value->realserver_connect_failed_count=0;
thread_up_data_value->data_begain_offset=0;
thread_up_data_value->data_size=0;
thread_up_data_value->current_record_rest_size=0;
cout << "[194]--------------------------------------------- " << endl;
//unit_test[194] 終了フラグをON,遷移先ステータスを設定する,status = CLIENT_DISCONNECT
- //unit_test[194] test data:no rescheduleモード、マルチスレッドの場合
EVENT_TAG schedule=this->handle_realserver_connection_fail(boost::this_thread::get_id(), ep);
{
boost::mutex::scoped_lock sclock(check_mutex);
BOOST_CHECK_EQUAL(this->realserver_selected(ep), false);
}
-
+ void get_option_info_test(){
+ {
+ cout << "[273]--------------------------------------------- " << endl;
+ //unit_test[273] timeoutが0、maxlistが0、rescheduleが0の場合。
+ this->timeout = 0;
+ this->maxlist = 0;
+ this->reschedule = 0;
+ std::string option;
+ this->get_option_info(option);
+ BOOST_CHECK_EQUAL(strcmp(option.c_str(), "--timeout 0 --maxlist 0 --no-reschedule"), 0);
+ }
+ {
+ cout << "[274]--------------------------------------------- " << endl;
+ //unit_test[274] timeoutが3600、maxlistが256 rescheduleが1の場合
+ this->timeout = 3600;
+ this->maxlist = 256;
+ this->reschedule = 1;
+ std::string option;
+ this->get_option_info(option);
+ BOOST_CHECK_EQUAL(strcmp(option.c_str(), "--timeout 3600 --maxlist 256 --reschedule"), 0);
+ }
+ }
};
protocol_module_sslid_test_class obj;
obj.handle_realserver_connection_fail_test();
}
-void handle_realserver_connection_fail_test_thread_reschedule(){
- protocol_module_sslid_test_class obj;
- boost::thread_group threads;
- for(int i=0; i<THREAD_COUNT; i++)
- {
- threads.create_thread(bind(&protocol_module_sslid_test_class::handle_realserver_connection_fail_test_thread_reschedule,&obj));
- }
- threads.join_all();
-}
+//void handle_realserver_connection_fail_test_thread_reschedule(){
+// protocol_module_sslid_test_class obj;
+// boost::thread_group threads;
+// for(int i=0; i<THREAD_COUNT; i++)
+// {
+// threads.create_thread(bind(&protocol_module_sslid_test_class::handle_realserver_connection_fail_test_thread_reschedule,&obj));
+// }
+// threads.join_all();
+//}
void handle_realserver_connection_fail_test_thread_noreschedule(){
protocol_module_sslid_test_class obj;
boost::thread_group threads;
protocol_module_sslid_test_class obj;
obj.realserver_selected_test();
}
+void get_option_info_test(){
+ protocol_module_sslid_test_class obj;
+ obj.get_option_info_test();
+}
void protocol_module_sslid_test_main() {
ts->add(BOOST_TEST_CASE( &handle_realserver_connect_test ));
ts->add(BOOST_TEST_CASE( &handle_realserver_connect_test_thread ));
ts->add(BOOST_TEST_CASE( &handle_realserver_connection_fail_test ));
- ts->add(BOOST_TEST_CASE( &handle_realserver_connection_fail_test_thread_reschedule ));
+ //ts->add(BOOST_TEST_CASE( &handle_realserver_connection_fail_test_thread_reschedule ));
ts->add(BOOST_TEST_CASE( &handle_realserver_connection_fail_test_thread_noreschedule ));
ts->add(BOOST_TEST_CASE( &handle_realserver_send_test ));
ts->add(BOOST_TEST_CASE( &handle_realserver_send_test_thread ));
ts->add(BOOST_TEST_CASE( &put_data_to_sendbuffer_test ));
ts->add(BOOST_TEST_CASE( &put_data_to_sendbuffer_test_thread ));
ts->add(BOOST_TEST_CASE( &realserver_selected_test ));
+ ts->add(BOOST_TEST_CASE( &get_option_info_test ));
framework::master_test_suite().add(ts);
}