From 26261e3bde38ce14f26cfadf861286f2397ebc0a Mon Sep 17 00:00:00 2001 From: Charles Kerr Date: Wed, 25 Jun 2008 11:34:35 +0000 Subject: [PATCH] (rpc) fix crash when quickly toggling rpc on/off reported by John_Clay --- libtransmission/rpc-server.c | 3 ++- libtransmission/trevent.c | 2 +- 2 files changed, 3 insertions(+), 2 deletions(-) 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; - } + } } }