Browse files

debugging the md5 sum calculation

  • Loading branch information...
1 parent 65ed6e9 commit 93d85edc6953f041785e9d94e2779917c0a4c533 BuzzTroll committed Oct 19, 2010
Showing with 7 additions and 1 deletion.
  1. +7 −1 cumulus/cb/pycb/cbRequest.py
View
8 cumulus/cb/pycb/cbRequest.py
@@ -433,6 +433,8 @@ def sendFile(self, dataObj):
try:
etag = dataObj.get_md5()
if etag == None:
+ etag = self.etag
+ if etag == None:
etag = self.calcMd5Sum(dataObj)
dataObj.set_md5(etag)
self.setHeader(self.request, 'ETag', '"%s"' % (etag))
@@ -448,10 +450,12 @@ def cbFinished(ignored):
except cbException, (ex):
ex.sendErrorResponse(self.request, self.requestId)
traceback.print_exc(file=sys.stdout)
- except:
+ pycb.log(logging.ERROR, "Error sending file %s" % (str(ex)), traceback)
+ except Exception, ex2:
traceback.print_exc(file=sys.stdout)
gdEx = cbException('InvalidArgument')
gdEx.sendErrorResponse(self.request, self.requestId)
+ pycb.log(logging.ERROR, "Error sending file %s" % (str(ex2)), traceback)
def sendObject(self, dataObj):
@@ -462,6 +466,8 @@ def sendObject(self, dataObj):
self.setHeader(request, 'Content-Type', 'binary/octet-stream')
self.setHeader(request, 'Content-Length', str(dataObj.get_size()))
+ (s,ct,self.etag) = self.user.get_info(self.bucketName, self.objectName)
+
reactor.callInThread(self.sendFile, dataObj)
class cbDeleteBucket(cbRequest):

0 comments on commit 93d85ed

Please sign in to comment.