Skip to content

Comments

feat: HTTP/2 Handler Implementation (TASK-204)#94

Merged
copyleftdev merged 1 commit intomainfrom
feat/TASK-204-http2-handler
Jan 11, 2026
Merged

feat: HTTP/2 Handler Implementation (TASK-204)#94
copyleftdev merged 1 commit intomainfrom
feat/TASK-204-http2-handler

Conversation

@copyleftdev
Copy link
Owner

Summary

Implements HTTP/2 protocol handler following the ProtocolHandler interface pattern, completing TASK-204.

  • Frame serialization: SETTINGS, HEADERS, DATA, PING, WINDOW_UPDATE, GOAWAY, RST_STREAM
  • HPACK compression: Static table encoder/decoder (no dynamic table or Huffman for v1)
  • Stream multiplexing: 10 concurrent streams per connection
  • Flow control: Connection-level and stream-level window management
  • Connection lifecycle: Preface + SETTINGS exchange, GOAWAY for graceful shutdown
  • Server push rejection: Automatically sends RST_STREAM with CANCEL

Files Changed

File Description
src/http2_handler.zig New - ProtocolHandler implementation
src/http2_hpack.zig New - HPACK encoder/decoder with static table
src/http2_frame.zig Added 9 frame serialization functions
src/z6.zig Exports for new HTTP/2 types
build.zig Test targets for new modules
tests/unit/http2_handler_test.zig New - 13 handler tests
tests/unit/http2_hpack_test.zig New - 16 HPACK tests
tests/unit/http2_frame_test.zig Added 11 serialization tests

Test plan

  • All 30 HTTP/2 frame tests pass
  • All 16 HPACK tests pass
  • All 13 handler tests pass
  • Total: 59 tests passing

Deferred to future PRs

  • ALPN/TLS integration
  • Dynamic HPACK table
  • Huffman encoding
  • CONTINUATION frames
  • Advanced stream prioritization

Closes #63

🤖 Generated with Claude Code

Implements HTTP/2 protocol handler following the ProtocolHandler interface pattern.

Features:
- Frame serialization (SETTINGS, HEADERS, DATA, PING, WINDOW_UPDATE, GOAWAY, RST_STREAM)
- HPACK header compression (static table, no dynamic table or Huffman)
- Stream multiplexing (10 concurrent streams per connection)
- Connection preface + SETTINGS exchange
- Flow control (connection + stream level)
- Server push rejection (RST_STREAM with CANCEL)

Files added:
- src/http2_handler.zig: ProtocolHandler implementation
- src/http2_hpack.zig: Minimal HPACK encoder/decoder
- tests/unit/http2_handler_test.zig: 13 handler tests
- tests/unit/http2_hpack_test.zig: 16 HPACK tests

Files modified:
- src/http2_frame.zig: Added 9 frame serialization functions
- src/z6.zig: Exports for new types
- build.zig: Test targets for new modules
- tests/unit/http2_frame_test.zig: 11 serialization tests

Test results: 59 tests passing (30 frame + 16 HPACK + 13 handler)

Closes #63

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
@copyleftdev copyleftdev merged commit 74610d6 into main Jan 11, 2026
1 check failed
@copyleftdev copyleftdev deleted the feat/TASK-204-http2-handler branch January 11, 2026 07:45
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

TASK-204: HTTP/2 Handler Implementation

1 participant