Browse Source

Support seamless digest auth with Connection: close (see PR #44)

pull/45/head r3e26675919877d834bb2e15482c0b60cfb07734a
B. Blechschmidt 3 years ago
parent
commit
3e26675919
  1. 1
      src/http.rs
  2. 14
      src/tun2proxy.rs

1
src/http.rs

@ -311,6 +311,7 @@ impl HttpConnection {
}
HttpState::Reset => {
self.state = HttpState::ExpectResponseHeaders;
return self.state_change();
}
_ => {}
}

14
src/tun2proxy.rs

@ -748,24 +748,18 @@ impl<'a> TunToProxy<'a> {
// The handler request for reset the server connection
if state.handler.reset_connection() {
_ = self.poll.registry().deregister(&mut state.mio_stream);
// Closes the connection with the proxy
state.mio_stream.shutdown(Both)?;
info!("RESETED {}", connection);
info!("RESET {}", connection);
// TODO: Improve the call upstairs
state.mio_stream = TcpStream::connect(server)?;
_ = self.poll.registry().deregister(&mut state.mio_stream);
self.poll.registry().register(
&mut state.mio_stream,
state.token,
Interest::WRITABLE,
)?;
state.wait_read = true;
state.wait_write = true;
state.close_state = 0;
self.update_mio_socket_interest(&connection)?;
return Ok(());
}

Loading…
Cancel
Save