From 0eea9ddc7cfb2820295dd87aed3dc911a100ecde Mon Sep 17 00:00:00 2001 From: Determinant Date: Wed, 12 Sep 2018 10:32:51 -0400 Subject: no need to cut the segs for the send_buffer --- src/conn.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'src') diff --git a/src/conn.cpp b/src/conn.cpp index d650b76..0607ed3 100644 --- a/src/conn.cpp +++ b/src/conn.cpp @@ -48,9 +48,9 @@ void ConnPool::Conn::send_data(evutil_socket_t fd, short events) { if (!(events & EV_WRITE)) return; auto conn = self(); /* pin the connection */ ssize_t ret = seg_buff_size; - while (!send_buffer.empty() && ret == (ssize_t)seg_buff_size) + while (!send_buffer.empty()) { - bytearray_t buff_seg = send_buffer.pop(seg_buff_size); + bytearray_t buff_seg = send_buffer.move_pop(); ssize_t size = buff_seg.size(); ret = send(fd, buff_seg.data(), size, MSG_NOSIGNAL); SALTICIDAE_LOG_DEBUG("socket sent %zd bytes", ret); -- cgit v1.2.3-70-g09d2