]> granicus.if.org Git - transmission/commitdiff
(trunk libT) #4101 "RPC method blocklist-update is broken" -- add debugging error...
authorJordan Lee <jordan@transmissionbt.com>
Fri, 10 Jun 2011 05:34:16 +0000 (05:34 +0000)
committerJordan Lee <jordan@transmissionbt.com>
Fri, 10 Jun 2011 05:34:16 +0000 (05:34 +0000)
libtransmission/rpcimpl.c

index 9dc1c3dcc1296bd824c84deeca2c540762406861..8748346e024551b7963f32d33f5edfae485ddc55 100644 (file)
@@ -1126,6 +1126,8 @@ gotNewBlocklist( tr_session       * session,
     char result[1024];
     struct tr_rpc_idle_data * data = user_data;
 
+    *result = '\0';
+
     if( response_code != 200 )
     {
         tr_snprintf( result, sizeof( result ), "gotNewBlocklist: http error %ld: %s",
@@ -1181,10 +1183,15 @@ gotNewBlocklist( tr_session       * session,
                     }
                     tr_free( buf );
                     gzclose( gzf );
+                } else {
+                    tr_snprintf( result, sizeof( result ), _( "Error opening \"%1$s\": %2$s" ), filename, tr_strerror( errno ) );
                 }
                 tr_close_file( fd );
             }
 
+            if( *result )
+                tr_err( "%s", result );
+
             unlink( filename );
             tr_free( filename );
             filename = filename2;