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

This commit is contained in:
B. Blechschmidt 2023-07-02 23:02:08 +02:00
parent a292be4bd8
commit 3e26675919
2 changed files with 5 additions and 10 deletions

View file

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

View file

@ -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(());
}