Skip to content

Commit

Permalink
point to latest lamina, and take a stab at getting rid of spurious wr…
Browse files Browse the repository at this point in the history
…ite error logging
  • Loading branch information
ztellman committed Mar 7, 2012
1 parent 175a8f1 commit eade210
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 15 deletions.
8 changes: 4 additions & 4 deletions project.clj
Expand Up @@ -11,18 +11,18 @@
[org.clojure.contrib/prxml "1.3.0-alpha4"]
[io.netty/netty "3.3.1.Final"]
[clj-http "0.1.3"]
[lamina "0.4.1-alpha1"]
[lamina "0.4.1-alpha2-SNAPSHOT"]
[gloss "0.2.1-alpha2-SNAPSHOT"]
[user-agent-utils "1.2.3"]
[potemkin "0.1.1"]]
[potemkin "0.1.2-SNAPSHOT"]]
:multi-deps {:all [[org.clojure/tools.logging "0.2.3"]
[org.clojure/data.json "0.1.1"]
[org.clojure.contrib/prxml "1.3.0-alpha4"]
[io.netty/netty "3.3.1.Final"]
[clj-http "0.1.3"]
[lamina "0.4.1-alpha1"]
[lamina "0.4.1-alpha2-SNAPSHOT"]
[gloss "0.2.1-alpha2-SNAPSHOT"]
[user-agent-utils "1.2.3"]
[potemkin "0.1.1"]]
[potemkin "0.1.2-SNAPSHOT"]]
"1.2" [[org.clojure/clojure "1.2.1"]]}
:jvm-opts ["-server" "-XX:+UseConcMarkSweepGC"])
26 changes: 15 additions & 11 deletions src/aleph/http/server.clj
Expand Up @@ -85,17 +85,21 @@
wrap-netty-channel-future
(fn [_] (close ch)))

(run-pipeline
(receive-in-order (consume-request-stream netty-channel ch server-generator options)
(fn [{:keys [request response]}]
(if (instance? Exception response)
(let [response (if (or
(instance? InterruptedException response)
(instance? TimeoutException response))
(timeout-response)
(error-response))]
(write-to-channel netty-channel response (not (:keep-alive? request))))
(respond netty-channel options (first response) (second response)))))
(run-pipeline nil
:error-handler (fn [_]
(.close netty-channel)
(complete nil))
(fn [_]
(receive-in-order (consume-request-stream netty-channel ch server-generator options)
(fn [{:keys [request response]}]
(if (instance? Exception response)
(let [response (if (or
(instance? InterruptedException response)
(instance? TimeoutException response))
(timeout-response)
(error-response))]
(write-to-channel netty-channel response (not (:keep-alive? request))))
(respond netty-channel options (first response) (second response))))))
(fn [_] (.close netty-channel))))

(enqueue ch request)))
Expand Down

0 comments on commit eade210

Please sign in to comment.