New Features
- Fast HTTP Parser (gunicorn_h1c 0.4.1): Integrate new exception types and limit parameters from gunicorn_h1c 0.4.1 for both WSGI and ASGI workers
- Requires gunicorn_h1c >= 0.4.1 for
http_parser='fast' - Falls back to Python parser in
automode if version not met - Proper HTTP status codes for limit errors (414, 431)
- Requires gunicorn_h1c >= 0.4.1 for
Bug Fixes
-
uWSGI Async Workers: Fix
InvalidUWSGIHeader: incomplete headererror when using gevent or gthread workers with uwsgi protocol behind nginx. (#3552, PR #3554) -
FileWrapper Iterator Protocol: Add
__iter__and__next__methods toFileWrapperfor full PEP 3333 compliance. (#3396, PR #3550)
Performance
- ASGI HTTP Parser Optimizations: Improve ASGI worker HTTP parsing performance
- Read chunks in 64-byte blocks instead of 1 byte at a time
- Reuse BytesIO buffers with truncate/seek instead of creating new objects
- Use
bytearray.find()directly instead of converting to bytes first - Use index-based iteration for header parsing instead of
list.pop(0)