-
Notifications
You must be signed in to change notification settings - Fork 2.6k
Description
This issue came from #241, because it's a different issue.
I also corrected a small bug in the decompressor which doesn't work with large splitted (multiple socket read) body. The inflate return value is 0 when the decompression is not over, then it goes to 1 (STREAM_END) for the last packet. So Decompressor::decompress should return true at the end.
Please have a look at this commit in httplib:
sophana/cpp-httplib@0423358Please note that it could check 2 possible return values: I think they are Z_STREAM_END or Z_STREAM_OK
But there are enough error checks just before, I think.I tested with a server that computes md5 of posted files, and tested hundred of megabytes files uploads with curl (gzipped and not)
@sophana, thanks for the helpful information. Do you think if the following change works?
return ret == Z_OK || ret == Z_STREAM_END;
Also I would like to know how large a gzipped file should be to reproduce the problem? I'll make a unit test for the problem as well. Thanks for your great help!