fix http connection and storage bug

This commit is contained in:
Marcos Pinto 2007-10-03 22:24:22 +00:00
parent d55fff555c
commit 3273dddb8a
2 changed files with 1 additions and 2 deletions

View File

@ -235,7 +235,7 @@ void http_connection::on_read(asio::error_code const& e
m_called = true; m_called = true;
char const* data = 0; char const* data = 0;
std::size_t size = 0; std::size_t size = 0;
if (m_bottled) if (m_bottled && m_parser.header_finished())
{ {
data = m_parser.get_body().begin; data = m_parser.get_body().begin;
size = m_parser.get_body().left(); size = m_parser.get_body().left();

View File

@ -1248,7 +1248,6 @@ namespace libtorrent
, block_size); , block_size);
crc.update(&buf[0], block_size); crc.update(&buf[0], block_size);
} }
if (num_blocks > 0 && bi[num_blocks - 1].state == piece_picker::block_info::state_finished) if (num_blocks > 0 && bi[num_blocks - 1].state == piece_picker::block_info::state_finished)
{ {
m_storage->read( m_storage->read(