File: script.rb

package info (click to toggle)
ruby-protocol-http2 0.23.0-1
  • links: PTS, VCS
  • area: main
  • in suites: sid
  • size: 472 kB
  • sloc: ruby: 3,627; makefile: 4
file content (30 lines) | stat: -rwxr-xr-x 563 bytes parent folder | download
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