UltraMonkey-L7 V3(multi-thread implementation)
修訂 | 6f7e6a6e25fd0d38aa80ac888a56c1ef7af7bc5b (tree) |
---|---|
時間 | 2012-09-08 13:19:30 |
作者 | Hiroaki Nakano <nakano.hiroaki@nttc...> |
Commiter | hibari |
#29144 でclose messageをpostするまえに、message queueをclearしておく。
Signed-off-by: Hiroaki Nakano <nakano.hiroaki@nttcom.co.jp>
@@ -897,11 +897,20 @@ void tcp_session::up_thread_run() | ||
897 | 897 | |
898 | 898 | if (ssl_flag) { |
899 | 899 | client_ssl_socket.wait_async_event_all_end(); |
900 | + | |
901 | + // clear messages | |
902 | + | |
903 | + tcp_thread_message *msg = up_thread_message_que.pop(); | |
904 | + while (msg) { | |
905 | + delete msg; | |
906 | + msg = up_thread_message_que.pop(); | |
907 | + } | |
908 | + | |
900 | 909 | upthread_status = UPTHREAD_LOCK; |
901 | 910 | parent_dispatcher.post(boost::bind(&tcp_session::up_thread_client_ssl_socket_clear_socket_handler,this)); |
902 | 911 | boost::mutex::scoped_lock lock(upthread_status_mutex); |
903 | 912 | while (unlikely(upthread_status == UPTHREAD_LOCK)) { |
904 | - tcp_thread_message *msg = up_thread_message_que.pop(); | |
913 | + msg = up_thread_message_que.pop(); | |
905 | 914 | if (msg) { // message is alive. |
906 | 915 | msg->message(MESSAGE_PROC); |
907 | 916 | delete msg; |