Skip to content
Open
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
7 changes: 3 additions & 4 deletions proxyprotocol/reader.py
Original file line number Diff line number Diff line change
Expand Up @@ -66,9 +66,8 @@ def get_callback(self, callback: _WrappedCallback,
to :func:`asyncio.start_server`.

The returned callback will first read the PROXY protocol header before
starting the provided *callback* as a :class:`~asyncio.Task`. The
*callback* argument is similar to *client_connected_cb* but with an
additional positional argument -- the
calling the provided *callback*. The *callback* argument is similar to
*client_connected_cb* but with an additional positional argument -- the
:class:`~proxyprotocol.sock.SocketInfo` read from the header.

Args:
Expand All @@ -89,4 +88,4 @@ async def _read_then_call(self, callback: _WrappedCallback,
writer.close()
result = ProxyResultUnknown(exc)
sock_info = SocketInfo.get(writer, result, unique_id=uuid4().bytes)
asyncio.create_task(callback(reader, writer, sock_info))
await callback(reader, writer, sock_info)