mirror of
https://github.com/tun2proxy/tun2proxy.git
synced 2025-06-21 16:41:01 +00:00
Support seamless digest auth with Connection: close (see PR #44)
This commit is contained in:
parent
a292be4bd8
commit
3e26675919
2 changed files with 5 additions and 10 deletions
|
@ -311,6 +311,7 @@ impl HttpConnection {
|
||||||
}
|
}
|
||||||
HttpState::Reset => {
|
HttpState::Reset => {
|
||||||
self.state = HttpState::ExpectResponseHeaders;
|
self.state = HttpState::ExpectResponseHeaders;
|
||||||
|
return self.state_change();
|
||||||
}
|
}
|
||||||
_ => {}
|
_ => {}
|
||||||
}
|
}
|
||||||
|
|
|
@ -748,24 +748,18 @@ impl<'a> TunToProxy<'a> {
|
||||||
|
|
||||||
// The handler request for reset the server connection
|
// The handler request for reset the server connection
|
||||||
if state.handler.reset_connection() {
|
if state.handler.reset_connection() {
|
||||||
|
_ = self.poll.registry().deregister(&mut state.mio_stream);
|
||||||
// Closes the connection with the proxy
|
// Closes the connection with the proxy
|
||||||
state.mio_stream.shutdown(Both)?;
|
state.mio_stream.shutdown(Both)?;
|
||||||
|
|
||||||
info!("RESETED {}", connection);
|
info!("RESET {}", connection);
|
||||||
|
|
||||||
// TODO: Improve the call upstairs
|
|
||||||
state.mio_stream = TcpStream::connect(server)?;
|
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_read = true;
|
||||||
state.wait_write = true;
|
state.wait_write = true;
|
||||||
state.close_state = 0;
|
|
||||||
|
self.update_mio_socket_interest(&connection)?;
|
||||||
|
|
||||||
return Ok(());
|
return Ok(());
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue