Skip to content

Commit

Permalink
to avoid connection leak (viz. #150 ) when ajax long polling is used
Browse files Browse the repository at this point in the history
  • Loading branch information
xfeep committed Sep 3, 2015
1 parent ffa8f38 commit a27a22a
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions src/taoensso/sente/server_adapters/nginx_clojure.clj
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,12 @@
;; Returns {:status 200 :body <nginx-clojure-implementation-channel>}:
(when (not upgrade-ok?) ;; send general header for non-websocket request
(.setIgnoreFilter nc-ch false)
;; Give a chance to set client broken listener.
;; Generally it can be mereged with invoking send-header!
;; e.g. (send-header! nc-ch 200, ..., true, false)
;; We do not merge them here just to make its behavior be the same with
;; those of other server adapters
(ncc/send! nc-ch nil true false)
(ncc/send-header! nc-ch 200 {"Content-Type" "text/html"} false false))
(ncc/add-aggregated-listener! nc-ch *max-message-size*
{:on-open (when on-open (fn [nc-ch] (on-open nc-ch)))
Expand Down

0 comments on commit a27a22a

Please sign in to comment.