improve error reporting of lazy_bdecode to use error_code

This commit is contained in:
Arvid Norberg
2010-10-28 04:01:59 +00:00
parent d737dd051d
commit fc1b44b560
19 changed files with 135 additions and 73 deletions

View File

@@ -301,7 +301,8 @@ namespace libtorrent
// handle tracker response
lazy_entry e;
int res = lazy_bdecode(data, data + size, e);
error_code ecode;
int res = lazy_bdecode(data, data + size, e, ecode);
if (res == 0 && e.type() == lazy_entry::dict_t)
{
@@ -309,7 +310,7 @@ namespace libtorrent
}
else
{
fail(error_code(errors::invalid_bencoding), parser.status_code());
fail(ecode, parser.status_code());
}
close();
}