Commit ee5bf890 authored by Àlex Fiestas's avatar Àlex Fiestas
Browse files

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.

parent 556c3a5f
......@@ -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;
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment