Skip to content

Commit

Permalink
Web protocol cleanup (#2500)
Browse files Browse the repository at this point in the history
* Drop deprecated slow_request_timeout param

* Drop **kwargs eager devourer from web protocol

* Drop slow_request_timeout from docs

* Add changelog
  • Loading branch information
asvetlov authored Nov 10, 2017
1 parent 5f4ba9f commit 3c1746d
Show file tree
Hide file tree
Showing 4 changed files with 3 additions and 13 deletions.
2 changes: 2 additions & 0 deletions CHANGES/2500.removal
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
Drop deprecated `slow_request_timeout` param and `**kwargs`` from
`RequestHandler`.
8 changes: 1 addition & 7 deletions aiohttp/web_protocol.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
import http.server
import socket
import traceback
import warnings
from collections import deque
from contextlib import suppress
from html import escape as html_escape
Expand Down Expand Up @@ -84,7 +83,6 @@ class RequestHandler(asyncio.streams.FlowControlMixin, asyncio.Protocol):
def __init__(self, manager, *, loop=None,
keepalive_timeout=75, # NGINX default value is 75 secs
tcp_keepalive=True,
slow_request_timeout=None,
logger=server_logger,
access_log_class=helpers.AccessLogger,
access_log=access_logger,
Expand All @@ -94,11 +92,7 @@ def __init__(self, manager, *, loop=None,
max_headers=32768,
max_field_size=8190,
lingering_time=10.0,
max_concurrent_handlers=1,
**kwargs):
if slow_request_timeout is not None:
warnings.warn(
'slow_request_timeout is deprecated', DeprecationWarning)
max_concurrent_handlers=1):

super().__init__(loop=loop)

Expand Down
1 change: 0 additions & 1 deletion docs/web_reference.rst
Original file line number Diff line number Diff line change
Expand Up @@ -1330,7 +1330,6 @@ duplicated like one using :meth:`Application.copy`.
:param bool tcp_keepalive: Enable TCP Keep-Alive. Default: ``True``.
:param int keepalive_timeout: Number of seconds before closing Keep-Alive
connection. Default: ``75`` seconds (NGINX's default value).
:param slow_request_timeout: Slow request timeout. Default: ``0``.
:param logger: Custom logger object. Default:
:data:`aiohttp.log.server_logger`.
:param access_log: Custom logging object. Default:
Expand Down
5 changes: 0 additions & 5 deletions tests/test_web_protocol.py
Original file line number Diff line number Diff line change
Expand Up @@ -253,11 +253,6 @@ def test_srv_keep_alive(srv):
assert not srv._keepalive


def test_slow_request(make_srv):
with pytest.warns(DeprecationWarning):
make_srv(slow_request_timeout=0.01)


async def test_simple(srv, loop, buf):
srv.data_received(
b'GET / HTTP/1.1\r\n\r\n')
Expand Down

0 comments on commit 3c1746d

Please sign in to comment.