Skip to content

Conversation

@anivar
Copy link

@anivar anivar commented Aug 16, 2025

This PR fixes three critical issues preventing Server v2 from being used in production:

  1. URL prefix normalization - Now handles --url-prefix //path correctly like the old server
  2. Args file loading - Fixed .args being loaded too late
  3. Connection stability - Removed aggressive client dropping, fixed partial writes, increased buffer size

The changes are minimal (~60 lines) and follow patterns from the existing server implementation.

Fixes #767, #783, #787

- Fix URL prefix normalization to handle double slashes (fixes Mozilla-Ocho#787)
  - Consolidates consecutive slashes (// -> /)
  - Ensures prefix starts with single slash
  - Removes trailing slash (except for root)
  - Matches old server behavior exactly

- Fix .args file loading order (fixes Mozilla-Ocho#783)
  - Load .args before determining program type
  - Allows --server --v2 flags in .args to work correctly

- Fix connection stability issues (addresses Mozilla-Ocho#767)
  - Remove aggressive client cancellation when workers are busy
  - Let TCP backlog handle connection queuing naturally
  - Fix partial write handling with simple retry logic
  - Increase file transfer buffer from 512B to 16KB

These minimal changes make Server v2 production-ready while maintaining
backward compatibility. All fixes follow existing patterns from the old
server implementation.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant