Commit Graph

2298 Commits

Author SHA1 Message Date
Ben Darnell 1cddd018e3 Fix tcpclient test when ipv6 is available but 'localhost' is only ipv4. 2014-05-18 19:56:17 -04:00
Ben Darnell 602f40dab7 Allow ipv6 in simple_httpclient by default.
Improve connection error handling (especially for SelectIOLoop).
2014-05-18 11:11:09 -04:00
Ben Darnell cc0e7624f1 Implement the "happy eyeballs" algorithm for ipv4/ipv6 selection.
IOStream.connect's Future resolves to the stream itself,
which streamlines some connection scenarios.
2014-05-18 10:19:31 -04:00
Ben Darnell a6e83a6c3b Hack around mac ipv6 firewall problems in bind_sockets to reenable tests.
Fix a test ResourceWarning.
2014-05-18 10:18:57 -04:00
Ben Darnell 2278cef74f Refactor connection logic from simple_httpclient to a new tcpclient module.
This is preparation for introducing connection pooling and better
handling of ipv6.

If an IOStream was closed due to an exception, its Futures will
now raise that exception instead of StreamClosedError.
2014-05-18 10:18:53 -04:00
Ben Darnell 4b6fc9cb9f Fix Tornado on Google App Engine.
Imports of tornado.ioloop have crept into more places, so the old
app engine policy of never importing these modules doesn't work.
Instead, we add guards around imports of unavailable modules
(fcntl, ssl, multiprocessing) so that everything is at least importable.

Closes #1059.
2014-05-17 10:56:35 -04:00
Ben Darnell 5a542d88ab Point all links to the 'demos' directory to the stable branch instead of master. 2014-05-17 10:19:17 -04:00
Ben Darnell c511857608 Document gen_test change. 2014-05-17 10:17:01 -04:00
Ben Darnell b9d6c97121 Merge pull request #1061 from stj/master
Extended gen_test decorator to pass args and kwargs.
2014-05-17 10:04:02 -04:00
Stefan Tjarks 5eb39608df Extended gen_test decorator to pass args and kwargs.
A use case might be a decorated test class that passes arguments to each class method, like mock.patch for instance.
2014-05-16 16:03:01 -07:00
dano 33bab42eef Merge remote-tracking branch 'upstream/master' 2014-05-14 11:14:28 -04:00
dano 5176866c68 Use parse_response_start_line instead of re 2014-05-14 10:48:38 -04:00
Ben Darnell f91b8357e2 Ensure that travis test runs can see .coveragerc 2014-05-13 21:07:38 -04:00
Ben Darnell a47c2c5eb5 Merge branch 'branch3.2'
Conflicts:
	tornado/tcpserver.py
2014-05-13 21:05:29 -04:00
Ben Darnell 7b225f8ecb Update links to github repo; add announcement mailing list. 2014-05-13 21:03:27 -04:00
Ben Darnell 6bdf7013f2 Also exclude pycares from pypy on travis. 2014-05-13 20:35:59 -04:00
Ben Darnell 0b441c52ed .travis.yml: don't install Twisted on 3.2 or pycurl on pypy. 2014-05-13 19:57:43 -04:00
Ben Darnell c85be5e2f3 Fix .travis.yaml syntax error.
Remove deprecated --use-mirrors flag to pip.
2014-05-13 11:02:03 -04:00
Ben Darnell 00d9ac38ab Twisted 14.0.0 is now (partially) installable on python 3, so test with it.
Consolidate the dependency section of the .travis.yml now that more of our
dependencies are cross-version.
2014-05-13 10:39:26 -04:00
Ben Darnell 9d0a2b1a38 Merge pull request #1055 from schlamar/patch-1
Test Python 3.4 on Travis.
2014-05-12 14:49:57 -04:00
Marc Schlaich d77eb7f628 Test Python 3.4 on Travis. 2014-05-12 10:00:35 +02:00
Ben Darnell f16ef3c1da Decouple read_from_buffer's search for the endpoint from consuming the data.
This lets us call find_read_pos from read_to_buffer_loop, avoiding some
unnecessary reads (e.g. it previously took a minimum of two recv calls
to serve an http request, but now we can do it in one).
2014-05-11 23:43:55 -04:00
dano a15eccec91 Update documentation 2014-05-11 23:29:46 -04:00
Ben Darnell 4ee968c1d5 IOStream: do not listen for close events if there is no close_callback.
HTTP1Connection now only registers its close callback when it is done
reading.  This improves performance for synchronous handlers, which no
longer interact with the IOLoop as often.
2014-05-11 20:23:33 -04:00
Ben Darnell 4f0d837ed2 Add gen.moment, a yieldable object that resumes after one IOLoop iteration.
Use this between requests in HTTP1ServerConnection to keep one connection
from monopolizing the IOLoop when there are pipelined (or just fast) requests
available.  This was causing increased variance in benchmarks using "ab -k"
(it also increased throughput, for reasons that are not yet clear, so this
change reduces observed speed in these benchmarks).
2014-05-11 18:49:40 -04:00
dano 185a246bd5 Another test 2014-05-10 22:31:35 -04:00
dano ea0df97aa2 Add tests 2014-05-10 22:27:40 -04:00
dano 93b81576ed Improve custom reason code support.
Adds support for custom reason messages to curl_httpclient.
Make custom reason code HTTPError.message if one is available.
2014-05-10 22:08:18 -04:00
Ben Darnell 302f57eef4 Improve performance by using Future interface when writing HTTP responses.
Previously, we passed a callback to IOStream.write() and also checked
IOStream.writing() to see if the write completed synchronously (which is
the common case).  If it did, we would complete the request immediately
but the write callback would remain on the IOLoop until its next iteration,
keeping the request state from being garbage collected.

