Author: gonzalo
Date: 2005-05-08 21:34:01 -0400 (Sun, 08 May 2005)
New Revision: 44234
Modified:
trunk/mcs/class/System.Web/System.Web/ChangeLog
trunk/mcs/class/System.Web/System.Web/HttpApplication.cs
trunk/mcs/class/System.Web/System.Web/HttpResponse.cs
trunk/mcs/class/System.Web/System.Web/StaticFileHandler.cs
Log:
2005-05-08 Gonzalo Paniagua Javier <[EMAIL PROTECTED]>
* HttpResponse.cs: we had 2 variables to track client connection status.
Use only one. Increase the buffer size to 28KB when writing from a file.
* StaticFileHandler.cs: set the Content-Type before writing the file.
This allows flushing before all the content is written.
* HttpApplication.cs: use the variable instead of the property when
setting the Principal for the current process.
Modified: trunk/mcs/class/System.Web/System.Web/ChangeLog
===================================================================
--- trunk/mcs/class/System.Web/System.Web/ChangeLog 2005-05-09 01:30:33 UTC
(rev 44233)
+++ trunk/mcs/class/System.Web/System.Web/ChangeLog 2005-05-09 01:34:01 UTC
(rev 44234)
@@ -1,5 +1,16 @@
2005-05-08 Gonzalo Paniagua Javier <[EMAIL PROTECTED]>
+ * HttpResponse.cs: we had 2 variables to track client connection status.
+ Use only one. Increase the buffer size to 28KB when writing from a file.
+
+ * StaticFileHandler.cs: set the Content-Type before writing the file.
+ This allows flushing before all the content is written.
+
+ * HttpApplication.cs: use the variable instead of the property when
+ setting the Principal for the current process.
+
+2005-05-08 Gonzalo Paniagua Javier <[EMAIL PROTECTED]>
+
* ReusableMemoryStream.cs:
* HttpWriter.cs: keep a pool of buffers to avoid allocations.
Modified: trunk/mcs/class/System.Web/System.Web/HttpApplication.cs
===================================================================
--- trunk/mcs/class/System.Web/System.Web/HttpApplication.cs 2005-05-09
01:30:33 UTC (rev 44233)
+++ trunk/mcs/class/System.Web/System.Web/HttpApplication.cs 2005-05-09
01:34:01 UTC (rev 44234)
@@ -1331,7 +1331,7 @@
_savedContext = HttpContext.Context;
HttpContext.Context = _Context;
HttpRuntime.TimeoutManager.Add (_Context);
- SetPrincipal (Context.User);
+ SetPrincipal (_Context.User);
}
internal void OnStateExecuteLeave ()
Modified: trunk/mcs/class/System.Web/System.Web/HttpResponse.cs
===================================================================
--- trunk/mcs/class/System.Web/System.Web/HttpResponse.cs 2005-05-09
01:30:33 UTC (rev 44233)
+++ trunk/mcs/class/System.Web/System.Web/HttpResponse.cs 2005-05-09
01:34:01 UTC (rev 44234)
@@ -65,7 +65,6 @@
DateTime _expiresAbsolute;
bool _expiresAbsoluteSet;
- bool _ClientDisconnected;
bool closed;
string _sContentType;
@@ -545,18 +544,15 @@
}
}
- public bool IsClientConnected
- {
+ public bool IsClientConnected {
get {
- if (_ClientDisconnected)
+ if (_bClientDisconnected)
return false;
- if (null != _WorkerRequest &&
(!_WorkerRequest.IsClientConnected ())) {
- _ClientDisconnected = false;
- return false;
- }
+ if (null != _WorkerRequest)
+ _bClientDisconnected =
(!_WorkerRequest.IsClientConnected ());
- return true;
+ return _bClientDisconnected;
}
}
@@ -745,7 +741,6 @@
public void Close ()
{
if (closed && !_bClientDisconnected) {
- _bClientDisconnected = false;
_WorkerRequest.CloseConnection ();
_bClientDisconnected = true;
}
@@ -1013,7 +1008,7 @@
if (readIntoMemory) {
WriteFromStream (fs, 0, size, size);
} else {
- WriteFromStream (fs, 0, size, 8192);
+ WriteFromStream (fs, 0, size, 30702);
}
} finally {
if (fs != null)
@@ -1026,7 +1021,7 @@
FileStream fs = null;
try {
fs = File.OpenRead (filename);
- WriteFromStream (fs, offset, size, 8192);
+ WriteFromStream (fs, offset, size, 30702);
} finally {
if (fs != null)
fs.Close ();
@@ -1038,7 +1033,7 @@
FileStream fs = null;
try {
fs = new FileStream (fileHandle,
FileAccess.Read);
- WriteFromStream (fs, offset, size, 8192);
+ WriteFromStream (fs, offset, size, 30702);
} finally {
if (fs != null)
fs.Close ();
Modified: trunk/mcs/class/System.Web/System.Web/StaticFileHandler.cs
===================================================================
--- trunk/mcs/class/System.Web/System.Web/StaticFileHandler.cs 2005-05-09
01:30:33 UTC (rev 44233)
+++ trunk/mcs/class/System.Web/System.Web/StaticFileHandler.cs 2005-05-09
01:34:01 UTC (rev 44234)
@@ -65,18 +65,15 @@
DateTime lastWT =
fi.LastWriteTime.ToUniversalTime ();
response.AddHeader ("Last-Modified",
lastWT.ToString ("r"));
- response.WriteFile (fileName);
response.ContentType = MimeTypes.GetMimeType
(fileName);
+ response.WriteFile (fileName);
} catch (Exception) {
throw new HttpException (403, "Forbidden.");
}
}
- public bool IsReusable
- {
- get {
- return true;
- }
+ public bool IsReusable {
+ get { return true; }
}
}
}
_______________________________________________
Mono-patches maillist - [email protected]
http://lists.ximian.com/mailman/listinfo/mono-patches