Permalink
Browse files

Backport of r153328

svn path=/branches/mono-2-6/xsp/; revision=153329
  • Loading branch information...
grendello committed Mar 9, 2010
1 parent 7bfa42d commit fdf81c78b22560ae06381d6086e53e13aa3210aa
Showing with 7 additions and 2 deletions.
  1. +7 −2 src/Mono.WebServer.Apache/ModMonoRequest.cs
@@ -172,8 +172,13 @@ void FillBuffer (int count)
reader_ms.SetLength (0);
reader_ms.Position = 0;
- if (fill_buffer == null || fill_buffer.Length < count)
- fill_buffer = new byte [count];
+ if (fill_buffer == null || fill_buffer.Length < count) {
+ if (fill_buffer == null)
+ // Use slightly more memory initially, but save on time.
+ fill_buffer = new byte [INITIAL_MEMORY_STREAM_SIZE];
+ else
+ fill_buffer = new byte [count];
+ }
int received = client.Receive (fill_buffer, count, SocketFlags.None);
reader_ms.Write (fill_buffer, 0, received);

0 comments on commit fdf81c7

Please sign in to comment.