Commit Graph

2295 Commits

Author SHA1 Message Date
Ben Darnell b489ef6d7f Guard against framing errors when applications manually specify a Content-Type
that doesn't match the data they send.

Split HTTPMessageException into HTTPInputException and HTTPOutputException.
2014-04-06 11:53:50 +01:00
bdarnell c20ab3547d Merge pull request #1023 from zakkie/feature/fix-testcase
put assertion outside of the exception handler
2014-03-31 10:54:15 -04:00
Akihiro Yamazaki 32c7a328ed correct testcases 2014-03-30 23:15:46 +09:00
Ben Darnell f95b4d7a34 Implement flow control for streaming RequestHandlers. 2014-03-29 17:23:32 +00:00
Ben Darnell 800d1dcec4 Add a chunk_size limitation to HTTP1Connection.
HTTPMessageDelegate will no longer receive more than chunk_size bytes
in a single call.
2014-03-29 16:32:21 +00:00
Ben Darnell c39e69f4a5 Add a 'partial' flag to IOStream.read_bytes.
This is a more coroutine-friendly alternative to streaming_callback.
2014-03-29 15:46:03 +00:00
Ben Darnell 681e51b38f Add body_producer argument to httpclient.HTTPRequest.
This allows for sending non-contiguous or asynchronously-produced
request bodies, including chunked encoding when the content-length
is not known in advance.
2014-03-29 15:26:23 +00:00
Ben Darnell e63b4cb9a5 Add option to disable the Resolver tests with an environment variable.
The resolver tests depend on external network resources; the twisted
resolver will time out when the network is unvailable instead of
returning an immediate failure like the other implementations.
2014-03-29 14:03:15 +00:00
Akihiro Yamazaki e914a5143e use "with self.assertRaises" pattern 2014-03-28 09:10:58 +09:00
Akihiro Yamazaki ccbe5a2787 put assertion outside of the exception handler 2014-03-27 09:37:29 +09:00
bdarnell 7508e216d0 Merge pull request #1022 from shinriyo/master
tab to space
2014-03-25 21:56:01 -04:00
shinriyo 142b5fb92f tab to space
tab to space and indent fix
2014-03-26 10:04:07 +09:00
Ben Darnell 42df0361e5 When a streaming-body request finishes early, stop reading the request data.
delegate.data_received should no longer be called after conn.finish().
2014-03-23 22:38:02 -04:00
Ben Darnell 02579a35c3 Introduce streaming request body support for RequestHandler. 2014-03-23 21:31:33 -04:00
bdarnell b5b2132771 Merge pull request #1020 from dhcmrlchtdj/fix-template-doc
Fix a mistake in template document.
2014-03-23 21:28:29 -04:00
Andrey Sumin adea4f5190 suggest to use libcurl with async dns resolver in httpclient docs 2014-03-23 18:31:30 +04:00
huangxiaokai 958c3f322c Fix a mistake in template document. 2014-03-23 18:25:25 +08:00
Ben Darnell 37cf8b9ea9 Introduce a fast path for coroutines that run to completion without yielding.
This mitigates the performance impact of allowing coroutines in
RequestHandler._execute when that capability is not actually used.
2014-03-22 14:16:10 -04:00
bdarnell 4b8a9943ac Merge pull request #1019 from minrk/clear_instance
add IOLoop.clear_instance
2014-03-22 13:20:06 -04:00
MinRK dd45026300 add IOLoop.clear_instance
like clear_current, but for the global IOLoop instance
2014-03-21 10:59:25 -07:00
Ben Darnell d41caf1697 Simplify RequestHandler._execute by making it a coroutine. 2014-03-17 00:27:28 -04:00
Ben Darnell c8ce4517e3 Stop overriding _execute in WebSocketHandler; use get() instead.
Revise HTTP1Connection detach protocol.

