• David Turner's avatar
    http.c: use CURLOPT_RANGE for range requests · 835c4d36
    David Turner authored
    A HTTP server is permitted to return a non-range response to a HTTP
    range request (and Apache httpd in fact does this in some cases).
    While libcurl knows how to correctly handle this (by skipping bytes
    before and after the requested range), it only turns on this handling
    if it is aware that a range request is being made.  By manually
    setting the range header instead of using CURLOPT_RANGE, we were
    hiding the fact that this was a range request from libcurl.  This
    could cause corruption.
    Signed-off-by: default avatarDavid Turner <dturner@twopensource.com>
    Reviewed-by: default avatarJeff King <peff@peff.net>
    Signed-off-by: default avatarJunio C Hamano <gitster@pobox.com>
http.h 6.15 KB