Swift backend should send content-length

Bug #1304432 reported by Hamish Forbes
14
This bug affects 2 people
Affects Status Importance Assigned to Milestone
Duplicity
Invalid
Undecided
Unassigned

Bug Description

Hi,

Ideally the swift backend should be sending the Content-Length header when uploading an object.
The swift shell does this here: https://github.com/openstack/python-swiftclient/blob/master/swiftclient/shell.py#L1098
by passing an extra parameter to conn.put_object of content_length=getsize(path).

If 100-continue responses are enabled on the swift endpoint it allows the aborting of a request before the file has been uploaded.
It also means in the situation where swift requests are being passed through a proxy that does not understand chunked transfer encoding the requests still work.
Granted this is a slightly odd use case but I have just run into it...

Its only a very small change and brings the duplicity swift backend into line with the python-swiftclient cli utility.

Thanks
Hamish

Revision history for this message
david (w-david-cole) wrote :

On a related note, we have a patch for python-swiftclient that would take the really useful from shell.py and make it usable (importable) in other applications , like duplicity. That would resolve this issue plus would give extra benefits . Gerrit review for the change is here https://review.openstack.org/#/c/85453/

David

Revision history for this message
Kenneth Loafman (kenneth-loafman) wrote :

Already done in latest python-swiftclient module.

Changed in duplicity:
status: New → Invalid
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.