range requests and multipart responses

Eric Wong normalperson at yhbt.net
Tue Jul 20 02:18:03 EDT 2010

Hi all,

Does anybody have real-world use cases of clients using Range: requests
with multiple comma-delimited byte ranges (and thus expecting multipart
responses)?  If not, I'm not going to bloat Rainbows! with it for now[1].

While being able to specify a single range is very useful for resuming
failed downloads and for things who want to "peek" at magic patterns
before requesting the rest of a file, I can't think of good use cases
for having to deal with multipart responses.

Even if you were writing a FUSE-based filesystem over HTTP, it wouldn't
even be useful for implementing preadv(2) since you can only specify a
single offset there.

Maybe if you mmap() a FUSE-ed file and two threads access the same file
in different parts at the *exact*same*time* the FUSE layer could be
smart enough to make a single HTTP request instead of two? :)

[1] - For the performance-minded, it's also tough to implement multipart
      responses efficiently using any sendfile() implementation.
      Our TCP_CORK support is far from optimal under Linux right now,
      and not using TCP_CORK would be even less efficient with extra
      multipart headers.  AFAIK, sendfilev() isn't available outside of
      Solaris, either.

Eric Wong

More information about the rainbows-talk mailing list