Commit Graph

1542 Commits

Author SHA1 Message Date
Ben Darnell 5b4f028202 TwistedIOLoop now supports overriding handle_callback_exception. 2012-12-08 19:17:27 -05:00
Ben Darnell 3c24b7b96f Remove some now-unnecessary calls to functools.partial 2012-12-08 18:32:17 -05:00
Ben Darnell 1ddbe8237f Add forgotten release note. 2012-12-08 18:27:12 -05:00
Ben Darnell ea79e8a938 add_callback now takes *args, **kwargs.
This reduces the need for functools.partial or lambda wrappers, and
works better with stack_context in some cases since binding the
arguments within IOLoop lets it see whether the function is already
wrapped.
2012-12-08 18:25:11 -05:00
Rhett Garber 11f90d0718 Don't catch and hide exceptions caused by callbacks in http client 2012-12-07 16:13:57 -08:00
Ben Darnell 6cf1fa1333 curl_httpclient: don't call remove_handler if we never added it.
Re-order IOLoop and self._fds operations for consistency.
2012-12-07 14:28:13 -05:00
Ben Darnell c6593a38c0 Catch all exceptions, not just {OS,IO}Error in IOLoop.remove_handler.
Attempting to remove a non-existent fd raises IOError on epoll
but KeyError on kqueue; this change swallows any exeption to make
both platforms consistent.
2012-12-07 14:27:53 -05:00
Ben Darnell 4ca0a0f294 Add path_{kw,}args attributes to RequestHandler. 2012-12-02 13:37:54 -05:00
Ben Darnell 69ead0286c Return a Vary: Accept-Encoding header whenever gzip is enabled.
This is one of two problems found with redbot.  The other,
that etags should change when content-encoding is used, is trickier to
fix and seems to be less problematic.

Closes #578.
2012-12-02 12:42:53 -05:00
Ben Darnell 0b1b515fc6 Add tests using the Redbot library for HTTP validation and caching. 2012-12-02 11:13:42 -05:00
Ben Darnell eea63fc20d Document the use of self.xsrf_token to set the cookie for ajax-only apps.
Closes #645.
2012-12-01 21:27:52 -05:00
Ben Darnell e25b753eba Document the need to pass Connection: close when using no_keep_alive.
Closes #641.
2012-12-01 18:17:07 -05:00
Ben Darnell e4ebf8be14 Add a mock.patch-compatible wrapper for options objects. 2012-12-01 15:50:40 -05:00
Ben Darnell 8c5ad60da3 Doc cleanups.
* Fix doc generation for httpclient.py (unescaped \r\n)
* Manually specify signature of Template constructor
* Include IOLoop.time

Closes #644.
2012-11-26 21:47:15 -05:00
Ben Darnell 12c4e9ff21 ErrorHandler no longer requires XSRF tokens.
Closes #638.
2012-11-25 12:01:14 -05:00
Ben Darnell d6f583fca7 Add protocol kwarg to HTTPServer constructor. 2012-11-25 11:38:25 -05:00
Ben Darnell 5f4d98c457 Accept Content-Length headers in 304 responses.
Closes #639.
2012-11-25 11:26:13 -05:00
Ben Darnell 6683077aec Remove now-redundant entries from next.rst, bump version to 2.4.post2. 2012-11-24 22:28:13 -05:00
Ben Darnell 307c523735 Merge branch 'branch2.4'
Conflicts:
	setup.py
	tornado/__init__.py
	tornado/test/auth_test.py
	website/sphinx/releases.rst
2012-11-24 21:54:18 -05:00
Ben Darnell 169ac4ef49 Bump version to 2.4.1, update release notes. 2012-11-24 21:24:44 -05:00
Ben Darnell 722731d571 Fix a bug with IOStream.read_until_close with a streaming_callback.
If the underlying socket was already closed the buffered data
would be passed to the final callback rather than the streaming callback.

Conflicts:
	website/sphinx/releases/next.rst
2012-11-22 13:31:48 -05:00
Ben Darnell c113ac17c8 Fix TwitterMixin on Python 3.
Also add tests, and add get_auth_http_client method to all auth mixins.

Closes #634.

Conflicts:
	tornado/test/auth_test.py
	website/sphinx/releases/next.rst
2012-11-22 13:30:49 -05:00
Ben Darnell 18a66beb55 Fix a memory leak in stack_context.
The old_contexts reference in StackContexts could maintain a chain of
old irrelevant contexts, so clear it once it's no longer needed.
This was mainly a problem in gen.engine, where additional contexts
would accumulate in memory (but not on the stack) for each asynchronous
operation.

Also clear the deactivate_stack_context in gen.Runner to allow
the StackContext to be garbage-collected sooner.
2012-11-22 13:28:50 -05:00
Ben Darnell 080f285b9d Use AsyncHTTPClient's defaults option in AsyncHTTPSTestCase.
Fix test_non_ssl_request, which has apparently been testing the wrong
thing for some time.
2012-11-19 10:14:01 -05:00
Ben Darnell 26078cdb40 Remove redundant logging of read errors in IOStream.
The logging in read_from_fd is generally redundant with logging at
higher levels - the error would be logged again in _handle_read,
or propagated from _try_inline_read.

