#include <vector>
#include <list>
-//#include <sstream>
-//#include <algorithm>
-//#include <boost/thread/pthread/mutex.hpp>
#include <boost/date_time/posix_time/posix_time.hpp>
#include <boost/xpressive/xpressive.hpp>
#include <boost/asio/ip/tcp.hpp>
namespace l7vs
{
-
-//---------------------------------------------------------------------------------
+//! constractor
protocol_module_cinsert::protocol_module_cinsert() : http_protocol_module_base( "cinsert" )
{
}
-//---------------------------------------------------------------------------------
+//! destractor
protocol_module_cinsert::~protocol_module_cinsert()
{
}
-//---------------------------------------------------------------------------------
+//! tcp protocol support check
+//! @return tcp support is true
+//! @return tcp not-support is false
bool protocol_module_cinsert::is_tcp()
{
+ //---------- DEBUG LOG START ------------------------------
+ if( LOG_LV_DEBUG == getloglevel())
+ {
+ putLogDebug( 0,
+ "function in : [protocol_module_cinsert::is_tcp]",
+ __FILE__,
+ __LINE__ );
+ putLogDebug( 0,
+ "function out : [protocol_module_cinsert::is_tcp] : return = [true]",
+ __FILE__,
+ __LINE__ );
+ }
+ //---------- DEBUG LOG END ------------------------------
return true;
}
-//---------------------------------------------------------------------------------
bool protocol_module_cinsert::is_udp()
{
+ //---------- DEBUG LOG START ------------------------------
+ if( LOG_LV_DEBUG == getloglevel())
+ {
+ putLogDebug( 0,
+ "function in : [protocol_module_cinsert::is_udp]",
+ __FILE__,
+ __LINE__ );
+ putLogDebug( 0,
+ "function out : [protocol_module_cinsert::is_udp] : return = [false]",
+ __FILE__,
+ __LINE__ );
+ }
+ //---------- DEBUG LOG END ------------------------------
return false;
}
-//---------------------------------------------------------------------------------
void protocol_module_cinsert::replication_interrupt()
{
// NOP
return;
}
-//---------------------------------------------------------------------------------
void protocol_module_cinsert::initialize(
rs_list_itr_func_type inlist_begin,
rs_list_itr_func_type inlist_end,
boost::function< void( void ) > inlist_lock,
boost::function< void( void ) > inlist_unlock )
{
+ //---------- DEBUG LOG START ------------------------------
+ if( LOG_LV_DEBUG == getloglevel())
+ {
+ boost::format outform( "function in : [protocol_module_cinsert::initialize] : "
+ "inlist_begin = [%p], "
+ "inlist_end = [%p], "
+ "inlist_next = [%p], "
+ "inlist_lock = [%p], "
+ "inlist_unlock = [%p]");
+
+ outform % &inlist_begin % &inlist_end % &inlist_next % &inlist_lock % &inlist_unlock;
+
+ putLogDebug( 0,
+ outform.str(),
+ __FILE__,
+ __LINE__ );
+ }
+ //---------- DEBUG LOG END ------------------------------
+
rs_list_begin = inlist_begin;
rs_list_end = inlist_end;
rs_list_next = inlist_next;
rs_list_lock = inlist_lock;
rs_list_unlock = inlist_unlock;
+
+ //---------- DEBUG LOG START ------------------------------
+ if( LOG_LV_DEBUG == getloglevel())
+ {
+ boost::format outform( "function out : [protocol_module_cinsert::initialize] : "
+ "rs_list_begin = [%p], "
+ "rs_list_end = [%p], "
+ "rs_list_next = [%p], "
+ "rs_list_lock = [%p], "
+ "rs_list_unlock = [%p]");
+
+ outform % &rs_list_begin % &rs_list_end % &rs_list_next % &rs_list_lock % &rs_list_unlock;
+
+ putLogDebug( 0,
+ outform.str(),
+ __FILE__,
+ __LINE__ );
+ }
+ //---------- DEBUG LOG END ------------------------------
+
}
-//---------------------------------------------------------------------------------
void protocol_module_cinsert::finalize()
{
+ //---------- DEBUG LOG START ------------------------------
+ if( LOG_LV_DEBUG == getloglevel())
+ {
+ putLogDebug( 0,
+ "function in : [protocol_module_cinsert::finalize]",
+ __FILE__,
+ __LINE__ );
+ }
+ //---------- DEBUG LOG END ------------------------------
+
getloglevel.clear();
putLogFatal.clear();
putLogError.clear();
reschedule = 0;
cookie_name.assign( '\0' );
sorry_uri.assign( '\0' );
+
+ //---------- DEBUG LOG START ------------------------------
+ if( LOG_LV_DEBUG == getloglevel())
+ {
+ putLogDebug( 0,
+ "function out : [protocol_module_cinsert::finalize]",
+ __FILE__,
+ __LINE__ );
+ }
+ //---------- DEBUG LOG END ------------------------------
+
}
//---------------------------------------------------------------------------------
protocol_module_cinsert::check_message_result
protocol_module_cinsert::check_parameter( const std::vector< std::string >& args )
{
+
+ //---------- DEBUG LOG START ------------------------------
+ if( LOG_LV_DEBUG == getloglevel())
+ {
+ boost::format outform( "function in : [protocol_module_cinsert::check_parameter] : "
+ "args.size = [%d], "
+ "args = [%s] ");
+
+ std::string str = "";
+
+ for( unsigned int i = 0; i < args.size(); i++ )
+ {
+ if( i != 0 )
+ {
+ str += ", ";
+ }
+ str += "{";
+ str += args[i];
+ str += "}";
+ }
+
+ outform % args.size() % str;
+
+ putLogDebug( 0,
+ outform.str(),
+ __FILE__,
+ __LINE__ );
+ }
+ //---------- DEBUG LOG END ------------------------------
+
using namespace boost::xpressive;
check_message_result check_result;
check_result.message = "Option error.";
}
+ //---------- DEBUG LOG START ------------------------------
+ if( LOG_LV_DEBUG == getloglevel())
+ {
+ boost::format outform( "function out : [protocol_module_cinsert::check_parameter] : "
+ "check_result.flag = [%d], "
+ "check_result.message = [%s] ");
+
+ outform % check_result.flag % check_result.message;
+
+ putLogDebug( 0,
+ outform.str(),
+ __FILE__,
+ __LINE__ );
+ }
+ //---------- DEBUG LOG END ------------------------------
+
return check_result;
}
protocol_module_cinsert::set_parameter( const std::vector< std::string >& args )
{
+ //---------- DEBUG LOG START ------------------------------
+ if( LOG_LV_DEBUG == getloglevel())
+ {
+ boost::format outform( "function in : [protocol_module_cinsert::set_parameter] : "
+ "args.size = [%d], "
+ "args = [%s] ");
+
+ std::string str = "";
+
+ for( unsigned int i = 0; i < args.size(); i++ )
+ {
+ if( i != 0 )
+ {
+ str += ", ";
+ }
+ str += "{";
+ str += args[i];
+ str += "}";
+ }
+
+ outform % args.size() % str;
+
+ putLogDebug( 0,
+ outform.str(),
+ __FILE__,
+ __LINE__ );
+ }
+ //---------- DEBUG LOG END ------------------------------
+
using namespace boost::xpressive;
check_message_result check_result;
check_result.message = "Option error.";
}
+ //---------- DEBUG LOG START ------------------------------
+ if( LOG_LV_DEBUG == getloglevel())
+ {
+ boost::format outform( "function out : [protocol_module_cinsert::set_parameter] : "
+ "check_result.flag = [%d], "
+ "check_result.message = [%s] ");
+
+ outform % check_result.flag % check_result.message;
+
+ putLogDebug( 0,
+ outform.str(),
+ __FILE__,
+ __LINE__ );
+ }
+ //---------- DEBUG LOG END ------------------------------
+
return check_result;
}
protocol_module_cinsert::check_message_result
protocol_module_cinsert::add_parameter( const std::vector< std::string >& args )
{
+
+ //---------- DEBUG LOG START ------------------------------
+ if( LOG_LV_DEBUG == getloglevel())
+ {
+ boost::format outform( "function in : [protocol_module_cinsert::add_parameter] : "
+ "args.size = [%d], "
+ "args = [%s] ");
+
+ std::string str = "";
+
+ for( unsigned int i = 0; i < args.size(); i++ )
+ {
+ if( i != 0 )
+ {
+ str += ", ";
+ }
+ str += "{";
+ str += args[i];
+ str += "}";
+ }
+
+ outform % args.size() % str;
+
+ putLogDebug( 0,
+ outform.str(),
+ __FILE__,
+ __LINE__ );
+ }
+ //---------- DEBUG LOG END ------------------------------
+
check_message_result check_result;
try
check_result.message = "Cannot add option.";
}
+ //---------- DEBUG LOG START ------------------------------
+ if( LOG_LV_DEBUG == getloglevel())
+ {
+ boost::format outform( "function out : [protocol_module_cinsert::add_parameter] : "
+ "check_result.flag = [%d], "
+ "check_result.message = [%s] ");
+
+ outform % check_result.flag % check_result.message;
+
+ putLogDebug( 0,
+ outform.str(),
+ __FILE__,
+ __LINE__ );
+ }
+ //---------- DEBUG LOG END ------------------------------
+
return check_result;
}
//---------------------------------------------------------------------------------
void protocol_module_cinsert::register_schedule( tcp_schedule_func_type inschedule )
{
+
+ //---------- DEBUG LOG START ------------------------------
+ if( LOG_LV_DEBUG == getloglevel())
+ {
+ boost::format outform( "function in : [protocol_module_cinsert::register_schedule] : "
+ "inschedule = [%p]");
+
+ outform % &inschedule;
+
+ putLogDebug( 0,
+ outform.str(),
+ __FILE__,
+ __LINE__ );
+ }
+ //---------- DEBUG LOG END ------------------------------
+
schedule_tcp = inschedule;
+
+ //---------- DEBUG LOG START ------------------------------
+ if( LOG_LV_DEBUG == getloglevel())
+ {
+ boost::format outform( "function out : [protocol_module_cinsert::register_schedule] : "
+ "schedule_tcp = [%p]");
+
+ outform % &schedule_tcp;
+
+ putLogDebug( 0,
+ outform.str(),
+ __FILE__,
+ __LINE__ );
+ }
+ //---------- DEBUG LOG END ------------------------------
}
//---------------------------------------------------------------------------------
const boost::asio::ip::udp::endpoint& client_endpoint_udp )
{
+ //---------- DEBUG LOG START ------------------------------
+ if( LOG_LV_DEBUG == getloglevel())
+ {
+ boost::format outform( "function in : [protocol_module_cinsert::handle_session_initialize] : "
+ "up_thread_id = [%s], "
+ "down_thread_id = [%s], "
+ "client_endpoint_tcp = [%s], "
+ "client_endpoint_udp = [%s]");
+
+ outform % up_thread_id % down_thread_id % client_endpoint_tcp % client_endpoint_udp;
+
+ putLogDebug( 0,
+ outform.str(),
+ __FILE__,
+ __LINE__ );
+ }
+ //---------- DEBUG LOG END ------------------------------
+
recive_data client_recv_data;
char* buffer = NULL;
} catch (...)
{
+ //---------- DEBUG LOG START ------------------------------
+ if( LOG_LV_DEBUG == getloglevel())
+ {
+ boost::format outform( "function out : [protocol_module_cinsert::handle_session_initialize] : "
+ "next_status = [%d]");
+
+ outform % FINALIZE;
+
+ putLogDebug( 0,
+ outform.str(),
+ __FILE__,
+ __LINE__ );
+ }
+ //---------- DEBUG LOG END ------------------------------
+
return FINALIZE;
}
+ //---------- DEBUG LOG START ------------------------------
+ if( LOG_LV_DEBUG == getloglevel())
+ {
+ boost::format outform( "function out : [protocol_module_cinsert::handle_session_initialize] : "
+ "next_status = [%d]");
+
+ outform % ACCEPT;
+
+ putLogDebug( 0,
+ outform.str(),
+ __FILE__,
+ __LINE__ );
+ }
+ //---------- DEBUG LOG END ------------------------------
+
return ACCEPT;
}
const boost::thread::id down_thread_id )
{
+ //---------- DEBUG LOG START ------------------------------
+ if( LOG_LV_DEBUG == getloglevel())
+ {
+ boost::format outform( "function in : [protocol_module_cinsert::handle_session_finalize] : "
+ "up_thread_id = [%s], "
+ "down_thread_id = [%s]");
+
+ outform % up_thread_id % down_thread_id;
+
+ putLogDebug( 0,
+ outform.str(),
+ __FILE__,
+ __LINE__ );
+ }
+ //---------- DEBUG LOG END ------------------------------
+
t_session_thread_data_map_itr thread_data_itr;
try
} catch (...)
{
+
+ //---------- DEBUG LOG START ------------------------------
+ if( LOG_LV_DEBUG == getloglevel())
+ {
+ boost::format outform( "function out : [protocol_module_cinsert::handle_session_finalize] : "
+ "next_status = [%d]");
+
+ outform % STOP;
+
+ putLogDebug( 0,
+ outform.str(),
+ __FILE__,
+ __LINE__ );
+ }
+ //---------- DEBUG LOG END ------------------------------
+
return STOP;
}
+
+ //---------- DEBUG LOG START ------------------------------
+ if( LOG_LV_DEBUG == getloglevel())
+ {
+ boost::format outform( "function out : [protocol_module_cinsert::handle_session_finalize] : "
+ "next_status = [%d]");
+
+ outform % STOP;
+
+ putLogDebug( 0,
+ outform.str(),
+ __FILE__,
+ __LINE__ );
+ }
+ //---------- DEBUG LOG END ------------------------------
+
return STOP;
}
protocol_module_cinsert::handle_accept( const boost::thread::id thread_id )
{
+ //---------- DEBUG LOG START ------------------------------
+ if( LOG_LV_DEBUG == getloglevel())
+ {
+ boost::format outform( "function in : [protocol_module_cinsert::handle_accept] : "
+ "thread_id = [%s]");
+
+ outform % thread_id;
+
+ putLogDebug( 0,
+ outform.str(),
+ __FILE__,
+ __LINE__ );
+ }
+ //---------- DEBUG LOG END ------------------------------
+
t_session_thread_data_cinsert thread_data;
t_session_thread_data_map_itr thread_data_itr;
}
} catch (...)
{
+
+ //---------- DEBUG LOG START ------------------------------
+ if( LOG_LV_DEBUG == getloglevel())
+ {
+ boost::format outform( "function out : [protocol_module_cinsert::handle_accept] : "
+ "next_status = [%d]");
+
+ outform % FINALIZE;
+
+ putLogDebug( 0,
+ outform.str(),
+ __FILE__,
+ __LINE__ );
+ }
+ //---------- DEBUG LOG END ------------------------------
+
return FINALIZE;
}
+
+ //---------- DEBUG LOG START ------------------------------
+ if( LOG_LV_DEBUG == getloglevel())
+ {
+ boost::format outform( "function out : [protocol_module_cinsert::handle_accept] : "
+ "next_status = [%d]");
+
+ outform % status;
+
+ putLogDebug( 0,
+ outform.str(),
+ __FILE__,
+ __LINE__ );
+ }
+ //---------- DEBUG LOG END ------------------------------
+
return status;
}
const size_t recvlen )
{
+ //---------- DEBUG LOG START ------------------------------
+ if( LOG_LV_DEBUG == getloglevel())
+ {
+ boost::format outform( "function in : [protocol_module_cinsert::handle_client_recv] : "
+ "thread_id = [%s], "
+ "recvlen = [%d]");
+
+ outform % thread_id % recvlen;
+
+ putLogDebug( 0,
+ outform.str(),
+ __FILE__,
+ __LINE__ );
+ }
+ //---------- DEBUG LOG END ------------------------------
+
using namespace boost::xpressive;
t_session_thread_data_cinsert thread_data;
}
} catch (...)
{
+ //---------- DEBUG LOG START ------------------------------
+ if( LOG_LV_DEBUG == getloglevel())
+ {
+ boost::format outform( "function out : [protocol_module_cinsert::handle_client_recv] : "
+ "next_status = [%d]");
+
+ outform % FINALIZE;
+
+ putLogDebug( 0,
+ outform.str(),
+ __FILE__,
+ __LINE__ );
+ }
+ //---------- DEBUG LOG END ------------------------------
+
return FINALIZE;
}
+
+ //---------- DEBUG LOG START ------------------------------
+ if( LOG_LV_DEBUG == getloglevel())
+ {
+ boost::format outform( "function out : [protocol_module_cinsert::handle_client_recv] : "
+ "next_status = [%d]");
+
+ outform % status;
+
+ putLogDebug( 0,
+ outform.str(),
+ __FILE__,
+ __LINE__ );
+ }
+ //---------- DEBUG LOG END ------------------------------
+
return status;
}
boost::asio::ip::tcp::endpoint & rs_endpoint )
{
+ //---------- DEBUG LOG START ------------------------------
+ if( LOG_LV_DEBUG == getloglevel())
+ {
+ boost::format outform( "function in : [protocol_module_cinsert::handle_realserver_select] : "
+ "thread_id = [%s]");
+
+ outform % thread_id;
+
+ putLogDebug( 0,
+ outform.str(),
+ __FILE__,
+ __LINE__ );
+ }
+ //---------- DEBUG LOG END ------------------------------
+
using namespace boost::xpressive;
t_session_thread_data_cinsert thread_data;
}
} catch (...)
{
+ //---------- DEBUG LOG START ------------------------------
+ if( LOG_LV_DEBUG == getloglevel())
+ {
+ boost::format outform( "function out : [protocol_module_cinsert::handle_realserver_select] : "
+ "next_status = [%d]");
+
+ outform % FINALIZE;
+
+ putLogDebug( 0,
+ outform.str(),
+ __FILE__,
+ __LINE__ );
+ }
+ //---------- DEBUG LOG END ------------------------------
+
return FINALIZE;
}
+
+ //---------- DEBUG LOG START ------------------------------
+ if( LOG_LV_DEBUG == getloglevel())
+ {
+ boost::format outform( "function out : [protocol_module_cinsert::handle_realserver_select] : "
+ "next_status = [%d], "
+ "rs_endpoint = [%s]");
+
+ outform % status % rs_endpoint;
+
+ putLogDebug( 0,
+ outform.str(),
+ __FILE__,
+ __LINE__ );
+ }
+ //---------- DEBUG LOG END ------------------------------
+
return status;
+
}
//---------------------------------------------------------------------------------
size_t& datalen )
{
+ //---------- DEBUG LOG START ------------------------------
+ if( LOG_LV_DEBUG == getloglevel())
+ {
+ boost::format outform( "function in : [protocol_module_cinsert::handle_realserver_connect] : "
+ "thread_id = [%s]");
+
+ outform % thread_id;
+
+ putLogDebug( 0,
+ outform.str(),
+ __FILE__,
+ __LINE__ );
+ }
+ //---------- DEBUG LOG END ------------------------------
+
t_session_thread_data_cinsert thread_data;
size_t rest_datalen = sendbuffer.size();
}
} catch (...)
{
+ //---------- DEBUG LOG START ------------------------------
+ if( LOG_LV_DEBUG == getloglevel())
+ {
+ boost::format outform( "function out : [protocol_module_cinsert::handle_realserver_connect] : "
+ "next_status = [%d]");
+
+ outform % FINALIZE;
+
+ putLogDebug( 0,
+ outform.str(),
+ __FILE__,
+ __LINE__ );
+ }
+ //---------- DEBUG LOG END ------------------------------
+
return FINALIZE;
}
+
+ //---------- DEBUG LOG START ------------------------------
+ if( LOG_LV_DEBUG == getloglevel())
+ {
+ boost::format outform( "function out : [protocol_module_cinsert::handle_realserver_connect] : "
+ "next_status = [%d], "
+ "datalen = [%d]");
+
+ outform % status % datalen;
+
+ putLogDebug( 0,
+ outform.str(),
+ __FILE__,
+ __LINE__ );
+ }
+ //---------- DEBUG LOG END ------------------------------
+
return status;
}
const boost::thread::id thread_id,
const boost::asio::ip::tcp::endpoint & rs_endpoint )
{
+
+ //---------- DEBUG LOG START ------------------------------
+ if( LOG_LV_DEBUG == getloglevel())
+ {
+ boost::format outform( "function in : [protocol_module_cinsert::handle_realserver_connection_fail] : "
+ "thread_id = [%s], "
+ "rs_endpoint = [%s]");
+
+ outform % thread_id % rs_endpoint;
+
+ putLogDebug( 0,
+ outform.str(),
+ __FILE__,
+ __LINE__ );
+ }
+ //---------- DEBUG LOG END ------------------------------
+
t_session_thread_data_cinsert thread_data;
t_session_thread_data_map_itr thread_data_itr;
}
} catch (...)
{
+ //---------- DEBUG LOG START ------------------------------
+ if( LOG_LV_DEBUG == getloglevel())
+ {
+ boost::format outform( "function out : [protocol_module_cinsert::handle_realserver_connection_fail] : "
+ "next_status = [%d]");
+
+ outform % FINALIZE;
+
+ putLogDebug( 0,
+ outform.str(),
+ __FILE__,
+ __LINE__ );
+ }
+ //---------- DEBUG LOG END ------------------------------
+
return FINALIZE;
}
+
+ //---------- DEBUG LOG START ------------------------------
+ if( LOG_LV_DEBUG == getloglevel())
+ {
+ boost::format outform( "function out : [protocol_module_cinsert::handle_realserver_connection_fail] : "
+ "next_status = [%d]");
+
+ outform % status;
+
+ putLogDebug( 0,
+ outform.str(),
+ __FILE__,
+ __LINE__ );
+ }
+ //---------- DEBUG LOG END ------------------------------
+
return status;
}
protocol_module_cinsert::EVENT_TAG
protocol_module_cinsert::handle_realserver_send( const boost::thread::id thread_id )
{
+
+ //---------- DEBUG LOG START ------------------------------
+ if( LOG_LV_DEBUG == getloglevel())
+ {
+ boost::format outform( "function in : [protocol_module_cinsert::handle_realserver_send] : "
+ "thread_id = [%s]");
+
+ outform % thread_id;
+
+ putLogDebug( 0,
+ outform.str(),
+ __FILE__,
+ __LINE__ );
+ }
+ //---------- DEBUG LOG END ------------------------------
+
t_session_thread_data_cinsert thread_data;
t_session_thread_data_map_itr thread_data_itr;
}
} catch (...)
{
+ //---------- DEBUG LOG START ------------------------------
+ if( LOG_LV_DEBUG == getloglevel())
+ {
+ boost::format outform( "function out : [protocol_module_cinsert::handle_realserver_send] : "
+ "next_status = [%d]");
+
+ outform % FINALIZE;
+
+ putLogDebug( 0,
+ outform.str(),
+ __FILE__,
+ __LINE__ );
+ }
+ //---------- DEBUG LOG END ------------------------------
+
return FINALIZE;
}
+
+ //---------- DEBUG LOG START ------------------------------
+ if( LOG_LV_DEBUG == getloglevel())
+ {
+ boost::format outform( "function out : [protocol_module_cinsert::handle_realserver_send] : "
+ "next_status = [%d]");
+
+ outform % status;
+
+ putLogDebug( 0,
+ outform.str(),
+ __FILE__,
+ __LINE__ );
+ }
+ //---------- DEBUG LOG END ------------------------------
+
return status;
}
const boost::thread::id thread_id,
boost::asio::ip::tcp::endpoint & sorry_endpoint )
{
+
+ //---------- DEBUG LOG START ------------------------------
+ if( LOG_LV_DEBUG == getloglevel())
+ {
+ boost::format outform( "function in : [protocol_module_cinsert::handle_sorryserver_select] : "
+ "thread_id = [%s], "
+ "sorry_endpoint = [%s]");
+
+ outform % thread_id % sorry_endpoint;
+
+ putLogDebug( 0,
+ outform.str(),
+ __FILE__,
+ __LINE__ );
+ }
+ //---------- DEBUG LOG END ------------------------------
+
t_session_thread_data_cinsert thread_data;
t_session_thread_data_map_itr thread_data_itr;
}
} catch (...)
{
+ //---------- DEBUG LOG START ------------------------------
+ if( LOG_LV_DEBUG == getloglevel())
+ {
+ boost::format outform( "function out : [protocol_module_cinsert::handle_sorryserver_select] : "
+ "next_status = [%d]");
+
+ outform % FINALIZE;
+
+ putLogDebug( 0,
+ outform.str(),
+ __FILE__,
+ __LINE__ );
+ }
+ //---------- DEBUG LOG END ------------------------------
+
return FINALIZE;
}
+
+ //---------- DEBUG LOG START ------------------------------
+ if( LOG_LV_DEBUG == getloglevel())
+ {
+ boost::format outform( "function out : [protocol_module_cinsert::handle_sorryserver_select] : "
+ "next_status = [%d], "
+ "sorry_endpoint = [%s]");
+
+ outform % status % sorry_endpoint;
+
+ putLogDebug( 0,
+ outform.str(),
+ __FILE__,
+ __LINE__ );
+ }
+ //---------- DEBUG LOG END ------------------------------
+
return status;
}
boost::array< char, MAX_BUFFER_SIZE >& sendbuffer,
size_t& datalen )
{
+
+ //---------- DEBUG LOG START ------------------------------
+ if( LOG_LV_DEBUG == getloglevel())
+ {
+ boost::format outform( "function in : [protocol_module_cinsert::handle_sorryserver_connect] : "
+ "thread_id = [%s]");
+
+ outform % thread_id;
+
+ putLogDebug( 0,
+ outform.str(),
+ __FILE__,
+ __LINE__ );
+ }
+ //---------- DEBUG LOG END ------------------------------
+
t_session_thread_data_cinsert thread_data;
edit_data edit_data_uri;
}
} catch (...)
{
+ //---------- DEBUG LOG START ------------------------------
+ if( LOG_LV_DEBUG == getloglevel())
+ {
+ boost::format outform( "function out : [protocol_module_cinsert::handle_sorryserver_connect] : "
+ "next_status = [%d]");
+
+ outform % FINALIZE;
+
+ putLogDebug( 0,
+ outform.str(),
+ __FILE__,
+ __LINE__ );
+ }
+ //---------- DEBUG LOG END ------------------------------
+
return FINALIZE;
}
+
+ //---------- DEBUG LOG START ------------------------------
+ if( LOG_LV_DEBUG == getloglevel())
+ {
+ boost::format outform( "function out : [protocol_module_cinsert::handle_sorryserver_connect] : "
+ "next_status = [%d], "
+ "datalen = [%d]");
+
+ outform % status % datalen;
+
+ putLogDebug( 0,
+ outform.str(),
+ __FILE__,
+ __LINE__ );
+ }
+ //---------- DEBUG LOG END ------------------------------
+
return status;
}
const boost::thread::id thread_id,
const boost::asio::ip::tcp::endpoint & sorry_endpoint )
{
+
+ //---------- DEBUG LOG START ------------------------------
+ if( LOG_LV_DEBUG == getloglevel())
+ {
+ boost::format outform( "function in : [protocol_module_cinsert::handle_sorryserver_connection_fail] : "
+ "thread_id = [%s], "
+ "sorry_endpoint = [%s]");
+
+ outform % thread_id % sorry_endpoint;
+
+ putLogDebug( 0,
+ outform.str(),
+ __FILE__,
+ __LINE__ );
+ }
+ //---------- DEBUG LOG END ------------------------------
+
t_session_thread_data_cinsert thread_data;
t_session_thread_data_map_itr thread_data_itr;
}
} catch (...)
{
+ //---------- DEBUG LOG START ------------------------------
+ if( LOG_LV_DEBUG == getloglevel())
+ {
+ boost::format outform( "function out : [protocol_module_cinsert::handle_sorryserver_connection_fail] : "
+ "next_status = [%d]");
+
+ outform % FINALIZE;
+
+ putLogDebug( 0,
+ outform.str(),
+ __FILE__,
+ __LINE__ );
+ }
+ //---------- DEBUG LOG END ------------------------------
+
return FINALIZE;
}
+
+ //---------- DEBUG LOG START ------------------------------
+ if( LOG_LV_DEBUG == getloglevel())
+ {
+ boost::format outform( "function out : [protocol_module_cinsert::handle_sorryserver_connection_fail] : "
+ "next_status = [%d]");
+
+ outform % status;
+
+ putLogDebug( 0,
+ outform.str(),
+ __FILE__,
+ __LINE__ );
+ }
+ //---------- DEBUG LOG END ------------------------------
+
return status;
}
protocol_module_cinsert::EVENT_TAG
protocol_module_cinsert::handle_sorryserver_send( const boost::thread::id thread_id )
{
+
+ //---------- DEBUG LOG START ------------------------------
+ if( LOG_LV_DEBUG == getloglevel())
+ {
+ boost::format outform( "function in : [protocol_module_cinsert::handle_sorryserver_send] : "
+ "thread_id = [%s]");
+
+ outform % thread_id;
+
+ putLogDebug( 0,
+ outform.str(),
+ __FILE__,
+ __LINE__ );
+ }
+ //---------- DEBUG LOG END ------------------------------
+
t_session_thread_data_cinsert thread_data;
t_session_thread_data_map_itr thread_data_itr;
}
} catch (...)
{
+ //---------- DEBUG LOG START ------------------------------
+ if( LOG_LV_DEBUG == getloglevel())
+ {
+ boost::format outform( "function out : [protocol_module_cinsert::handle_sorryserver_send] : "
+ "next_status = [%d]");
+
+ outform % FINALIZE;
+
+ putLogDebug( 0,
+ outform.str(),
+ __FILE__,
+ __LINE__ );
+ }
+ //---------- DEBUG LOG END ------------------------------
+
return FINALIZE;
}
+
+ //---------- DEBUG LOG START ------------------------------
+ if( LOG_LV_DEBUG == getloglevel())
+ {
+ boost::format outform( "function out : [protocol_module_cinsert::handle_sorryserver_send] : "
+ "next_status = [%d]");
+
+ outform % status;
+
+ putLogDebug( 0,
+ outform.str(),
+ __FILE__,
+ __LINE__ );
+ }
+ //---------- DEBUG LOG END ------------------------------
+
return status;
}
const boost::array< char, MAX_BUFFER_SIZE >& recvbuffer,
const size_t recvlen )
{
+
+ //---------- DEBUG LOG START ------------------------------
+ if( LOG_LV_DEBUG == getloglevel())
+ {
+ boost::format outform( "function in : [protocol_module_cinsert::handle_realserver_recv] : "
+ "thread_id = [%s], "
+ "rs_endpoint = [%s], "
+ "recvlen = [%d]");
+
+ outform % thread_id % rs_endpoint % recvlen;
+
+ putLogDebug( 0,
+ outform.str(),
+ __FILE__,
+ __LINE__ );
+ }
+ //---------- DEBUG LOG END ------------------------------
+
using namespace boost::xpressive;
t_session_thread_data_cinsert thread_data;
}
} catch (...)
{
+ //---------- DEBUG LOG START ------------------------------
+ if( LOG_LV_DEBUG == getloglevel())
+ {
+ boost::format outform( "function out : [protocol_module_cinsert::handle_realserver_recv] : "
+ "next_status = [%d]");
+
+ outform % FINALIZE;
+
+ putLogDebug( 0,
+ outform.str(),
+ __FILE__,
+ __LINE__ );
+ }
+ //---------- DEBUG LOG END ------------------------------
+
return FINALIZE;
}
+
+ //---------- DEBUG LOG START ------------------------------
+ if( LOG_LV_DEBUG == getloglevel())
+ {
+ boost::format outform( "function out : [protocol_module_cinsert::handle_realserver_recv] : "
+ "next_status = [%d]");
+
+ outform % status;
+
+ putLogDebug( 0,
+ outform.str(),
+ __FILE__,
+ __LINE__ );
+ }
+ //---------- DEBUG LOG END ------------------------------
+
return status;
}
const boost::array< char, MAX_BUFFER_SIZE >& recvbuffer,
const size_t recvlen )
{
+
+ //---------- DEBUG LOG START ------------------------------
+ if( LOG_LV_DEBUG == getloglevel())
+ {
+ boost::format outform( "function in : [protocol_module_cinsert::handle_sorryserver_recv] : "
+ "thread_id = [%s], "
+ "sorry_endpoint = [%s], "
+ "recvlen = [%d]");
+
+ outform % thread_id % sorry_endpoint % recvlen;
+
+ putLogDebug( 0,
+ outform.str(),
+ __FILE__,
+ __LINE__ );
+ }
+ //---------- DEBUG LOG END ------------------------------
+
using namespace boost::xpressive;
t_session_thread_data_cinsert thread_data;
}
} catch (...)
{
+ //---------- DEBUG LOG START ------------------------------
+ if( LOG_LV_DEBUG == getloglevel())
+ {
+ boost::format outform( "function out : [protocol_module_cinsert::handle_sorryserver_recv] : "
+ "next_status = [%d]");
+
+ outform % FINALIZE;
+
+ putLogDebug( 0,
+ outform.str(),
+ __FILE__,
+ __LINE__ );
+ }
+ //---------- DEBUG LOG END ------------------------------
+
return FINALIZE;
}
+
+ //---------- DEBUG LOG START ------------------------------
+ if( LOG_LV_DEBUG == getloglevel())
+ {
+ boost::format outform( "function out : [protocol_module_cinsert::handle_sorryserver_recv] : "
+ "next_status = [%d]");
+
+ outform % status;
+
+ putLogDebug( 0,
+ outform.str(),
+ __FILE__,
+ __LINE__ );
+ }
+ //---------- DEBUG LOG END ------------------------------
+
return status;
}
size_t& datalen )
{
+ //---------- DEBUG LOG START ------------------------------
+ if( LOG_LV_DEBUG == getloglevel())
+ {
+ boost::format outform( "function in : [protocol_module_cinsert::handle_client_connection_check] : "
+ "thread_id = [%s]");
+
+ outform % thread_id;
+
+ putLogDebug( 0,
+ outform.str(),
+ __FILE__,
+ __LINE__ );
+ }
+ //---------- DEBUG LOG END ------------------------------
+
t_session_thread_data_cinsert thread_data;
size_t rest_datalen = sendbuffer.size();
}
} catch (...)
{
+ //---------- DEBUG LOG START ------------------------------
+ if( LOG_LV_DEBUG == getloglevel())
+ {
+ boost::format outform( "function out : [protocol_module_cinsert::handle_client_connection_check] : "
+ "next_status = [%d]");
+
+ outform % FINALIZE;
+
+ putLogDebug( 0,
+ outform.str(),
+ __FILE__,
+ __LINE__ );
+ }
+ //---------- DEBUG LOG END ------------------------------
+
return FINALIZE;
}
+
+ //---------- DEBUG LOG START ------------------------------
+ if( LOG_LV_DEBUG == getloglevel())
+ {
+ boost::format outform( "function out : [protocol_module_cinsert::handle_client_connection_check] : "
+ "next_status = [%d], "
+ "datalen = [%d]");
+
+ outform % status % datalen;
+
+ putLogDebug( 0,
+ outform.str(),
+ __FILE__,
+ __LINE__ );
+ }
+ //---------- DEBUG LOG END ------------------------------
+
return status;
}
protocol_module_cinsert::handle_client_send( const boost::thread::id thread_id )
{
+ //---------- DEBUG LOG START ------------------------------
+ if( LOG_LV_DEBUG == getloglevel())
+ {
+ boost::format outform( "function in : [protocol_module_cinsert::handle_client_send] : "
+ "thread_id = [%s]");
+
+ outform % thread_id;
+
+ putLogDebug( 0,
+ outform.str(),
+ __FILE__,
+ __LINE__ );
+ }
+ //---------- DEBUG LOG END ------------------------------
+
t_session_thread_data_cinsert thread_data;
t_session_thread_data_map_itr thread_data_itr;
}
} catch (...)
{
+ //---------- DEBUG LOG START ------------------------------
+ if( LOG_LV_DEBUG == getloglevel())
+ {
+ boost::format outform( "function out : [protocol_module_cinsert::handle_client_send] : "
+ "next_status = [%d]");
+
+ outform % FINALIZE;
+
+ putLogDebug( 0,
+ outform.str(),
+ __FILE__,
+ __LINE__ );
+ }
+ //---------- DEBUG LOG END ------------------------------
+
return FINALIZE;
}
+
+ //---------- DEBUG LOG START ------------------------------
+ if( LOG_LV_DEBUG == getloglevel())
+ {
+ boost::format outform( "function out : [protocol_module_cinsert::handle_client_send] : "
+ "next_status = [%d]");
+
+ outform % status;
+
+ putLogDebug( 0,
+ outform.str(),
+ __FILE__,
+ __LINE__ );
+ }
+ //---------- DEBUG LOG END ------------------------------
+
return status;
}
protocol_module_cinsert::EVENT_TAG
protocol_module_cinsert::handle_client_disconnect( const boost::thread::id thread_id )
{
+
+ //---------- DEBUG LOG START ------------------------------
+ if( LOG_LV_DEBUG == getloglevel())
+ {
+ boost::format outform_1( "function in : [protocol_module_cinsert::handle_client_disconnect] : "
+ "thread_id = [%s]");
+
+ outform_1 % thread_id;
+
+ putLogDebug( 0,
+ outform_1.str(),
+ __FILE__,
+ __LINE__ );
+
+ boost::format outform_2( "function out : [protocol_module_cinsert::handle_client_disconnect] : "
+ "next_status = [%d]");
+
+ outform_2 % FINALIZE;
+
+ putLogDebug( 0,
+ outform_2.str(),
+ __FILE__,
+ __LINE__ );
+ }
+ //---------- DEBUG LOG END ------------------------------
+
return FINALIZE;
}
protocol_module_cinsert::handle_sorry_enable( const boost::thread::id thread_id )
{
+ //---------- DEBUG LOG START ------------------------------
+ if( LOG_LV_DEBUG == getloglevel())
+ {
+ boost::format outform( "function in : [protocol_module_cinsert::handle_sorry_enable] : "
+ "thread_id = [%s]");
+
+ outform % thread_id;
+
+ putLogDebug( 0,
+ outform.str(),
+ __FILE__,
+ __LINE__ );
+ }
+ //---------- DEBUG LOG END ------------------------------
+
t_session_thread_data_cinsert thread_data;
t_session_thread_data_map_itr thread_data_itr;
}
} catch (...)
{
+ //---------- DEBUG LOG START ------------------------------
+ if( LOG_LV_DEBUG == getloglevel())
+ {
+ boost::format outform( "function out : [protocol_module_cinsert::handle_sorry_enable] : "
+ "next_status = [%d]");
+
+ outform % FINALIZE;
+
+ putLogDebug( 0,
+ outform.str(),
+ __FILE__,
+ __LINE__ );
+ }
+ //---------- DEBUG LOG END ------------------------------
+
return FINALIZE;
}
+ //---------- DEBUG LOG START ------------------------------
+ if( LOG_LV_DEBUG == getloglevel())
+ {
+ boost::format outform( "function out : [protocol_module_cinsert::handle_sorry_enable] : "
+ "next_status = [%d]");
+
+ outform % status;
+
+ putLogDebug( 0,
+ outform.str(),
+ __FILE__,
+ __LINE__ );
+ }
+ //---------- DEBUG LOG END ------------------------------
+
return status;
}
protocol_module_cinsert::EVENT_TAG
protocol_module_cinsert::handle_sorry_disable( const boost::thread::id thread_id )
{
+
+ //---------- DEBUG LOG START ------------------------------
+ if( LOG_LV_DEBUG == getloglevel())
+ {
+ boost::format outform( "function in : [protocol_module_cinsert::handle_sorry_disable] : "
+ "thread_id = [%s]");
+
+ outform % thread_id;
+
+ putLogDebug( 0,
+ outform.str(),
+ __FILE__,
+ __LINE__ );
+ }
+ //---------- DEBUG LOG END ------------------------------
+
t_session_thread_data_cinsert thread_data;
t_session_thread_data_map_itr thread_data_itr;
}
} catch (...)
{
+ //---------- DEBUG LOG START ------------------------------
+ if( LOG_LV_DEBUG == getloglevel())
+ {
+ boost::format outform( "function out : [protocol_module_cinsert::handle_sorry_disable] : "
+ "next_status = [%d]");
+
+ outform % FINALIZE;
+
+ putLogDebug( 0,
+ outform.str(),
+ __FILE__,
+ __LINE__ );
+ }
+ //---------- DEBUG LOG END ------------------------------
+
return FINALIZE;
}
+ //---------- DEBUG LOG START ------------------------------
+ if( LOG_LV_DEBUG == getloglevel())
+ {
+ boost::format outform( "function out : [protocol_module_cinsert::handle_sorry_disable] : "
+ "next_status = [%d]");
+
+ outform % status;
+
+ putLogDebug( 0,
+ outform.str(),
+ __FILE__,
+ __LINE__ );
+ }
+ //---------- DEBUG LOG END ------------------------------
+
return status;
}
const boost::asio::ip::tcp::endpoint & rs_endpoint )
{
+ //---------- DEBUG LOG START ------------------------------
+ if( LOG_LV_DEBUG == getloglevel())
+ {
+ boost::format outform( "function in : [protocol_module_cinsert::handle_realserver_disconnect] : "
+ "thread_id = [%s], "
+ "rs_endpoint = [%s]");
+
+ outform % thread_id % rs_endpoint;
+
+ putLogDebug( 0,
+ outform.str(),
+ __FILE__,
+ __LINE__ );
+ }
+ //---------- DEBUG LOG END ------------------------------
+
t_session_thread_data_cinsert thread_data;
t_session_thread_data_map_itr thread_data_itr;
}
} catch (...)
{
+ //---------- DEBUG LOG START ------------------------------
+ if( LOG_LV_DEBUG == getloglevel())
+ {
+ boost::format outform( "function out : [protocol_module_cinsert::handle_realserver_disconnect] : "
+ "next_status = [%d]");
+
+ outform % FINALIZE;
+
+ putLogDebug( 0,
+ outform.str(),
+ __FILE__,
+ __LINE__ );
+ }
+ //---------- DEBUG LOG END ------------------------------
+
return FINALIZE;
}
+ //---------- DEBUG LOG START ------------------------------
+ if( LOG_LV_DEBUG == getloglevel())
+ {
+ boost::format outform( "function out : [protocol_module_cinsert::handle_realserver_disconnect] : "
+ "next_status = [%d]");
+
+ outform % status;
+
+ putLogDebug( 0,
+ outform.str(),
+ __FILE__,
+ __LINE__ );
+ }
+ //---------- DEBUG LOG END ------------------------------
+
return status;
}
const boost::thread::id thread_id,
const boost::asio::ip::tcp::endpoint & sorry_endpoint )
{
+
+ //---------- DEBUG LOG START ------------------------------
+ if( LOG_LV_DEBUG == getloglevel())
+ {
+ boost::format outform( "function in : [protocol_module_cinsert::handle_sorryserver_disconnect] : "
+ "thread_id = [%s], "
+ "sorry_endpoint = [%s]");
+
+ outform % thread_id % sorry_endpoint;
+
+ putLogDebug( 0,
+ outform.str(),
+ __FILE__,
+ __LINE__ );
+ }
+ //---------- DEBUG LOG END ------------------------------
+
t_session_thread_data_cinsert thread_data;
t_session_thread_data_map_itr thread_data_itr;
}
} catch (...)
{
+ //---------- DEBUG LOG START ------------------------------
+ if( LOG_LV_DEBUG == getloglevel())
+ {
+ boost::format outform( "function out : [protocol_module_cinsert::handle_sorryserver_disconnect] : "
+ "next_status = [%d]");
+
+ outform % FINALIZE;
+
+ putLogDebug( 0,
+ outform.str(),
+ __FILE__,
+ __LINE__ );
+ }
+ //---------- DEBUG LOG END ------------------------------
+
return FINALIZE;
}
+ //---------- DEBUG LOG START ------------------------------
+ if( LOG_LV_DEBUG == getloglevel())
+ {
+ boost::format outform( "function out : [protocol_module_cinsert::handle_sorryserver_disconnect] : "
+ "next_status = [%d]");
+
+ outform % status;
+
+ putLogDebug( 0,
+ outform.str(),
+ __FILE__,
+ __LINE__ );
+ }
+ //---------- DEBUG LOG END ------------------------------
+
return status;
}