From: Tatiana Al-Chueyr Date: Mon, 21 Jul 2014 22:10:45 +0000 (-0700) Subject: Merge branch 'master' of github.com:tornadoweb/tornado X-Git-Tag: v4.1.0b1~123^2~5 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=52760e51208d619ca9294590140072d25508ad62;p=thirdparty%2Ftornado.git Merge branch 'master' of github.com:tornadoweb/tornado --- 52760e51208d619ca9294590140072d25508ad62 diff --cc tornado/curl_httpclient.py index 32d52373b,a09732330..2ed6fcf61 --- a/tornado/curl_httpclient.py +++ b/tornado/curl_httpclient.py @@@ -400,16 -393,18 +396,16 @@@ def _curl_setup_request(curl, request, % request.method) request_buffer = BytesIO(utf8(request.body)) + def ioctl(cmd): + if cmd == curl.IOCMD_RESTARTREAD: + request_buffer.seek(0) curl.setopt(pycurl.READFUNCTION, request_buffer.read) + curl.setopt(pycurl.IOCTLFUNCTION, ioctl) if request.method == "POST": - def ioctl(cmd): - if cmd == curl.IOCMD_RESTARTREAD: - request_buffer.seek(0) - curl.setopt(pycurl.IOCTLFUNCTION, ioctl) curl.setopt(pycurl.POSTFIELDSIZE, len(request.body)) else: + curl.setopt(pycurl.UPLOAD, True) curl.setopt(pycurl.INFILESIZE, len(request.body)) - elif request.method == "GET": - if request.body is not None: - raise AssertionError('Body must be empty for GET request') if request.auth_username is not None: userpwd = "%s:%s" % (request.auth_username, request.auth_password or '')