mirror of
https://github.com/tun2proxy/tun2proxy.git
synced 2025-04-22 14:59:09 +00:00
Fix banner bug with HTTP proxies
This commit is contained in:
parent
b3314f5abc
commit
01a0d9164d
1 changed files with 5 additions and 1 deletions
|
@ -172,6 +172,8 @@ impl HttpConnection {
|
|||
return Ok(());
|
||||
}
|
||||
|
||||
let header_size = self.counter;
|
||||
|
||||
self.counter = 0;
|
||||
self.crlf_state = 0;
|
||||
|
||||
|
@ -192,7 +194,9 @@ impl HttpConnection {
|
|||
if status_code == 200 {
|
||||
// Connection successful
|
||||
self.state = HttpState::Established;
|
||||
self.server_inbuf.clear();
|
||||
// The server may have sent a banner already (SMTP, SSH, etc.).
|
||||
// Therefore, server_inbuf must retain this data.
|
||||
self.server_inbuf.drain(0..header_size);
|
||||
return self.state_change().await;
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue