Changeset 8361


Ignore:
Timestamp:
May 8, 2009, 5:04:12 PM (12 years ago)
Author:
charles
Message:

(trunk libT) don't rely just on errno to tell if tr_loadFile() succeeded. xref: http://trac.transmissionbt.com/ticket/2030?replyto=38#comment:38

File:
1 edited

Legend:

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

    r8360 r8361  
    336336        content = tr_loadFile( filename, &content_len );
    337337
    338         if( errno )
    339         {
    340             char * tmp = tr_strdup_printf( "%s (%s)", filename, tr_strerror( errno ) );
    341             send_simple_response( req, HTTP_NOTFOUND, tmp );
    342             tr_free( tmp );
    343         }
    344         else
     338        if( content )
    345339        {
    346340            struct evbuffer * out;
     
    357351            tr_releaseBuffer( out );
    358352            tr_free( content );
     353        }
     354        else
     355        {
     356            char * tmp = tr_strdup_printf( "%s (%s)", filename, tr_strerror( errno ) );
     357            send_simple_response( req, HTTP_NOTFOUND, tmp );
     358            tr_free( tmp );
    359359        }
    360360    }
Note: See TracChangeset for help on using the changeset viewer.