uasyncio: benchmark: Modern browsers produce requests more than 256 bytes.

So, not all of the request was read, and a browser would report than
connection was reset.
pull/164/head
Paul Sokolovsky 2017-03-16 01:55:32 +03:00
rodzic a355801fb1
commit 53193ba2e7
2 zmienionych plików z 2 dodań i 2 usunięć

Wyświetl plik

@ -5,7 +5,7 @@ import uasyncio as asyncio
def serve(reader, writer):
#print(reader, writer)
#print("================")
yield from reader.read(256)
yield from reader.read(512)
yield from writer.awrite("HTTP/1.0 200 OK\r\n\r\nHello.\r\n")
yield from writer.aclose()
#print("Finished processing request")

Wyświetl plik

@ -6,7 +6,7 @@ resp = "HTTP/1.0 200 OK\r\n\r\n" + "Hello.\r\n" * 1500
def serve(reader, writer):
#print(reader, writer)
#print("================")
yield from reader.read(256)
yield from reader.read(512)
yield from writer.awrite(resp)
yield from writer.aclose()
#print("Finished processing request")