diff --git a/.github/workflows/development.yml b/.github/workflows/development.yml new file mode 100644 index 0000000..4bd7f9e --- /dev/null +++ b/.github/workflows/development.yml @@ -0,0 +1,48 @@ +name: Development + +on: [push, pull_request] + +jobs: + test: + runs-on: ${{matrix.os}}-latest + continue-on-error: ${{matrix.experimental}} + + strategy: + matrix: + experimental: [false] + + os: + - ubuntu + - macos + + ruby: + - 2.5 + - 2.6 + - 2.7 + + include: + # - experimental: true + # os: ubuntu + # ruby: truffleruby + # - experimental: true + # os: ubuntu + # ruby: jruby + - experimental: true + os: ubuntu + ruby: head + - experimental: true + os: ubuntu + ruby: 2.6 + env: COVERAGE=PartialSummary,Coveralls + + steps: + - uses: actions/checkout@v1 + - uses: ruby/setup-ruby@v1 + with: + ruby-version: ${{matrix.ruby}} + + - name: Install dependencies + run: ${{matrix.env}} bundle install + + - name: Run tests + run: ${{matrix.env}} bundle exec rspec diff --git a/.travis.yml b/.travis.yml deleted file mode 100644 index 29285b3..0000000 --- a/.travis.yml +++ /dev/null @@ -1,22 +0,0 @@ -language: ruby -dist: xenial -cache: bundler - -script: bundle exec rspec - -matrix: - include: - - rvm: 2.5 - - rvm: 2.6 - - rvm: 2.7 - - rvm: 2.6 - env: COVERAGE=PartialSummary,Coveralls - - rvm: 2.7 - - rvm: truffleruby - - rvm: jruby-head - env: JRUBY_OPTS="--debug -X+O" - - rvm: ruby-head - allow_failures: - - rvm: truffleruby - - rvm: ruby-head - - rvm: jruby-head diff --git a/README.md b/README.md index bef0f06..72d076d 100644 --- a/README.md +++ b/README.md @@ -2,7 +2,7 @@ Provides a low-level implementation of the HTTP/2 protocol. -[![Build Status](https://travis-ci.com/socketry/protocol-http2.svg?branch=master)](https://travis-ci.com/socketry/protocol-http2?branch=master) +[![Actions Status](https://github.com/socketry/protocol-http2/workflows/Development/badge.svg)](https://github.com/socketry/protocol-http2/actions?workflow=Development) ## Installation diff --git a/fuzz/framer/bake.rb b/fuzz/framer/bake.rb new file mode 100644 index 0000000..da71bd1 --- /dev/null +++ b/fuzz/framer/bake.rb @@ -0,0 +1,16 @@ + +# Run the fuzz test. +def run + system("AFL_SKIP_BIN_CHECK=1 afl-fuzz -i input/ -o output/ -m 100 -- ruby script.rb") +end + +def generate + require_relative '../../lib/protocol/http2/framer' + + framer = Protocol::HTTP2::Framer.new($stdout) + + frame = Protocol::HTTP2::DataFrame.new + frame.pack("Hello World") + + framer.write_frame(frame) +end diff --git a/fuzz/framer/input/data.txt b/fuzz/framer/input/data.txt new file mode 100644 index 0000000..0a3680b Binary files /dev/null and b/fuzz/framer/input/data.txt differ diff --git a/fuzz/framer/script.rb b/fuzz/framer/script.rb new file mode 100755 index 0000000..89b1457 --- /dev/null +++ b/fuzz/framer/script.rb @@ -0,0 +1,26 @@ +#!/usr/bin/env ruby + +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 diff --git a/lib/protocol/http2/connection.rb b/lib/protocol/http2/connection.rb index 05373e6..f81f24a 100644 --- a/lib/protocol/http2/connection.rb +++ b/lib/protocol/http2/connection.rb @@ -99,8 +99,9 @@ def maximum_concurrent_streams # The highest stream_id that has been successfully accepted by this connection. attr :remote_stream_id + # Whether the connection is effectively or actually closed. def closed? - @state == :closed + @state == :closed || @framer.nil? end def delete(id) diff --git a/lib/protocol/http2/version.rb b/lib/protocol/http2/version.rb index 3ef7e89..0881dd7 100644 --- a/lib/protocol/http2/version.rb +++ b/lib/protocol/http2/version.rb @@ -20,6 +20,6 @@ module Protocol module HTTP2 - VERSION = "0.13.3" + VERSION = "0.14.0" end end pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy