Changeset 5899


Ignore:
Timestamp:
May 22, 2008, 3:42:26 AM (15 years ago)
Author:
charles
Message:

tr_base64_decode() now decodes both data with, and without, newlines. thanks to dm1024 for helping track this down.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/libtransmission/utils.c

    r5891 r5899  
    10791079    bmem = BIO_push( b64, bmem );
    10801080    retlen = BIO_read( bmem, ret, length );
     1081    if( !retlen )
     1082    {
     1083        /* try again, but with the BIO_FLAGS_BASE64_NO_NL flag */
     1084        BIO_free_all( bmem );
     1085        b64 = BIO_new( BIO_f_base64( ) );
     1086        BIO_set_flags( b64, BIO_FLAGS_BASE64_NO_NL );
     1087        bmem = BIO_new_mem_buf( (unsigned char*)input, length );
     1088        bmem = BIO_push( b64, bmem );
     1089        retlen = BIO_read( bmem, ret, length );
     1090    }
     1091
    10811092    if( setme_len )
    10821093        *setme_len = retlen;
Note: See TracChangeset for help on using the changeset viewer.