diff options
author | Eric Wong <e@80x24.org> | 2016-12-31 04:40:49 +0000 |
---|---|---|
committer | Eric Wong <e@80x24.org> | 2016-12-31 04:40:49 +0000 |
commit | 4381e96d74036c4a3ac5d95bab1e747d5c44f886 (patch) | |
tree | 847274dbb39d06002cb74139ac8822381a616152 /lib | |
parent | 470cceaff7cead94d60abd1dac3bee9c9a3c211b (diff) | |
download | yahns-4381e96d74036c4a3ac5d95bab1e747d5c44f886.tar.gz |
We try to cleanup after ourselves if possible so future mallocs can find memory more easily. We do not need to nil the object slot, just String#clear since we're exiting the function soon, anyways. Followup to commit bb774680aae0a827f887761b18da304aa94111cc ("use String#clear for short-lived buffers we create")
Diffstat (limited to 'lib')
-rw-r--r-- | lib/yahns/proxy_http_response.rb | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/lib/yahns/proxy_http_response.rb b/lib/yahns/proxy_http_response.rb index 1776291..7df2834 100644 --- a/lib/yahns/proxy_http_response.rb +++ b/lib/yahns/proxy_http_response.rb @@ -132,7 +132,9 @@ module Yahns::HttpResponse # :nodoc: # send the headers case rv = kgio_syssend(res, flags) - when nil then break # all done, likely + when nil # all done, likely + res.clear + break when String # partial write, highly unlikely flags = MSG_DONTWAIT res = rv # hope the skb grows |