diff options
author | RaNaN <Mast3rRaNaN@hotmail.de> | 2011-03-13 19:28:21 +0100 |
---|---|---|
committer | RaNaN <Mast3rRaNaN@hotmail.de> | 2011-03-13 19:28:21 +0100 |
commit | 18cefb5fc5992c362e3a19e44c2bfc2f22930515 (patch) | |
tree | d893abe6a2fa2ec1a8fa38af5cced5f168379f77 /module/network | |
parent | fixed gzip (diff) | |
download | pyload-18cefb5fc5992c362e3a19e44c2bfc2f22930515.tar.xz |
make sure everything is written to disk before merging
Diffstat (limited to 'module/network')
-rw-r--r-- | module/network/HTTPDownload.py | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/module/network/HTTPDownload.py b/module/network/HTTPDownload.py index ad6312508..295c8f465 100644 --- a/module/network/HTTPDownload.py +++ b/module/network/HTTPDownload.py @@ -17,7 +17,7 @@ @author: RaNaN """ -from os import remove +from os import remove, fsync from time import sleep, time from shutil import move @@ -212,6 +212,8 @@ class HTTPDownload(): failed = e.code remove(self.info.getChunkName(chunk.id)) + chunk.fp.flush() + fsync(chunk.fp) #make sure everything was written to disk chunk.fp.close() #needs to be closed, or merging chunks will fail if failed: raise BadHeader(failed) |