Skip to content

Commit 5d9f22c

Browse files
authored
Merge pull request #134 from OpenVoxProject/renovate/ring-ring-core-1.x
Update dependency ring:ring-core to v1.15.3
2 parents 5fce2e1 + 9be57d3 commit 5d9f22c

2 files changed

Lines changed: 8 additions & 5 deletions

File tree

project.clj

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -197,7 +197,7 @@
197197
[prismatic/schema "1.4.1"]
198198
[riddley "0.2.0"]
199199
[ring/ring-codec "1.3.0"]
200-
[ring/ring-core "1.8.2"]
200+
[ring/ring-core "1.15.3"]
201201
[ring/ring-mock "0.6.2"]
202202
[robert/hooke "1.3.0"]
203203
[timofreiberg/bultitude "0.3.1"]

src/puppetlabs/puppetdb/http/command.clj

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717
(:import
1818
(clojure.lang ExceptionInfo)
1919
(java.net HttpURLConnection)
20-
(org.apache.commons.fileupload.util LimitedInputStream)))
20+
(org.apache.commons.io.input BoundedInputStream)))
2121

2222
(def min-supported-commands
2323
{"configure expiration" 1
@@ -124,13 +124,16 @@
124124
;; The drain is because ruby. i.e. if we closed the connection
125125
;; without that, one of the ruby clients wouldn't handle the broken
126126
;; pipe in a friendly way.
127-
(proxy [LimitedInputStream] [stream max-size]
128-
(raiseError [max-size count]
127+
;;
128+
;; Override onMaxLength which is called when
129+
;; the max count is reached during a read operation.
130+
(proxy [BoundedInputStream] [stream max-size]
131+
(onMaxLength [max-count read-count]
129132
;; We don't trust skip; it appears to just invoke InputStream
130133
;; skip which claims to allocate at least one buffer (of
131134
;; unspecified size) per request.
132135
(loop [buf (byte-array (* 64 1024))]
133-
(when (pos? (.read ^java.io.InputStream this buf))
136+
(when (pos? (.read ^java.io.InputStream stream buf))
134137
(recur buf)))
135138
(throw (ex-info "" {:kind ::body-stream-overflow})))))
136139

0 commit comments

Comments
 (0)