CMIS-632: closing response stream in SetContentStream()
git-svn-id: https://svn.apache.org/repos/asf/chemistry/dotcmis/trunk@1482731 13f79535-47bb-0310-9956-ffa450edef68
diff --git a/DotCMIS/binding/atompub/atompub.cs b/DotCMIS/binding/atompub/atompub.cs
index 00406b0..435a117 100644
--- a/DotCMIS/binding/atompub/atompub.cs
+++ b/DotCMIS/binding/atompub/atompub.cs
@@ -1987,6 +1987,7 @@
// make the call
HttpUtils.Response resp = HttpUtils.InvokeDELETE(url, Session);
+ resp.CloseStream();
// check response code
if (resp.StatusCode == HttpStatusCode.OK || resp.StatusCode == HttpStatusCode.Accepted || resp.StatusCode == HttpStatusCode.NoContent)
@@ -2084,6 +2085,7 @@
// send content
HttpUtils.Response resp = HttpUtils.InvokePUT(url, contentStream.MimeType, headers, output, Session);
+ resp.CloseStream();
// check response code
if (resp.StatusCode != HttpStatusCode.OK && resp.StatusCode != HttpStatusCode.Created && resp.StatusCode != HttpStatusCode.NoContent)
diff --git a/DotCMIS/binding/http.cs b/DotCMIS/binding/http.cs
index 2e78527..0e0c13f 100644
--- a/DotCMIS/binding/http.cs
+++ b/DotCMIS/binding/http.cs
@@ -239,6 +239,14 @@
try { response.Close(); }
catch (Exception) { }
}
+
+ public void CloseStream()
+ {
+ if (Stream != null)
+ {
+ Stream.Close();
+ }
+ }
}
}