mirror of
https://github.com/YGGverse/aquatic.git
synced 2026-03-31 17:55:36 +00:00
WIP: get http load test into better (but bad) state
Is now able to maintain correspondence with aquatic_http and opentracker
This commit is contained in:
parent
9707898a32
commit
cb3ec8cbf1
6 changed files with 89 additions and 44 deletions
|
|
@ -45,6 +45,17 @@ impl EstablishedConnection {
|
|||
}
|
||||
}
|
||||
|
||||
pub fn shutdown(&mut self){
|
||||
match self.stream {
|
||||
Stream::TcpStream(ref mut s) => {
|
||||
s.shutdown(::std::net::Shutdown::Both);
|
||||
},
|
||||
Stream::TlsStream(ref mut s) => {
|
||||
s.shutdown();
|
||||
},
|
||||
}
|
||||
}
|
||||
|
||||
pub fn read_request(&mut self) -> Result<Request, RequestReadError> {
|
||||
if (self.buf.len() - self.bytes_read < 512) & (self.buf.len() <= 3072){
|
||||
self.buf.extend_from_slice(&[0; 1024]);
|
||||
|
|
|
|||
|
|
@ -326,6 +326,8 @@ pub fn send_responses(
|
|||
match established.send_response(&buffer.get_mut()[..bytes_written]){
|
||||
Ok(()) => {
|
||||
debug!("sent response");
|
||||
|
||||
// established.shutdown();
|
||||
},
|
||||
Err(err) if err.kind() == ErrorKind::WouldBlock => {
|
||||
debug!("send response: would block");
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue