branlwyd / rspd

A simple, pure-Rust SNI-based HTTPS proxy.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Fix panic on unwrap of client address

branlwyd opened this issue · comments

There are a few errors in logs about:

thread 'async-std/runtime' panicked at 'called `Result::unwrap()` on an `Err` value: Os { code: 107, kind: NotConnected, message: "Transport endpoint is not connected" }', src/main.rs:78:62

Line 78 is:

let client_addr = stream.peer_addr().unwrap().ip();

We should ignore-but-drop NotConnected errors rather than panicking, and probably report other kinds of errors.