From: Ben Darnell Date: Thu, 5 Aug 2010 00:40:24 +0000 (-0700) Subject: Suppress libcurl's magic "Expect: 100-continue" behavior. X-Git-Tag: v1.1.0~49 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=becb5f270336ad972b23f2e703de677f8ece30b1;p=thirdparty%2Ftornado.git Suppress libcurl's magic "Expect: 100-continue" behavior. This was motivated by the discovery of bug https://sourceforge.net/tracker/?func=detail&atid=100976&aid=3039744&group_id=976 --- diff --git a/tornado/httpclient.py b/tornado/httpclient.py index 355ceed3e..fd72ad430 100644 --- a/tornado/httpclient.py +++ b/tornado/httpclient.py @@ -348,6 +348,16 @@ class HTTPRequest(object): timestamp, localtime=False, usegmt=True) if "Pragma" not in headers: headers["Pragma"] = "" + # libcurl's magic "Expect: 100-continue" behavior causes delays + # with servers that don't support it (which include, among others, + # Google's OpenID endpoint). Additionally, this behavior has + # a bug in conjunction with the curl_multi_socket_action API + # (https://sourceforge.net/tracker/?func=detail&atid=100976&aid=3039744&group_id=976), + # which increases the delays. It's more trouble than it's worth, + # so just turn off the feature (yes, setting Expect: to an empty + # value is the official way to disable this) + if "Expect" not in headers: + headers["Expect"] = "" self.url = _utf8(url) self.method = method self.headers = headers