diff --git a/proxyprotocol/reader.py b/proxyprotocol/reader.py index 21ea798..d804a08 100644 --- a/proxyprotocol/reader.py +++ b/proxyprotocol/reader.py @@ -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: @@ -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)