From 4b627327c9cca5d0ddd038cd5b42466945ae1657 Mon Sep 17 00:00:00 2001 From: Charles Hsu Date: Tue, 18 Aug 2015 19:22:24 +0800 Subject: Increase httplib._MAXHEADERS to 256. By default Swift increase the number of max metadata count to 90 and extra header count to 32. That mean we can put 90 metadata to Account/Container/Object by default, when user put 90 metadata to a Account, the Account header count is close or more than 100. The swift client unable to access Account and get an error likes, ('Connection aborted.', HTTPException('got more than 100 headers',)) So the default _MAXHEADERS(100) won't enough. Change-Id: I5ffc4eb5d3e1ebc3dbdd7dc69376919ae3e1c5a8 --- swiftclient/client.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/swiftclient/client.py b/swiftclient/client.py index 74e60c0..25c2133 100644 --- a/swiftclient/client.py +++ b/swiftclient/client.py @@ -16,7 +16,6 @@ """ OpenStack Swift client library used internally """ - import socket import requests import logging @@ -24,6 +23,7 @@ import warnings from distutils.version import StrictVersion from requests.exceptions import RequestException, SSLError +from six.moves import http_client from six.moves.urllib.parse import quote as _quote from six.moves.urllib.parse import urlparse, urlunparse from time import sleep, time @@ -34,6 +34,9 @@ from swiftclient.exceptions import ClientException from swiftclient.utils import ( LengthWrapper, ReadableToIterable, parse_api_response) +# Defautl is 100, increase to 256 +http_client._MAXHEADERS = 256 + AUTH_VERSIONS_V1 = ('1.0', '1', 1) AUTH_VERSIONS_V2 = ('2.0', '2', 2) AUTH_VERSIONS_V3 = ('3.0', '3', 3) -- cgit v1.2.1