diff --git a/libtransmission/rpcimpl.c b/libtransmission/rpcimpl.c index bf8c2c41d..b9d3f8e34 100644 --- a/libtransmission/rpcimpl.c +++ b/libtransmission/rpcimpl.c @@ -29,11 +29,19 @@ #define TR_N_ELEMENTS( ary ) ( sizeof( ary ) / sizeof( *ary ) ) +#if 0 +#define dbgmsg(fmt, ...) \ + do { \ + fprintf( stderr, "%s:%d"#fmt, __FILE__, __LINE__, __VA_ARGS__ ); \ + fprintf( stderr, "\n" ); \ + } while( 0 ) +#else #define dbgmsg( ... ) \ do { \ if( tr_deepLoggingIsActive( ) ) \ tr_deepLog( __FILE__, __LINE__, "RPC", __VA_ARGS__ ); \ } while( 0 ) +#endif /*** @@ -921,6 +929,14 @@ methods[] = { "torrent-verify", TRUE, torrentVerify } }; +static void +noop_response_callback( tr_session * session UNUSED, + const char * response UNUSED, + size_t response_len UNUSED, + void * user_data UNUSED ) +{ +} + static void request_exec( tr_session * session, tr_benc * request, @@ -932,6 +948,9 @@ request_exec( tr_session * session, tr_benc * args_in = tr_bencDictFind( request, "arguments" ); const char * result = NULL; + if( callback == NULL ) + callback = noop_response_callback; + /* parse the request */ if( !tr_bencDictFindStr( request, "method", &str ) ) result = "no method name";