lib/elastic_apm/transport/connection/proxy_pipe.rb in elastic-apm-2.8.1 vs lib/elastic_apm/transport/connection/proxy_pipe.rb in elastic-apm-2.9.0
- old
+ new
@@ -7,11 +7,18 @@
module Transport
class Connection
# @api private
class ProxyPipe
def initialize(enc = nil, compress: true)
- @read, wr = IO.pipe(enc)
+ rd, wr = IO.pipe(enc)
+
+ @read = rd
@write = Write.new(wr, compress: compress)
+
+ # Http.rb<4 calls rewind on the request bodies, but IO::Pipe raises
+ # ~mikker
+ return if HTTP::VERSION.to_i >= 4
+ def rd.rewind; end
end
attr_reader :read, :write
# @api private