X-Git-Url: https://git.gag.com/?a=blobdiff_plain;f=device-src%2Fxfer-dest-taper-directtcp.c;h=5bc492c67643ab1ccae64ef432485eb1afa298db;hb=c21061ed466e7ee71cb21dd35010e33f6cf76424;hp=9036d22382bdcf282f8c06461d4d37e1591cca3e;hpb=fd48f3e498442f0cbff5f3606c7c403d0566150e;p=debian%2Famanda diff --git a/device-src/xfer-dest-taper-directtcp.c b/device-src/xfer-dest-taper-directtcp.c index 9036d22..5bc492c 100644 --- a/device-src/xfer-dest-taper-directtcp.c +++ b/device-src/xfer-dest-taper-directtcp.c @@ -19,8 +19,8 @@ * Sunnyvale, CA 94085, USA, or: http://www.zmanda.com */ -#include "amxfer.h" #include "amanda.h" +#include "amxfer.h" #include "xfer-device.h" #include "arglist.h" #include "conffile.h" @@ -135,6 +135,12 @@ worker_thread( DBG(2, "connection accepted; sending XMSG_READY"); xfer_queue_message(elt->xfer, xmsg_new(elt, XMSG_READY, 0)); + /* round the part size up to the next multiple of the block size */ + if (self->part_size) { + self->part_size += self->device->block_size-1; + self->part_size -= self->part_size % self->device->block_size; + } + /* now loop until we're out of parts */ while (1) { guint64 size; @@ -209,6 +215,10 @@ worker_thread( msg->successful = TRUE; msg->eom = eom; msg->eof = eof; + + /* time runs backward on some test boxes, so make sure this is positive */ + if (msg->duration < 0) msg->duration = 0; + xfer_queue_message(elt->xfer, msg); self->partnum++; @@ -388,16 +398,6 @@ use_device_impl( g_mutex_unlock(self->state_mutex); } -static void -cache_inform_impl( - XferDestTaper *xdtself G_GNUC_UNUSED, - const char *filename G_GNUC_UNUSED, - off_t offset G_GNUC_UNUSED, - off_t length G_GNUC_UNUSED) -{ - /* do nothing */ -} - static guint64 get_part_bytes_written_impl( XferDestTaper *xdtself G_GNUC_UNUSED) @@ -466,7 +466,6 @@ class_init( klass->cancel = cancel_impl; xdt_klass->start_part = start_part_impl; xdt_klass->use_device = use_device_impl; - xdt_klass->cache_inform = cache_inform_impl; xdt_klass->get_part_bytes_written = get_part_bytes_written_impl; goc->finalize = finalize_impl;