bbx10/WebServer_tng

Wrong HTTPupload size member semantics

everslick opened this issue · 2 comments

IMHO the semantics of HTTPupload.currentSize and HTTPupload.totalSize are wrong or at least highly misleading.

now we get the size of the last chunk of data in currentSize and the number of bytes received so far in totalSize. But currentSize as it is, is pretty useless and we really want the know how big the file is going to be once complete (for correct progress calculation and for checking filesystem requirements).

i suggest to make currentSize what totalSize is now and put the Content-Length header arg in totalSize.

does this sound reasonable?

I want to add, this issue is also discussed in the ESP8266 implementation here: esp8266/Arduino#3787. we should just copy whatever the fix will be there.

to @everslick
hi
I have a similar problem like this. it trap me for days. can you help me
lbernstone/setCerts#1
thanks,