http_parser fix

This commit is contained in:
Arvid Norberg 2007-05-22 19:39:06 +00:00
parent 1c147018db
commit e58c161057
1 changed files with 1 additions and 7 deletions

View File

@ -171,6 +171,7 @@ namespace libtorrent
char const* line_end = newline;
if (pos != line_end && *(line_end - 1) == '\r') --line_end;
line.assign(pos, line_end);
++newline;
m_recv_pos += newline - pos;
boost::get<1>(ret) += newline - pos;
pos = newline;
@ -181,10 +182,6 @@ namespace libtorrent
// this means we got a blank line,
// the header is finished and the body
// starts.
++pos;
++m_recv_pos;
boost::get<1>(ret) += 1;
m_state = read_body;
m_body_start_pos = m_recv_pos;
break;
@ -223,9 +220,6 @@ namespace libtorrent
m_content_length = range_end - range_start + 1;
}
// TODO: make sure we don't step outside of the buffer
++pos;
++m_recv_pos;
assert(m_recv_pos <= (int)recv_buffer.left());
newline = std::find(pos, recv_buffer.end, '\n');
}