MagicStack / MagicStack/uvloop

SSL connection error while debug is enabled

Đang mở
#449 1 bình luận 0 reaction 1 người được giao Xem trên GitHub

@fantix đang làm issue này rồi.

Từ ngày 27/10/2021.

Ngôn ngữ chính
Cython
Star
11.9k
Fork
616
Chỉ số merge pull request
Không có pull request nào được merge trong 30 ngày

Mô tả

* **uvloop version**: 0.15.2
* **Python version**: 3.7.3
* **Platform**: Debian GNU/Linux 10
* **Can you reproduce the bug with `PYTHONASYNCIODEBUG` in env?**: yes
* **Does uvloop behave differently from vanilla asyncio? How?**: yes, error in uvloop code

Sometimes when asyncio debug enabled (and connection is closed before starting SSL handshake? ) I got the error:
```
protocol:
transport:
Traceback (most recent call last):
File "uvloop/handles/stream.pyx", line 987, in uvloop.loop.__uv_stream_buffered_on_read
File "uvloop/loop.pyx", line 107, in uvloop.loop.run_in_context1
File "uvloop/sslproto.pyx", line 379, in uvloop.loop.SSLProtocol.buffer_updated
File "uvloop/sslproto.pyx", line 505, in uvloop.loop.SSLProtocol._do_handshake
File "uvloop/sslproto.pyx", line 531, in uvloop.loop.SSLProtocol._on_handshake_complete
TypeError: unsupported operand type(s) for -: 'float' and 'NoneType'
```

Looks like you should check if handshake is started before getting _handshake_start_time sslproto.pyx:
```
if self._loop.get_debug():
dt = self._loop.time() - self._handshake_start_time
aio_logger.debug("%r: SSL handshake took %.1f ms", self, dt * 1e3)
```

Hướng dẫn đóng góp

Chưa lập chỉ mục được hướng dẫn đóng góp cho kho mã nguồn này

Bắt đầu từ đâu

  1. Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
  2. Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
  3. Fork repository và làm thay đổi trên một nhánh.
  4. Mở pull request có tham chiếu số hiệu của issue.

Đánh giá

Issue này chưa được đánh giá.

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.