1699 Commits

Author SHA1 Message Date
Emile Fugulin
ddf5e66ac8 Remove strict check of Transfer-Encoding 2019-11-20 12:25:39 -05:00
Gaige B Paulsen
4264e09c6f fix fromfd on solaris
This patches the fromfd code in socketfromfd by grabbing the correct symbol under SmartOS (SunOS).

The patch is pretty straightforward, basically switching on the OS to determine what the symbol is likely to be. If need be, I could put a try block around the original libc.getsockopt and then fall back to looking for _so_getsockopt, if that's preferred in this codebase

fix #2184
2019-11-20 07:09:43 +01:00
David Lord
19cb68f4c3 load application from factory function (#2178)
* load application from factory function

Use `ast.parse` to validate that the string passed to the CLI is either
an attribute name or a function call. Use `ast.literal_eval` to parse
any positional and keyword arguments to the function. Call the function
to get the real application.

Co-authored-by: Connor Brinton <connor.brinton@gmail.com>

* test coverage for util.import_app

* document app factory pattern
2019-11-19 23:09:53 +01:00
Emile Fugulin
f74324bd75 Handle multiple transfer-encoding 2019-11-18 22:29:02 -05:00
Emile Fugulin
bd8670b4db Handle duplicate content-length 2019-11-18 21:16:12 -05:00
Emile Fugulin
b798412444 Remove default strip of header name 2019-11-18 19:44:01 -05:00
Jason Madden
902d9c89ab
Capture os.sendfile before patching in gevent and eventlet workers.
Fixes #1925 and fixes #2170.
2019-11-13 07:08:26 -06:00
Jun
21d6287e15 Fix fdopen RuntimeWarning in 3.8 (#2146) 2019-10-30 09:16:07 +01:00
Talha Malik
51a4afd7ef Remove locking in polling reloader 2019-10-29 15:17:42 -04:00
Talha Malik
a4b6b1385a Fixes #2133 2019-10-29 15:17:42 -04:00
Hasan Ramezani
e7890d8d1b
Fix lint errors (#2123) 2019-10-27 11:57:16 +01:00
Jeff Brooks
ad6ed3f4c8 Implement check and exception for str type on value in Response process_headers method. 2019-10-15 09:03:44 -05:00
Jeff Brooks
54c820feb3 Ensure header value is string before conducting regex search on it. 2019-10-10 10:41:22 -05:00
Benoit Chesneau
e6a88dbfcd bump to 20.0.0 2019-09-27 01:47:03 +02:00
Benoit Chesneau
ce03c192f4 fix formatting 2019-09-27 01:45:03 +02:00
장준영
d765f0d123 Group exceptions with same body together in Arbiter.run() (#2081) 2019-08-20 03:34:18 +03:00
Randall Leeds
40802904eb Avoid unnecessary chown of temporary files
When Gunicorn is configured to change the effective user or group of the
worker processes, it changes the owner and group fo the the temporary
files used for interprocess communication.

With this change, Gunicorn does not change the owner or group of the
files if the worker processes will run as the current effective user and
gorup. This change avoids calling chown when it is not necessary, which
may allow Gunicorn to be used in environments that restrict use of the
chown syscall.

Relates to #2059.
2019-08-19 11:22:58 -07:00
Martin Bašti
7e640f804c Logging: Handle auth type case insensitively
According RFC-7617 (inherited from RFC-2978) schema and parameter names are handled
case insensitively:
```
Note that both scheme and parameter names are matched case-
insensitively.
```

Signed-off-by: Martin Bašti <mbasti@redhat.com>
2019-07-17 18:56:18 +03:00
Brett Randall
b014fa78ee Various code improvements contributed by dilyanpalauzov.
These were originally based on 19.9.0 code and were rebased
with conflicts resolved.

Fixed #1690.

Co-Authored-By: dilyanpalauzov <git-dpa@aegee.org>
Signed-off-by: Brett Randall <javabrett@gmail.com>
2019-07-17 07:32:11 +10:00
Marwan Rabbâa
dc7b5d5c48 Fix compatility with tornado 6 (#2001) 2019-06-04 14:17:01 -07:00
Robert Coup
93d2687d24 f-strings only date back to Py3.6 2019-05-31 12:15:02 +01:00
Robert Coup
13c5d72bd1 Add --print-config option to print the resolved settings at startup. 2019-05-31 12:04:22 +01:00
c-bata
6df58a99b5 Remove util.import_module 2019-05-28 16:07:31 +03:00
Masashi SHIBATA
a13a2096ed Use SourceFileLoader instead instead of execfile_ (#2046) 2019-05-26 22:09:52 +03:00
Masashi SHIBATA
3701ad9f26 Use importlib instead of __import__ and eval (#2043) 2019-05-22 22:07:02 +03:00
c-bata
85ec74fc10 Fix typo: connnection to connection 2019-05-20 22:24:45 +09:00
c-bata
aa8b258f93 Fix typo: treatement to treatment 2019-05-20 12:56:44 +03:00
c-bata
d4ff4b419c Fix typo: peform to perform 2019-05-20 12:56:18 +03:00
c-bata
dc639e0d0e Fix typo: hanle 2019-05-20 12:54:59 +03:00
Sebastien Williams-Wynn
678b326dc0 Fix typo in --worker-class documentation (#2030) 2019-05-09 21:13:31 +03:00
Randall Leeds
a542a07773 Fix eventlet patching and bump required version
Fix eventlet patching by performing the patching before the
`init_process` method, which does not return, is called.

This fix depends on bumping the required version to 0.24.1, which
contains a fix for the monotonic clock. See the relevant commit:
eventlet/eventlet@82f1877

This commit reverts 120f503f68929ef98d721a406745a1dbbb9d83fe

Fix #1847
Fix #1884
2019-05-08 19:23:13 -07:00
Benoit Chesneau
cf8ac37ce4
Merge pull request #1969 from benoitc/wsgi_input_terminated
handle `wsgi.input_terminated` extension
2019-04-29 13:58:05 +02:00
dblack
96dde54af1 optional datadog tags for statsd metrics 2019-04-27 18:49:47 -07:00
Brett Randall
879651bb6f Header values are encoded using latin-1, not ascii.
This commit reverts one aspect changed by 5f4ebd2eb2b08783a5fbefe79d09fcb3fc1fbc73 (#1151);
header-values are again encoded as latin-1 and not ascii. Test is restored but uses
a latin-1-mappable test-character, not a general utf8 character.

Fixed #1778.

Signed-off-by: Brett Randall <javabrett@gmail.com>
2019-04-18 04:23:19 +03:00
Randall Leeds
cc8e67ea83 Fix new pylint errors 2019-03-16 16:11:23 -07:00
Hasan Ramezani
2b07f2be28 Rewrite parse_address util and add one test 2019-03-16 15:07:53 -07:00
Marat
a8963ef1a5 Remove redundant super() arguments 2019-03-16 15:00:07 -07:00
Andrew Widdersheim
a2a8bc1ae6 Move ThreadPoolExecutor() creation into own method
Move ThreadPoolExecutor() creation into it's own method so it is easier
to override when subclassing.
2019-02-21 09:28:47 -08:00
Andrew Widdersheim
5680320e5c Simplify futures import
Commits e974f305 and 78208c8c removed support for Python 2 and Python
<3.4 respectively so the conditional logic for importing
`concurrent.futures` is no longer necessary as it has been part of the
standard library since Python 3.2.
2019-02-20 05:57:49 +03:00
Benoit Chesneau
7ed20f6833 corretly set max_requests
fix #1978
2019-02-07 17:04:15 +01:00
Benoit Chesneau
194f47f92b
Merge pull request #1957 from benoitc/simplify-paste-integrations
Simplify Paste Deployment integration
2019-02-06 09:17:28 +01:00
Randall Leeds
9f87c88819 Bump minimum Eventlet and Gevent versions (#1962)
Update the Eventlet and Gevent worker classes to check for versions of
Eventlet and Gevent that are stable under Python 3 and remove outdated
compatibility code.
2019-01-25 08:24:14 +01:00
Benoit Chesneau
97a45805f8
remove gaiohttp worker (#1971)
* remove gaiohttp worker

worker is deprecated and won't work on latest version.
2019-01-24 23:05:28 +01:00
Daniel Pope
2ea5fbdc86 Use Python's default SSL cipher list by default (#1970) 2019-01-24 22:41:04 +01:00
Benoit Chesneau
e5141a1c5a handle wsgi.input_terminated extension
fix #1653
2019-01-24 15:47:15 +01:00
Randall Leeds
61e136b922 Simplify Paste Deployment integration
Remove the `gunicorn_paster` command. With the `--paste` option to the
`gunicorn` command, Gunicorn will no longer read the server section of
the configuration. Instead, server configuration must be done with
Gunicorn configuration files, command line switches, and environment
variables.

The use of Gunicorn as a Paste Deployment server factory is no longer
deprecated. It allows specifying `host` and `port`, as well as `bind`,
but is otherwise more strict with options than in the past. Rather than
ignoring unknown options it will raise an error.

Close #1189
2019-01-22 03:58:03 -08:00
fangfei
6da84c614d Fix root logging
root and logger are same level. https://docs.python.org/2/library/logging.config.html#dictionary-schema-details
2019-01-21 22:51:55 -08:00
Brett Randall
c85bfba8b2 Fixed typo in ssl_version doc, TLSv2 -> TLSv1_2 (TLS 1.2). (#1959)
* Fixed typo in ssl_version doc, TLSv2 -> TLSv1_2 (TLS 1.2).

Signed-off-by: Brett Randall <javabrett@gmail.com>

* revert chdir change
2019-01-22 00:03:38 +01:00
Дамјан Георгиевски
9184ae8898 add systemd sd_notify support (#1897)
* add systemd sd_notify support

roughly based on sd_notify() from systemd and https://github.com/bb4242/sdnotify

only implements `READY=1` and `STATUS=Gunicorn arbiter booted` of the
protocol in the arbiter. in the future, reloads can be notified, and
possibly also other statuses.

see https://www.freedesktop.org/software/systemd/man/sd_notify.html for
more info

sd_notify() is a noop when not run in a systemd service (i.e
NOTIFY_SOCKET environment variable is not set)
2019-01-11 04:41:09 +01:00
Pengpeng Zuo
ad1afe7b79 Fix typo in gthread.py 2018-12-23 12:11:36 +03:00