diff options
author | Janoš Guljaš <janos@users.noreply.github.com> | 2018-08-09 22:15:07 +0800 |
---|---|---|
committer | Balint Gabor <balint.g@gmail.com> | 2018-08-09 22:15:07 +0800 |
commit | 3bcb501c8fefeec1bc8aac26686460cae86f2ccb (patch) | |
tree | 51d3251a1d0042d042981d334a996939ebe7ceb0 /swarm | |
parent | d3e4c2dcb00eb61c32dd3a9b94a317727c2449a7 (diff) | |
download | dexon-3bcb501c8fefeec1bc8aac26686460cae86f2ccb.tar dexon-3bcb501c8fefeec1bc8aac26686460cae86f2ccb.tar.gz dexon-3bcb501c8fefeec1bc8aac26686460cae86f2ccb.tar.bz2 dexon-3bcb501c8fefeec1bc8aac26686460cae86f2ccb.tar.lz dexon-3bcb501c8fefeec1bc8aac26686460cae86f2ccb.tar.xz dexon-3bcb501c8fefeec1bc8aac26686460cae86f2ccb.tar.zst dexon-3bcb501c8fefeec1bc8aac26686460cae86f2ccb.zip |
swarm/api: close tar writer in GetDirectoryTar to flush and clean (#17339)
Diffstat (limited to 'swarm')
-rw-r--r-- | swarm/api/api.go | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/swarm/api/api.go b/swarm/api/api.go index ad4bd7dcb..b418c45e1 100644 --- a/swarm/api/api.go +++ b/swarm/api/api.go @@ -525,6 +525,10 @@ func (a *API) GetDirectoryTar(ctx context.Context, uri *URI) (io.ReadCloser, err return nil }) + // close tar writer before closing pipew + // to flush remaining data to pipew + // regardless of error value + tw.Close() if err != nil { apiGetTarFail.Inc(1) pipew.CloseWithError(err) |