Ignore:
Timestamp:
Oct 3, 2008, 8:46:58 PM (13 years ago)
Author:
charles
Message:

(rpc) #1319 as pointed out by spry, deflate()'s output can sometimes be larger than the native form. In these cases, use the smaller of the two sources.

File:
1 edited

Legend:

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

    r6845 r6846  
    242242    }
    243243
     244    /* if the deflated form is larger, then just use the original */
     245    if( !err && ( EVBUFFER_LENGTH( out ) >= EVBUFFER_LENGTH( evbuf ) ) )
     246        err = -1;
     247
    244248    if( !err ) {
    245         fprintf( stderr, "deflated response from %zu bytes to %zu\n",
    246                  EVBUFFER_LENGTH( evbuf ),
    247                  EVBUFFER_LENGTH( out ) );
     249        tr_ninf( MY_NAME, "deflated response from %zu bytes to %zu\n",
     250                          EVBUFFER_LENGTH( evbuf ),
     251                          EVBUFFER_LENGTH( out ) );
    248252        evbuffer_drain( evbuf, EVBUFFER_LENGTH( evbuf ) );
    249253        evbuffer_add_buffer( evbuf, out );
Note: See TracChangeset for help on using the changeset viewer.