summary history branches tags files
commit:a69016c5a8ea0f3f05f0570f0a836543ef55e9dd
author:Trevor Bentley
committer:Trevor Bentley
date:Tue Dec 11 20:44:19 2018 +0100
parents:cd87d4475002de22a9546755e4a61b90b663e292
Add HTTP timeout
diff --git a/src/http/mod.rs b/src/http/mod.rs
line changes: +1/-0
index 2f652e6..b500a97
--- a/src/http/mod.rs
+++ b/src/http/mod.rs
@@ -105,6 +105,7 @@ pub fn http(url: &str, query: Option<&str>, body: Option<&str>,
     let mut json_bytes = Vec::<u8>::new();
     {
         let mut easy = Easy::new();
+        let _ = easy.timeout(Duration::new(20,0)); // 20 sec timeout
         easy.url(&url).unwrap();
         match method {
             HttpMethod::POST => {