Closed zarqman closed 8 months ago
Revised to remove the previous attempt at request.close
as further testing shows it might be causing a regression. Instead, using request.each{}
which functions like the original call to request.finish
except that it avoids buffering the request body into memory.
This seems reasonable to me, thanks for investigating the history.
This PR includes 2 related items:
Fixes an old regression where
request = nil
should be conditional upon the request body, but was incorrectly the response body. Looking at the git history, the original behavior was... unless request.body
and was changed in b3cc9ce, seemingly accidentally during a refactor.I occasionally experience random hangs when running my test suite and believe this might be one cause of them.
Changes the handling of unconsumed bodies from
request.finish
torequest.each{}
.finish
buffers the request fully in memory as aBuffered
, causing needless memory bloat in the ruby process. Usingeach
skips the buffering, but is otherwise behaves the same.Types of Changes
Contribution