mirror of
https://github.com/rakshasa/rtorrent.git
synced 2026-10-19 23:56:16 +00:00
assert valid read_length
This commit is contained in:
@@ -85,6 +85,9 @@ SCgiTask::event_read() {
|
|||||||
if (m_content_length == 0)
|
if (m_content_length == 0)
|
||||||
read_length--;
|
read_length--;
|
||||||
|
|
||||||
|
if (read_length <= 0)
|
||||||
|
throw torrent::internal_error("SCgiTask::event_read() no space in buffer for event_read.");
|
||||||
|
|
||||||
int bytes = ::recv(m_fileDesc, m_buffer.data() + m_position, read_length, 0);
|
int bytes = ::recv(m_fileDesc, m_buffer.data() + m_position, read_length, 0);
|
||||||
|
|
||||||
if (bytes <= 0) {
|
if (bytes <= 0) {
|
||||||
|
|||||||
Reference in New Issue
Block a user