• S
    Enable info/refs gzip decompression in HTTP client · aa90b969
    Shawn O. Pearce 提交于
    Some HTTP servers try to use gzip compression on the /info/refs
    request to save transfer bandwidth. Repositories with many tags
    may find the /info/refs request can be gzipped to be 50% of the
    original size due to the few but often repeated bytes used (hex
    SHA-1 and commonly digits in tag names).
    
    For most HTTP requests enable "Accept-Encoding: gzip" ensuring
    the /info/refs payload can use this encoding format.
    
    Only request gzip encoding from servers. Although deflate is
    supported by libcurl, most servers have standardized on gzip
    encoding for compression as that is what most browsers support.
    Asking for deflate increases request sizes by a few bytes, but is
    unlikely to ever be used by a server.
    
    Disable the Accept-Encoding header on probe RPCs as response bodies
    are supposed to be exactly 4 bytes long, "0000". The HTTP headers
    requesting and indicating compression use more space than the data
    transferred in the body.
    Signed-off-by: NShawn O. Pearce <spearce@spearce.org>
    Signed-off-by: NJunio C Hamano <gitster@pobox.com>
    aa90b969
remote-curl.c 21.6 KB