Use computed size on object PUT, not fstat.
The object server knows the size of the file on disk already since it's counted the bytes as they were written out. There's no need to go ask the filesystem. This also lets object PUTs work when the filesystem is some crazy, non-POSIX thing that doesn't always give the right answers from fstat(). See bug 904723 for a case when this happened. Fixes bug 904723. Change-Id: Ibdf44ea991e0cc4f9e0997cc9ff566cb0eac5332
This commit is contained in:
parent
a69bc08990
commit
d61dfb32e7
@ -631,7 +631,7 @@ class ObjectController(object):
|
||||
'X-Timestamp': request.headers['x-timestamp'],
|
||||
'Content-Type': request.headers['content-type'],
|
||||
'ETag': etag,
|
||||
'Content-Length': str(os.fstat(fd).st_size),
|
||||
'Content-Length': str(upload_size),
|
||||
}
|
||||
metadata.update(val for val in request.headers.iteritems()
|
||||
if val[0].lower().startswith('x-object-meta-') and
|
||||
|
Loading…
x
Reference in New Issue
Block a user