proxy_unbuffer is vulnerable to the same race condition
we avoided in commit 5328992829b2
("proxy_pass: fix race condition due to flawed hijack check")
---
lib/yahns/proxy_http_response.rb | 6 ++----
1 file changed, 2 insertions(+), 4 deletions(-)
diff --git a/lib/yahns/proxy_http_response.rb b/lib/yahns/proxy_http_response.rb
index 0ca2c34..a37b387 100644
--- a/lib/yahns/proxy_http_response.rb
+++ b/lib/yahns/proxy_http_response.rb
@@ -13,10 +13,8 @@ module Yahns::HttpResponse # :nodoc:
def proxy_unbuffer(wbuf, nxt = :ignore)
@state = wbuf
wbuf.req_res = nil if nxt.nil? && wbuf.respond_to?(:req_res=)
- tc = Thread.current
- tc[:yahns_fdmap].remember(self) # Yahns::HttpClient
- tc[:yahns_queue].queue_mod(self, wbuf.busy == :wait_readable ?
- Yahns::Queue::QEV_RD : Yahns::Queue::QEV_WR)
+ proxy_wait_next(wbuf.busy == :wait_readable ? Yahns::Queue::QEV_RD :
+ Yahns::Queue::QEV_WR)
nxt
end
--
EW
--
unsubscribe: [email protected]
archive: https://yhbt.net/yahns-public/