Merge branch 'issue-159' into 'master'

Fix for HTTP/1 logging on pipelining

Closes #159

See merge request honeyryderchuck/httpx!175
This commit is contained in:
HoneyryderChuck 2021-11-16 14:57:06 +00:00
commit 7e73c3a066
3 changed files with 11 additions and 3 deletions

View File

@ -36,6 +36,8 @@ module HTTPX
request = @requests.first
return unless request
return :w if request.interests == :w || !@buffer.empty?
:r
@ -313,8 +315,9 @@ module HTTPX
end
def join_headers(request)
@buffer << "#{request.verb.to_s.upcase} #{headline_uri(request)} HTTP/#{@version.join(".")}" << CRLF
log(color: :yellow) { "<- HEADLINE: #{@buffer.to_s.chomp.inspect}" }
headline = "#{request.verb.to_s.upcase} #{headline_uri(request)} HTTP/#{@version.join(".")}"
@buffer << headline << CRLF
log(color: :yellow) { "<- HEADLINE: #{headline.chomp.inspect}" }
extra_headers = set_protocol_headers(request)
join_headers2(request.headers.each(extra_headers))
log { "<- " }

View File

@ -15,6 +15,11 @@ module HTTPX
@max_requests: Integer
@parser: Parser::HTTP1
@buffer: Buffer
@version: [Integer, Integer]
@handshake_completed: bool
@pipelining: bool
@request: Request?
def interests: () -> io_interests?

View File

@ -60,7 +60,7 @@ fi
bundle install --quiet
echo "Waiting for S3 at address ${AMZ_HOST}/health, attempting every 5s"
until $(curl --silent --fail ${AMZ_HOST}/health | grep "\"s3\": \"running\"" > /dev/null); do
until $(curl --silent --fail ${AMZ_HOST}/health | grep "\"s3\": \"available\"" > /dev/null); do
printf '.'
sleep 5
done