From: Charles Kerr Date: Wed, 25 Jun 2008 11:34:35 +0000 (+0000) Subject: (rpc) fix crash when quickly toggling rpc on/off reported by John_Clay X-Git-Tag: 1.31~186 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=26261e3bde38ce14f26cfadf861286f2397ebc0a;p=transmission (rpc) fix crash when quickly toggling rpc on/off reported by John_Clay --- diff --git a/libtransmission/rpc-server.c b/libtransmission/rpc-server.c index 3fa581ae1..1d12539d2 100644 --- a/libtransmission/rpc-server.c +++ b/libtransmission/rpc-server.c @@ -112,7 +112,8 @@ rpcPulse( int socket UNUSED, short action UNUSED, void * vserver ) assert( server ); - shttpd_poll( server->ctx, 1 ); + if( server->ctx ) + shttpd_poll( server->ctx, 1 ); /* set a timer for the next pulse */ if( EVBUFFER_LENGTH( server->in ) || EVBUFFER_LENGTH( server->out ) ) diff --git a/libtransmission/trevent.c b/libtransmission/trevent.c index 9e4fb4011..0851d586a 100644 --- a/libtransmission/trevent.c +++ b/libtransmission/trevent.c @@ -117,7 +117,7 @@ readFromPipe( int fd, short eventType, void * veh ) { assert( 0 && "unhandled command type!" ); break; - } + } } }