From 8c225f799d83622a437b4856b1311793fa55c475 Mon Sep 17 00:00:00 2001 From: David Brodsky Date: Wed, 6 Dec 2006 19:37:06 +0100 Subject: [PATCH] Close connection when we get a request for too big piece. --- src/main/torrentclient.cpp | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/main/torrentclient.cpp b/src/main/torrentclient.cpp index 79bb079..b0a1c80 100644 --- a/src/main/torrentclient.cpp +++ b/src/main/torrentclient.cpp @@ -154,8 +154,10 @@ void TorrentClient::gotRequest(uint32_t index, uint32_t start, uint32_t length, if (c->isPeerChoked()) // we don't send pieces to the choked peers return; - if (length > 16384) // too big piece - return; // TODO: close connection + if (length > 16384) { // too big piece + c->close(); + connectionClosed(c); + } storage->gotRequest(index, start, length, c); } -- 2.11.4.GIT