Skip to content

Commit 1536d9b

Browse files
committed
Fix HTTP/2 request example.
1 parent 70982fb commit 1536d9b

File tree

1 file changed

+5
-6
lines changed

1 file changed

+5
-6
lines changed

examples/http2/request.rb

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -44,12 +44,11 @@ def stream.process_headers(frame)
4444
puts "Got response headers: #{headers} (#{frame.end_stream?})"
4545
end
4646

47-
def stream.receive_data(frame)
48-
data = super
49-
50-
$count += data.scan(/kittens/).size
51-
52-
puts "Got response data: #{data.bytesize}"
47+
def stream.process_data(frame)
48+
if data = super
49+
$count += data.scan(/kittens/).size
50+
puts "Got response data: #{data.bytesize}"
51+
end
5352
end
5453

5554
until stream.closed?

0 commit comments

Comments
 (0)