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:
parent
556c3a5fae
commit
ee5bf89071
1 changed files with 3 additions and 0 deletions
|
@ -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;
|
||||
|
|
Loading…
Reference in a new issue