unsupport keep alive fix

This commit is contained in:
MeexReay 2024-12-08 02:28:22 +03:00
parent 9b2209bcce
commit e06a2a0207
2 changed files with 9 additions and 4 deletions

View File

@ -83,7 +83,7 @@ impl Config {
let mut cert: Option<SslCert> = None; let mut cert: Option<SslCert> = None;
let s = s.as_mapping()?; let s = s.as_mapping()?;
if s.contains_key("ssl_cert") && !s.get("ssl_cert")?.is_null() { if s.contains_key("ssl_cert") {
cert = Some( cert = Some(
SslCert::new( SslCert::new(
s.get("ssl_cert")?.as_str()?, s.get("ssl_cert")?.as_str()?,

View File

@ -509,9 +509,14 @@ impl FlowgateServer {
} }
} }
} else { } else {
let mut buf = Vec::new(); let mut buf = vec![0;1024];
conn.stream.read_to_end(&mut buf).ok()?; while let Ok(n) = conn.stream.read(&mut buf) {
stream.write_all(&buf).ok()?; if n == 0 { break }
buf.truncate(n);
stream.write_all(&buf).ok()?;
if n < 1024 { break }
buf = vec![0;1024];
}
} }
info!("{addr} > {} {}://{}{}", status_seq[0], if https { "https" } else { "http" }, conn.host, status_seq[1]); info!("{addr} > {} {}://{}{}", status_seq[0], if https { "https" } else { "http" }, conn.host, status_seq[1]);