Skip to content

Commit

Permalink
Fix for #43
Browse files Browse the repository at this point in the history
  • Loading branch information
wettenhj committed Apr 28, 2015
1 parent 59e9c02 commit f2095cc
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 2 deletions.
8 changes: 6 additions & 2 deletions FoldersController.py
Original file line number Diff line number Diff line change
Expand Up @@ -1088,8 +1088,7 @@ def Md5ProgressCallback(bytesProcessed):
"before it began uploading." %
self.uploadModel.GetRelativePathToUpload())
return
if self.foldersController.uploadMethod == UploadMethod.HTTP_POST or \
not self.existingUnverifiedDatafile:
if self.foldersController.uploadMethod == UploadMethod.HTTP_POST:
self.uploadModel.SetMessage("Initializing buffered reader...")
datafileBufferedReader = io.open(dataFilePath, 'rb')
self.uploadModel.SetBufferedReader(datafileBufferedReader)
Expand Down Expand Up @@ -1453,3 +1452,8 @@ def ProgressCallback(param, current, total, message=None):
folderModel=self.folderModel,
dataFileIndex=self.dataFileIndex,
uploadModel=self.uploadModel))
if self.foldersController.uploadMethod == UploadMethod.HTTP_POST:
try:
self.uploadModel.GetBufferedReader().close()
except:
logger.error(traceback.format_exc())
9 changes: 9 additions & 0 deletions UploadModel.py
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,16 @@ def GetFolderModel(self):
def GetDataFileIndex(self):
return self.dataFileIndex

def GetBufferedReader(self):
"""
Only used with UploadMethod.HTTP_POST
"""
return self.bufferedReader

def SetBufferedReader(self, bufferedReader):
"""
Only used with UploadMethod.HTTP_POST
"""
self.bufferedReader = bufferedReader

def GetSshMasterProcess(self):
Expand Down

0 comments on commit f2095cc

Please sign in to comment.