From 97e86b2969ad8bbe6885ad2ac67aaef02492f270 Mon Sep 17 00:00:00 2001 From: arvidn Date: Sat, 22 Dec 2018 17:26:12 +0200 Subject: [PATCH] minor fix to invalid_request_alert logging --- src/alert.cpp | 2 +- src/peer_connection.cpp | 9 +++------ 2 files changed, 4 insertions(+), 7 deletions(-) diff --git a/src/alert.cpp b/src/alert.cpp index da24d17ba..513587821 100644 --- a/src/alert.cpp +++ b/src/alert.cpp @@ -536,7 +536,7 @@ namespace libtorrent { std::string invalid_request_alert::message() const { - char ret[200]; + char ret[400]; std::snprintf(ret, sizeof(ret), "%s peer sent an invalid piece request " "(piece: %d start: %d len: %d)%s" , peer_alert::message().c_str() diff --git a/src/peer_connection.cpp b/src/peer_connection.cpp index 89ce15515..2ab0df465 100644 --- a/src/peer_connection.cpp +++ b/src/peer_connection.cpp @@ -2306,7 +2306,7 @@ namespace libtorrent { { // msvc 12 appears to deduce the rvalue reference template // incorrectly for bool temporaries. So, create a dummy instance - bool peer_interested = bool(m_peer_interested); + bool const peer_interested = bool(m_peer_interested); t->alerts().emplace_alert( t->get_handle(), m_remote, m_peer_id, r , t->has_piece_passed(r.piece), peer_interested, true); @@ -2379,13 +2379,10 @@ namespace libtorrent { #endif if (t->alerts().should_post()) { - // msvc 12 appears to deduce the rvalue reference template - // incorrectly for bool temporaries. So, create a dummy instance - bool peer_interested = bool(m_peer_interested); t->alerts().emplace_alert( t->get_handle(), m_remote, m_peer_id, r , t->has_piece_passed(r.piece) - , peer_interested, false); + , false, false); } // be lenient and pretend that the peer said it was interested @@ -2433,7 +2430,7 @@ namespace libtorrent { { // msvc 12 appears to deduce the rvalue reference template // incorrectly for bool temporaries. So, create a dummy instance - bool peer_interested = bool(m_peer_interested); + bool const peer_interested = bool(m_peer_interested); t->alerts().emplace_alert( t->get_handle(), m_remote, m_peer_id, r , t->has_piece_passed(r.piece), peer_interested, false);