mirror of
https://github.com/rakshasa/rtorrent.git
synced 2026-08-13 21:52:30 +00:00
Close the connection when an SCGI header does not fit the buffer.
A malformed header aborted the process from the SCGI thread.
This commit is contained in:
@@ -94,8 +94,12 @@ SCgiTask::event_read() {
|
||||
if (m_content_length == 0)
|
||||
read_length--;
|
||||
|
||||
if (read_length <= 0)
|
||||
if (read_length <= 0) {
|
||||
if (m_content_length == 0)
|
||||
return close();
|
||||
|
||||
throw torrent::internal_error("SCgiTask::event_read() no space in buffer for event_read.");
|
||||
}
|
||||
|
||||
int bytes = ::recv(file_descriptor(), m_buffer.data() + m_position, read_length, 0);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user