X-Git-Url: https://git.gag.com/?a=blobdiff_plain;ds=sidebyside;f=server-src%2Fxfer-source-holding.c;h=52e0ee1859e533844c41af7a58389ad7ed0bd47a;hb=HEAD;hp=a53c512d8f866a331d2a6049bb06a631470568fd;hpb=42ff24f2a525d5965e1841b2ebe3ee0f4b918ac6;p=debian%2Famanda diff --git a/server-src/xfer-source-holding.c b/server-src/xfer-source-holding.c index a53c512..52e0ee1 100644 --- a/server-src/xfer-source-holding.c +++ b/server-src/xfer-source-holding.c @@ -1,10 +1,11 @@ /* * Amanda, The Advanced Maryland Automatic Network Disk Archiver - * Copyright (c) 2009 Zmanda, Inc. All Rights Reserved. + * Copyright (c) 2009-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 - * by the Free Software Foundation. + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU General Public License + * as published by the Free Software Foundation; either version 2 + * of the License, or (at your option) any later version. * * This program is distributed in the hope that it will be useful, but * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY @@ -49,6 +50,7 @@ typedef struct XferSourceHolding { int fd; char *next_filename; + guint64 bytes_read; XferElement *dest_taper; } XferSourceHolding; @@ -195,6 +197,7 @@ pull_buffer_impl( bytes_read = full_read(self->fd, buf, HOLDING_BLOCK_SIZE); if (bytes_read > 0) { *size = bytes_read; + self->bytes_read += bytes_read; return buf; } @@ -296,7 +299,17 @@ xfer_source_holding( XferElement *elt = XFER_ELEMENT(self); self->next_filename = g_strdup(filename); + self->bytes_read = 0; return elt; } +guint64 +xfer_source_holding_get_bytes_read( + XferElement *elt) +{ + XferSourceHolding *self = (XferSourceHolding *)elt; + + return self->bytes_read; +} +