Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Web protocol cleanup #2500

Merged
merged 4 commits into from
Nov 10, 2017
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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,
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is that an accidental removal?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

max_concurrent_handlers is not removed, see below.
But **kwargs is dropped

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Bah! GitHub UI tricked me.

**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 @@ -1343,7 +1343,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