diff options
Diffstat (limited to 'OpenSim/Framework/WebUtil.cs')
-rw-r--r-- | OpenSim/Framework/WebUtil.cs | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/OpenSim/Framework/WebUtil.cs b/OpenSim/Framework/WebUtil.cs index 55b38cd..bc2cd01 100644 --- a/OpenSim/Framework/WebUtil.cs +++ b/OpenSim/Framework/WebUtil.cs | |||
@@ -199,14 +199,14 @@ namespace OpenSim.Framework | |||
199 | using (GZipStream comp = new GZipStream(ms, CompressionMode.Compress)) | 199 | using (GZipStream comp = new GZipStream(ms, CompressionMode.Compress)) |
200 | { | 200 | { |
201 | comp.Write(buffer, 0, buffer.Length); | 201 | comp.Write(buffer, 0, buffer.Length); |
202 | comp.Flush(); | 202 | // We need to close the gzip stream before we write it anywhere |
203 | 203 | // because apparently something important related to gzip compression | |
204 | ms.Seek(0, SeekOrigin.Begin); | 204 | // gets written on the strteam upon Dispose() |
205 | |||
206 | request.ContentLength = ms.Length; //Count bytes to send | ||
207 | using (Stream requestStream = request.GetRequestStream()) | ||
208 | requestStream.Write(ms.ToArray(), 0, (int)ms.Length); | ||
209 | } | 205 | } |
206 | byte[] buf = ms.ToArray(); | ||
207 | request.ContentLength = buf.Length; //Count bytes to send | ||
208 | using (Stream requestStream = request.GetRequestStream()) | ||
209 | requestStream.Write(buf, 0, (int)buf.Length); | ||
210 | } | 210 | } |
211 | } | 211 | } |
212 | else | 212 | else |