lt sync 3236

This commit is contained in:
Andrew Resch 2009-02-08 00:08:15 +00:00
parent 44d2fd1f1f
commit ea734931d7
2 changed files with 78 additions and 66 deletions

View File

@ -487,15 +487,15 @@ namespace libtorrent
if (error && m_ses.m_alerts.should_post<fastresume_rejected_alert>())
{
m_ses.m_alerts.post_alert(fastresume_rejected_alert(get_handle(), error));
}
if (error)
{
#if defined TORRENT_VERBOSE_LOGGING || defined TORRENT_LOGGING || defined TORRENT_ERROR_LOGGING
(*m_ses.m_logger) << "fastresume data for "
<< torrent_file().name() << " rejected: "
<< error << "\n";
#endif
}
if (error)
{
std::vector<char>().swap(m_resume_data);
lazy_entry().swap(m_resume_entry);
}
@ -4739,3 +4739,4 @@ namespace libtorrent
#endif
}

View File

@ -355,6 +355,9 @@ namespace libtorrent
if (error)
{
#ifdef TORRENT_VERBOSE_LOGGING
(*m_logger) << "*** " << std::string(recv_buffer.begin, recv_buffer.end) << "\n";
#endif
disconnect("failed to parse HTTP response", 2);
return;
}
@ -408,6 +411,14 @@ namespace libtorrent
// we just completed reading the header
if (!header_finished)
{
#ifdef TORRENT_VERBOSE_LOGGING
(*m_logger) << "*** STATUS: " << m_parser.status_code()
<< " " << m_parser.message() << "\n";
std::map<std::string, std::string> const& headers = m_parser.headers();
for (std::map<std::string, std::string>::const_iterator i = headers.begin()
, end(headers.end()); i != end; ++i)
(*m_logger) << " " << i->first << ": " << i->second << "\n";
#endif
if (m_parser.status_code() >= 300 && m_parser.status_code() < 400)
{
// this means we got a redirection request