X-Git-Url: https://git.gag.com/?a=blobdiff_plain;f=xfer-src%2Fxfer.c;fp=xfer-src%2Fxfer.c;h=97b71473642859dc6bcad874904bff4dcdc66171;hb=949b8910a5e23c4285d0b1aedacfc82a14dc97a5;hp=ac97198c34cc6d46d1a9afc9712e679354c3455c;hpb=c6f0a88c567f8536c498f554285aed1f8150da18;p=debian%2Famanda diff --git a/xfer-src/xfer.c b/xfer-src/xfer.c index ac97198..97b7147 100644 --- a/xfer-src/xfer.c +++ b/xfer-src/xfer.c @@ -1,5 +1,5 @@ /* - * Copyright (c) 2008, 2009, 2010 Zmanda, Inc. All Rights Reserved. + * Copyright (c) 2008-2012 Zmanda, Inc. All Rights Reserved. * * This program is free software; you can redistribute it and/or modify it * under the terms of the GNU General Public License version 2 as published @@ -269,7 +269,10 @@ xfer_cancel( { /* Since xfer_cancel can be called from any thread, we just send a message. * The action takes place when the message is received. */ - XferElement *src = g_ptr_array_index(xfer->elements, 0); + XferElement *src; + if (xfer->cancelled > 0) return; + xfer->cancelled++; + src = g_ptr_array_index(xfer->elements, 0); xfer_queue_message(xfer, xmsg_new(src, XMSG_CANCEL, 0)); }