Permalink
Browse files

No reason for *cookies* to be a ref.

  • Loading branch information...
1 parent cc61cb1 commit 107e68a59f673d4064d57fa84871356730061589 @technomancy committed Jun 14, 2010
Showing with 3 additions and 3 deletions.
  1. +3 −3 src/clojure_http/resourcefully.clj
View
6 src/clojure_http/resourcefully.clj
@@ -21,7 +21,7 @@
(defn- save-cookies [response]
(when (and *cookies* (:cookies response))
- (dosync (alter *cookies* merge (:cookies response))))
+ (swap! *cookies* merge (:cookies response)))
response)
(defn- error? [response]
@@ -56,7 +56,7 @@ Cookies will be saved if inside with-cookies block.")
(defmacro with-cookies
"Perform body with *cookies* bound to cookie-map (should be a map;
empty if you don't want any initial cookies). Responses that set cookies
-will have them saved in the *cookies* ref."
+will have them saved in the *cookies* atom."
[cookie-map & body]
- `(binding [*cookies* (ref (or ~cookie-map {}))]
+ `(binding [*cookies* (atom (or ~cookie-map {}))]
~@body))

0 comments on commit 107e68a

Please sign in to comment.