Browse Source

Fix Issue #285

Fix case of msg is successfully "bdecoded", but it is not lazy_entry dictionary actually.
miguelfreitas
Denis Ryabov 10 years ago
parent
commit
85c380ca6e
  1. 3
      src/twister.cpp

3
src/twister.cpp

@ -1090,7 +1090,8 @@ bool processReceivedDM(lazy_entry const* post) @@ -1090,7 +1090,8 @@ bool processReceivedDM(lazy_entry const* post)
lazy_entry v;
int pos;
libtorrent::error_code ec;
if (lazy_bdecode(textOut.data(), textOut.data()+textOut.size(), v, ec, &pos) == 0) {
if (lazy_bdecode(textOut.data(), textOut.data()+textOut.size(), v, ec, &pos) == 0
&& v.type() == lazy_entry::dict_t) {
msg = v.dict_find_string_value("msg");
to = v.dict_find_string_value("to");
// new features here: key distribution etc

Loading…
Cancel
Save