HTTPClient checks if the given IO responds to :size and set
"Content-Length" header if the size is given. But it read too much till
EOF. Should read just as the specified size.
To make the logic simple, now HTTPClient doesn't try to calculate the
whole size of request body for Content-Length if the request body is a
multipart and contains an IO as a parameter.
If lengths of all posted arguments are known HTTPClient sends
'Content-Length' as a sum length of all arguments. But the length of
actual body was wrong because it read as much as possible regardless of
what IO#size returned. So if the file is getting bigger while HTTPClient
is processing a request the request has inconsistent Content-Length and
This bug is found, and the fix is proposed both by @Teshootub7. Thank
you very much for patient trouble shooting!