617 Commits

Author SHA1 Message Date
benoitc
78e3d08f96 add missing GeventWSGIWorker 2011-05-11 23:11:03 +02:00
denis
70b962e626 fix typo catched by pyflakes 2011-05-11 23:11:03 +02:00
denis
2ab4bbf46f fix compatibility with gevent 0.14 dev version
Move "import gevent.wsgi" into a separate module, which is not
imported if pywsgi worker is requested. (The gevent.wsgi currently
not provided by gevent trunk but pywsgi works fine.)
2011-05-11 23:11:03 +02:00
benoitc
4ecc1441b9 i hate my kbd. Real fix 2011-05-11 23:11:03 +02:00
benoitc
a65bf395ae fix fbsd support 2011-05-11 23:11:02 +02:00
benoitc
c17f7230e8 refactor sendfile and add an example. 2011-05-11 23:11:02 +02:00
benoitc
fc69d5e17c useless debug info 2011-05-11 23:11:02 +02:00
benoitc
fcab6bc144 after multiple attempts it's easier to just reload the app. People using
mange.py have to use USR2 signal if they want to upgrade the django
version instread of HUP. On the other hand, upgrading django version
with HUP is possible with gunicorn_django command.
2011-05-11 23:11:02 +02:00
Paul J. Davis
4211be4df4 Reorder hook config section to be more logical. 2011-05-11 23:11:02 +02:00
Paul J. Davis
9e6631e832 Fix hook function names.
The names were being rendered into the online docs and
causing confusion.
2011-05-11 23:11:00 +02:00
Paul J. Davis
d83c63429e Empty chunks incorrectly signal end of response.
If an app iterator attempts to send an empty string to the client
while using chunked transfer encoding it incorrectly signals the
end of the transfer. This patch just ignores empty strings that
are yielded by the application.
2011-05-11 23:09:55 +02:00
benoitc
0b094ca08a fix issue #195. Thanks! 2011-04-24 09:32:55 +02:00
benoitc
f1d5f26dfa django manage.py load settings before we launch every worker. This
change remove it from loaded modules on reload. While we are here we
remove any django module preloaded so we can upgrade django version to
on HUP. fix issue #197.
2011-04-24 09:05:27 +02:00
benoitc
1d00c5e09d bump version 2011-03-23 09:48:22 +01:00
Dan Sully
4f96ccedc1 Catch ctypes import errors. 2011-03-23 07:37:40 +01:00
Graham Dumpleton
b7adfe2628 Add wsgi.file_wrapper optimisations for MacOS X/Linux. 2011-03-23 07:37:40 +01:00
benoitc
853b2ad37a that's not a dev server. 2011-03-15 14:38:35 -04:00
Neil Chintomby
06987d3702 add server hook "on_starting" to allow socket patching to allow gevent worker reloading. 2011-03-14 23:28:33 -04:00
Alex Robbins
974698671a Moved the random seed method into a function.
Added a try/except block to catch NotImplementedErrors for platforms
that don't support urandom.
2011-03-14 23:10:09 -04:00
benoitc
dbc61f310e fix issue #143. unnecessary list(). 2011-03-06 10:24:56 +01:00
benoitc
c21578df40 ctypes triggers selinux execmem denial
https://bugzilla.redhat.com/show_bug.cgi?id=488396

fix issue #168. Thanks!
2011-03-06 10:14:52 +01:00
benoitc
4b2c04317c Apply patch from Chris Lamb <lamby@debian.org> with minor revision.
Validate models before allowing connections via gunicorn_django

This prevents issues where the site is accepting connections but not all
of the models have loaded yet. If your model importing has side effects
(monkey-patching, etc) this can results in errors about missing attributes
or features simply because the code that enables those features as not been
run yet.

This issue does not affect the "run_gunicorn" management command as that
performs it's own model validation before allowing connections, so we are
simply making this consistent here.

