mirror of
https://github.com/YGGverse/aquatic.git
synced 2026-03-31 17:55:36 +00:00
aquatic http load test: send Host header, downloaded&uploaded keys
This commit is contained in:
parent
01a3e7795a
commit
e6a74c5bfe
2 changed files with 4 additions and 3 deletions
|
|
@ -91,9 +91,10 @@ impl Connection {
|
|||
state.statistics.responses_scrape
|
||||
.fetch_add(1, Ordering::SeqCst);
|
||||
},
|
||||
Response::Failure(_) => {
|
||||
Response::Failure(response) => {
|
||||
state.statistics.responses_failure
|
||||
.fetch_add(1, Ordering::SeqCst);
|
||||
println!("failure response: reason: {}", response.failure_reason);
|
||||
},
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -32,7 +32,7 @@ impl AnnounceRequest {
|
|||
output.write_all(b"&port=")?;
|
||||
output.write_all(itoa::Buffer::new().format(self.port).as_bytes())?;
|
||||
|
||||
output.write_all(b"&left=")?;
|
||||
output.write_all(b"&uploaded=0&downloaded=0&left=")?;
|
||||
output.write_all(itoa::Buffer::new().format(self.bytes_left).as_bytes())?;
|
||||
|
||||
match self.event {
|
||||
|
|
@ -55,7 +55,7 @@ impl AnnounceRequest {
|
|||
output.write_all(::urlencoding::encode(key.as_str()).as_bytes())?;
|
||||
}
|
||||
|
||||
output.write_all(b" HTTP/1.1\r\nConnection: keep-alive\r\n\r\n")?;
|
||||
output.write_all(b" HTTP/1.1\r\nHost: localhost\r\n\r\n")?;
|
||||
|
||||
Ok(())
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue