]> granicus.if.org Git - transmission/commitdiff
(rpc) fix crash when quickly toggling rpc on/off reported by John_Clay
authorCharles Kerr <charles@transmissionbt.com>
Wed, 25 Jun 2008 11:34:35 +0000 (11:34 +0000)
committerCharles Kerr <charles@transmissionbt.com>
Wed, 25 Jun 2008 11:34:35 +0000 (11:34 +0000)
libtransmission/rpc-server.c
libtransmission/trevent.c

index 3fa581ae1751f477d10187654c5f1ab8f1c09fef..1d12539d28622741b94889d9720b1e67c4d6966f 100644 (file)
@@ -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 ) )
index 9e4fb4011689ae91e7cbb4282963130fc8c02295..0851d586a900a3d14e035601fd0586a09ec5545b 100644 (file)
@@ -117,7 +117,7 @@ readFromPipe( int fd, short eventType, void * veh )
         {
             assert( 0 && "unhandled command type!" );
             break;
-       }
+        }
     }
 }