     :as upstream
     (swap! state #(assoc % :upstream upstream))
     (upstream :request request))))
+
+(defn- retry-request
+  [state downstream request current-state]
+  (log/info (str "retrying request: " (request-url request)))
+  (attempt-request state downstream request current-state))
 
 (defn retry
   ([app] (retry app {}))

(ns picard.middleware.retry
  (:use [picard helpers utils]))

(defrecord State [app upstream retries sent-body? opts])

                (if (< 0 retry)
                  (timeout
                   (first (.retries current-state))
                   #(retry-request state downstream request current-state*))
                  (retry-request state downstream request current-state*)))))

           (when-let [current-downstream @current-downstream-atom]
             (current-downstream evt val))
