Browse Source

Rust/hyper: enable server http pipelining (#3016)

Sean McArthur 7 years ago
parent
commit
9f01d500d0
2 changed files with 4 additions and 2 deletions
  1. 1 1
      frameworks/Rust/hyper/Cargo.toml
  2. 3 1
      frameworks/Rust/hyper/src/main.rs

+ 1 - 1
frameworks/Rust/hyper/Cargo.toml

@@ -5,7 +5,7 @@ authors = ["Steve Klabnik <[email protected]>", "Alexander Polyakov <plhk@s
 
 
 [dependencies]
 [dependencies]
 futures = "0.1"
 futures = "0.1"
-hyper = "0.11"
+hyper = "0.11.6"
 tokio-proto = "0.1"
 tokio-proto = "0.1"
 tokio-service = "0.1"
 tokio-service = "0.1"
 num_cpus = "1.2"
 num_cpus = "1.2"

+ 3 - 1
frameworks/Rust/hyper/src/main.rs

@@ -55,7 +55,9 @@ impl Service for TechEmpower {
 
 
 fn main() {
 fn main() {
     let addr: SocketAddr = "0.0.0.0:8080".parse().unwrap();
     let addr: SocketAddr = "0.0.0.0:8080".parse().unwrap();
-    let mut srv = TcpServer::new(Http::new(), addr);
+    let mut http = Http::new();
+    http.pipeline(true);
+    let mut srv = TcpServer::new(http, addr);
     println!("Listening on http://{} using {} threads",
     println!("Listening on http://{} using {} threads",
              addr,
              addr,
              num_cpus::get());
              num_cpus::get());