Skip to content

serving a static mp4 file caused exception #1595

Closed
@yinzuojie

Description

ERROR:aiohttp.server:Error handling request
Traceback (most recent call last):
File "D:\soft\prog\python3\python-3.5.1\lib\site-packages\aiohttp\file_sender.py", line 131, in _sendfile_fallback
yield from resp.drain()
File "D:\soft\prog\python3\python-3.5.1\lib\site-packages\aiohttp\web_reqrep.py", line 888, in drain
yield from self._resp_impl.transport.drain()
File "D:\soft\prog\python3\python-3.5.1\lib\asyncio\streams.py", line 333, in drain
yield from self._protocol._drain_helper()
File "D:\soft\prog\python3\python-3.5.1\lib\asyncio\streams.py", line 211, in _drain_helper
yield from waiter
File "D:\soft\prog\python3\python-3.5.1\lib\asyncio\futures.py", line 361, in iter
yield self # This tells Task to wait for completion.
concurrent.futures._base.CancelledError

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
File "D:\soft\prog\python3\python-3.5.1\lib\site-packages\aiohttp\web_server.py", line 61, in handle_request
resp = yield from self._handler(request)
File "D:\soft\prog\python3\python-3.5.1\lib\site-packages\aiohttp\web.py", line 249, in _handle
resp = yield from handler(request)
File "D:\prog\comp.lang.python\vmax\webfx2.py", line 330, in response
r = await handler(request)
File "D:\soft\prog\python3\python-3.5.1\lib\site-packages\aiohttp\web_urldispatcher.py", line 486, in _handle
ret = yield from self._file_sender.send(request, filepath)
File "D:\soft\prog\python3\python-3.5.1\lib\site-packages\aiohttp\file_sender.py", line 201, in send
yield from self._sendfile(request, resp, f, count)
File "D:\soft\prog\python3\python-3.5.1\lib\site-packages\aiohttp\file_sender.py", line 137, in _sendfile_fallback
resp.set_tcp_nodelay(True)
File "D:\soft\prog\python3\python-3.5.1\lib\site-packages\aiohttp\web_reqrep.py", line 737, in set_tcp_nodelay
resp_impl.transport.set_tcp_nodelay(value)
File "D:\soft\prog\python3\python-3.5.1\lib\site-packages\aiohttp\parsers.py", line 254, in set_tcp_nodelay
self._socket.setsockopt(socket.IPPROTO_TCP, socket.TCP_NODELAY, value)
OSError: [WinError 10038] 在一个非套接字上尝试了一个操作。
■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■
I'm using py3.5.2, win32, aiohttp 1.3a (master)

request:

GET /static/upload/%E6%B5%99%E6%B1%9F%E8%81%94%E9%80%9Avmax/%E7%94%BB%E7%94%BB2.mp4 HTTP/1.1
Host: localhost:8080
Connection: keep-alive
Pragma: no-cache
Cache-Control: no-cache
Accept-Encoding: identity;q=1, *;q=0
User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/50.0.2661.102 Safari/537.36
Accept: /
Referer: http://localhost:8080/static/issue.html?id=1
Accept-Language: zh-CN,zh;q=0.8
Range: bytes=0-

response:
HTTP/1.1 206 Partial Content
Content-Type: video/mp4
Last-Modified: Tue, 03 Jan 2017 02:19:38 GMT
Content-Length: 4201671
Date: Tue, 07 Feb 2017 15:26:24 GMT
Server: Python/3.5 aiohttp/1.3.0a0

the file is 4M, but the console shows only 366KB.
image

I'm just a plain lib user, have no idea how to fix it. only thing to do is waiting this to be fixed.
thanks all~

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions