Changeset 7014


Ignore:
Timestamp:
Nov 1, 2008, 10:09:16 PM (12 years ago)
Author:
charles
Message:

(daemon) when serving deflated output, strip off the first 2 and last 4 bytes from deflate()'s output, for reasons described at http://carsten.codimi.de/gzip.yaws/

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/libtransmission/rpc-server.c

    r6961 r7014  
    261261        {
    262262            EVBUFFER_LENGTH( out ) = content_len - stream.avail_out;
     263
     264            /* http://carsten.codimi.de/gzip.yaws/
     265               It turns out that some browsers expect deflated data without
     266               the first two bytes (a kind of header) and and the last four
     267               bytes (an ADLER32 checksum). This format can of course
     268               be produced by simply stripping these off. */
     269            if( EVBUFFER_LENGTH( out ) >= 6 ) {
     270                EVBUFFER_LENGTH( out ) -= 4;
     271                evbuffer_drain( out, 2 );
     272            }
     273
    263274            tr_ninf( MY_NAME, _( "Deflated response from %zu bytes to %zu" ),
    264275                              content_len,
Note: See TracChangeset for help on using the changeset viewer.