libcloud-notifications mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From to...@apache.org
Subject svn commit: r1079334 - /incubator/libcloud/trunk/libcloud/storage/base.py
Date Tue, 08 Mar 2011 12:00:02 GMT
Author: tomaz
Date: Tue Mar  8 12:00:01 2011
New Revision: 1079334

URL: http://svn.apache.org/viewvc?rev=1079334&view=rev
Log:
Oops, this whole body shouldn't be wrapped inside "if calculate_hash"

Modified:
    incubator/libcloud/trunk/libcloud/storage/base.py

Modified: incubator/libcloud/trunk/libcloud/storage/base.py
URL: http://svn.apache.org/viewvc/incubator/libcloud/trunk/libcloud/storage/base.py?rev=1079334&r1=1079333&r2=1079334&view=diff
==============================================================================
--- incubator/libcloud/trunk/libcloud/storage/base.py (original)
+++ incubator/libcloud/trunk/libcloud/storage/base.py Tue Mar  8 12:00:01 2011
@@ -444,27 +444,26 @@ class StorageDriver(object):
             return False, None, None
 
         while len(chunk) > 0:
+            try:
+                if chunked:
+                    response.connection.connection.send('%X\r\n' %
+                                                       (len(chunk)))
+                    response.connection.connection.send(chunk)
+                    response.connection.connection.send('\r\n')
+                else:
+                    response.connection.connection.send(chunk)
+            except Exception, e:
+                # Timeout, etc.
+                return False, None, bytes_transferred
+
+            bytes_transferred += len(chunk)
             if calculate_hash:
-                try:
-                    if chunked:
-                        response.connection.connection.send('%X\r\n' %
-                                                           (len(chunk)))
-                        response.connection.connection.send(chunk)
-                        response.connection.connection.send('\r\n')
-                    else:
-                        response.connection.connection.send(chunk)
-                except Exception, e:
-                    # Timeout, etc.
-                    return False, None, bytes_transferred
-
-                bytes_transferred += len(chunk)
-                if calculate_hash:
-                    data_hash.update(chunk)
-
-                try:
-                    chunk = generator.next()
-                except StopIteration:
-                    chunk = ''
+                data_hash.update(chunk)
+
+            try:
+                chunk = generator.next()
+            except StopIteration:
+                chunk = ''
 
         if chunked:
                 response.connection.connection.send('0\r\n\r\n')



Mime
View raw message