mirror of
https://github.com/rakshasa/rtorrent.git
synced 2026-10-22 17:16:17 +00:00
fix off-by-one in SCgiTask::event_read
This commit is contained in:
@@ -80,7 +80,7 @@ SCgiTask::close() {
|
|||||||
|
|
||||||
void
|
void
|
||||||
SCgiTask::event_read() {
|
SCgiTask::event_read() {
|
||||||
int bytes = ::recv(m_fileDesc, m_buffer.data() + m_position, m_buffer.size() - m_position, 0);
|
int bytes = ::recv(m_fileDesc, m_buffer.data() + m_position, m_buffer.size() - m_position - (m_content_length == 0), 0);
|
||||||
|
|
||||||
if (bytes <= 0) {
|
if (bytes <= 0) {
|
||||||
if (bytes == 0 || !(errno == EAGAIN || errno == EINTR))
|
if (bytes == 0 || !(errno == EAGAIN || errno == EINTR))
|
||||||
|
|||||||
Reference in New Issue
Block a user