As a side effect, this now decodes the arguments to open() in the same
way as the arguments to get().
2014-03-16 23:29:50 -04:00
Ben Darnell adc7e4f17f Add chunk and callback arguments to write_headers.
This restores an optimization that allows small responses to be written out
in the same system call as the headers.
2014-03-16 18:43:49 -04:00
Ben Darnell 10e1108ad6 Make Application an HTTPServerConnectionDelegate.
HTTPServer now forwards delegate events to its request callback
if it implements this interface.  This allows the application to be
in the loop as the request is being read.
2014-03-16 12:57:54 -04:00
Ben Darnell e9c83cbbc8 HTTPServer: Support requests that are received in multiple chunks. 2014-03-16 00:21:51 -04:00
Ben Darnell 4f734ddcb0 Allow gzip to be used with WSGIApplication.
Now that transfer encodings have been moved to http1connection,
the content-level output transforms can be used with wsgi.
2014-03-15 23:42:16 -04:00
Ben Darnell ca7f4d0724 Move chunked-response generation into http1connection. 2014-03-15 23:39:59 -04:00
Ben Darnell 39f1888088 Pass start_line to headers_received as a tuple instead of a string. 2014-03-15 23:00:13 -04:00
Ben Darnell 6c7eac6c83 Unify WSGI support with the HTTPConnection abstraction.
Deprecate WSGIApplication in favor of a WSGIAdapter that can wrap
an ordinary Application.

Remove the wsgi module's separate HTTPRequest variant and tornado.web's
wsgi special cases.
2014-03-15 22:30:23 -04:00
Ben Darnell 361b612663 Move outgoing HTTP header generation to HTTP1Connection. 2014-03-15 20:11:02 -04:00
Ben Darnell 4ff47bb486 Update links for comments about json list output.
The vulnerability in the older link affects only ancient browsers,
but there are other issues that are more recent.

Fixes #1009.
2014-03-15 00:50:25 -04:00
Ben Darnell 99474fe89b Refactor unittest/unittest2 imports to fix issues with unittest2 on py3.
Never use unittest2 on python 3 (it appears to not interoperate with
the standard unittest module).  On python 2, use the same logic in
tornado.testing and tornado.test.util to select an implementation.

Fixes #1005.
2014-03-15 00:46:52 -04:00
Ben Darnell d2226ff81b Improve simple_httpclient ssl configuration to pass howsmyssl.com.
Remove insecure cipher suites and disable TLS compression.  The option
to disable compression was only added in Python 3.3 so we do not
pass the test on older versions, but we come as close as possible with
the APIs available.

Closes #1014.
2014-03-13 10:15:41 -04:00
Ben Darnell 2aef15dfa3 Fix command-line tornado.httpclient on python 3. 2014-03-13 10:04:36 -04:00
bdarnell 180e8186ca Merge pull request #1012 from dlutxx/br310
remove a redundant assignment in read_until_close.
2014-03-11 00:09:28 -04:00
bdarnell f1f66d1b28 Merge pull request #1008 from yaccz/fix/1007
twisted can be installed without twisted.names fixes #1007
2014-03-10 22:32:17 -04:00
xuxiang 1759dc694a remove useless code of BaseIOStream 2014-03-10 18:22:39 +08:00
yac a749b999ad
twisted can be installed without twisted.names fixes #1007 2014-03-08 01:20:09 +01:00
INADA Naoki 753de8d042 Remove `write_buffer_size` read-only property. 2014-03-04 15:54:42 +09:00
bdarnell b1f5cc59be Merge pull request #996 from cardoe/exception-fix
use errno attr instead of index into args for errno
2014-03-03 10:59:18 -05:00
INADA Naoki 76cba7eb5a Add max_write_buffer_size to iostream. 2014-03-03 14:06:37 +09:00
INADA Naoki 9cb4422976 Add iostream.write_buffer_size property. 2014-03-03 13:58:09 +09:00
Ben Darnell 122be5ed8a Add a test for HTTPServer's recently-acquired support for chunked requests. 2014-03-02 23:10:48 -05:00
Ben Darnell 16b9bc34df Add support for gzipped request bodies to HTTPServer. 2014-03-02 22:42:11 -05:00
Ben Darnell a47e500d3e Move gzip decompression from simple_httpclient to http1connection. 2014-03-02 21:26:15 -05:00
Ben Darnell 90dcf5a396 Some cleanup and renamings.
Replaced some server-specific names and cut down on overuse of "process"
as a generic verb.
2014-03-02 21:15:22 -05:00
Ben Darnell a3d6fc6def Use HTTP1Connection in SimpleAsyncHTTPClient.
This incidentally adds support for chunked request bodies on the server side.
2014-03-02 15:48:26 -05:00
Ben Darnell d4627e09bd Exclude another timing-sensitive test from the travis build. 2014-03-02 11:06:06 -05:00
bdarnell e52db2f110 Merge pull request #999 from mengzhuo/master
update Template Loader with 'with' statement
2014-03-02 11:03:29 -05:00
Meng Zhuo 41a8f1a393 update Template Loader with 'with' statment 2014-03-02 22:20:49 +08:00