]>
git.ipfire.org Git - thirdparty/tornado.git/log
David Wolever [Tue, 21 May 2013 21:06:53 +0000 (17:06 -0400)]
Test revealing StaticFileHandler path regression.
A bisect suggests that the regression was introduced in
3f04edf5546e388293d8d1d2f015ca74f8a93217
Ben Darnell [Mon, 20 May 2013 03:19:53 +0000 (23:19 -0400)]
Release note updates.
Ben Darnell [Sun, 19 May 2013 18:23:17 +0000 (14:23 -0400)]
Read static files in 64-KB chunks.
Based on #526, but updated for the new interfaces in StaticFileHandler.
Unlike #526, this change does not actually wait for each chunk to be
flushed before reading the next one. Flushing raises some additional
complications (wsgi compatibility, chunked encoding vs content-length)
that are probably not worthwhile for the intended use of StaticFileHandler.
Reading in chunks has benefits even if we don't wait for the flush
(i.e. memory fragmentation), and this change establishes the necessary
subclass interfaces so we can add flushing in the future.
Ben Darnell [Sun, 19 May 2013 17:57:31 +0000 (13:57 -0400)]
Add start and end parameters to get_content() instead of reading everything.
Ben Darnell [Sun, 19 May 2013 17:18:53 +0000 (13:18 -0400)]
Make static_url pass arbitrary kwargs to make_static_url.
The include_version argument to make_static_url is no longer mandatory
in subclasses.
Ben Darnell [Sun, 19 May 2013 17:11:53 +0000 (13:11 -0400)]
Merge remote-tracking branch 'birknilson/static_version_override' into merge
Conflicts:
tornado/test/web_test.py
Ben Darnell [Sun, 19 May 2013 16:41:12 +0000 (12:41 -0400)]
Add method StaticFileHandler.get_content_version.
This method is easier for subclasses to override (the base class still
handles caching) and lets us use the post-validation absolute path,
fixing some issues with default_filename support.
Improve StaticFileHandler test coverage.
Ben Darnell [Sun, 19 May 2013 16:02:03 +0000 (12:02 -0400)]
Add back a lost call to abspath (which may or may not cause test failures
depending on how they were run).
Ben Darnell [Sun, 19 May 2013 15:53:43 +0000 (11:53 -0400)]
Document recent additions to StaticFileHandler.
Make httputil's range functions private.
Ben Darnell [Sun, 19 May 2013 14:55:13 +0000 (10:55 -0400)]
Cleanups after the big StaticFileHandler merge.
Some reshuffling of logic between class and instance methods.
Ben Darnell [Sun, 19 May 2013 04:18:08 +0000 (00:18 -0400)]
Rough merge of the birknilson and wolever StaticFileHandler branches.
Some of Birk's new methods become classmethods so they can be used
in get_version.
This silences the warning logged in CustomStaticFileTest.
Ben Darnell [Sun, 19 May 2013 03:59:00 +0000 (23:59 -0400)]
Merge remote-tracking branch 'birknilson/refactoring/reduce_statichandler_complexity' into merge
Conflicts:
tornado/web.py
Ben Darnell [Sun, 19 May 2013 03:50:19 +0000 (23:50 -0400)]
Merge remote-tracking branch 'wolever/accept-range-in-static-file-handler' into merge
Ben Darnell [Sat, 18 May 2013 23:58:18 +0000 (19:58 -0400)]
Update redbot tests to work with current versions of redbot.
David Wolever [Sat, 18 May 2013 20:36:37 +0000 (16:36 -0400)]
206 in response to Range, refactor ETag checking
Ben Darnell [Sat, 18 May 2013 20:34:10 +0000 (16:34 -0400)]
Add PATCH and OPTIONS support by default to curl_httpclient.
Add some tests to cover all the standard (and non-standard) http methods.
Closes #792.
Ben Darnell [Sat, 18 May 2013 20:03:45 +0000 (16:03 -0400)]
Remove redundant call to find_named_blocks in template processing.
self._get_ancestors already returns self.file in the appropriate position.
Closes #791.
David Wolever [Sat, 18 May 2013 20:00:06 +0000 (16:00 -0400)]
Fixing errant paren, missing format value
David Wolever [Sat, 18 May 2013 19:30:41 +0000 (15:30 -0400)]
Return HTTP 416 Range Not Satisfiable, not 406
David Wolever [Fri, 17 May 2013 04:34:36 +0000 (00:34 -0400)]
Handle negative byte ranges
David Wolever [Fri, 17 May 2013 04:11:40 +0000 (00:11 -0400)]
Tests for Range header
David Wolever [Fri, 17 May 2013 04:11:22 +0000 (00:11 -0400)]
Set Accept-Range header, return 406 on invalid range
Ben Darnell [Fri, 17 May 2013 04:08:33 +0000 (00:08 -0400)]
Merge branch 'branch3.0'
Ben Darnell [Fri, 17 May 2013 04:07:25 +0000 (00:07 -0400)]
Dereference the current YieldPoint as soon as it resolves.
These references could otherwise keep a chain of old references alive
(test code: https://groups.google.com/group/python-tornado/browse_thread/thread/
37d3928817e4924d )
David Wolever [Fri, 17 May 2013 03:59:30 +0000 (23:59 -0400)]
Fix bytes/str issues
Ben Darnell [Fri, 17 May 2013 02:56:14 +0000 (22:56 -0400)]
Add test for option redefinition error.
David Wolever [Thu, 16 May 2013 23:37:30 +0000 (19:37 -0400)]
(incomplete) Honnoring Range request header
David Wolever [Thu, 16 May 2013 22:45:06 +0000 (18:45 -0400)]
Use 'get_version' to calculate static file hashes.
cloudaice [Thu, 16 May 2013 09:06:41 +0000 (11:06 +0200)]
comparison to None should be 'if cond is not None'
cloudaice [Thu, 16 May 2013 08:54:37 +0000 (10:54 +0200)]
fixed bug when raise error in options
项超 [Thu, 16 May 2013 08:44:45 +0000 (01:44 -0700)]
Merge pull request #1 from facebook/master
merge master from facebook tornado
Ben Darnell [Thu, 16 May 2013 02:47:35 +0000 (22:47 -0400)]
Add a close method to Resolver and use it where necessary.
This fixes a thread leak when running the test suite with
ThreadedResolver.
Ben Darnell [Thu, 16 May 2013 01:44:34 +0000 (21:44 -0400)]
Add a missing stack_context.wrap in SSLIOStream.connect.
Run some of simple_httpclient test in both HTTP and HTTPS modes, which
would have detected this bug.
Closes #787.
Ben Darnell [Mon, 13 May 2013 04:49:16 +0000 (00:49 -0400)]
Release note updates
Ben Darnell [Mon, 13 May 2013 04:08:04 +0000 (00:08 -0400)]
Remove whitespace/control-character check from RequestHandler.redirect.
Control characters (and newlines and tabs) will be caught in
set_header (which will raise an exception instead of silently
stripping them). Spaces will now be allowed through, producing
invalid urls, but at least they won't mess up the header framing.
Closes #617.
Ben Darnell [Mon, 13 May 2013 03:32:24 +0000 (23:32 -0400)]
Clean up cancelled timeout handles when the queue gets full of them.
Based on a patch by Giampaolo Radola:
https://github.com/facebook/tornado/issues/408
Closes #408.
Ben Darnell [Mon, 13 May 2013 00:26:44 +0000 (20:26 -0400)]
Respect HTTPServer's no_keep_alive option in RequestHandler.clear.
Also make the keep-alive header check case-insensitive for consistency
with the corresponding code in HTTPServer.
Fixes #31.
Ben Darnell [Mon, 13 May 2013 00:02:54 +0000 (20:02 -0400)]
Allow handlers to assign to self.current_user
Ben Darnell [Sun, 12 May 2013 23:34:12 +0000 (19:34 -0400)]
Allow prepare to be asynchronous, and detect coroutines by their result.
The prepare method does not use the @asynchronous decorator, only
@gen.coroutine (or @return_future; it detects the Future return type).
The same logic is now available for the regular http verb methods as well.
Closes #605.
Ben Darnell [Sun, 12 May 2013 23:32:20 +0000 (19:32 -0400)]
Don't try sending another error response in _handle_request_exception
if the stack context catches an error after the request is done.
(this may be related to the error discussed in the comments of #751)
Ben Darnell [Sun, 12 May 2013 22:08:23 +0000 (18:08 -0400)]
Release note and doc updates
bdarnell [Sun, 12 May 2013 20:36:56 +0000 (13:36 -0700)]
Merge pull request #748 from wsantos/fix732
Add max_buffer_size argument to TCPServer's constructor
Ben Darnell [Sun, 12 May 2013 20:24:19 +0000 (16:24 -0400)]
Check for ECONNRESET in addition to EPIPE on send().
ECONNRESET appears to be the error code used here on Windows.
Closes #757.
Closes #758.
bdarnell [Sun, 12 May 2013 20:16:13 +0000 (13:16 -0700)]
Merge pull request #784 from tahajahangir/patch-1
Don't log EPIPE (broken pipe) errors as warnings
Ben Darnell [Sun, 12 May 2013 20:12:27 +0000 (16:12 -0400)]
Use plus=False when constructing and decoding url paths.
Ben Darnell [Sun, 12 May 2013 19:48:52 +0000 (15:48 -0400)]
Add a 'plus' argument to url_{un,}escape, defaulting to True.
Closes #25.
Taha Jahangir [Sun, 12 May 2013 18:16:13 +0000 (22:46 +0430)]
Don't log EPIPE (broken pipe) errors as warnings
Broken pipe errors are usually caused by connection reset, and its better to not log EPIPE errors to minimize log spam
Ben Darnell [Sun, 12 May 2013 17:17:20 +0000 (13:17 -0400)]
Add a run_with_stack_context function to more easily use stack contexts in coroutines.
Ben Darnell [Sun, 12 May 2013 16:47:27 +0000 (12:47 -0400)]
Add a distinct MissingArgumentError class for get_argument.
Closes #782.
Ben Darnell [Sun, 12 May 2013 16:37:11 +0000 (12:37 -0400)]
Move _UIModuleNamespace from the top of web.py to the UIModule implementation.
bdarnell [Sat, 11 May 2013 01:45:33 +0000 (18:45 -0700)]
Merge pull request #783 from gwk/master
Add note about handler regex capture to StaticFileHandler documentation.
gwk [Fri, 10 May 2013 21:32:28 +0000 (17:32 -0400)]
Added note regarding regex group capture to StaticFileHandler docs.
bdarnell [Thu, 9 May 2013 03:47:57 +0000 (20:47 -0700)]
Merge pull request #777 from mauriciosl/master
bind_unused_port raising gaierror: [Errno 8]
Ben Darnell [Thu, 9 May 2013 02:40:27 +0000 (22:40 -0400)]
Add note about frequently-seen pull request to add **kwargs to json_encode.
bdarnell [Wed, 8 May 2013 04:31:46 +0000 (21:31 -0700)]
Merge pull request #780 from keakon/patch-1
add missing parameter doc
bdarnell [Wed, 8 May 2013 04:31:15 +0000 (21:31 -0700)]
Merge pull request #779 from clowwindy/master
fix a typo in httpclient docs
keakon [Wed, 8 May 2013 03:44:12 +0000 (11:44 +0800)]
add missing parameter doc
clowwindy [Wed, 8 May 2013 03:28:03 +0000 (11:28 +0800)]
Update httpclient.py
fix typo
Mauricio Souza Lima [Tue, 7 May 2013 21:00:23 +0000 (18:00 -0300)]
change bind_unused_port to pass None as port
bind_unused_port was passing 0 as port number to the socket module.
This generated some exceptional behaviour on systems where nslookup of
localhost didn't returned the loopback interface.
Ben Darnell [Sun, 5 May 2013 16:58:34 +0000 (12:58 -0400)]
Create UIModule proxies on demand instead of in RequestHandler init.
It would be nice to do something similar for UI methods, but it's tricker
and they are less common (there are three UIModules defined by default
for every handler).
Ben Darnell [Sun, 5 May 2013 16:31:30 +0000 (12:31 -0400)]
Add a test that covers creation and binding of UIModules and methods.
Ben Darnell [Sun, 5 May 2013 15:46:55 +0000 (11:46 -0400)]
Precompile the regex used on severy set_header call.
The regex was cached by the re module, but the overhead of looking it
up in the cache added up to almost 1% of the time in benchmark.py.
Ben Darnell [Sun, 5 May 2013 14:45:36 +0000 (10:45 -0400)]
Rewrite HTTPHeaders normalization to limit the growth of the cache.
Reorganize the code into a dict subclass for speed: cache hits are now
just a dict lookup, with no python function call. (this saves about 1%
on demos/benchmark/benchmark.py on cpython 2.7)
Remove the regex-based fast path, which has not had any real impact since
we added the dict cache.
Ben Darnell [Sun, 5 May 2013 14:18:13 +0000 (10:18 -0400)]
Catch and ignore EINVAL errors from setsockopt.
This seems to happen a lot in benchmark runs when sockets are closed
after a request.
Ben Darnell [Sun, 5 May 2013 13:55:37 +0000 (09:55 -0400)]
Clear the NODELAY flag in set_nodelay(False).
Ben Darnell [Sun, 5 May 2013 01:50:31 +0000 (21:50 -0400)]
Add an interface to set the TCP_NODELAY flag on an IOStream.
Use this flag from simple_httpclient (always) and httpserver (when a complete
response is available), and add an accessor for WebSocketHandler.
Also make simple_httpclient send headers and body in a single
IOStream.write call.
Ben Darnell [Sat, 4 May 2013 04:13:53 +0000 (00:13 -0400)]
Add overrideable method RequestHandler.log_exception.
Most apps that currently override _handle_request_exception can now
use a combination of log_exception and write_error.
Closes #730.
Ben Darnell [Sat, 4 May 2013 02:45:12 +0000 (22:45 -0400)]
Update docs for AsyncTestCase to make @gen_test more prominent.
Ben Darnell [Wed, 1 May 2013 03:37:37 +0000 (23:37 -0400)]
Add an exception handler in _try_inline_read to ensure close_callback is run.
This is probably just a stopgap until some larger refactoring around
pending_callbacks, but will help with the max_buffer_size leak.
Ben Darnell [Wed, 1 May 2013 03:01:54 +0000 (23:01 -0400)]
Fix another case in which streaming read_until_close passed data to the final callback.
Closes #774.
Ben Darnell [Mon, 29 Apr 2013 04:08:41 +0000 (00:08 -0400)]
Release note updates.
Ben Darnell [Mon, 29 Apr 2013 03:25:23 +0000 (23:25 -0400)]
Fix a memory leak in HTTPServer with very large file uploads.
This is not quite a true leak since the garbage collector will
reclaim everything when it runs, but it might as well be a leak
because CPython's garbage collector uses heuristics based on the
number of allocated objects to decide when to run. Since this
scenario resulted in a small number of very large objects, the process
could consume a large amount of memory.
The actual change is to ensure that HTTPConnection always sets a
close_callback on the IOStream instead of waiting for the Application
to set one. I also nulled out a few more references to break up cycles.
Closes #740.
Closes #747.
Closes #760.
Ben Darnell [Sun, 28 Apr 2013 22:40:31 +0000 (18:40 -0400)]
Fix locale.format_date on python 3.
There's probably more work to be done on this largely-untested code,
but this was the case I could find by grepping for stray references
to `long`.
Ben Darnell [Sun, 28 Apr 2013 22:31:57 +0000 (18:31 -0400)]
Prefix all "reserved" names used by the template system with _tt_
to avoid collisions with user-defined names.
Inspired by #768.
Ben Darnell [Sun, 28 Apr 2013 22:17:15 +0000 (18:17 -0400)]
Use weakrefs instead of __del__ in reference cycle test.
This avoids an awkward and otherwise meaningless use of Task(None).
Ben Darnell [Sun, 28 Apr 2013 22:10:16 +0000 (18:10 -0400)]
Merge remote-tracking branch 'homm/master'
homm [Sun, 28 Apr 2013 21:32:53 +0000 (01:32 +0400)]
Use add_callback to trigger ioloop in test.
Ben Darnell [Sun, 28 Apr 2013 21:29:26 +0000 (17:29 -0400)]
Add a --debug_gc flag to runtests to easily turn on extra logging.
Ben Darnell [Sun, 28 Apr 2013 21:28:02 +0000 (17:28 -0400)]
Fix options with multiple=True on python 3; add tests.
homm [Sun, 28 Apr 2013 20:28:03 +0000 (00:28 +0400)]
Fix typo.
homm [Sun, 28 Apr 2013 19:25:28 +0000 (23:25 +0400)]
Avoid circular references in StackContext and ExceptionStackContext.
homm [Sun, 28 Apr 2013 17:35:48 +0000 (21:35 +0400)]
Remove reference to last task and his arguments in engine to free memory.
Ben Darnell [Sun, 28 Apr 2013 16:17:00 +0000 (12:17 -0400)]
Fix resolver implementation on Solaris.
Closes #766.
Ben Darnell [Sun, 28 Apr 2013 02:54:55 +0000 (22:54 -0400)]
Catch additional errors to prevent warnings logged when connections
are closed immediately after opening.
Closes #750.
Waldecir Santos [Wed, 24 Apr 2013 16:30:43 +0000 (13:30 -0300)]
Corrected or logic to make use of max_buffer_size if it is setted
Waldecir Santos [Wed, 17 Apr 2013 18:00:09 +0000 (15:00 -0300)]
Expose IOStream's max_buffer_size, so we can set it in TCPServer and others.
bdarnell [Wed, 24 Apr 2013 03:21:50 +0000 (20:21 -0700)]
Merge pull request #752 from oyerli/patch-1
Unnecessary MozWebSocket in the WebSocket demo
Ben Darnell [Wed, 24 Apr 2013 03:17:24 +0000 (23:17 -0400)]
Don't try to run HTTPConnection._close_callback if it is None.
This was the case for WSGIContainer.
Closes #751.
bdarnell [Wed, 24 Apr 2013 02:13:34 +0000 (19:13 -0700)]
Merge pull request #745 from davidwilemski/xheaders
support ip lists in X-Forwarded-For headers
Ozan Yerli [Sun, 21 Apr 2013 18:30:23 +0000 (21:30 +0300)]
Unnecessary MozWebSocket in the WebSocket demo
WebSocket is implemented in all modern web browsers.
David Wilemski [Thu, 18 Apr 2013 18:20:37 +0000 (14:20 -0400)]
support ip lists in X-Forwarded-For headers
Ben Darnell [Thu, 18 Apr 2013 14:40:20 +0000 (10:40 -0400)]
Expand docs for @asynchronous decorator and other cleanups.
Closes #742.
Ben Darnell [Thu, 18 Apr 2013 13:33:57 +0000 (09:33 -0400)]
Fix the same typo in docs/index.rst
bdarnell [Thu, 18 Apr 2013 13:33:39 +0000 (06:33 -0700)]
Merge pull request #739 from eguven/master
Fix typo in README
Eren Güven [Thu, 18 Apr 2013 07:26:08 +0000 (10:26 +0300)]
Fix typo in README
bdarnell [Thu, 18 Apr 2013 03:33:18 +0000 (20:33 -0700)]
Merge pull request #723 from ajdavis/gen-test-timeout
Make gen_test's timeout configurable
MinRK [Tue, 16 Apr 2013 01:12:48 +0000 (18:12 -0700)]
use getattr to check for close method in IOLoop.close
instead of catching AttributeError directly
MinRK [Mon, 15 Apr 2013 18:36:58 +0000 (11:36 -0700)]
try close method to close FDs in IOLoop
If an object has a `close` method, use that first,
then fallback on `os.close`.
This is useful in subclasses that support polling things (zmq sockets, specifically)
that are not simple FDs (and Jython, I hear?).
Ben Darnell [Sun, 14 Apr 2013 21:03:46 +0000 (17:03 -0400)]
Start a new next-release-notes file
Ben Darnell [Sun, 14 Apr 2013 20:07:40 +0000 (16:07 -0400)]
Fix the import_object ImportError on Python 3.
Python 3 also changed exception messages slightly so remove one case
from the doctest.