In benchmarks, this would manifest as as something like a memory leak,
since benchmarks often handle many requests in one IOLoop iteration.
This slowed things down (by about 10% in my benchmarks) by increasing
pressure on the garbage collector.
2014-05-10 13:27:46 -04:00
Ben Darnell 33a84e0174 Merge pull request #1042 from moijes12/fix1033_2
Changed _on_close method tornado/simple_httpclient.py to raise the error instead of raising an HTTPError
2014-05-08 20:54:42 -04:00
Kyle Kelley 7fcbe30b3c Clean up style when rejecting/passing on origin 2014-05-08 13:57:39 -05:00
Kyle Kelley bc2b146f0d Test when origin contains a path. 2014-05-08 13:53:11 -05:00
Kyle Kelley fb39ba2cdd Move origin parsing in to check_origin 2014-05-08 13:42:21 -05:00
Kyle Kelley 47a8530157 Move nil origin check out to execute 2014-05-08 13:42:21 -05:00
Kyle Kelley 9963e737aa Modify origin handling & normalization. Add tests. 2014-05-08 13:42:21 -05:00
Kyle Kelley 8cf5f0a0a9 Response of None on failure 2014-05-08 13:42:21 -05:00
Kyle Kelley 217ba68490 Add tests, fix allowed_origins, rebase tests 2014-05-08 13:42:09 -05:00
Kyle Kelley 75fd4db1b6 Change to check_origin, add override statement. 2014-05-08 13:40:28 -05:00
Kyle Kelley 27637a30e1 Handle varying origin name 2014-05-08 13:40:28 -05:00
Kyle Kelley 917b54af98 Disable cross origin websockets by default. 2014-05-08 13:40:28 -05:00
Ben Darnell 7849162cfc Add a test with newlines in template tags to control whitespace in output. 2014-05-07 23:06:01 -04:00
Ben Darnell 41c4116a00 Merge pull request #1045 from schlamar/fix-win-tests
Fixed tests on Windows.
2014-05-06 08:57:17 -04:00
Ben Darnell 63ff9d6971 Merge pull request #1044 from schlamar/wouldblock-const
Use constant for blocking errnos.
2014-05-06 08:55:34 -04:00
schlamar a1bc78b4f0 Fixed tests on Windows. 2014-05-06 11:35:51 +02:00
schlamar 702892a66b Use constant for blocking errnos. 2014-05-06 11:20:37 +02:00
Ben Darnell d19cba34a8 Merge branch 'branch3.2'
Conflicts:
	docs/releases.rst
	setup.py
	tornado/__init__.py
	tornado/test/web_test.py
	tornado/web.py
2014-05-05 23:21:35 -04:00
Ben Darnell 636965fda0 Give credit to Joost Pol for reporting the security issue. 2014-05-05 22:44:01 -04:00
Ben Darnell 9896931862 Set version number to 3.2.1 2014-05-05 22:28:23 -04:00
Ben Darnell 3488413e9d v3.2.1 release notes 2014-05-05 22:27:20 -04:00
Ben Darnell ae864fa151 Document the cookie versioning interface. 2014-05-05 21:58:22 -04:00