Permalink
Browse files

Added connect timeout; thanks cmoscoso!

  • Loading branch information...
1 parent cb052ed commit 6f0bbb4d671abf077771863aeb1d45a955c7a02d @technomancy committed Sep 6, 2009
Showing with 3 additions and 0 deletions.
  1. +3 −0 src/clojure/http/client.clj
@@ -11,6 +11,8 @@
" (+http://clojure.org)"),
"Connection" "close"})
+(def *connect-timeout* 0)
+
(defn set-system-proxy!
"Java's HttpURLConnection cannot do per-request proxying. Instead,
system properties are used. This function mutates the global setting.
@@ -109,6 +111,7 @@ by a server."
method (.toUpperCase #^String (as-str (or method
"GET")))]
(.setRequestMethod connection method)
+ (.setConnectTimeout connection *connect-timeout*)
(doseq [[header value] (conj default-headers (or headers {}))]
;; Treat Cookie specially -- see below.

0 comments on commit 6f0bbb4

Please sign in to comment.