From 3e04e54937116a48dfdc5496c6a20dea686e2c04 Mon Sep 17 00:00:00 2001 From: Marcos Pinto Date: Mon, 9 Jul 2007 18:56:38 +0000 Subject: [PATCH] 1392 lt snc --- libtorrent/include/libtorrent/peer_connection.hpp | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/libtorrent/include/libtorrent/peer_connection.hpp b/libtorrent/include/libtorrent/peer_connection.hpp index b459c491e..2c01e4dfb 100755 --- a/libtorrent/include/libtorrent/peer_connection.hpp +++ b/libtorrent/include/libtorrent/peer_connection.hpp @@ -395,6 +395,9 @@ namespace libtorrent #ifndef TORRENT_DISABLE_ENCRYPTION buffer::interval wr_recv_buffer() { +#ifndef NDEBUG + if (m_recv_buffer.empty()) return buffer::interval(0,0); +#endif return buffer::interval(&m_recv_buffer[0] , &m_recv_buffer[0] + m_recv_pos); } @@ -402,6 +405,9 @@ namespace libtorrent buffer::const_interval receive_buffer() const { +#ifndef NDEBUG + if (m_recv_buffer.empty()) return buffer::const_interval(0,0); +#endif return buffer::const_interval(&m_recv_buffer[0] , &m_recv_buffer[0] + m_recv_pos); }