aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorStuart Sierra <mail@stuartsierra.com>2010-06-15 09:46:07 -0400
committerStuart Sierra <mail@stuartsierra.com>2010-06-15 09:46:07 -0400
commit6b9a8b5e6f5cbb839fdfc87f8328b568a99453c3 (patch)
treed2a1e147935bea1297c51ca2070c4bf804433918
parente2014cf11b5598a955dd5a1d6e8ce9c06f934ae8 (diff)
Implement :connect-timeout and :read-timeout in http.agent
-rw-r--r--src/main/clojure/clojure/contrib/http/agent.clj4
1 files changed, 4 insertions, 0 deletions
diff --git a/src/main/clojure/clojure/contrib/http/agent.clj b/src/main/clojure/clojure/contrib/http/agent.clj
index edae6f96..937aadc0 100644
--- a/src/main/clojure/clojure/contrib/http/agent.clj
+++ b/src/main/clojure/clojure/contrib/http/agent.clj
@@ -79,6 +79,10 @@
"Sets the instance method, redirect behavior, and request headers of
the HttpURLConnection."
[#^HttpURLConnection conn options]
+ (when-let [t (:connect-timeout options)]
+ (.setConnectTimeout conn t))
+ (when-let [t (:read-timeout options)]
+ (.setReadTimeout conn t))
(.setRequestMethod conn (:method options))
(.setInstanceFollowRedirects conn (:follow-redirects options))
(doseq [[name value] (:headers options)]