Handle X-Copy-From header in container_quota middleware

Content length of the copied object is checked before
allowing the copy request according to the container quota.

Closes-Bug: #1201875
Change-Id: If44b916791e94ac6c66eee04a5727186ce0e56ae
Two small account-quota fixes

First: even if a user has exceeded their account quota, they should be
able to make object POST requests. Updating an object's metadata isn't
going to make them any more over quota, so should be allowed.

Second: don't bother with the reseller_admin check for container or
object requests. If I send the header X-Account-Meta-Quota-Bytes: 100
on e.g. an object PUT request, the proxy will (rightly) ignore it. Now
account-quotas does too.

Change-Id: I970a76349659acdd8229a324bd33bfe7fe7261a4
Fix utf-8 handling in object versions.

Fixes object versioning when object name and/or version
container name contain multibyte utf-8 characters.

When object names containing non-ASCII characters
are PUT multiple times into a container with an
x-versions-location set, subsequent DELETE of the
object results in a 500 response status.

When the versions container name contains
non-ASCII characters the first delete of an object
succeeds but fails to restore previous version of
object, so second delete incorrectly returns 404.

Fixes bug 1229142

Change-Id: I425440f76b8328f8e119d390bfa4c7022181e89e
Revert "Refactor common/utils methods to common/ondisk"

This reverts commit 7760f41c3ce436cb23b4b8425db3749a3da33d32

Change-Id: I95e57a2563784a8cd5e995cc826afeac0eadbe62
Signed-off-by: Peter Portante <peter.portante@redhat.com>
Don't apply timeout to Pool.get operation (leaks)

The connection timeout to a memcache server is performed by using the
"with Timeout()" construct over the sock.connect() call in the
.create() method. In addition, the same construct was being applied to
the Pool.get() call in ._get_conns().

If the maximum number of connections was already created, and the
Pool.get() called took longer than the connect timeout, then the error
handling path would add a place holder to the connection
pool. Eventlet's Pool class allows for additional items to be added to
the pool, over and above the max_size setting. This additional place
holder will eventually be pulled and a new connection created to take
its place.

The fix is to remove the timeout construct in the _get_conns() method.

In addition, we also apply the unit test patch mentioned in the review
comments for Patch Set 6 of https://review.openstack.org/45134,
located at http://paste.openstack.org/show/47288/.

Fixes bug 1235027

Change-Id: I786cabefe3e8ddf7d92feb7ebc7cfb613d60a1da
Signed-off-by: Peter Portante <peter.portante@redhat.com>
Add a Timeout when getting Memcache connections

The old Timeout behavior when pulling connections of the MemcacheConnPool left
ambiguity around what timed out and could put more placeholders in the queue
than the configured max_connections.

To avoid waiting indefinitely on slow severs we raise a custom Timeout when we
fail get a connection from the pool.  We still error limit the slow server,
and move onto the next, but we still don't allow more than max_connections.

Change-Id: I9e2409896423d52da69e35c038e5f457c71f705d
Merge "Two small account-quota fixes"
allow container create even if over account quota

Change-Id: I07278bc3314c26426ff0557fe2f5c69c02d6550c
Merge "Don't apply timeout to Pool.get operation (leaks)"
Merge "Revert "Refactor common/utils methods to common/ondisk""
Merge "Fix utf-8 handling in object versions."
Merge "allow container create even if over account quota"
CHANGELOG and AUTHORS updates for 1.10.0 release

Change-Id: Iaf8d289c5ddb6ac778243a5e1fc27600bade6feb
Merge "Add a Timeout when getting Memcache connections"
Merge "CHANGELOG and AUTHORS updates for 1.10.0 release"
Merge "Handle X-Copy-From header in container_quota middleware"