summaryrefslogtreecommitdiff
path: root/src/UTPexExtensionMessage.cc
diff options
context:
space:
mode:
authorTatsuhiro Tsujikawa <tatsuhiro.t@gmail.com>2012-07-26 21:07:10 +0900
committerTatsuhiro Tsujikawa <tatsuhiro.t@gmail.com>2012-07-26 21:07:10 +0900
commit01e1fdaf495342ae8735ec74eb57f912fa67d535 (patch)
treee5573e8aa7f3786d8364c76cabf5397f7473ed2f /src/UTPexExtensionMessage.cc
parent7176107414f73d7fe0cfd7d5ce516aa41a2f0b22 (diff)
Parse torrent file on the fly if --follow-torrent=mem is given
In this changes, Bencode parser in bencode2 is removed and the request is delegated to BencodeParser.
Diffstat (limited to 'src/UTPexExtensionMessage.cc')
-rw-r--r--src/UTPexExtensionMessage.cc2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/UTPexExtensionMessage.cc b/src/UTPexExtensionMessage.cc
index 0e1446e0..4b64be47 100644
--- a/src/UTPexExtensionMessage.cc
+++ b/src/UTPexExtensionMessage.cc
@@ -191,7 +191,7 @@ UTPexExtensionMessage::create(const unsigned char* data, size_t len)
}
UTPexExtensionMessageHandle msg(new UTPexExtensionMessage(*data));
- SharedHandle<ValueBase> decoded = bencode2::decode(data+1, data+len);
+ SharedHandle<ValueBase> decoded = bencode2::decode(data+1, len - 1);
const Dict* dict = downcast<Dict>(decoded);
if(dict) {
const String* added = downcast<String>(dict->get("added"));