summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCharles Hsu <charles0126@gmail.com>2015-08-18 19:22:24 +0800
committerCharles Hsu <charles0126@gmail.com>2015-08-27 00:01:22 +0800
commit4b627327c9cca5d0ddd038cd5b42466945ae1657 (patch)
tree6968872558ee186336f09092b1a59373e53f67ed
parent3c6565235464fa724929b5abe8f2c32c001996bf (diff)
downloadpython-swiftclient-4b627327c9cca5d0ddd038cd5b42466945ae1657.tar.gz
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
-rw-r--r--swiftclient/client.py5
1 files changed, 4 insertions, 1 deletions
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)