Revision | cd1ba4fe27c7964667b95bcaa7a4a00a1bb44d00 (tree) |
---|---|
Time | 2011-12-22 10:50:05 |
Author | hibari <hibari@git....> |
Commiter | takeda kenji |
v3.0.2 packet break bug fix.
@@ -1543,7 +1543,7 @@ void tcp_session::up_thread_realserver_send(const TCP_PROCESS_TYPE_TAG process_t | ||
1543 | 1543 | } else { |
1544 | 1544 | if (error_code == boost::asio::error::try_again) { |
1545 | 1545 | upthread_status = UPTHREAD_LOCK; |
1546 | - func_tag = UP_FUNC_REALSERVER_SEND; | |
1546 | + func_tag = UP_FUNC_REALSERVER_HANDLE_ASEND; | |
1547 | 1547 | basic_tcp_socket<boost::asio::ip::tcp>::async_rw_handler_t handler = |
1548 | 1548 | boost::bind(&tcp_session::up_thread_realserver_async_write_some_handler, |
1549 | 1549 | this, |
@@ -1558,7 +1558,7 @@ void tcp_session::up_thread_realserver_send(const TCP_PROCESS_TYPE_TAG process_t | ||
1558 | 1558 | handler |
1559 | 1559 | ); |
1560 | 1560 | else |
1561 | - func_tag = UP_FUNC_REALSERVER_DISCONNECT_EVENT; | |
1561 | + func_tag = UP_FUNC_REALSERVER_DISCONNECT; | |
1562 | 1562 | } else { |
1563 | 1563 | func_tag = UP_FUNC_REALSERVER_DISCONNECT; |
1564 | 1564 | boost::format fmt("Thread ID[%d] realserver send error: %s"); |
@@ -2128,7 +2128,7 @@ void tcp_session::up_thread_sorryserver_send(const TCP_PROCESS_TYPE_TAG process_ | ||
2128 | 2128 | } else { |
2129 | 2129 | if (ec == boost::asio::error::try_again) { |
2130 | 2130 | upthread_status = UPTHREAD_LOCK; |
2131 | - func_tag = UP_FUNC_SORRYSERVER_SEND; | |
2131 | + func_tag = UP_FUNC_SORRYSERVER_HANDLE_ASEND; | |
2132 | 2132 | basic_tcp_socket<boost::asio::ip::tcp>::async_rw_handler_t handler = |
2133 | 2133 | boost::bind(&tcp_session::up_thread_sorryserver_async_write_some_handler, |
2134 | 2134 | this, |
@@ -3561,11 +3561,12 @@ void tcp_session::up_thread_client_handle_async_read_some(const tcp_session::TCP | ||
3561 | 3561 | |
3562 | 3562 | if (!error_code) { // no error |
3563 | 3563 | if (recv_size > 0) { |
3564 | - parent_service.update_up_recv_size(up_thread_data_client_side.get_size()); | |
3564 | + up_thread_data_client_side.set_size(recv_size); | |
3565 | + parent_service.update_up_recv_size(recv_size); | |
3565 | 3566 | protocol_module_base::EVENT_TAG module_event = protocol_module->handle_client_recv( |
3566 | 3567 | up_thread_id, |
3567 | 3568 | up_thread_data_client_side.get_data(), |
3568 | - up_thread_data_client_side.get_async_len()); | |
3569 | + recv_size); | |
3569 | 3570 | #ifdef DEBUG |
3570 | 3571 | boost::format fmt("Thread ID[%d] protocol_module->handle_client_recv( upthread_id = %d, downthread_id = %d ) return %s"); |
3571 | 3572 | fmt % up_thread_id % down_thread_id % func_tag_to_string(module_event); |
@@ -3660,7 +3661,7 @@ void tcp_session::up_thread_realserver_handle_async_write_some(const tcp_session | ||
3660 | 3661 | std::size_t send_data_size = up_thread_data_dest_side.get_send_size(); |
3661 | 3662 | |
3662 | 3663 | if (!up_thread_data_dest_side.get_error_code()) { // no error |
3663 | - send_data_size = up_thread_data_dest_side.get_async_len(); | |
3664 | + send_data_size += up_thread_data_dest_side.get_async_len(); | |
3664 | 3665 | up_thread_data_dest_side.set_send_size(send_data_size); |
3665 | 3666 | parent_service.update_up_send_size(up_thread_data_dest_side.get_async_len()); |
3666 | 3667 | if (data_size > send_data_size) |
@@ -3669,7 +3670,7 @@ void tcp_session::up_thread_realserver_handle_async_write_some(const tcp_session | ||
3669 | 3670 | func_tag = up_thread_module_event_map[protocol_module->handle_realserver_send(up_thread_id)]; |
3670 | 3671 | } else { // error |
3671 | 3672 | if (up_thread_data_dest_side.get_error_code() == boost::asio::error::try_again) { |
3672 | - func_tag = UP_FUNC_REALSERVER_ASEND_HANDLE_EVENT; | |
3673 | + func_tag = UP_FUNC_REALSERVER_HANDLE_ASEND; | |
3673 | 3674 | upthread_status = UPTHREAD_LOCK; |
3674 | 3675 | boost::array<char, MAX_BUFFER_SIZE>& send_buff = up_thread_data_dest_side.get_data(); |
3675 | 3676 | tcp_socket::async_rw_handler_t handler = boost::bind(&tcp_session::up_thread_realserver_async_write_some_handler, |
@@ -3683,6 +3684,8 @@ void tcp_session::up_thread_realserver_handle_async_write_some(const tcp_session | ||
3683 | 3684 | data_size - send_data_size |
3684 | 3685 | ), |
3685 | 3686 | handler); |
3687 | + else | |
3688 | + func_tag = UP_FUNC_REALSERVER_DISCONNECT; | |
3686 | 3689 | } else { |
3687 | 3690 | func_tag = UP_FUNC_REALSERVER_DISCONNECT; |
3688 | 3691 | boost::format fmt("Thread ID[%d] realserver send error: %s"); |
@@ -3746,9 +3749,8 @@ void tcp_session::up_thread_sorryserver_handle_async_write_some(const TCP_PROCES | ||
3746 | 3749 | std::size_t send_data_size = up_thread_data_dest_side.get_send_size(); |
3747 | 3750 | |
3748 | 3751 | if (!up_thread_data_dest_side.get_error_code()) { //no error |
3749 | - send_data_size = up_thread_data_dest_side.get_async_len(); | |
3752 | + send_data_size += up_thread_data_dest_side.get_async_len(); | |
3750 | 3753 | up_thread_data_dest_side.set_send_size(send_data_size); |
3751 | - parent_service.update_up_send_size(up_thread_data_dest_side.get_async_len()); | |
3752 | 3754 | if (data_size > send_data_size) |
3753 | 3755 | func_tag = UP_FUNC_SORRYSERVER_SEND; |
3754 | 3756 | else |
@@ -3934,7 +3936,8 @@ void tcp_session::down_thread_client_handle_async_write_some(tcp_session::TCP_PR | ||
3934 | 3936 | |
3935 | 3937 | if (!error_code) { //no error |
3936 | 3938 | send_data_size += send_size; |
3937 | - down_thread_data_client_side.set_send_size(send_size); | |
3939 | + down_thread_data_client_side.set_send_size(send_data_size); | |
3940 | + parent_service.update_down_send_size(send_size); | |
3938 | 3941 | if (data_size > send_data_size) { |
3939 | 3942 | func_tag = DOWN_FUNC_CLIENT_SEND; |
3940 | 3943 | } else { |
@@ -4022,7 +4025,6 @@ void tcp_session::down_thread_sorryserver_handle_async_read_some(tcp_session::TC | ||
4022 | 4025 | if (!error_code) { // no error |
4023 | 4026 | if (recv_size > 0) { //recv success |
4024 | 4027 | down_thread_data_dest_side.set_size(recv_size); |
4025 | - parent_service.update_down_recv_size(recv_size); | |
4026 | 4028 | protocol_module_base::EVENT_TAG module_event = |
4027 | 4029 | protocol_module->handle_sorryserver_recv(down_thread_id, |
4028 | 4030 | sorryserver_endpoint, |