From 3273dddb8a691ed7401ab8a5506c97db49156656 Mon Sep 17 00:00:00 2001 From: Marcos Pinto Date: Wed, 3 Oct 2007 22:24:22 +0000 Subject: [PATCH] fix http connection and storage bug --- libtorrent/src/http_connection.cpp | 2 +- libtorrent/src/storage.cpp | 1 - 2 files changed, 1 insertion(+), 2 deletions(-) diff --git a/libtorrent/src/http_connection.cpp b/libtorrent/src/http_connection.cpp index 5a0cfb741..5dd568655 100644 --- a/libtorrent/src/http_connection.cpp +++ b/libtorrent/src/http_connection.cpp @@ -235,7 +235,7 @@ void http_connection::on_read(asio::error_code const& e m_called = true; char const* data = 0; std::size_t size = 0; - if (m_bottled) + if (m_bottled && m_parser.header_finished()) { data = m_parser.get_body().begin; size = m_parser.get_body().left(); diff --git a/libtorrent/src/storage.cpp b/libtorrent/src/storage.cpp index fac91ef77..53d8379a0 100755 --- a/libtorrent/src/storage.cpp +++ b/libtorrent/src/storage.cpp @@ -1248,7 +1248,6 @@ namespace libtorrent , block_size); crc.update(&buf[0], block_size); } - if (num_blocks > 0 && bi[num_blocks - 1].state == piece_picker::block_info::state_finished) { m_storage->read(