diff options
author | Stuart Sierra <mail@stuartsierra.com> | 2009-08-14 14:39:23 -0400 |
---|---|---|
committer | Stuart Sierra <mail@stuartsierra.com> | 2009-08-14 14:39:23 -0400 |
commit | 5f3988ffe6eb894448cbdc2bd4ec8b01ba2e10ce (patch) | |
tree | 463dbc0cbf463bee814d4cdfc16267b50b6e0d28 /src | |
parent | ebba2e312d18692934299ccf2a238e2e344e5d2c (diff) |
http/connection.clj: set streaming mode before calling connect method
Patch from drewr, http://paste.lisp.org/display/85390
Diffstat (limited to 'src')
-rw-r--r-- | src/clojure/contrib/http/connection.clj | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/src/clojure/contrib/http/connection.clj b/src/clojure/contrib/http/connection.clj index d664f237..0e975cd9 100644 --- a/src/clojure/contrib/http/connection.clj +++ b/src/clojure/contrib/http/connection.clj @@ -29,6 +29,7 @@ (defmethod send-request-entity duck/*byte-array-type* [conn entity] (.setFixedLengthStreamingMode conn (count entity)) + (.connect conn) (duck/copy entity (.getOutputStream conn))) (defmethod send-request-entity String [conn entity] @@ -36,14 +37,17 @@ (defmethod send-request-entity File [conn entity] (.setFixedLengthStreamingMode conn (.length entity)) + (.connect conn) (duck/copy entity (.getOutputStream conn))) (defmethod send-request-entity InputStream [conn entity] (.setChunkedStreamingMode conn -1) + (.connect conn) (duck/copy entity (.getOutputStream conn))) (defmethod send-request-entity Reader [conn entity] (.setChunkedStreamingMode conn -1) + (.connect conn) (duck/copy entity (.getOutputStream conn))) (defn start-http-connection @@ -51,6 +55,5 @@ ([conn request-entity-body] (if request-entity-body (do (.setDoOutput conn true) - (.connect conn) (send-request-entity conn request-entity-body)) (.connect conn)))) |