Signed-off-by: Chris Lamb <lamby@debian.org>
2011-03-06 10:02:40 +01:00
Paul J. Davis
894e2d2526 Missing spaces in the error response. 2011-03-03 12:02:08 -05:00
benoitc
3fc530c162 this is just a warning, we don't really care about exceptions here. 2011-03-03 10:45:23 +01:00
benoitc
ba89a400dc we don't do anythiung in __init__, remove these lines. 2011-03-03 10:36:14 +01:00
benoitc
14313985d6 add worker info at startup. 2011-03-03 10:05:16 +01:00
benoitc
7dd7b71523 patch from @davisp, ease the code. 2011-02-25 08:47:46 +01:00
benoitc
43dfb8f0f7 fix issue #165. Sometimes apache don't specify the port ipv6 address are
in the form of  aaaa:aaaa:... . Thanks to zauberpony for first
implementation of the patch.
2011-02-25 08:23:56 +01:00
benoitc
75fec00896 don't import django before we really need it. Should fix issue #166 . 2011-02-24 22:25:00 +01:00
Paul J. Davis
0c05de4d2b Fixed a couple harmless typos.
Thanks to Josh Ourisman for spotting them.
2011-02-15 14:51:03 -05:00
benoitc
a942f6a06c just load environ when we load the app 2011-02-09 00:06:57 +01:00
Benoit Chesneau
618bc873d8 typo. 2011-01-31 10:00:23 +01:00
Benoit Chesneau
0bd86f7729 fix ipv6 address parsing in forward address. Spotted 3 weeks ago by
Jonathan Leroy.
2011-01-30 18:46:17 +01:00
Paul J. Davis
cdd58014a7 Prevent exceptions from being logged twice.
* Remove logging call in worker subclasses and rely on the
    logging in Worker.handle_error to do the proper logging.
2011-01-29 16:40:25 -05:00
Paul J. Davis
885b530e1a Always log exceptions during request handling.
* Always log the exception locally
  * Still only pass the exception in the HTTP response if
    debug is turned on.
  * Slight cosmetic changes to the actual HTML of the error
    response.
2011-01-29 14:43:18 -05:00
Benoit Chesneau
a1ced17d8b test only if clengtih is defined. 2011-01-15 17:50:59 +01:00
Paul J. Davis
f942b3a8b2 Fix broken chunked response generation.
* Transfer-Encoding header was not being set.
* Whether a connection should close should depend on whether
  we are able to continue accepting requests.
2011-01-14 19:24:21 -05:00
Paul J. Davis
bcafd6eb22 Fix broken responses with missing Content-Length.
We were testing for None and using a default value of -1.
2011-01-14 19:16:23 -05:00
benoitc
39f5d313f7 improve content-length handling. Chunked encoding is only used when not
content-length is provided and http version >= 1.1. In other case send
until we content is empty.

Also HTTP don't expect we can send more than content-length if header is
set, so discard any content if we have already send the expected
lenghth. (spotted by @GrahamDumpleton)

reviewed and OK by @davisp. More readable function by @davisp
2011-01-10 12:02:24 +01:00
benoitc
cd726f6d8c fix issue #142. Thanks 2011-01-04 09:42:49 +01:00
benoitc
c8d3b7764f don't truncate, just create a new instance. 2010-12-27 14:07:08 +01:00
benoitc
7e6beaf8e7 don't display broken pipe 2010-12-22 23:07:27 +01:00
benoitc
16fd5d3c20 remove some useless code. pyflakes my friend. 2010-12-22 19:52:34 +01:00
benoitc
c90ecd1eba put back murder_workers. We are not sure there isn't a border effect with
active_workers patch. So postpone it for 0.12.1 waiting more feedbacks
and tests. "<davisp> Sounds good ot me"
2010-12-22 18:34:57 +01:00
Paul J. Davis
07f0c0f21d Fixes signal reaction times.
After messing around trying to make this more elegant we've decided to
just slap a 1s poll to the thing which seems to fix various bugs in the
async event handling.
2010-12-20 08:15:45 -05:00
benoitc
3ef8688fcc fix issue #137. Use our own way to unlink temporary files so we can set
permissions and umask on it.
2010-12-20 13:51:03 +01:00
benoitc
8eca403d89 only 2 values to print. 2010-12-13 11:18:41 +01:00
benoitc
0716a3bd84 fix issue #136. thanks 2010-12-13 11:17:54 +01:00
benoitc
2e39db265c rather than sleeping the timeout, just test if time is elapsed, then
notify. Speed graceful reload and exit.
2010-12-12 22:57:50 +01:00
benoitc
f0a4dc493f update doc. 2010-12-12 22:18:41 +01:00