Browse files

Implement :connect-timeout and :read-timeout in http.agent

  • Loading branch information...
1 parent e2014cf commit 6b9a8b5e6f5cbb839fdfc87f8328b568a99453c3 @stuartsierra stuartsierra committed Jun 15, 2010
Showing with 4 additions and 0 deletions.
  1. +4 −0 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)]

0 comments on commit 6b9a8b5

Please sign in to comment.