• R/O
  • HTTP
  • SSH
  • HTTPS

Commit

Tags
No Tags

Frequently used words (click to add to your profile)

javac++androidlinuxc#windowsobjective-ccocoa誰得qtpythonphprubygameguibathyscaphec計画中(planning stage)翻訳omegatframeworktwitterdomtestvb.netdirectxゲームエンジンbtronarduinopreviewer

UltraMonkey-L7 V3(multi-thread implementation)


Commit MetaInfo

Revisionb91c7fbdc8cc34bd53a554c2953c1c2aa3081451 (tree)
Time2012-09-18 15:42:25
Authorhibari <l05102@shib...>
Commiterhibari

Log Message

・SorryServerへの振り分け時、接続が切断されてしまう問題を修正

SorryServer接続と同時にリクエストが送られない場合に
(HTTPであればtelnet で接続して、"GET /"を送る場合など)、
接続が切断されてしまう問題を修正した。

Change Summary

Incremental Difference

--- a/l7vsd/src/tcp_session.cpp
+++ b/l7vsd/src/tcp_session.cpp
@@ -2255,9 +2255,34 @@ void tcp_session::up_thread_sorryserver_connect(const TCP_PROCESS_TYPE_TAG proce
22552255 Logger::putLogDebug(LOG_CAT_L7VSD_SESSION, 999, formatter.str(), __FILE__, __LINE__);
22562256 }
22572257
2258- sorryserver_socket.reset(new tcp_socket(parent_dispatcher, socket_opt_info));
22592258 boost::system::error_code error_code;
22602259
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+
22612286 // up thread pause on
22622287 upthread_status = UPTHREAD_LOCK;
22632288 up_thread_next_call_function = up_thread_function_array[UP_FUNC_SORRYSERVER_CONNECT_EVENT];