Closes #632.
2012-11-18 21:35:36 -05:00
Ben Darnell 1a5b337552 Allow default HTTPRequest attributes to be set globally via configure.
Closes #379.
2012-11-18 19:48:02 -05:00
Ben Darnell aeff86a0d7 Remove outdated warnings and config instructions from simple_httpclient. 2012-11-18 17:13:31 -05:00
Ben Darnell d42de2d0ac Merge branch 'branch2.4'
Conflicts:
	website/sphinx/database.rst
2012-11-18 16:24:49 -05:00
Ben Darnell 488c0d2739 Upgrade appengine website to python 2.7. 2012-11-18 16:19:33 -05:00
Ben Darnell 05e0a38698 Update app engine id for HRD migration. 2012-11-18 16:09:45 -05:00
Ben Darnell f5d4a92e66 Document the deprecation of tornado.database in the 2.4 branch. 2012-11-18 15:27:22 -05:00
Jon Parise 3643216539 _get_host_handlers() now returns all host matches.
This approach has more clearly defined precedence rules than the
previous insertion-time strategy implemented in add_handlers().

It also correctly leaves pattern matching in the hands of the regular
expression evaluator as opposed to directly comparing pattern strings.
2012-11-18 11:52:33 -08:00
Jon Parise a5fffe3259 Merge branch 'master' into append-handlers 2012-11-18 10:38:09 -08:00
Ben Darnell 65d27e5a04 Make header_callback behavior consistent across both HTTP clients.
SimpleAsyncHTTPClient now sends the first and last lines to the callback,
matching CurlAsyncHTTPClient's behavior.

All secondary callbacks are now wrapped for stack_context.

Closes #637.
2012-11-18 12:25:13 -05:00
Ben Darnell 3f5e658998 Fix If-None-Match support for StaticFileHandler.
No longer set Cache-Control: public on static files; redbot.org says
it generally doesn't do anything useful.
2012-11-17 23:37:42 -05:00
Ben Darnell bff0740554 Fix a memory leak in stack_context.
The old_contexts reference in StackContexts could maintain a chain of
old irrelevant contexts, so clear it once it's no longer needed.
This was mainly a problem in gen.engine, where additional contexts
would accumulate in memory (but not on the stack) for each asynchronous
operation.

Also clear the deactivate_stack_context in gen.Runner to allow
the StackContext to be garbage-collected sooner.
2012-11-17 16:35:42 -05:00
Ben Darnell b724652105 Ensure that add_callback fails cleanly if called while IOLoop is closing.
Previously there would (sometimes) be an exception when writing to the
waker pipe.

Closes #635.
2012-11-17 15:44:21 -05:00
Ben Darnell e7485f858c Fix TwitterMixin on Python 3.
Also add tests, and add get_auth_http_client method to all auth mixins.

Closes #634.
2012-11-17 15:15:31 -05:00
bdarnell 5f597b58a2 Merge pull request #627 from jparise/urlspec-repr
Add a helpful __repr__ implementation to URLSpec.
2012-11-10 19:18:28 -08:00
bdarnell 465f572dfc Merge pull request #624 from pablopda/master
Move README so github web interface recognize its markup language
2012-11-10 19:17:37 -08:00
Ben Darnell b71650ffed Fix a bug with IOStream.read_until_close with a streaming_callback.
If the underlying socket was already closed the buffered data
would be passed to the final callback rather than the streaming callback.
2012-11-08 23:29:45 -05:00
Jon Parise 68f52c12d6 Allow add_handlers() to append to existing hosts.
This change removes the restriction that all handlers for a given host
pattern be registered in a single call to add_handlers().
2012-11-06 17:33:24 -08:00
Jon Parise b27c54c257 Add a helpful __repr__ implementation to URLSpec. 2012-11-06 16:04:36 -08:00
Pablo Perez De Angelis 5ee48f9dca Mv README so github web interface recognize its markup language 2012-11-02 18:29:40 -03:00
Ben Darnell 958301dd96 Release notes for 302/303 change. 2012-11-01 10:23:27 -07:00
Ben Darnell ff343ae91c simple_httpclient: Treat 302 like 303.
Cherry-picked from e49b263de2

Closes #623.
2012-10-31 23:11:58 -07:00
Ben Darnell 81475d5172 AsyncHTTPTestCase no longer closes AsyncHTTPClients on the global IOLoop.
Code that uses the global IOLoop may retain a global reference to
an AsyncHTTPClient as well, which would become inoperable after a test
had closed it.
2012-10-29 22:33:54 -07:00
Peter Sobot 317508b7b5 Added more sensical callback time verification. 2012-10-23 18:06:08 -03:00
Peter Sobot 041388cbca Added period check in PeriodicCallback
If a user currently passes in 0ms (hopefully by accident) as the
callback time for a periodic callback, Tornado consumes a huge amount
of CPU and never calls the function.
2012-10-23 15:33:17 -03:00
Ben Darnell db843a5987 Add a comment to runtests.sh about python 3.
Closes #612.
2012-10-18 21:20:53 -04:00