]> git.ipfire.org Git - thirdparty/tornado.git/commit
simple_httpclient: handle connect_timeout or request_timeout of 0
authorPierce Lopez <pierce.lopez@gmail.com>
Tue, 22 Sep 2020 19:43:43 +0000 (15:43 -0400)
committerPierce Lopez <pierce.lopez@gmail.com>
Fri, 25 Sep 2020 20:16:48 +0000 (16:16 -0400)
commit926040063532076ee270f79a54ad85d6c777d645
treee2a435e1c5bcd59ac31241d9016cdb741c870fec
parent582f2cbc920a2633f94409614a07696f63fea07e
simple_httpclient: handle connect_timeout or request_timeout of 0

Using a connect_timeout or request_timeout of 0 was effectively
invalid for simple_httpclient: it would skip the actual request
entirely (because the bulk of the logic was inside "if timeout:").
This was not checked for or raised as an error, it just behaved
unexpectedly.

Change simple_httpclient to always assert these timeouts are not None
and to support the 0 value similar to curl (where request_timeout=0
means no timeout, and connect_timeout=0 means curl default 300 seconds
which is very very long for a tcp connection).
tornado/simple_httpclient.py