diff options
author | Matt Riedemann <mriedem@us.ibm.com> | 2014-07-15 07:58:34 -0700 |
---|---|---|
committer | Matt Riedemann <mriedem@us.ibm.com> | 2014-07-16 02:14:07 -0700 |
commit | 68c1d1fbc614d11b95f2fd6da26fd669e40f4186 (patch) | |
tree | d7fe878d76d7ebaa0ca2089f7cc70f406f5e51db /glanceclient/common/utils.py | |
parent | f75a81000e1060d608c624ff8e3287e8c99a5123 (diff) | |
download | python-glanceclient-68c1d1fbc614d11b95f2fd6da26fd669e40f4186.tar.gz |
Don't stream non-binary requests
Setting stream=True with requests can lead to issues
with not closing the connection so the urllib3 connection
pool is not freed up, so only set stream=True if making
a request with application/octet-stream content-type.
See the body-content-workflow and keep-alive sections
in the requests docs here for more information:
http://docs.python-requests.org/en/latest/user/advanced/
Note that commit dbb242b changed the response body_iter
code to potentially return a six.StringIO object rather
than the old ResponseBodyIterator class and since the
images client code is not converting the body_iter into
a dict using json.loads, we have to do that directly
in the _request method where the body_iter is
constructed.
Co-authored-by: Flavio Percoco <fpercoco@redhat.com>
Change-Id: I86572b69c4511f933c9676108190271874346302
Partial-Bug: #1341777
Diffstat (limited to 'glanceclient/common/utils.py')
0 files changed, 0 insertions, 0 deletions