Skip to main content

Module splice_http

Module splice_http 

Source
Expand description

Linux-only zero-copy HTTP download via splice(2).

When downloading a file over plain HTTP (no HTTPS, no proxy) on Linux, this module bypasses the hyper/reqwest HTTP client and uses a raw TCP connection to enable splice(2) zero-copy transfer from socket to file.

The response headers are read into user space (small, ~1 KB), then the response body is spliced directly from the kernel socket buffer to the output file via a pipe buffer — no user-space data copy for the body.

§Limitations

  • Linux only (splice is a Linux-specific syscall)
  • Plain HTTP only (no TLS/HTTPS support)
  • No proxy support
  • No custom headers or cookies (use the reqwest path for those)
  • HTTP 1.1 only (no HTTP/2)
  • Requires 206 Partial Content response (Range request)
  • No chunked transfer encoding (Content-Length required)

Functions§

try_splice_download
Attempt a zero-copy splice download of a byte range from url into file at file_offset.