UltraMonkey-L7 V3(multi-thread implementation)
Revision | b91c7fbdc8cc34bd53a554c2953c1c2aa3081451 (tree) |
---|---|
Time | 2012-09-18 15:42:25 |
Author | hibari <l05102@shib...> |
Commiter | hibari |
・SorryServerへの振り分け時、接続が切断されてしまう問題を修正
SorryServer接続と同時にリクエストが送られない場合に
(HTTPであればtelnet で接続して、"GET /"を送る場合など)、
接続が切断されてしまう問題を修正した。
@@ -2255,9 +2255,34 @@ void tcp_session::up_thread_sorryserver_connect(const TCP_PROCESS_TYPE_TAG proce | ||
2255 | 2255 | Logger::putLogDebug(LOG_CAT_L7VSD_SESSION, 999, formatter.str(), __FILE__, __LINE__); |
2256 | 2256 | } |
2257 | 2257 | |
2258 | - sorryserver_socket.reset(new tcp_socket(parent_dispatcher, socket_opt_info)); | |
2259 | 2258 | boost::system::error_code error_code; |
2260 | 2259 | |
2260 | + if (sorryserver_socket && sorryserver_socket->is_open()) { | |
2261 | + up_thread_data_dest_side.initialize(); | |
2262 | + boost::array<char, MAX_BUFFER_SIZE>& data_buff = up_thread_data_dest_side.get_data(); | |
2263 | + size_t data_size = 0; | |
2264 | + protocol_module_base::EVENT_TAG module_event = protocol_module->handle_sorryserver_connect(up_thread_id, data_buff, data_size); | |
2265 | +#ifdef DEBUG | |
2266 | + { | |
2267 | + boost::format fmt("Thread ID[%d] protocol_module->handle_sorryserver_connect() return: %s"); | |
2268 | + fmt % boost::this_thread::get_id() | |
2269 | + % func_tag_to_string(module_event); | |
2270 | + Logger::putLogInfo(LOG_CAT_L7VSD_SESSION, 0, fmt.str(), __FILE__, __LINE__); | |
2271 | + } | |
2272 | +#endif | |
2273 | + up_thread_data_dest_side.set_size(data_size); | |
2274 | + // next call function setup. | |
2275 | + up_thread_next_call_function = up_thread_function_array[ up_thread_module_event_map[module_event] ]; | |
2276 | + if (unlikely(LOG_LV_DEBUG == Logger::getLogLevel(LOG_CAT_L7VSD_SESSION))) { | |
2277 | + boost::format formatter("Thread ID[%d] FUNC OUT up_thread_sorryserver_connect_event: NEXT_FUNC[%s]"); | |
2278 | + formatter % boost::this_thread::get_id() % func_tag_to_string(up_thread_module_event_map[module_event]); | |
2279 | + Logger::putLogDebug(LOG_CAT_L7VSD_SESSION, 999, formatter.str(), __FILE__, __LINE__); | |
2280 | + } | |
2281 | + return ; | |
2282 | + } | |
2283 | + | |
2284 | + sorryserver_socket.reset(new tcp_socket(parent_dispatcher, socket_opt_info)); | |
2285 | + | |
2261 | 2286 | // up thread pause on |
2262 | 2287 | upthread_status = UPTHREAD_LOCK; |
2263 | 2288 | up_thread_next_call_function = up_thread_function_array[UP_FUNC_SORRYSERVER_CONNECT_EVENT]; |