Increased the keep alive timer per google recommendation. Fixed map parsing error when pairs are not in map order.
This commit is contained in:
parent
2a36493281
commit
6b83c2ae36
|
@ -32,20 +32,6 @@
|
||||||
(close [this]
|
(close [this]
|
||||||
(.complete continuation)))
|
(.complete continuation)))
|
||||||
|
|
||||||
#_(defn- add-ssl-connector!
|
|
||||||
"Add an SslSocketConnector to a Jetty Server instance."
|
|
||||||
[^Server server options]
|
|
||||||
(let [ssl-connector (SslSocketConnector.)]
|
|
||||||
(doto ssl-connector
|
|
||||||
(.setPort (options :ssl-port 8443))
|
|
||||||
(.setKeystore (options :keystore))
|
|
||||||
(.setKeyPassword (options :key-password)))
|
|
||||||
(when (options :truststore)
|
|
||||||
(.setTruststore ssl-connector (options :truststore)))
|
|
||||||
(when (options :trust-password)
|
|
||||||
(.setTrustPassword ssl-connector (options :trust-password)))
|
|
||||||
(.addConnector server ssl-connector)))
|
|
||||||
|
|
||||||
(defn- add-ssl-connector!
|
(defn- add-ssl-connector!
|
||||||
"Add an SslSelectChannelConnector to a Jetty Server instance."
|
"Add an SslSelectChannelConnector to a Jetty Server instance."
|
||||||
[^Server server options]
|
[^Server server options]
|
||||||
|
|
|
@ -24,8 +24,8 @@
|
||||||
"X-Content-Type-Options" "nosniff"
|
"X-Content-Type-Options" "nosniff"
|
||||||
}
|
}
|
||||||
:base "/channel" ;; root for /test and /bind urls
|
:base "/channel" ;; root for /test and /bind urls
|
||||||
:keep-alive-interval 10 ;; seconds, keep less than session-time-out
|
:keep-alive-interval 30 ;; seconds, keep less than session-time-out
|
||||||
:session-timeout-interval 15 ;; seconds
|
:session-timeout-interval 120 ;; seconds
|
||||||
;; after this number of bytes a
|
;; after this number of bytes a
|
||||||
;; backchannel will always be closed
|
;; backchannel will always be closed
|
||||||
:data-threshold (* 10 1024)
|
:data-threshold (* 10 1024)
|
||||||
|
@ -81,6 +81,8 @@
|
||||||
(recur (pop queue) id)))))
|
(recur (pop queue) id)))))
|
||||||
|
|
||||||
|
|
||||||
|
;; Key value pairs do not always come ordered by request number.
|
||||||
|
;; E.g. {req0_key1 val01, req1_key1 val11, req0_key2 val02, req1_key2 val12}
|
||||||
(defn transform-url-data [data]
|
(defn transform-url-data [data]
|
||||||
(let [ofs (get data "ofs" "0")
|
(let [ofs (get data "ofs" "0")
|
||||||
pieces (dissoc data "count" "ofs")]
|
pieces (dissoc data "count" "ofs")]
|
||||||
|
@ -88,8 +90,8 @@
|
||||||
:maps (->> (for [[k v] pieces]
|
:maps (->> (for [[k v] pieces]
|
||||||
(let [[_ n k] (re-find #"req(\d+)_(\w+)" k)]
|
(let [[_ n k] (re-find #"req(\d+)_(\w+)" k)]
|
||||||
[n {k v}]))
|
[n {k v}]))
|
||||||
(partition-by first)
|
(group-by first) ; {0 [[0 [k1 v2]] [0 [k2 v2]]],1 [[1 [k1 v1]] [1 [k2 v2]]]}
|
||||||
(map #(into {} (map second %))))}))
|
(map #(into {} (map second (val %)))))}))
|
||||||
|
|
||||||
(assert (= {:ofs 0 :maps [{"x" "3" "y" "10"} {"abc" "def"}]}
|
(assert (= {:ofs 0 :maps [{"x" "3" "y" "10"} {"abc" "def"}]}
|
||||||
(transform-url-data {"count" "2"
|
(transform-url-data {"count" "2"
|
||||||
|
|
Reference in a new issue