@@ -54,7 +54,7 @@ namespace extension {
5454 }
5555
5656 PeerPlugin::~PeerPlugin () {
57- std::clog << " ~PeerPlugin() called." << std::endl;
57+ // std::clog << "~PeerPlugin() called." << std::endl;
5858 }
5959
6060 char const * PeerPlugin::type () const {
@@ -176,6 +176,7 @@ namespace extension {
176176 if (_peerBEP10SupportStatus != BEPSupportStatus::supported) {
177177
178178 // Remove peer
179+ std::clog << " Dropping Peer: bad handshake (non-BEP10 peer sent extended handshake)" << std::endl;
179180 libtorrent::error_code ec; // "Peer misbehaved: didn't support BEP10, but it sent extended handshake."
180181 drop (ec);
181182
@@ -191,6 +192,7 @@ namespace extension {
191192 _peerPaymentBEPSupportStatus = BEPSupportStatus::not_supported;
192193
193194 // Remove peer
195+ std::clog << " Dropping Peer: bad handshake (not dictionary)" << std::endl;
194196 libtorrent::error_code ec; // "Malformed handshake received: not dictionary."
195197 drop (ec);
196198
@@ -211,6 +213,7 @@ namespace extension {
211213 // If the version string is not in the extension, it has not properly sent an unmapping
212214
213215 // Remove peer
216+ std::clog << " Dropping Peer: bad handshake - peer sent full mapping without first sending unmapping" << std::endl;
214217 libtorrent::error_code ec; // "Malformed protocol version format provided: " << versionString
215218 drop (ec);
216219 }
@@ -230,6 +233,7 @@ namespace extension {
230233 _peerPaymentBEPSupportStatus = BEPSupportStatus::not_supported;
231234
232235 // Remove peer
236+ std::clog << " Dropping Peer: bad handshake (malformed protocol vesrion format)" << std::endl;
233237 libtorrent::error_code ec; // "Malformed protocol version format provided: " << versionString
234238 drop (ec);
235239
@@ -246,6 +250,7 @@ namespace extension {
246250 _peerPaymentBEPSupportStatus = BEPSupportStatus::not_supported;
247251
248252 // Remove peer
253+ std::clog << " Dropping Peer: bad handshake (m key not present)" << std::endl;
249254 libtorrent::error_code ec; // "Malformed handshake received: m key not present."
250255 drop (ec);
251256
@@ -260,6 +265,7 @@ namespace extension {
260265 _peerPaymentBEPSupportStatus = BEPSupportStatus::not_supported;
261266
262267 // Remove peer
268+ std::clog << " Dropping Peer: bad handshake (m key not mapping to dictionary)" << std::endl;
263269 libtorrent::error_code ec; // "Malformed handshake received: m key not mapping to dictionary."
264270 drop (ec);
265271
@@ -282,6 +288,7 @@ namespace extension {
282288 _peerPaymentBEPSupportStatus = BEPSupportStatus::not_supported;
283289
284290 // Remove peer
291+ std::clog << " Dropping Peer: bad handshake (peer already sent full mapping)" << std::endl;
285292 libtorrent::error_code ec; // "Peer misbehaved: sent uninstall mapping, despite not recently annoncing valid mapping to uninstall."
286293 drop (ec);
287294
@@ -299,11 +306,11 @@ namespace extension {
299306 // If the uninstall mapping was valid we do not need to disconnect the peer
300307 if (e.problem == exception::InvalidMessageMappingDictionary::Problem::UninstallMappingFound) {
301308 if (peerMappingWasPreviouslySet) {
302- std::clog << " Uninstall mapping was found ." << std::endl;
309+ std::clog << " Removing Peer from Session - Uninstall mapping was sent ." << std::endl;
303310 // Remove from session if present
304311 _plugin->removeFromSession (this );
305312 } else {
306- std::clog << " Uninstall mapping was found, but no mapping has been previoulsy installed " << std::endl;
313+ std::clog << " Dropping Peer: bad handshake (attempting to uninstall mapping but no mapping exists) " << std::endl;
307314 libtorrent::error_code ec;
308315 drop (ec);
309316 }
@@ -449,12 +456,12 @@ namespace extension {
449456
450457 // If this peer is not part of this session, then we ignore the message
451458 if (_plugin->_session .mode () == protocol_session::SessionMode::not_set) {
452- std::clog << " Ignoring extended message, session mode not set" << std::endl;
459+ std::clog << " Warning: Ignoring extended message, session mode not set" << std::endl;
453460 return false ;
454461 }
455462
456463 if (!_plugin->peerInSession (this )) {
457- std::clog << " Ignoring extended message, connection not in session" << std::endl;
464+ std::clog << " Warning: Ignoring extended message, connection not in session" << std::endl;
458465 return false ;
459466 }
460467
@@ -552,7 +559,7 @@ namespace extension {
552559
553560 } catch (std::exception & e) {
554561
555- std::clog << " Extended Message was Malformed" << std::endl;
562+ std::clog << " Dropping Peer: Extended Message was Malformed" << std::endl;
556563
557564 // Remove this peer
558565 libtorrent::error_code ec; // <-- "Malformed extended message received, removing."
0 commit comments