swift/swift/common
Samuel Merritt 25ebf3aa9e Raise error on long or short DLO
The GET response for a DLO has a Content-Length that's computed from
the container listing, but the response body's length is determined by
the segments. If a segment grows or shrinks between when the headers
are sent and when the segment is requested, this confuses clients.

For example, if the DLO is longer than its Content-Length and the
client sends another request on the same TCP connection, then it can
get leftover object bytes instead of an HTTP status line.
Alternately, if the headers it sends fill up the TCP buffers since
Swift won't read them until the first response is done, then deadlock
hilarity ensues.

If the DLO is shorter than its Content-Length, you're pretty much
guaranteed a deadlock: the client is waiting for the rest of the
response, and the server is waiting for a new request.

Now SegmentedIterable detects both these conditions and raises an
exception so that the TCP connection gets torn down. It can't save
this request, but it can stop the next one from getting hosed too.

Change-Id: Icf79ba046ef7aaaab49ce6d0b33147332c967afc
2014-02-20 21:03:51 -08:00
..
middleware Merge "Support If-[None-]Match for object HEAD, SLO, and DLO" 2014-02-21 05:02:25 +00:00
ring Various optimizations to RingBuilder.rebalance() 2013-12-20 16:13:26 +04:00
__init__.py Start using Hacking 2013-07-15 11:41:58 +02:00
bufferedhttp.py Merge "Stop reading from object server when client disconnects." 2013-10-07 22:30:13 +00:00
constraints.py Move all DLO functionality to middleware 2014-02-03 18:29:48 -08:00
container_sync_realms.py New container sync configuration option 2014-01-10 23:48:00 +00:00
daemon.py Revert "Refactor common/utils methods to common/ondisk" 2013-10-07 17:18:09 -04:00
db_replicator.py Remove obsolete future imports 2013-11-22 12:23:58 -08:00
db.py Fixed DB test cases on PyPy 2013-12-02 14:24:22 -06:00
direct_client.py Remove swiftclient dep on direct_client 2013-12-24 03:11:43 -08:00
exceptions.py Remove swiftclient dep on direct_client 2013-12-24 03:11:43 -08:00
http.py Change OpenStack LLC to Foundation 2013-09-20 01:02:31 +08:00
internal_client.py Remove swiftclient dependency 2014-02-06 09:44:58 +00:00
manager.py Up nproc limit on startup. 2013-12-29 11:35:07 -05:00
memcached.py bare excepts, as is proper 2013-11-26 14:39:30 -08:00
request_helpers.py Raise error on long or short DLO 2014-02-20 21:03:51 -08:00
swob.py Support If-[None-]Match for object HEAD, SLO, and DLO 2014-02-20 14:54:26 -08:00
utils.py Support If-[None-]Match for object HEAD, SLO, and DLO 2014-02-20 14:54:26 -08:00
wsgi.py Support If-[None-]Match for object HEAD, SLO, and DLO 2014-02-20 14:54:26 -08:00