1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30
|
#!/usr/bin/env ruby
# frozen_string_literal: true
# Released under the MIT License.
# Copyright, 2020-2024, by Samuel Williams.
require "socket"
require_relative "../../lib/protocol/http2/framer"
def test
framer = Protocol::HTTP2::Framer.new($stdin)
while frame = framer.read_frame
pp frame
end
rescue EOFError
# Ignore.
end
if ENV["_"] =~ /afl/
require "kisaten"
Kisaten.crash_at [Exception], [EOFError, Protocol::HTTP2::FrameSizeError, Protocol::HTTP2::ProtocolError], Signal.list["USR1"]
while Kisaten.loop 10_000
test
end
else
test
end
|