Commit Graph

552 Commits

Author SHA1 Message Date
Ben Darnell 15ceda2278 Fix ioloop._KQueue to work correctly when listening for both read and write.
kqueue.control must be called separately for each type of filter, not just
once with the filters or'd together.

Fixes http://github.com/facebook/tornado/issues/issue/59/
Change adapted from
97e528cf6b
2010-02-16 12:53:23 -08:00
Bret Taylor ef83f4b6ca Support passing in cookie value directly in cases where you have to parse the value from other sources (e.g., from the URL for Flash requests). Also fix documentation error for Facebook Connect. 2010-02-05 10:24:57 -08:00
Ben Darnell 7ffb44237f Don't set content-length in StaticFileHandler unless we're actually
sending the content.  Some browsers get confused by this (e.g. the
version of webkit embedded in fluid, but not the version used in chrome).
2010-02-04 13:18:43 -08:00
Bret Taylor c1be85fcfe Add backwards compatability for secure cookie reading 2010-02-04 00:02:09 -08:00
Bret Taylor 4daeb8d880 Simplify JavaScript path ordering patch 2010-02-03 23:51:20 -08:00
Ben Darnell a34dc422e2 Import setuptools if it's available. 2010-02-03 15:49:05 -08:00
Elias Torres ae1ed23421 Making sure StaticFileHandlers get first, if not, a catch all handler would break the static handlers. 2010-02-03 15:46:52 -08:00
Ben Darnell 3e9a285af0 Include cookie name in signature so that a value signed for use in one
cookie can't be used in another.  Note that this invalidates all existing
signed cookies.
2010-02-03 12:18:44 -08:00
unknown efbc2e09b9 using os specific path seperator 2010-02-03 14:17:28 -06:00
Elias Torres 8aae3263dd Fix for maintaining script inclusion order 2010-02-03 12:11:09 -08:00
Elias Torres 0984e008c9 Added the ability to stop an HTTPServer. Mostly for unittesting. 2010-02-03 12:07:56 -08:00
Ben Darnell 74f75616c1 Stop parsing arguments after -- 2010-02-03 12:06:43 -08:00
Ben Darnell 2036199336 Fix EINTR exception handling for non-english locales. 2010-02-03 12:05:03 -08:00
Ben Darnell 8186101e65 Set headers earlier in StaticFileHandler, so we return the correct
content-type with 304 results (instead of always returning text/html)
2010-02-03 11:56:57 -08:00
Ben Darnell 77eb5867e1 Add static_url_prefix setting to allow serving of static files somewhere
other than /static/
2010-02-03 11:49:32 -08:00
unknown 123771a096 Added support for running Tornado on win32 2010-02-03 10:03:01 -06:00
Ben Darnell e30e28bcfb Add a hook to allow applications to modify the curl objects directly. 2010-01-28 16:44:20 -08:00
Casey Muller b6ad0f6323 Merge branch 'master' of git://github.com/bdarnell/tornado 2010-01-28 00:28:22 -08:00
Casey Muller a2adfa1f99 allow connect and request timeouts of zero 2010-01-27 23:46:12 -08:00
Casey Muller 47db027764 use self.headers for cases where no headers were passed in 2010-01-27 23:35:17 -08:00
Ben Darnell a1991136fd Make parse_command_line initialize logging even when there are non-option
arguments.
2010-01-22 13:09:51 -08:00
Ben Darnell adcc103994 Merge branch 'master' of git://github.com/facebook/tornado 2010-01-22 13:08:33 -08:00
Bret Taylor 1e291eb509 Add HTML 5 WebSocket support (see http://bret.appspot.com/entry/web-sockets-in-tornado) 2010-01-18 11:39:39 -08:00
Bret Taylor fb66140dce Fix httpclient / epoll interaction errors, per http://groups.google.com/group/python-tornado/browse_thread/thread/276059a076593266. Thanks everyone for the patch and discussion. 2010-01-17 21:12:24 -08:00
Ben Darnell 57ec818a3f Catch both IOError and OSError in another place. 2010-01-15 20:27:42 -08:00
Ben Darnell 8c2429dbd3 Catch IOError in addition to OSError in IOLoop.remove_handler
(friendfeed's epoll module throws OSError, while the one in the standard
library throws IOError)
2010-01-15 18:42:00 -08:00
Benjamin Golub 7e3ace8607 fb demo fix 2010-01-14 06:07:58 -05:00
Bret Taylor c436d7aa8d Fix new connection close handler for WSGI handlers 2010-01-11 14:17:27 -08:00
Bret Taylor 9107b6be2b Add reverse_url to RequestHandler class as well 2010-01-11 11:53:21 -08:00
Bret Taylor 7014417608 Merge remote branch 'bdarnell/master' 2010-01-11 11:02:23 -08:00
Gary Burd e4c6eec211 Use time indepdent compare for secure cookie. 2010-01-11 10:31:41 -08:00
Ben Darnell 1ea5df5e6f Add a method to RequestHandler that can be used to detect when the connection
has been closed by the client.

This has always been supported via
self.request.connection.stream.set_close_callback, but putting it in
RequestHandler directly is more discoverable and less fragile.
2010-01-07 19:06:11 -08:00
Ben Darnell d877a65d47 Add a kqueue-based implementation of IOLoop for BSD/Mac systems.
The main reason for this is to be able to detect when a connection has
been closed on the other side.
(http://github.com/facebook/tornado/issues/#issue/37)

This has been supported with epoll but not select, and it turned out to be
easier to add kqueue support than to figure out how to detect and handle
this case with select.

This change has not been tested in a production environment, but I have tested
it on my mac (10.6) and everything appears to work, and
IOStream.set_close_callback now works as expected.
2010-01-07 18:53:47 -08:00
Ben Darnell 52d20a0daf Don't try to write to a stream that was closed out from under us.
This should get rid of all the "exception after headers written" spam
in our logs.
2009-12-28 17:55:00 -08:00
Ben Darnell 6ee22230f8 Add httpclient support for the delete method. 2009-12-28 17:27:05 -08:00
Ben Darnell 3ab63905aa If IOLoop.stop is called before the loop is running, make the next
call to IOLoop.start return immediately, so that one call each to start
and stop will result in the loop not running rather than running
infinitely, even if the call to stop happens first.
2009-12-16 17:01:37 -08:00
Chris Wetherell 22d840ed1d Added kwargs to get_error_html in the RequestHandler so that downstream actors can render or otherwise use the exception object thrown. This is a backwards-incompatible change for anyone who has overridden get_error_html(). 2009-12-14 15:21:26 -08:00
Ben Darnell 4381df04e7 Use empty dictionary instead of None as default for kwargs 2009-12-09 17:07:18 -08:00
Ben Darnell 1823a772c0 Fix missed variable rename 2009-12-09 16:59:04 -08:00
Ben Darnell df5c994ae0 Add Application.reverse_url, which can generate a url to a handler by name.
This minimizes repetition of url patterns for links and redirects.

Internally, handler mappings are now maintained as a list of URLSpec objects
instead of tuples.  The Application constructor and add_handlers method
will accept either URLSpecs or (pattern, handler, [kwargs]) tuples.

Inspired by similar functionality in django, and based on
0b57fbcf99
by apgwoz.
2009-12-09 16:44:19 -08:00
Ben Darnell 9ade70501e Merge branch 'master' of git://github.com/facebook/tornado 2009-12-09 15:23:08 -08:00
Bret Taylor b3d98c4a36 Add basic error checking so you can't add a server to the IOLoop twice 2009-12-09 01:48:50 -08:00
Bret Taylor 8d4dde80e8 Typo in error message 2009-12-09 01:45:05 -08:00
Bret Taylor 6fb90ae694 Pre-forking implementation so a single Tornado server can utilize all CPU cores 2009-12-09 00:24:03 -08:00
Bret Taylor 1da2b3c5c6 Add gzip Content-Encoding support with 'gzip' application option 2009-12-08 08:56:02 -08:00
Ben Darnell 41a9473095 Add REMOTE_ADDR to WSGIContainer 2009-12-07 16:17:19 -08:00
Ben Darnell ce20498adb Merge branch 'master' of http://github.com/facebook/tornado 2009-12-07 15:53:28 -08:00
Ben Darnell 400d2c9f80 Make WSGIContainer._environ public and static, so it can be used to adapt
tornado requests to WSGI environments without a full WSGIContainer.
2009-12-07 15:47:16 -08:00
Bret Taylor 41e46d97f5 Fix transform headers bug 2009-12-07 01:28:06 -08:00
Bret Taylor c50d9b8c78 Ignore XSRF cookie check when X-Requested-With XMLHttpRequest header is present 2009-12-05 19:36:50 -08:00