Fallback to body->size if payLoadsize is empty

For some reason body->size is exactly as big as the
payload I'm trying to send (using android app). This is
probably a bug in the Android app, I decided to commit
the workaround anyway so we keep compatibility with
current (and old) versions of the Android app.

CCMAIL: albertvaka@gmail.com
This commit is contained in:
Àlex Fiestas 2014-03-03 21:08:34 +01:00
parent 556c3a5fae
commit ee5bf89071

View file

@ -112,6 +112,9 @@ bool NetworkPackage::unserialize(const QByteArray& a, NetworkPackage* np)
}
np->mPayloadSize = variant["payloadSize"].toInt(); //Will return 0 if was not present, which is ok
if (np->mPayloadSize == -1) {
np->mPayloadSize = np->get<int>("size", -1);
}
np->mPayloadTransferInfo = variant["payloadTransferInfo"].toMap(); //Will return an empty qvariantmap if was not present, which is ok
return true;