Thanks for the report.
We definitely have to fix `AttributeError`.
Unfortunately, SSL implementation in asyncio is very tricky.
Yuri has an experimental asyncio ssl replacement in his uvloop project rewritten from scratch.
There is a plan to port it into asyncio itself.
P.S.
`await writer.drain()` doesn't send all data to buffer but ensures that the write buffer size is below high watermark limit (https://docs.python.org/3/library/asyncio-protocol.html#asyncio.WriteTransport.set_write_buffer_limits)
Actually, it is good. Even after pushing a data into socket buffer you have no knowledge when the data is delivered to peer (or maybe not delivered at all at the moment of socket closing).
Moreover, when I experimented with write buffer disabling (transport.set_write_buffer_limits(1)) in aiohttp server benchmarks was executed about 50% slower for simple 'ping' request. |