From f32ca66210d751452cf9b676bb757d21745a92c1 Mon Sep 17 00:00:00 2001 From: Eric Petit Date: Thu, 12 Jan 2006 19:01:41 +0000 Subject: [PATCH] Update 2005-12-29 --- gtk/main.c | 5 +---- libtransmission/transmission.c | 7 +++++++ 2 files changed, 8 insertions(+), 4 deletions(-) diff --git a/gtk/main.c b/gtk/main.c index cafa5b61c..e6922c3ba 100644 --- a/gtk/main.c +++ b/gtk/main.c @@ -807,10 +807,7 @@ actionclick(GtkWidget *widget, gpointer gdata) { switch(act) { case ACT_START: - if(TR_STATUS_STOPPING & sb[index].status) - fprintf(stderr, "XXX still running\n"); - else - tr_torrentStart(data->tr, index); + tr_torrentStart(data->tr, index); updatesave = TRUE; break; case ACT_STOP: diff --git a/libtransmission/transmission.c b/libtransmission/transmission.c index a393c0b53..60c9f5f98 100644 --- a/libtransmission/transmission.c +++ b/libtransmission/transmission.c @@ -25,6 +25,7 @@ /*********************************************************************** * Local prototypes **********************************************************************/ +static void torrentReallyStop( tr_handle_t * h, int t ); static void downloadLoop( void * ); static float rateDownload( tr_torrent_t * ); static float rateUpload( tr_torrent_t * ); @@ -232,6 +233,12 @@ void tr_torrentStart( tr_handle_t * h, int t ) uint64_t now; int i; + if( tor->status & ( TR_STATUS_STOPPING | TR_STATUS_STOPPED ) ) + { + /* Join the thread first */ + torrentReallyStop( h, t ); + } + tor->status = TR_STATUS_CHECK; tor->tracker = tr_trackerInit( h, tor ); tor->bindPort = h->bindPort;