-
-
Notifications
You must be signed in to change notification settings - Fork 38
Open
Labels
Description
Not sure if this is a bug or not but I'd like to discuss how decode should behave when we feed multiple parts.
Example:
bencode.decode('i123ei123e', 'utf8'); // 123The input has more data than that. When we use the decode function, it silently returns just the first decoded part. Is this intended?
I saw some cases where a single buffer they wanted to decode had multiple bencoded parts (it was some data received from the network they had no control over). And when they used this lib, it was silently missing parts. So they had to implement some logic to check if the decoded result was everything the input had or not. They managed to get everything working, but I'm wondering if the lib should give a heads up (exception or whatever) when this happens.