Skip to content
This repository was archived by the owner on Jan 13, 2021. It is now read-only.
This repository was archived by the owner on Jan 13, 2021. It is now read-only.

HTTP upgrade can block #142

@Lukasa

Description

@Lukasa

When running plaintext HTTP/2 upgrades on my Windows machine (Windows 7, Python 2.7.10, Hyper version 0.4.0) I hit a timeout and the following traceback:

C:\Users\Cory>hyper GET http://http2bin.org/get
Traceback (most recent call last):
  File "C:\Python27\Lib\runpy.py", line 162, in _run_module_as_main
    "__main__", fname, loader, pkg_name)
  File "C:\Python27\Lib\runpy.py", line 72, in _run_code
    exec code in run_globals
  File "C:\Python27\Scripts\hyper.exe\__main__.py", line 9, in <module>
  File "C:\Python27\lib\site-packages\hyper\cli.py", line 231, in main
    data = request(args)
  File "C:\Python27\lib\site-packages\hyper\cli.py", line 219, in request
    response = conn.get_response()
  File "C:\Python27\lib\site-packages\hyper\common\connection.py", line 114, in
get_response
    return self._conn.get_response()
  File "C:\Python27\lib\site-packages\hyper\http11\connection.py", line 170, in
get_response
    self._sock.fill()
  File "C:\Python27\lib\site-packages\hyper\common\bufsocket.py", line 170, in f
ill
    count = self._sck.recv_into(self._buffer_view[self._buffer_end:])
socket.timeout: timed out

There's one obvious problem here: we should attempt to grab a response from the buffered socket before calling fill, as we may have already encountered all the data we need from the socket. At the very least, that should change.

However, making that change doesn't resolve the problem. More work is required to diagnose this.

Metadata

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