/*
* @file protocol_module_cinsert.cpp
- * @brief shared object protocol module class
+ * @brief shared object protocol module cinsert class
*
* L7VSD: Linux Virtual Server for Layer7 Load Balancing
* Copyright (C) 2009 NTT COMWARE Corporation.
//---------- DEBUG LOG START ------------------------------
if(unlikely(LOG_LV_DEBUG == getloglevel()))
{
- putLogDebug( 0,
+ putLogDebug( 50000,
"function in : [is_tcp]",
__FILE__,
__LINE__ );
- putLogDebug( 0,
+ putLogDebug( 50001,
"function out : [is_tcp] : return = [true]",
__FILE__,
__LINE__ );
return true;
}
+//! udp protocol support check
+//! @return udp support is true
+//! @return udp not-support is false
bool protocol_module_cinsert::is_udp()
{
//---------- DEBUG LOG START ------------------------------
if(unlikely(LOG_LV_DEBUG == getloglevel()))
{
- putLogDebug( 0,
+ putLogDebug( 50002,
"function in : [is_udp]",
__FILE__,
__LINE__ );
- putLogDebug( 0,
+ putLogDebug( 50003,
"function out : [is_udp] : return = [false]",
__FILE__,
__LINE__ );
return false;
}
+//! replication interval interrrupt
+//! timer thread call this function. from virtualservice.
void protocol_module_cinsert::replication_interrupt()
{
// NOP
return;
}
+//! initialize function. called from module control. module loaded call
+//! @param[in] realserver list iterator begin function object type
+//! @param[in] realserver list iterator end function object type
+//! @param[in] realserver list iterator next function object type
+//! @param[in] realserver list mutex lock function object type.
+//! @param[in] realserver list mutex unlock function object type
void protocol_module_cinsert::initialize(
rs_list_itr_func_type inlist_begin,
rs_list_itr_func_type inlist_end,
outform % &inlist_begin % &inlist_end % &inlist_next % &inlist_lock % &inlist_unlock;
- putLogDebug( 0,
+ putLogDebug( 50004,
outform.str(),
__FILE__,
__LINE__ );
outform % &rs_list_begin % &rs_list_end % &rs_list_next % &rs_list_lock % &rs_list_unlock;
- putLogDebug( 0,
+ putLogDebug( 50005,
outform.str(),
__FILE__,
__LINE__ );
}
+//! finalize called from module control. module unloaded call.
void protocol_module_cinsert::finalize()
{
//---------- DEBUG LOG START ------------------------------
if(unlikely(LOG_LV_DEBUG == getloglevel()))
{
- putLogDebug( 0,
+ putLogDebug( 50006,
"function in : [finalize]",
__FILE__,
__LINE__ );
//---------- DEBUG LOG START ------------------------------
if(unlikely(LOG_LV_DEBUG == getloglevel()))
{
- putLogDebug( 0,
+ putLogDebug( 50007,
"function out : [finalize]",
__FILE__,
__LINE__ );
}
-//---------------------------------------------------------------------------------
+//! sorry support check
+//! @return true sorry mode is supported.
+//! @return false sorry mode is unsupported.
bool protocol_module_cinsert::is_use_sorry()
{
return true;
}
-//---------------------------------------------------------------------------------
+//! module parameter check.used by l7vsadm
+//! @param[in] module paramter string list
+//! @return result.flag true is parameter is noproblem.
+//! @return result.flag false is paramter is problem.
protocol_module_cinsert::check_message_result
protocol_module_cinsert::check_parameter( const std::vector< std::string >& args )
{
outform % args.size() % str;
- putLogDebug( 0,
+ putLogDebug( 50008,
outform.str(),
__FILE__,
__LINE__ );
outform % check_result.flag % check_result.message;
- putLogDebug( 0,
+ putLogDebug( 50009,
outform.str(),
__FILE__,
__LINE__ );
return check_result;
}
-//---------------------------------------------------------------------------------
+//! parameter set
+//! @param[in] module paramter string list
+//! @return result.flag true is parameter is noproblem.
+//! @return result.flag false is paramter is problem.
protocol_module_cinsert::check_message_result
protocol_module_cinsert::set_parameter( const std::vector< std::string >& args )
{
outform % args.size() % str;
- putLogDebug( 0,
+ putLogDebug( 50010,
outform.str(),
__FILE__,
__LINE__ );
outform % check_result.flag % check_result.message;
- putLogDebug( 0,
+ putLogDebug( 50011,
outform.str(),
__FILE__,
__LINE__ );
return check_result;
}
-//---------------------------------------------------------------------------------
+//! parameter add
+//! @param[in] module paramter string list
+//! @return result.flag true is parameter is noproblem.
+//! @return result.flag false is paramter is problem.
protocol_module_cinsert::check_message_result
protocol_module_cinsert::add_parameter( const std::vector< std::string >& args )
{
outform % args.size() % str;
- putLogDebug( 0,
+ putLogDebug( 50012,
outform.str(),
__FILE__,
__LINE__ );
outform % check_result.flag % check_result.message;
- putLogDebug( 0,
+ putLogDebug( 50013,
outform.str(),
__FILE__,
__LINE__ );
return check_result;
}
-//---------------------------------------------------------------------------------
+//! realserver list update event
void protocol_module_cinsert::handle_rslist_update()
{
// NOP
return;
}
-//---------------------------------------------------------------------------------
+//! TCP/IP scheduled function registation.
+//! @param[in] schedule module TCP/IP scheduled function object type
void protocol_module_cinsert::register_schedule( tcp_schedule_func_type inschedule )
{
outform % &inschedule;
- putLogDebug( 0,
+ putLogDebug( 50014,
outform.str(),
__FILE__,
__LINE__ );
outform % &schedule_tcp;
- putLogDebug( 0,
+ putLogDebug( 50015,
outform.str(),
__FILE__,
__LINE__ );
//---------- DEBUG LOG END ------------------------------
}
-//---------------------------------------------------------------------------------
+//! UDP scheduled function registation
+//! @param[in] schedule module UDP scheduled funtion object type
void protocol_module_cinsert::register_schedule( udp_schedule_func_type inschedule )
{
// NOP
return;
}
-//---------------------------------------------------------------------------------
+//! called from session initialzie use in upstream_thread
+//! @param[in] upstream thread id.
+//! @param[in] downstream thread id
+//! @return session use EVENT mode.
protocol_module_cinsert::EVENT_TAG
protocol_module_cinsert::handle_session_initialize(
const boost::thread::id up_thread_id,
outform % up_thread_id % down_thread_id % client_endpoint_tcp % client_endpoint_udp;
- putLogDebug( 0,
+ putLogDebug( 50016,
outform.str(),
__FILE__,
__LINE__ );
down_thread_data->client_endpoint_tcp = client_endpoint_tcp;
{
-// boost::mutex::scoped_lock lock( session_thread_data_map_mutex );
rw_scoped_lock lock( session_thread_data_map_mutex );
session_thread_data_map[ up_thread_id ] = up_thread_data;
session_thread_data_map[ down_thread_id ] = down_thread_data;
outform % up_thread_id % down_thread_id % FINALIZE;
- putLogDebug( 0,
+ putLogDebug( 50017,
outform.str(),
__FILE__,
__LINE__ );
outform % up_thread_id % down_thread_id % ACCEPT;
- putLogDebug( 0,
+ putLogDebug( 50018,
outform.str(),
__FILE__,
__LINE__ );
}
-//---------------------------------------------------------------------------------
+//! called from session finalize use in upstream thread.
+//! @param[in] upstream thread id.
+//! @param[in] downstream thread id
+//! @return session use EVENT mode.
protocol_module_cinsert::EVENT_TAG
protocol_module_cinsert::handle_session_finalize(
const boost::thread::id up_thread_id,
outform % up_thread_id % down_thread_id;
- putLogDebug( 0,
+ putLogDebug( 50019,
outform.str(),
__FILE__,
__LINE__ );
try
{
-// boost::mutex::scoped_lock lock( session_thread_data_map_mutex );
rw_scoped_lock lock( session_thread_data_map_mutex );
thread_data_itr = session_thread_data_map.find( up_thread_id );
outform % up_thread_id % down_thread_id % STOP;
- putLogDebug( 0,
+ putLogDebug( 50020,
outform.str(),
__FILE__,
__LINE__ );
outform % up_thread_id % down_thread_id % STOP;
- putLogDebug( 0,
+ putLogDebug( 50021,
outform.str(),
__FILE__,
__LINE__ );
return STOP;
}
-//---------------------------------------------------------------------------------
+//! called from after session accept.in client socket use in upstream thread.
+//! @param[in] upstream thread id.
+//! @return session use EVENT mode.
protocol_module_cinsert::EVENT_TAG
protocol_module_cinsert::handle_accept( const boost::thread::id thread_id )
{
outform % thread_id;
- putLogDebug( 0,
+ putLogDebug( 50022,
outform.str(),
__FILE__,
__LINE__ );
try
{
{
-// boost::mutex::scoped_lock lock( session_thread_data_map_mutex );
rd_scoped_lock lock( session_thread_data_map_mutex );
thread_data_itr = session_thread_data_map.find( thread_id );
outform % thread_id % FINALIZE;
- putLogDebug( 0,
+ putLogDebug( 50023,
outform.str(),
__FILE__,
__LINE__ );
outform % thread_id % status;
- putLogDebug( 0,
+ putLogDebug( 50024,
outform.str(),
__FILE__,
__LINE__ );
}
-//---------------------------------------------------------------------------------
+//! called from after session recv in client socket. use in upstream thread.
+//! @param[in] upstream thread id
+//! @param[in] recive buffer refarence.
+//! @param[in] recive length
+//! @return session use EVENT mode.
protocol_module_cinsert::EVENT_TAG
protocol_module_cinsert::handle_client_recv(
const boost::thread::id thread_id,
outform % thread_id % recvlen;
- putLogDebug( 0,
+ putLogDebug( 50025,
outform.str(),
__FILE__,
__LINE__ );
try
{
{
-// boost::mutex::scoped_lock lock( session_thread_data_map_mutex );
rd_scoped_lock lock( session_thread_data_map_mutex );
thread_data_itr = session_thread_data_map.find( thread_id );
else if( send_status_itr->status == SEND_NG )
{
-// check_result = check_http_method(
-// (const char*)recive_data_itr->second.recive_buffer
-// + send_status_itr->send_offset,
-// unsend_data_size );
-//
-// if( check_result == CHECK_OK )
-// {
-//
-// check_result = check_http_version(
-// (const char*)recive_data_itr->second.recive_buffer
-// + send_status_itr->send_offset,
-// unsend_data_size );
-// }
-
check_result = check_http_method_and_version(
(const char*)recive_data_itr->second.recive_buffer
+ send_status_itr->send_offset,
if( likely( check_result == CHECK_OK ))
{
-// find_result = find_http_header(
-// (const char*)recive_data_itr->second.recive_buffer
-// + send_status_itr->send_offset,
-// unsend_data_size,
-// http_header_name_blank,
-// http_header_offset,
-// http_header_len );
-
find_result = find_http_header_all(
(const char*)recive_data_itr->second.recive_buffer
+ send_status_itr->send_offset,
= http_header_offset + http_header_len + 4;
}
-// find_result = find_http_header(
-// (const char*)recive_data_itr->second.recive_buffer
-// + send_status_itr->send_offset,
-// send_status_itr->send_rest_size,
-// http_header_name_content_length,
-// http_header_offset,
-// http_header_len );
-
find_result = find_http_header_content_length(
(const char*)recive_data_itr->second.recive_buffer
+ send_status_itr->send_offset,
send_status_add.edit_division = 0;
send_status_add.send_offset = next_request_offset;
-// check_result = check_http_method(
-// (const char*)recive_data_itr->second.recive_buffer
-// + send_status_add.send_offset,
-// rest_request_data_size );
-//
-// if( check_result == CHECK_OK )
-// {
-//
-// check_result = check_http_version(
-// (const char*)recive_data_itr->second.recive_buffer
-// + send_status_add.send_offset,
-// rest_request_data_size );
-// }
-
check_result = check_http_method_and_version(
(const char*)recive_data_itr->second.recive_buffer
+ send_status_add.send_offset,
if( likely( check_result == CHECK_OK ))
{
-// find_result = find_http_header(
-// (const char*)recive_data_itr->second.recive_buffer
-// + send_status_add.send_offset,
-// rest_request_data_size,
-// http_header_name_blank,
-// http_header_offset,
-// http_header_len );
-
find_result = find_http_header_all(
(const char*)recive_data_itr->second.recive_buffer
+ send_status_add.send_offset,
= http_header_offset + http_header_len + 4;
}
-// find_result = find_http_header(
-// (const char*)recive_data_itr->second.recive_buffer
-// + send_status_add.send_offset,
-// send_status_add.send_rest_size,
-// http_header_name_content_length,
-// http_header_offset,
-// http_header_len );
-
find_result = find_http_header_content_length(
(const char*)recive_data_itr->second.recive_buffer
+ send_status_add.send_offset,
outform % thread_id % FINALIZE;
- putLogDebug( 0,
+ putLogDebug( 50026,
outform.str(),
__FILE__,
__LINE__ );
outform % thread_id % status;
- putLogDebug( 0,
+ putLogDebug( 50027,
outform.str(),
__FILE__,
__LINE__ );
return status;
}
-//---------------------------------------------------------------------------------
+//! called from after realserver select.use in upstream thread.
+//! @param[in] upstream thread id
+//! @param[out] realserver TCP endpoint
+//! @return session use EVENT mode.
protocol_module_cinsert::EVENT_TAG
protocol_module_cinsert::handle_realserver_select(
const boost::thread::id thread_id,
outform % thread_id;
- putLogDebug( 0,
+ putLogDebug( 50028,
outform.str(),
__FILE__,
__LINE__ );
}
//---------- DEBUG LOG END ------------------------------
-// cregex cookie_regex;
-
t_session_thread_data_cinsert thread_data;
boost::asio::ip::tcp::endpoint endpoint_init;
size_t http_header_offset = 0;
size_t http_header_len = 0;
std::string http_header_name_cookie = "Cookie";
-// std::string cookie_name_str = cookie_name.data();
std::string cookie;
std::string cookie_address;
std::string cookie_port;
try
{
{
-// boost::mutex::scoped_lock lock( session_thread_data_map_mutex );
rd_scoped_lock lock( session_thread_data_map_mutex );
thread_data_itr = session_thread_data_map.find( thread_id );
else
{
-// find_result = find_http_header(
-// (const char*)recive_data_itr->second.recive_buffer
-// + send_status_itr->send_offset,
-// send_status_itr->send_possible_size,
-// http_header_name_cookie,
-// http_header_offset,
-// http_header_len );
-
find_result = find_http_header_cookie(
(const char*)recive_data_itr->second.recive_buffer
+ send_status_itr->send_offset,
+ http_header_offset,
http_header_len );
-// cookie_regex
-// = icase("Cookie") >> ":" >> *_ >>
-// cookie_name_str >> "=" >>
-// ( s1 = +_d >> "." >> +_d >> "." >> +_d >> "." >> +_d ) >>
-// ":" >> ( s2 = +_d );
-
find_result = regex_search( cookie.c_str(),
regex_result,
cookie_regex );
outform % cookie_address % cookie_port;
- putLogError( 0,
+ putLogError( 57000,
outform.str(),
__FILE__,
__LINE__ );
outform % thread_id % FINALIZE;
- putLogDebug( 0,
+ putLogDebug( 50029,
outform.str(),
__FILE__,
__LINE__ );
outform % thread_id % status % rs_endpoint;
- putLogDebug( 0,
+ putLogDebug( 50030,
outform.str(),
__FILE__,
__LINE__ );
}
-//---------------------------------------------------------------------------------
+//! called from after realserver select
+//! @param[in] upstream thread id
+//! @param[out] realserver UDP endpoint
+//! @param[out] sendbudffer reference
+//! @param[out] send data length
+//! @return session use EVENT mode.
protocol_module_cinsert::EVENT_TAG
protocol_module_cinsert::handle_realserver_select(
const boost::thread::id thread_id,
return STOP;
}
-//---------------------------------------------------------------------------------
+//! called from after realserver connect
+//! @param[in] upstream thread id
+//! @param[out] sendbuffer reference
+//! @param[out] send data length
+//! @return session use EVENT mode.
protocol_module_cinsert::EVENT_TAG
protocol_module_cinsert::handle_realserver_connect(
const boost::thread::id thread_id,
outform % thread_id;
- putLogDebug( 0,
+ putLogDebug( 50031,
outform.str(),
__FILE__,
__LINE__ );
try
{
{
-// boost::mutex::scoped_lock lock( session_thread_data_map_mutex );
rd_scoped_lock lock( session_thread_data_map_mutex );
thread_data_itr = session_thread_data_map.find( thread_id );
if( forwarded_for == 1 )
{
-// find_result
-// = find_http_header( (const char*)recive_data_itr->second.recive_buffer
-// + send_status_itr->send_offset,
-// send_status_itr->send_possible_size,
-// http_header_name_x_forwarded_for,
-// http_header_offset,
-// http_header_len );
-
find_result = find_http_header_x_forwarded_for(
(const char*)recive_data_itr->second.recive_buffer
+ send_status_itr->send_offset,
else
{
-// find_result
-// = find_http_header( (const char*)recive_data_itr->second.recive_buffer
-// + send_status_itr->send_offset,
-// send_status_itr->send_possible_size,
-// http_header_name_blank,
-// http_header_offset,
-// http_header_len );
-
find_result = find_http_header_all(
(const char*)recive_data_itr->second.recive_buffer
+ send_status_itr->send_offset,
outform % thread_id % FINALIZE;
- putLogDebug( 0,
+ putLogDebug( 50032,
outform.str(),
__FILE__,
__LINE__ );
outform % thread_id % status % datalen;
- putLogDebug( 0,
+ putLogDebug( 50033,
outform.str(),
__FILE__,
__LINE__ );
}
-//---------------------------------------------------------------------------------
+//! called from after realserver connection fail
+//! @param[in] upstream thread id
+//! @param[in] fail realserver endpoint reference
+//! @return session use EVENT mode.
protocol_module_cinsert::EVENT_TAG
protocol_module_cinsert::handle_realserver_connection_fail(
const boost::thread::id thread_id,
outform % thread_id % rs_endpoint;
- putLogDebug( 0,
+ putLogDebug( 50034,
outform.str(),
__FILE__,
__LINE__ );
try
{
{
-// boost::mutex::scoped_lock lock( session_thread_data_map_mutex );
rd_scoped_lock lock( session_thread_data_map_mutex );
thread_data_itr = session_thread_data_map.find( thread_id );
outform % thread_id % FINALIZE;
- putLogDebug( 0,
+ putLogDebug( 50035,
outform.str(),
__FILE__,
__LINE__ );
outform % thread_id % status;
- putLogDebug( 0,
+ putLogDebug( 50036,
outform.str(),
__FILE__,
__LINE__ );
return status;
}
-//---------------------------------------------------------------------------------
+//! called from after realserver send.
+//! @param[in] upstream thread id
+//! @return session use EVENT mode.
protocol_module_cinsert::EVENT_TAG
protocol_module_cinsert::handle_realserver_send( const boost::thread::id thread_id )
{
outform % thread_id;
- putLogDebug( 0,
+ putLogDebug( 50037,
outform.str(),
__FILE__,
__LINE__ );
try
{
{
-// boost::mutex::scoped_lock lock( session_thread_data_map_mutex );
rd_scoped_lock lock( session_thread_data_map_mutex );
thread_data_itr = session_thread_data_map.find( thread_id );
outform % thread_id % FINALIZE;
- putLogDebug( 0,
+ putLogDebug( 50038,
outform.str(),
__FILE__,
__LINE__ );
outform % thread_id % status;
- putLogDebug( 0,
+ putLogDebug( 50039,
outform.str(),
__FILE__,
__LINE__ );
return status;
}
-//---------------------------------------------------------------------------------
+//! called from after sorryserver select
+//! @param[in] upstream thread id
+//! @param[in] sorryserver endppiont reference
+//! @return session use EVENT mode.
protocol_module_cinsert::EVENT_TAG
protocol_module_cinsert::handle_sorryserver_select(
const boost::thread::id thread_id,
outform % thread_id % sorry_endpoint;
- putLogDebug( 0,
+ putLogDebug( 50040,
outform.str(),
__FILE__,
__LINE__ );
try
{
{
-// boost::mutex::scoped_lock lock( session_thread_data_map_mutex );
rd_scoped_lock lock( session_thread_data_map_mutex );
thread_data_itr = session_thread_data_map.find( thread_id );
outform % thread_id % FINALIZE;
- putLogDebug( 0,
+ putLogDebug( 50041,
outform.str(),
__FILE__,
__LINE__ );
outform % thread_id % status % sorry_endpoint;
- putLogDebug( 0,
+ putLogDebug( 50042,
outform.str(),
__FILE__,
__LINE__ );
return status;
}
-//---------------------------------------------------------------------------------
+//! called from after sorryserver connect
+//! @param[in] upstream thread id
+//! @param[out] send buffer reference.
+//! @param[out] send length
+//! @return session use EVENT mode.
protocol_module_cinsert::EVENT_TAG
protocol_module_cinsert::handle_sorryserver_connect(
const boost::thread::id thread_id,
outform % thread_id;
- putLogDebug( 0,
+ putLogDebug( 50043,
outform.str(),
__FILE__,
__LINE__ );
try
{
{
-// boost::mutex::scoped_lock lock( session_thread_data_map_mutex );
rd_scoped_lock lock( session_thread_data_map_mutex );
thread_data_itr = session_thread_data_map.find( thread_id );
if( forwarded_for == 1 )
{
-// find_result
-// = find_http_header( (const char*)recive_data_itr->second.recive_buffer
-// + send_status_itr->send_offset,
-// send_status_itr->send_possible_size,
-// http_header_name_x_forwarded_for,
-// http_header_offset,
-// http_header_len );
find_result = find_http_header_x_forwarded_for(
(const char*)recive_data_itr->second.recive_buffer
else
{
-// find_result
-// = find_http_header( (const char*)recive_data_itr->second.recive_buffer
-// + send_status_itr->send_offset,
-// send_status_itr->send_possible_size,
-// http_header_name_blank,
-// http_header_offset,
-// http_header_len );
-
find_result = find_http_header_all(
(const char*)recive_data_itr->second.recive_buffer
+ send_status_itr->send_offset,
outform % thread_id % FINALIZE;
- putLogDebug( 0,
+ putLogDebug( 50044,
outform.str(),
__FILE__,
__LINE__ );
outform % thread_id % status % datalen;
- putLogDebug( 0,
+ putLogDebug( 50045,
outform.str(),
__FILE__,
__LINE__ );
return status;
}
-//---------------------------------------------------------------------------------
+//! called from after sorryserver connection fail
+//! @param[in] upstream thread id
+//! @param[in] sorryserver endpoint reference.
+//! @return session use EVENT mode.
protocol_module_cinsert::EVENT_TAG
protocol_module_cinsert::handle_sorryserver_connection_fail(
const boost::thread::id thread_id,
outform % thread_id % sorry_endpoint;
- putLogDebug( 0,
+ putLogDebug( 50046,
outform.str(),
__FILE__,
__LINE__ );
try
{
{
-// boost::mutex::scoped_lock lock( session_thread_data_map_mutex );
rd_scoped_lock lock( session_thread_data_map_mutex );
thread_data_itr = session_thread_data_map.find( thread_id );
outform % thread_id % FINALIZE;
- putLogDebug( 0,
+ putLogDebug( 50047,
outform.str(),
__FILE__,
__LINE__ );
outform % thread_id % status;
- putLogDebug( 0,
+ putLogDebug( 50048,
outform.str(),
__FILE__,
__LINE__ );
return status;
}
-//---------------------------------------------------------------------------------
+//! called from after sorryserver send
+//! @param[in] upstream thread id
+//! @return session use EVENT mode.
protocol_module_cinsert::EVENT_TAG
protocol_module_cinsert::handle_sorryserver_send( const boost::thread::id thread_id )
{
outform % thread_id;
- putLogDebug( 0,
+ putLogDebug( 50049,
outform.str(),
__FILE__,
__LINE__ );
try
{
{
-// boost::mutex::scoped_lock lock( session_thread_data_map_mutex );
rd_scoped_lock lock( session_thread_data_map_mutex );
thread_data_itr = session_thread_data_map.find( thread_id );
outform % thread_id % FINALIZE;
- putLogDebug( 0,
+ putLogDebug( 50050,
outform.str(),
__FILE__,
__LINE__ );
outform % thread_id % status;
- putLogDebug( 0,
+ putLogDebug( 50051,
outform.str(),
__FILE__,
__LINE__ );
return status;
}
-//---------------------------------------------------------------------------------
+//! called from after realserver recvive for TCP/IP
+//! @param[in] downstream thread id
+//! @param[in] realserver TCP/IP endpoint reference
+//! @param[in] realserver recive buffer reference.
+//! @param[in] recv data length
+//! @return session use EVENT mode.
protocol_module_cinsert::EVENT_TAG
protocol_module_cinsert::handle_realserver_recv(
const boost::thread::id thread_id,
outform % thread_id % rs_endpoint % recvlen;
- putLogDebug( 0,
+ putLogDebug( 50052,
outform.str(),
__FILE__,
__LINE__ );
try
{
{
-// boost::mutex::scoped_lock lock( session_thread_data_map_mutex );
rd_scoped_lock lock( session_thread_data_map_mutex );
thread_data_itr = session_thread_data_map.find( thread_id );
else if( send_status_itr->status == SEND_NG )
{
-// check_result = check_status_code(
-// (const char*)recive_data_itr->second.recive_buffer
-// + send_status_itr->send_offset,
-// unsend_data_size );
-//
-// if( check_result == CHECK_OK )
-// {
-//
-// check_result = check_http_version(
-// (const char*)recive_data_itr->second.recive_buffer
-// + send_status_itr->send_offset,
-// unsend_data_size );
-// }
-
check_result = check_http_version_and_status_code(
(const char*)recive_data_itr->second.recive_buffer
+ send_status_itr->send_offset,
if( likely( check_result == CHECK_OK ))
{
-// find_result = find_http_header(
-// (const char*)recive_data_itr->second.recive_buffer
-// + send_status_itr->send_offset,
-// unsend_data_size,
-// http_header_name_blank,
-// http_header_offset,
-// http_header_len );
-
find_result = find_http_header_all(
(const char*)recive_data_itr->second.recive_buffer
+ send_status_itr->send_offset,
= http_header_offset + http_header_len + 4;
}
-// find_result = find_http_header(
-// (const char*)recive_data_itr->second.recive_buffer
-// + send_status_itr->send_offset,
-// send_status_itr->send_rest_size,
-// http_header_name_content_length,
-// http_header_offset,
-// http_header_len );
-
find_result = find_http_header_content_length(
(const char*)recive_data_itr->second.recive_buffer
+ send_status_itr->send_offset,
send_status_add.edit_division = 0;
send_status_add.send_offset = next_response_offset;
-// check_result = check_status_code(
-// (const char*)recive_data_itr->second.recive_buffer
-// + send_status_add.send_offset,
-// rest_response_data_size );
-//
-// if( check_result == CHECK_OK )
-// {
-//
-// check_result = check_http_version(
-// (const char*)recive_data_itr->second.recive_buffer
-// + send_status_add.send_offset,
-// rest_response_data_size );
-// }
-
check_result = check_http_version_and_status_code(
(const char*)recive_data_itr->second.recive_buffer
+ send_status_add.send_offset,
if( likely( check_result == CHECK_OK ))
{
-// find_result = find_http_header(
-// (const char*)recive_data_itr->second.recive_buffer
-// + send_status_add.send_offset,
-// rest_response_data_size,
-// http_header_name_blank,
-// http_header_offset,
-// http_header_len );
-
find_result = find_http_header_all(
(const char*)recive_data_itr->second.recive_buffer
+ send_status_add.send_offset,
= http_header_offset + http_header_len + 4;
}
-// find_result = find_http_header(
-// (const char*)recive_data_itr->second.recive_buffer
-// + send_status_add.send_offset,
-// send_status_add.send_rest_size,
-// http_header_name_content_length,
-// http_header_offset,
-// http_header_len );
-
find_result = find_http_header_content_length(
(const char*)recive_data_itr->second.recive_buffer
+ send_status_add.send_offset,
outform % thread_id % FINALIZE;
- putLogDebug( 0,
+ putLogDebug( 50053,
outform.str(),
__FILE__,
__LINE__ );
outform % thread_id % status;
- putLogDebug( 0,
+ putLogDebug( 50054,
outform.str(),
__FILE__,
__LINE__ );
return status;
}
-//---------------------------------------------------------------------------------
+//! called from after realserver recive.for UDP
+//! @param[in] downstream thread id
+//! @param[in] realserver UDP endpoint reference
+//! @param[in] recive from realserver buffer reference
+//! @param[in] recv data length
+//! @return session use EVENT mode.
protocol_module_cinsert::EVENT_TAG
protocol_module_cinsert::handle_realserver_recv(
const boost::thread::id thread_id,
return STOP;
}
-//---------------------------------------------------------------------------------
+//! called from after sorryserver recive
+//! @param[in] downstream thread id
+//! @param[in] sorryserver endpoint reference
+//! @param[in] recive from realserver buffer reference.
+//! @param[in] recv data length
+//! @return session use EVENT mode
protocol_module_cinsert::EVENT_TAG
protocol_module_cinsert::handle_sorryserver_recv(
const boost::thread::id thread_id,
outform % thread_id % sorry_endpoint % recvlen;
- putLogDebug( 0,
+ putLogDebug( 50055,
outform.str(),
__FILE__,
__LINE__ );
try
{
{
-// boost::mutex::scoped_lock lock( session_thread_data_map_mutex );
rd_scoped_lock lock( session_thread_data_map_mutex );
thread_data_itr = session_thread_data_map.find( thread_id );
else if( send_status_itr->status == SEND_NG )
{
-// check_result = check_status_code(
-// (const char*)recive_data_itr->second.recive_buffer
-// + send_status_itr->send_offset,
-// unsend_data_size );
-//
-// if( check_result == CHECK_OK )
-// {
-// check_result = check_http_version(
-// (const char*)recive_data_itr->second.recive_buffer
-// + send_status_itr->send_offset,
-// unsend_data_size );
-// }
-
check_result = check_http_version_and_status_code(
(const char*)recive_data_itr->second.recive_buffer
+ send_status_itr->send_offset,
if( likely( check_result == CHECK_OK ))
{
-// find_result = find_http_header(
-// (const char*)recive_data_itr->second.recive_buffer
-// + send_status_itr->send_offset,
-// unsend_data_size,
-// http_header_name_blank,
-// http_header_offset,
-// http_header_len );
-
find_result = find_http_header_all(
(const char*)recive_data_itr->second.recive_buffer
+ send_status_itr->send_offset,
= http_header_offset + http_header_len + 4;
}
-// find_result = find_http_header(
-// (const char*)recive_data_itr->second.recive_buffer
-// + send_status_itr->send_offset,
-// send_status_itr->send_rest_size,
-// http_header_name_content_length,
-// http_header_offset,
-// http_header_len );
-
find_result = find_http_header_content_length(
(const char*)recive_data_itr->second.recive_buffer
+ send_status_itr->send_offset,
send_status_add.edit_division = 0;
send_status_add.send_offset = next_response_offset;
-// check_result = check_status_code(
-// (const char*)recive_data_itr->second.recive_buffer
-// + send_status_add.send_offset,
-// rest_response_data_size );
-//
-// if( check_result == CHECK_OK )
-// {
-// check_result = check_http_version(
-// (const char*)recive_data_itr->second.recive_buffer
-// + send_status_add.send_offset,
-// rest_response_data_size );
-// }
-
check_result = check_http_version_and_status_code(
(const char*)recive_data_itr->second.recive_buffer
+ send_status_add.send_offset,
if( likely( check_result == CHECK_OK ))
{
-// find_result = find_http_header(
-// (const char*)recive_data_itr->second.recive_buffer
-// + send_status_add.send_offset,
-// rest_response_data_size,
-// http_header_name_blank,
-// http_header_offset,
-// http_header_len );
-
find_result = find_http_header_all(
(const char*)recive_data_itr->second.recive_buffer
+ send_status_add.send_offset,
= http_header_offset + http_header_len + 4;
}
-// find_result = find_http_header(
-// (const char*)recive_data_itr->second.recive_buffer
-// + send_status_add.send_offset,
-// send_status_add.send_rest_size,
-// http_header_name_content_length,
-// http_header_offset,
-// http_header_len );
-
find_result = find_http_header_content_length(
(const char*)recive_data_itr->second.recive_buffer
+ send_status_add.send_offset,
outform % thread_id % FINALIZE;
- putLogDebug( 0,
+ putLogDebug( 50056,
outform.str(),
__FILE__,
__LINE__ );
outform % thread_id % status;
- putLogDebug( 0,
+ putLogDebug( 50057,
outform.str(),
__FILE__,
__LINE__ );
return status;
}
-//---------------------------------------------------------------------------------
+//! called from UPSTEEARM thread. make module original message.
+//! @param[in] downstream thread id.
+//! @return session use EVENT mode
protocol_module_cinsert::EVENT_TAG
protocol_module_cinsert::handle_response_send_inform( const boost::thread::id thread_id )
{
return STOP;
}
-//---------------------------------------------------------------------------------
+//! called from after client connection check. use TCP/IP only. create client send message.
+//! @param[in] downstream thread id
+//! @param[out] send budffer reference
+//! @param[out] send data length
+//! @return session use EVENT mode
protocol_module_cinsert::EVENT_TAG
protocol_module_cinsert::handle_client_connection_check(
const boost::thread::id thread_id,
outform % thread_id;
- putLogDebug( 0,
+ putLogDebug( 50058,
outform.str(),
__FILE__,
__LINE__ );
try
{
{
-// boost::mutex::scoped_lock lock( session_thread_data_map_mutex );
rd_scoped_lock lock( session_thread_data_map_mutex );
thread_data_itr = session_thread_data_map.find( thread_id );
if( send_status_itr->edit_data_list.empty() == true )
{
-// find_result
-// = find_http_header( (const char*)recive_data_itr->second.recive_buffer
-// + send_status_itr->send_offset,
-// send_status_itr->send_possible_size,
-// http_header_name_blank,
-// http_header_offset,
-// http_header_len );
-
find_result = find_http_header_all(
(const char*)recive_data_itr->second.recive_buffer
+ send_status_itr->send_offset,
outform % thread_id % FINALIZE;
- putLogDebug( 0,
+ putLogDebug( 50059,
outform.str(),
__FILE__,
__LINE__ );
outform % thread_id % status % datalen;
- putLogDebug( 0,
+ putLogDebug( 50060,
outform.str(),
__FILE__,
__LINE__ );
}
-//---------------------------------------------------------------------------------
+//! called from after client select. use UDP only
+//! @param[in] downstream thread id
+//! @param[in] client udp endpoint
+//! @param[out] send buffer reference
+//! @param[out] send data length
+//! @return session use EVENT mode
protocol_module_cinsert::EVENT_TAG
protocol_module_cinsert::handle_client_select(
const boost::thread::id thread_id,
return STOP;
}
-//---------------------------------------------------------------------------------
+//! called from after client send
+//! @param[in] downstream thread id
+//! @return session use EVENT mode
protocol_module_cinsert::EVENT_TAG
protocol_module_cinsert::handle_client_send( const boost::thread::id thread_id )
{
outform % thread_id;
- putLogDebug( 0,
+ putLogDebug( 50061,
outform.str(),
__FILE__,
__LINE__ );
try
{
{
-// boost::mutex::scoped_lock lock( session_thread_data_map_mutex );
rd_scoped_lock lock( session_thread_data_map_mutex );
thread_data_itr = session_thread_data_map.find( thread_id );
outform % thread_id % FINALIZE;
- putLogDebug( 0,
+ putLogDebug( 50062,
outform.str(),
__FILE__,
__LINE__ );
outform % thread_id % status;
- putLogDebug( 0,
+ putLogDebug( 50063,
outform.str(),
__FILE__,
__LINE__ );
}
-//---------------------------------------------------------------------------------
+//! call from client disconnect event. use upstream thread and downstream thread.
+//! @param[in] upstream and downstream thread id( check! one thread one event! )
+//! @return session use EVENT mode
protocol_module_cinsert::EVENT_TAG
protocol_module_cinsert::handle_client_disconnect( const boost::thread::id thread_id )
{
outform_1 % thread_id;
- putLogDebug( 0,
+ putLogDebug( 50064,
outform_1.str(),
__FILE__,
__LINE__ );
outform_2 % thread_id % FINALIZE;
- putLogDebug( 0,
+ putLogDebug( 50065,
outform_2.str(),
__FILE__,
__LINE__ );
return FINALIZE;
}
-//---------------------------------------------------------------------------------
+//! call from sorry mode event. use upstream thread and downstream thread
+//! @param[in] upstream and downstream thread id( check! one thread one event and first time call pattern )
+//! @return session use EVENT mode
protocol_module_cinsert::EVENT_TAG
protocol_module_cinsert::handle_sorry_enable( const boost::thread::id thread_id )
{
outform % thread_id;
- putLogDebug( 0,
+ putLogDebug( 50066,
outform.str(),
__FILE__,
__LINE__ );
try
{
{
-// boost::mutex::scoped_lock lock( session_thread_data_map_mutex );
rd_scoped_lock lock( session_thread_data_map_mutex );
thread_data_itr = session_thread_data_map.find( thread_id );
outform % thread_id % FINALIZE;
- putLogDebug( 0,
+ putLogDebug( 50067,
outform.str(),
__FILE__,
__LINE__ );
outform % thread_id % status;
- putLogDebug( 0,
+ putLogDebug( 50068,
outform.str(),
__FILE__,
__LINE__ );
}
-//---------------------------------------------------------------------------------
+//! call from sorry mode disable. use upstream thread and downstream thread.
+//! @param[in] upstream and downstream thread id( check! one thread one event )
+//! @return session use EVENT mode
protocol_module_cinsert::EVENT_TAG
protocol_module_cinsert::handle_sorry_disable( const boost::thread::id thread_id )
{
outform % thread_id;
- putLogDebug( 0,
+ putLogDebug( 50069,
outform.str(),
__FILE__,
__LINE__ );
try
{
{
-// boost::mutex::scoped_lock lock( session_thread_data_map_mutex );
rd_scoped_lock lock( session_thread_data_map_mutex );
thread_data_itr = session_thread_data_map.find( thread_id );
outform % thread_id % FINALIZE;
- putLogDebug( 0,
+ putLogDebug( 50070,
outform.str(),
__FILE__,
__LINE__ );
outform % thread_id % status;
- putLogDebug( 0,
+ putLogDebug( 50071,
outform.str(),
__FILE__,
__LINE__ );
return status;
}
-//---------------------------------------------------------------------------------
+//! call from realserver disconnect. use upstream thread and downstream thread
+//! @param[in] upstream and downstream thread id( check! one thread one event )
+//! @param[in] disconnected realserver endpoint.
+//! @return session use EVENT mode
protocol_module_cinsert::EVENT_TAG
protocol_module_cinsert::handle_realserver_disconnect(
const boost::thread::id thread_id,
outform % thread_id % rs_endpoint;
- putLogDebug( 0,
+ putLogDebug( 50072,
outform.str(),
__FILE__,
__LINE__ );
try
{
{
-// boost::mutex::scoped_lock lock( session_thread_data_map_mutex );
rd_scoped_lock lock( session_thread_data_map_mutex );
thread_data_itr = session_thread_data_map.find( thread_id );
outform % thread_id % FINALIZE;
- putLogDebug( 0,
+ putLogDebug( 50073,
outform.str(),
__FILE__,
__LINE__ );
outform % thread_id % status;
- putLogDebug( 0,
+ putLogDebug( 50074,
outform.str(),
__FILE__,
__LINE__ );
return status;
}
-//---------------------------------------------------------------------------------
+//! call from sorry server disconnect. use upstraem thread and downstream thread
+//! @param[in] upstream and downstream thread id( check! one thread one event )
+//! @param[in] disconnect sorryserver endpoint
+//! @return session use EVENT mode
protocol_module_cinsert::EVENT_TAG
protocol_module_cinsert::handle_sorryserver_disconnect(
const boost::thread::id thread_id,
outform % thread_id % sorry_endpoint;
- putLogDebug( 0,
+ putLogDebug( 50075,
outform.str(),
__FILE__,
__LINE__ );
try
{
{
-// boost::mutex::scoped_lock lock( session_thread_data_map_mutex );
rd_scoped_lock lock( session_thread_data_map_mutex );
thread_data_itr = session_thread_data_map.find( thread_id );
outform % thread_id % FINALIZE;
- putLogDebug( 0,
+ putLogDebug( 50076,
outform.str(),
__FILE__,
__LINE__ );
outform % thread_id % status;
- putLogDebug( 0,
+ putLogDebug( 50077,
outform.str(),
__FILE__,
__LINE__ );
}
-//---------------------------------------------------------------------------------
+//! call from realserver disconnect. use upstream thread and downstream thread.
+//! @param[in] upstream and downstream thread id( check! one thread one event )
+//! @param[in] disconnect realserver endpoint
+//! @return session use EVENT mode.
protocol_module_cinsert::EVENT_TAG
protocol_module_cinsert::handle_realserver_close(
const boost::thread::id thread_id,
}
}
-//---------------------------------------------------------------------------------
+
extern "C" l7vs::protocol_module_base*
create_module(){
return dynamic_cast<l7vs::protocol_module_base*>(new l7vs::protocol_module_cinsert());
/*
* @file protocol_module_cinsert.h
- * @brief shared object protocol module class
+ * @brief shared object protocol module cinsert class
*
* L7VSD: Linux Virtual Server for Layer7 Load Balancing
* Copyright (C) 2009 NTT COMWARE Corporation.
boost::array< char, MAX_OPTION_SIZE > cookie_name;
boost::array< char, MAX_OPTION_SIZE > sorry_uri;
t_session_thread_data_map session_thread_data_map;
-// boost::mutex session_thread_data_map_mutex;
wr_mutex session_thread_data_map_mutex;
public:
+ //! constractor
protocol_module_cinsert();
+
+ //! destractor
~protocol_module_cinsert();
+ //! tcp protocol support check
+ //! @return tcp support is true
+ //! @return tcp not-support is false
bool is_tcp();
+ //! udp protocol support check
+ //! @return udp support is true
+ //! @return udp not-support is false
bool is_udp();
+ //! replication interval interrrupt
+ //! timer thread call this function. from virtualservice.
void replication_interrupt();
+ //! initialize function. called from module control. module loaded call
+ //! @param[in] realserver list iterator begin function object type
+ //! @param[in] realserver list iterator end function object type
+ //! @param[in] realserver list iterator next function object type
+ //! @param[in] realserver list mutex lock function object type.
+ //! @param[in] realserver list mutex unlock function object type
void 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 );
+ //! finalize called from module control. module unloaded call.
void finalize();
+ //! sorry support check
+ //! @return true sorry mode is supported.
+ //! @return false sorry mode is unsupported.
bool is_use_sorry();
+ //! module parameter check.used by l7vsadm
+ //! @param[in] module paramter string list
+ //! @return result.flag true is parameter is noproblem.
+ //! @return result.flag false is paramter is problem.
check_message_result check_parameter( const std::vector< std::string >& args);
+ //! parameter set
+ //! @param[in] module paramter string list
+ //! @return result.flag true is parameter is noproblem.
+ //! @return result.flag false is paramter is problem.
check_message_result set_parameter( const std::vector< std::string >& args);
+ //! parameter add
+ //! @param[in] module paramter string list
+ //! @return result.flag true is parameter is noproblem.
+ //! @return result.flag false is paramter is problem.
check_message_result add_parameter( const std::vector< std::string >& args);
+ //! realserver list update event
void handle_rslist_update();
+ //! TCP/IP scheduled function registation.
+ //! @param[in] schedule module TCP/IP scheduled function object type
void register_schedule( tcp_schedule_func_type inschedule );
+ //! UDP scheduled function registation
+ //! @param[in] schedule module UDP scheduled funtion object type
void register_schedule( udp_schedule_func_type inschedule );
+ //! called from session initialzie use in upstream_thread
+ //! @param[in] upstream thread id.
+ //! @param[in] downstream thread id
+ //! @return session use EVENT mode.
EVENT_TAG handle_session_initialize(
const boost::thread::id up_thread_id,
const boost::thread::id down_thread_id,
const boost::asio::ip::tcp::endpoint& client_endpoint_tcp,
const boost::asio::ip::udp::endpoint& client_endpoint_udp );
+ //! called from session finalize use in upstream thread.
+ //! @param[in] upstream thread id.
+ //! @param[in] downstream thread id
+ //! @return session use EVENT mode.
EVENT_TAG handle_session_finalize(
const boost::thread::id up_thread_id,
const boost::thread::id down_thread_id );
+ //! called from after session accept.in client socket use in upstream thread.
+ //! @param[in] upstream thread id.
+ //! @return session use EVENT mode.
EVENT_TAG handle_accept( const boost::thread::id thread_id );
+ //! called from after session recv in client socket. use in upstream thread.
+ //! @param[in] upstream thread id
+ //! @param[in] recive buffer refarence.
+ //! @param[in] recive length
+ //! @return session use EVENT mode.
EVENT_TAG handle_client_recv(
const boost::thread::id thread_id,
const boost::array< char, MAX_BUFFER_SIZE >& recvbuffer,
const size_t recvlen );
+ //! called from after realserver select.use in upstream thread.
+ //! @param[in] upstream thread id
+ //! @param[out] realserver TCP endpoint
+ //! @return session use EVENT mode.
EVENT_TAG handle_realserver_select(
const boost::thread::id thread_id,
boost::asio::ip::tcp::endpoint& rs_endpoint );
+ //! called from after realserver select
+ //! @param[in] upstream thread id
+ //! @param[out] realserver UDP endpoint
+ //! @param[out] sendbudffer reference
+ //! @param[out] send data length
+ //! @return session use EVENT mode.
EVENT_TAG handle_realserver_select(
const boost::thread::id thread_id,
boost::asio::ip::udp::endpoint& rs_endpoint,
boost::array< char, MAX_BUFFER_SIZE >& sendbuffer,
size_t& datalen );
+ //! called from after realserver connect
+ //! @param[in] upstream thread id
+ //! @param[out] sendbuffer reference
+ //! @param[out] send data length
+ //! @return session use EVENT mode.
EVENT_TAG handle_realserver_connect(
const boost::thread::id thread_id,
boost::array< char, MAX_BUFFER_SIZE >& sendbuffer,
size_t& datalen );
+ //! called from after realserver connection fail
+ //! @param[in] upstream thread id
+ //! @param[in] fail realserver endpoint reference
+ //! @return session use EVENT mode.
EVENT_TAG handle_realserver_connection_fail(
const boost::thread::id thread_id,
const boost::asio::ip::tcp::endpoint& rs_endpoint );
+ //! called from after realserver send.
+ //! @param[in] upstream thread id
+ //! @return session use EVENT mode.
EVENT_TAG handle_realserver_send( const boost::thread::id thread_id );
+ //! called from after sorryserver select
+ //! @param[in] upstream thread id
+ //! @param[in] sorryserver endppiont reference
+ //! @return session use EVENT mode.
EVENT_TAG handle_sorryserver_select(
const boost::thread::id thread_id,
boost::asio::ip::tcp::endpoint& sorry_endpoint );
+ //! called from after sorryserver connect
+ //! @param[in] upstream thread id
+ //! @param[out] send buffer reference.
+ //! @param[out] send length
+ //! @return session use EVENT mode.
EVENT_TAG handle_sorryserver_connect(
const boost::thread::id thread_id,
boost::array< char, MAX_BUFFER_SIZE >& sendbuffer,
size_t& datalen );
+ //! called from after sorryserver connection fail
+ //! @param[in] upstream thread id
+ //! @param[in] sorryserver endpoint reference.
+ //! @return session use EVENT mode.
EVENT_TAG handle_sorryserver_connection_fail(
const boost::thread::id thread_id,
const boost::asio::ip::tcp::endpoint& sorry_endpoint );
+ //! called from after sorryserver send
+ //! @param[in] upstream thread id
+ //! @return session use EVENT mode.
EVENT_TAG handle_sorryserver_send( const boost::thread::id thread_id );
+ //! called from after realserver recvive for TCP/IP
+ //! @param[in] downstream thread id
+ //! @param[in] realserver TCP/IP endpoint reference
+ //! @param[in] realserver recive buffer reference.
+ //! @param[in] recv data length
+ //! @return session use EVENT mode.
EVENT_TAG handle_realserver_recv(
const boost::thread::id thread_id,
const boost::asio::ip::tcp::endpoint& rs_endpoint,
const boost::array< char, MAX_BUFFER_SIZE >& recvbuffer,
const size_t recvlen );
+ //! called from after realserver recive.for UDP
+ //! @param[in] downstream thread id
+ //! @param[in] realserver UDP endpoint reference
+ //! @param[in] recive from realserver buffer reference
+ //! @param[in] recv data length
+ //! @return session use EVENT mode.
EVENT_TAG handle_realserver_recv(
const boost::thread::id thread_id,
const boost::asio::ip::udp::endpoint& rs_endpoint,
const boost::array< char, MAX_BUFFER_SIZE >& recvbuffer,
const size_t recvlen );
+ //! called from after sorryserver recive
+ //! @param[in] downstream thread id
+ //! @param[in] sorryserver endpoint reference
+ //! @param[in] recive from realserver buffer reference.
+ //! @param[in] recv data length
+ //! @return session use EVENT mode
EVENT_TAG handle_sorryserver_recv(
const boost::thread::id thread_id,
const boost::asio::ip::tcp::endpoint& sorry_endpoint,
const boost::array< char, MAX_BUFFER_SIZE >& recvbuffer,
const size_t recvlen );
+ //! called from UPSTEEARM thread. make module original message.
+ //! @param[in] downstream thread id.
+ //! @return session use EVENT mode
EVENT_TAG handle_response_send_inform( const boost::thread::id thread_id );
+ //! called from after client connection check. use TCP/IP only. create client send message.
+ //! @param[in] downstream thread id
+ //! @param[out] send budffer reference
+ //! @param[out] send data length
+ //! @return session use EVENT mode
EVENT_TAG handle_client_connection_check(
const boost::thread::id thread_id,
boost::array< char, MAX_BUFFER_SIZE >& sendbuffer,
size_t& datalen );
+ //! called from after client select. use UDP only
+ //! @param[in] downstream thread id
+ //! @param[in] client udp endpoint
+ //! @param[out] send buffer reference
+ //! @param[out] send data length
+ //! @return session use EVENT mode
EVENT_TAG handle_client_select(
const boost::thread::id thread_id,
boost::asio::ip::udp::endpoint& cl_endpoint,
boost::array< char, MAX_BUFFER_SIZE >& sendbuffer,
size_t& datalen );
+ //! called from after client send
+ //! @param[in] downstream thread id
+ //! @return session use EVENT mode
EVENT_TAG handle_client_send( const boost::thread::id thread_id );
+ //! call from client disconnect event. use upstream thread and downstream thread.
+ //! @param[in] upstream and downstream thread id( check! one thread one event! )
+ //! @return session use EVENT mode
EVENT_TAG handle_client_disconnect( const boost::thread::id thread_id );
+ //! call from sorry mode event. use upstream thread and downstream thread
+ //! @param[in] upstream and downstream thread id( check! one thread one event and first time call pattern )
+ //! @return session use EVENT mode
EVENT_TAG handle_sorry_enable( const boost::thread::id thread_id );
+ //! call from sorry mode disable. use upstream thread and downstream thread.
+ //! @param[in] upstream and downstream thread id( check! one thread one event )
+ //! @return session use EVENT mode
EVENT_TAG handle_sorry_disable( const boost::thread::id thread_id );
+ //! call from realserver disconnect. use upstream thread and downstream thread
+ //! @param[in] upstream and downstream thread id( check! one thread one event )
+ //! @param[in] disconnected realserver endpoint.
+ //! @return session use EVENT mode
EVENT_TAG handle_realserver_disconnect(
const boost::thread::id thread_id,
const boost::asio::ip::tcp::endpoint& rs_endpoint );
+ //! call from sorry server disconnect. use upstraem thread and downstream thread
+ //! @param[in] upstream and downstream thread id( check! one thread one event )
+ //! @param[in] disconnect sorryserver endpoint
+ //! @return session use EVENT mode
EVENT_TAG handle_sorryserver_disconnect(
const boost::thread::id thread_id,
const boost::asio::ip::tcp::endpoint& sorry_endpoint );
+ //! call from realserver disconnect. use upstream thread and downstream thread.
+ //! @param[in] upstream and downstream thread id( check! one thread one event )
+ //! @param[in] disconnect realserver endpoint
+ //! @return session use EVENT mode.
EVENT_TAG handle_realserver_close(
const boost::thread::id thread_id,
const boost::asio::ip::udp::endpoint& rs_endpoint );