got-body-data reports different size than read from stream
When i download a body, i monitor how much i read from the input stream.
If i connect the got-body-data
signal, it reports a chunk size from the body which was read from the network.
I would expect that both, data read from the input stream and size accumulated in got-body-data
are the same.
But it seems its not.
What you can see here in the log is body data
which accumulates what we get in the got-body-data
signal, and Read
which accumulates what we read from the input stream.
The input stream reads accumulate exactly to content-length, whatever is reported in got-body-data
is more than content-length
INFO:nbxmpp.http:Request(140379766381120): Created
INFO:nbxmpp.http:Request(140379766381120): Request sent, method: GET, uri: https://upload.wikimedia.org/wikipedia/commons/thumb/0/06/Acrocantosaurus4.jpg/1280px-Acrocantosaurus4.jpg
INFO:nbxmpp.http:Request(140379766381120): Got Headers: content-length: 194417
INFO:nbxmpp.http:Request(140379766381120): Sniffed: content-type: image/jpeg
INFO:nbxmpp.http:Request(140379766381120): Request response received
INFO:nbxmpp.http:Request(140379766381120): Start downloading response body
body data 13883
Read 512
Read 13874
body data 30212
Read 30194
body data 46541
Read 46514
body data 62870
Read 62834
body data 79199
Read 79154
body data 95528
Read 95474
body data 111857
Read 111794
body data 128186
Read 128114
body data 144515
Read 144434
body data 160844
Read 160754
body data 177173
Read 177074
body data 193502
body data 194534
Read 194417
INFO:nbxmpp.http:Request(140379766381120): Body received
INFO:nbxmpp.http:Request(140379766381120): Finished reading
INFO:nbxmpp.http:Request(140379766381120): Message finished
INFO:nbxmpp.http:Request(140379766381120): Request status: OK
INFO:nbxmpp.http:Request(140379766381120): Set Complete
Edited by lovetox