Changeset 11798


Ignore:
Timestamp:
Jan 31, 2011, 10:47:07 PM (11 years ago)
Author:
jordan
Message:

(trunk libT) #3969 "tr_base64_encode() has unnecessary overhead with linefeeds" -- fixed.

Don't add linefeeds to base64-encoded data. We don't need it and it just increases the length of the string, which is typically sent over the network to an RPC client.

Location:
trunk/libtransmission
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/libtransmission/utils-test.c

    r11619 r11798  
    418418    out = tr_base64_encode( "YOYO!", -1, &len );
    419419    check( out );
    420     check( !strcmp( out, "WU9ZTyE=\n" ) );
    421     check( len == 9 );
     420    check( !strcmp( out, "WU9ZTyE=" ) );
     421    check( len == 8 );
    422422    in = tr_base64_decode( out, -1, &len );
    423423    check( in );
  • trunk/libtransmission/utils.c

    r11778 r11798  
    11551155        bmem = BIO_new( BIO_s_mem( ) );
    11561156        b64 = BIO_new( BIO_f_base64( ) );
     1157        BIO_set_flags( b64, BIO_FLAGS_BASE64_NO_NL );
    11571158        b64 = BIO_push( b64, bmem );
    11581159        BIO_write( b64, input, length );
Note: See TracChangeset for help on using the changeset viewer.