diff options
Diffstat (limited to 'mcs/class/System.Web')
27 files changed, 132 insertions, 222 deletions
diff --git a/mcs/class/System.Web/System.Web.Caching/Cache.cs b/mcs/class/System.Web/System.Web.Caching/Cache.cs index b8ecda5dd90..720d86c71ca 100644 --- a/mcs/class/System.Web/System.Web.Caching/Cache.cs +++ b/mcs/class/System.Web/System.Web.Caching/Cache.cs @@ -209,7 +209,7 @@ namespace System.Web.Caching { // If we have any kind of expiration add into the CacheExpires class if (objEntry.HasSlidingExpiration || objEntry.HasAbsoluteExpiration) { if (objEntry.HasSlidingExpiration) - objEntry.Expires = DateTime.Now.Ticks + objEntry.SlidingExpiration; + objEntry.Expires = DateTime.UtcNow.Ticks + objEntry.SlidingExpiration; _objExpires.Add (objEntry); } @@ -392,7 +392,7 @@ namespace System.Web.Caching { internal CacheEntry GetEntry (string strKey) { CacheEntry objEntry = null; - long ticksNow = DateTime.Now.Ticks; + long ticksNow = DateTime.UtcNow.Ticks; if (strKey == null) throw new ArgumentNullException ("strKey"); diff --git a/mcs/class/System.Web/System.Web.Caching/CacheEntry.cs b/mcs/class/System.Web/System.Web.Caching/CacheEntry.cs index 0e07353dc56..10e0f7c57a0 100644 --- a/mcs/class/System.Web/System.Web.Caching/CacheEntry.cs +++ b/mcs/class/System.Web/System.Web.Caching/CacheEntry.cs @@ -100,7 +100,7 @@ namespace System.Web.Caching { // moved after each period, and the absolute expiration is the value used
// for all expiration calculations.
if (tsSpan.Ticks != Cache.NoSlidingExpiration.Ticks)
- _ticksExpires = System.DateTime.Now.AddTicks(_ticksSlidingExpiration).Ticks;
+ _ticksExpires = System.DateTime.UtcNow.AddTicks(_ticksSlidingExpiration).Ticks;
_objDependency = objDependency;
if (_objDependency != null)
diff --git a/mcs/class/System.Web/System.Web.Caching/CacheExpires.cs b/mcs/class/System.Web/System.Web.Caching/CacheExpires.cs index 673468ae209..11e2377e3c1 100644 --- a/mcs/class/System.Web/System.Web.Caching/CacheExpires.cs +++ b/mcs/class/System.Web/System.Web.Caching/CacheExpires.cs @@ -71,7 +71,7 @@ namespace System.Web.Caching { } while (bytePos < 60);
// GC Bucket controller
- _intFlush = System.DateTime.Now.Minute - 1;
+ _intFlush = System.DateTime.UtcNow.Minute - 1;
_objTimer = new System.Threading.Timer (new System.Threading.TimerCallback (GarbageCleanup), null, 10000, 60000);
}
@@ -80,7 +80,7 @@ namespace System.Web.Caching { /// </summary>
/// <param name="objEntry">Cache entry to add.</param>
internal void Add (CacheEntry objEntry) {
- long now = DateTime.Now.Ticks;
+ long now = DateTime.UtcNow.Ticks;
if (objEntry.Expires < now)
objEntry.Expires = now;
diff --git a/mcs/class/System.Web/System.Web.Caching/ChangeLog b/mcs/class/System.Web/System.Web.Caching/ChangeLog index 3b09664543a..1b19523286f 100644 --- a/mcs/class/System.Web/System.Web.Caching/ChangeLog +++ b/mcs/class/System.Web/System.Web.Caching/ChangeLog @@ -1,3 +1,8 @@ +2004-10-03 Ben Maurer <bmaurer@ximian.com> + + * Cache.cs, CacheEntry.cs, CacheExpires.cs, ExpiresBuckets.cs: + use UtcNow rather than Now. + 2004-05-27 Patrik Torstensson <totte@hiddenpeaks.com> * ExpiresBucket.cs (FlushExpiredItems): fix csc and a typo bug diff --git a/mcs/class/System.Web/System.Web.Caching/ExpiresBuckets.cs b/mcs/class/System.Web/System.Web.Caching/ExpiresBuckets.cs index e32194c836c..7b8c139afeb 100644 --- a/mcs/class/System.Web/System.Web.Caching/ExpiresBuckets.cs +++ b/mcs/class/System.Web/System.Web.Caching/ExpiresBuckets.cs @@ -231,7 +231,7 @@ namespace System.Web.Caching { int intPos;
long ticksNow;
- ticksNow = DateTime.Now.Ticks;
+ ticksNow = DateTime.UtcNow.Ticks;
intPos = 0;
// Lookup all items that needs to be removed, this is done in a two part
diff --git a/mcs/class/System.Web/System.Web.Compilation/BuildProviderResultFlags.cs b/mcs/class/System.Web/System.Web.Compilation/BuildProviderResultFlags.cs deleted file mode 100644 index 3cd3ea5723a..00000000000 --- a/mcs/class/System.Web/System.Web.Compilation/BuildProviderResultFlags.cs +++ /dev/null @@ -1,41 +0,0 @@ -// -// System.Web.Compilation.BuildProviderResultFlags.cs -// -// Authors: -// Duncan Mak (duncan@ximian.com) -// -// Permission is hereby granted, free of charge, to any person obtaining -// a copy of this software and associated documentation files (the -// "Software"), to deal in the Software without restriction, including -// without limitation the rights to use, copy, modify, merge, publish, -// distribute, sublicense, and/or sell copies of the Software, and to -// permit persons to whom the Software is furnished to do so, subject to -// the following conditions: -// -// The above copyright notice and this permission notice shall be -// included in all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, -// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND -// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE -// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION -// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION -// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. -// -// Copyright (C) 2004 Novell, Inc (http://www.novell.com) -// - -using System.Resources; - -#if NET_2_0 -namespace System.Web.Compilation -{ - [Serializable, Flags] - public enum BuildProviderResultFlags - { - Default = 0, - ShutdownAppDomainOnChange = 1 - } -} -#endif diff --git a/mcs/class/System.Web/System.Web.Compilation/IImplicitResourceProvider.cs b/mcs/class/System.Web/System.Web.Compilation/IImplicitResourceProvider.cs deleted file mode 100644 index 3e2c38ff5db..00000000000 --- a/mcs/class/System.Web/System.Web.Compilation/IImplicitResourceProvider.cs +++ /dev/null @@ -1,42 +0,0 @@ -// -// System.Web.Compilation.IImplicitResourceProvider.cs -// -// Authors: -// Duncan Mak (duncan@ximian.com) -// -// Permission is hereby granted, free of charge, to any person obtaining -// a copy of this software and associated documentation files (the -// "Software"), to deal in the Software without restriction, including -// without limitation the rights to use, copy, modify, merge, publish, -// distribute, sublicense, and/or sell copies of the Software, and to -// permit persons to whom the Software is furnished to do so, subject to -// the following conditions: -// -// The above copyright notice and this permission notice shall be -// included in all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, -// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND -// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE -// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION -// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION -// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. -// -// Copyright (C) 2004 Novell, Inc (http://www.novell.com) -// - -#if NET_2_0 - -using System.Collections; -using System.Globalization; - -namespace System.Web.Compilation -{ - public interface IImplicitResourceProvider - { - object GetObject (ImplicitResourceKey key, CultureInfo culture); - ICollection GetResources (string keyPrefix); - } -} -#endif diff --git a/mcs/class/System.Web/System.Web.Compilation/IResourceReader.cs b/mcs/class/System.Web/System.Web.Compilation/IResourceReader.cs deleted file mode 100644 index 4cdb8b14784..00000000000 --- a/mcs/class/System.Web/System.Web.Compilation/IResourceReader.cs +++ /dev/null @@ -1,39 +0,0 @@ -// -// System.Web.Compilation.IResourceProvider.cs -// -// Authors: -// Duncan Mak (duncan@ximian.com) -// -// Permission is hereby granted, free of charge, to any person obtaining -// a copy of this software and associated documentation files (the -// "Software"), to deal in the Software without restriction, including -// without limitation the rights to use, copy, modify, merge, publish, -// distribute, sublicense, and/or sell copies of the Software, and to -// permit persons to whom the Software is furnished to do so, subject to -// the following conditions: -// -// The above copyright notice and this permission notice shall be -// included in all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, -// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND -// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE -// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION -// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION -// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. -// -// Copyright (C) 2004 Novell, Inc (http://www.novell.com) -// - -using System.Resources; - -#if NET_2_0 -namespace System.Web.Compilation -{ - public interface IResourceProvider - { - IResourceReader ResourceReader { get; } - } -} -#endif diff --git a/mcs/class/System.Web/System.Web.Compilation/ImplicitResourceKey.cs b/mcs/class/System.Web/System.Web.Compilation/ImplicitResourceKey.cs deleted file mode 100644 index ac2bab3c256..00000000000 --- a/mcs/class/System.Web/System.Web.Compilation/ImplicitResourceKey.cs +++ /dev/null @@ -1,43 +0,0 @@ -// -// System.Web.Compilation.IImplicitResourceProvider.cs -// -// Authors: -// Duncan Mak (duncan@ximian.com) -// -// Permission is hereby granted, free of charge, to any person obtaining -// a copy of this software and associated documentation files (the -// "Software"), to deal in the Software without restriction, including -// without limitation the rights to use, copy, modify, merge, publish, -// distribute, sublicense, and/or sell copies of the Software, and to -// permit persons to whom the Software is furnished to do so, subject to -// the following conditions: -// -// The above copyright notice and this permission notice shall be -// included in all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, -// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND -// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE -// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION -// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION -// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. -// -// Copyright (C) 2004 Novell, Inc (http://www.novell.com) -// - -#if NET_2_0 -namespace System.Web.Compilation -{ - public class ImplicitResourceKey - { - public ImplicitResourceKey () - { - } - - public string Filter; - public string KeyPrefix; - public string Property; - } -} -#endif diff --git a/mcs/class/System.Web/System.Web.Handlers/ChangeLog b/mcs/class/System.Web/System.Web.Handlers/ChangeLog index 50459bd9024..4f3e185e220 100644 --- a/mcs/class/System.Web/System.Web.Handlers/ChangeLog +++ b/mcs/class/System.Web/System.Web.Handlers/ChangeLog @@ -1,3 +1,8 @@ +2004-10-06 Gonzalo Paniagua Javier <gonzalo@ximian.com> + + * TraceHandler.cs: error code is 403 and the message different when + trace is enabled but not for remote clients. + 2004-07-02 Gonzalo Paniagua Javier <gonzalo@ximian.com> * TraceHandler.cs: check that trace is enabled or throw. diff --git a/mcs/class/System.Web/System.Web.Handlers/TraceHandler.cs b/mcs/class/System.Web/System.Web.Handlers/TraceHandler.cs index 343aa5957a7..23e35288f80 100644 --- a/mcs/class/System.Web/System.Web.Handlers/TraceHandler.cs +++ b/mcs/class/System.Web/System.Web.Handlers/TraceHandler.cs @@ -44,11 +44,21 @@ namespace System.Web.Handlers #endif class TraceNotAvailableException : HttpException { - public TraceNotAvailableException () : - base ("Trace Error") {} + bool notLocal; + + public TraceNotAvailableException (bool notLocal) : + base (notLocal ? 403 : 500, "Trace Error") + { + this.notLocal = notLocal; + } internal override string Description { - get { return "Trace.axd is not enabled in the configuration file for this application."; } + get { + if (notLocal) + return "Trace is not enabled for remote clients."; + + return "Trace.axd is not enabled in the configuration file for this application."; + } } } @@ -58,9 +68,8 @@ namespace System.Web.Handlers { TraceManager manager = HttpRuntime.TraceManager; - if (!manager.Enabled || manager.LocalOnly && !context.Request.IsLocal) { - throw new TraceNotAvailableException (); - } + if (!manager.Enabled || manager.LocalOnly && !context.Request.IsLocal) + throw new TraceNotAvailableException (manager.Enabled); HtmlTextWriter output = new HtmlTextWriter (context.Response.Output); diff --git a/mcs/class/System.Web/System.Web.SessionState/ChangeLog b/mcs/class/System.Web/System.Web.SessionState/ChangeLog index b8e60f21cdd..65d40fbe0bc 100644 --- a/mcs/class/System.Web/System.Web.SessionState/ChangeLog +++ b/mcs/class/System.Web/System.Web.SessionState/ChangeLog @@ -1,3 +1,7 @@ +2004-10-06 Gonzalo Paniagua Javier <gonzalo@ximian.com> + + * SessionStateModule.cs: use SetCurrentExePath instead of SetFilePath. + 2004-09-09 Gonzalo Paniagua Javier <gonzalo@ximian.com> * HttpSessionState.cs: don't share static session objects declared in diff --git a/mcs/class/System.Web/System.Web.SessionState/SessionStateModule.cs b/mcs/class/System.Web/System.Web.SessionState/SessionStateModule.cs index cbee9af88f8..c909e2a4086 100644 --- a/mcs/class/System.Web/System.Web.SessionState/SessionStateModule.cs +++ b/mcs/class/System.Web/System.Web.SessionState/SessionStateModule.cs @@ -109,7 +109,7 @@ namespace System.Web.SessionState if (id == null) return; - context.Request.SetFilePath (UrlUtils.RemoveSessionId (base_path, + context.Request.SetCurrentExePath (UrlUtils.RemoveSessionId (base_path, context.Request.FilePath)); context.Request.SetHeader (HeaderName, id); } diff --git a/mcs/class/System.Web/System.Web.UI.WebControls/AdRotator.cs b/mcs/class/System.Web/System.Web.UI.WebControls/AdRotator.cs index 0777e266fc4..de46e7d14ac 100755 --- a/mcs/class/System.Web/System.Web.UI.WebControls/AdRotator.cs +++ b/mcs/class/System.Web/System.Web.UI.WebControls/AdRotator.cs @@ -217,7 +217,7 @@ namespace System.Web.UI.WebControls [Bindable(true)] [DefaultValue("")] [Editor ("System.Web.UI.Design.XmlUrlEditor, " + Consts.AssemblySystem_Design, typeof (System.Drawing.Design.UITypeEditor))] - [WebCategory("Behaviour")] + [WebCategory("Behavior")] [WebSysDescription("AdRotator_AdvertisementFile")] public string AdvertisementFile { get { return ((advertisementFile != null) ? advertisementFile : ""); } @@ -232,7 +232,7 @@ namespace System.Web.UI.WebControls [Bindable(true)] [DefaultValue("")] - [WebCategory("Behaviour")] + [WebCategory("Behavior")] [WebSysDescription("AdRotator_KeywordFilter")] public string KeywordFilter { get { @@ -251,7 +251,7 @@ namespace System.Web.UI.WebControls [Bindable(true)] [DefaultValue("")] [TypeConverter(typeof(TargetConverter))] - [WebCategory("Behaviour")] + [WebCategory("Behavior")] [WebSysDescription("AdRotator_Target")] public string Target { get { diff --git a/mcs/class/System.Web/System.Web.UI.WebControls/BaseCompareValidator.cs b/mcs/class/System.Web/System.Web.UI.WebControls/BaseCompareValidator.cs index 86de6a314f5..83ac1c850cc 100755 --- a/mcs/class/System.Web/System.Web.UI.WebControls/BaseCompareValidator.cs +++ b/mcs/class/System.Web/System.Web.UI.WebControls/BaseCompareValidator.cs @@ -56,7 +56,7 @@ namespace System.Web.UI.WebControls } [DefaultValue(ValidationDataType.String)] - [WebCategory("Behaviour")] + [WebCategory("Behavior")] [WebSysDescription("RangeValidator_Type")] public ValidationDataType Type { diff --git a/mcs/class/System.Web/System.Web.UI.WebControls/ChangeLog b/mcs/class/System.Web/System.Web.UI.WebControls/ChangeLog index 874a1774bce..632b24ace91 100644 --- a/mcs/class/System.Web/System.Web.UI.WebControls/ChangeLog +++ b/mcs/class/System.Web/System.Web.UI.WebControls/ChangeLog @@ -1,3 +1,7 @@ +2004-09-28 Gonzalo Paniagua Javier <gonzalo@ximian.com> + + * TableStyle.cs: don't render empty 'rules' attribute (again). + 2004-09-12 Gonzalo Paniagua Javier <gonzalo@ximian.com> * RadioButton.cs: fix GroupName when the control is inside a diff --git a/mcs/class/System.Web/System.Web.UI.WebControls/TableStyle.cs b/mcs/class/System.Web/System.Web.UI.WebControls/TableStyle.cs index 413b8a0745c..a1653a11928 100644 --- a/mcs/class/System.Web/System.Web.UI.WebControls/TableStyle.cs +++ b/mcs/class/System.Web/System.Web.UI.WebControls/TableStyle.cs @@ -171,7 +171,7 @@ namespace System.Web.UI.WebControls {
writer.AddAttribute(HtmlTextWriterAttribute.Align, Enum.Format(typeof(HorizontalAlign), HorizontalAlign, "G"));
}
- string gd = String.Empty; + string gd = null; switch(GridLines)
{
case GridLines.None: break; @@ -182,6 +182,8 @@ namespace System.Web.UI.WebControls case GridLines.Both: gd = "all";
break;
} + + if (gd != null) writer.AddAttribute(HtmlTextWriterAttribute.Rules, gd); } diff --git a/mcs/class/System.Web/System.Web.UI/ChangeLog b/mcs/class/System.Web/System.Web.UI/ChangeLog index ee8644d5f3c..4f16a45684a 100644 --- a/mcs/class/System.Web/System.Web.UI/ChangeLog +++ b/mcs/class/System.Web/System.Web.UI/ChangeLog @@ -1,3 +1,8 @@ +2004-10-01 Gonzalo Paniagua Javier <gonzalo@ximian.com> + + * Control.cs: even if the control has no children the naming container + may contain the control we're looking for. Fixes bug #67304. + 2004-09-09 Gonzalo Paniagua Javier <gonzalo@ximian.com> * TemplateParser.cs: ensure bin directory exists before trying to access diff --git a/mcs/class/System.Web/System.Web.UI/Control.cs b/mcs/class/System.Web/System.Web.UI/Control.cs index b2d3ada71f2..da9aac46dc8 100644 --- a/mcs/class/System.Web/System.Web.UI/Control.cs +++ b/mcs/class/System.Web/System.Web.UI/Control.cs @@ -501,9 +501,6 @@ namespace System.Web.UI protected virtual Control FindControl (string id, int pathOffset)
{
EnsureChildControls ();
- if (_controls == null)
- return null;
-
Control namingContainer = null;
if (!_isNamingContainer) {
namingContainer = NamingContainer;
@@ -512,7 +509,10 @@ namespace System.Web.UI return namingContainer.FindControl (id, pathOffset);
}
-
+ + if (!HasControls ()) + return null; + int colon = id.IndexOf (':', pathOffset);
if (colon == -1)
return LookForControlByName (id.Substring (pathOffset));
diff --git a/mcs/class/System.Web/System.Web/ChangeLog b/mcs/class/System.Web/System.Web/ChangeLog index 01478566763..9bfa82351cf 100644 --- a/mcs/class/System.Web/System.Web/ChangeLog +++ b/mcs/class/System.Web/System.Web/ChangeLog @@ -1,3 +1,36 @@ +2004-10-06 Gonzalo Paniagua Javier <gonzalo@ximian.com> + + * HttpRequest.cs: CurrentExecutionFilePath is the one that + changes when Transfer or Execute are used, not FilePath. + + * HttpServerUtility.cs: moved form saving/restoring from + Transfer to Execute, as it's needed there too. the query string is + correctly set now. Fixes bug #67388. + + * HttpContext.cs: use SetCurrentExePath instead of SetFilePath. + +2004-10-03 Ben Maurer <bmaurer@ximian.com> + + * HttpResponse.cs: use UtcNow + +2004-10-01 Gonzalo Paniagua Javier <gonzalo@ximian.com> + + * HttpResponse.cs: SuppressContent does not throw and clears all the + buffered output. Fixes bug #67213. + +2004-09-30 Gonzalo Paniagua Javier <gonzalo@ximian.com> + + * HttpUtility.cs: UrlPathEncode is static. Fixes bug #67155. + +2004-09-29 Ben Maurer <bmaurer@ximian.com> + + * HttpContext.cs, TimeoutManager: Use DateTime.UtcNow. + +2004-09-25 Ben Maurer <bmaurer@ximian.com> + + * HttpApplication.cs: Make sure requests are removed from + the timeout manager. Fixes a major leak. #66751. + 2004-09-24 Gonzalo Paniagua Javier <gonzalo@ximian.com> * HttpApplicationFactory.cs: diff --git a/mcs/class/System.Web/System.Web/HttpApplication.cs b/mcs/class/System.Web/System.Web/HttpApplication.cs index 37599a8e1f0..91dfda2ae8d 100644 --- a/mcs/class/System.Web/System.Web/HttpApplication.cs +++ b/mcs/class/System.Web/System.Web/HttpApplication.cs @@ -664,19 +664,23 @@ namespace System.Web handler = _handlers [_currentStateIdx]; _countSteps++; timeoutPossible = handler.PossibleToTimeout; - if (timeoutPossible) - HttpRuntime.TimeoutManager.Add (_app.Context); - - lasterror = ExecuteState (handler, ref ready_sync); - if (ready_sync) - _countSyncSteps++; + try { + if (timeoutPossible) + HttpRuntime.TimeoutManager.Add (_app.Context); + + lasterror = ExecuteState (handler, ref ready_sync); + if (ready_sync) + _countSyncSteps++; + } finally { + if (timeoutPossible) + HttpRuntime.TimeoutManager.Remove (_app.Context); + } } while (ready_sync && _currentStateIdx < _endStateIdx); if (null != lasterror) _app.HandleError (lasterror); } finally { - if (timeoutPossible) - HttpRuntime.TimeoutManager.Remove (_app.Context); + _app.OnStateExecuteLeave (); } diff --git a/mcs/class/System.Web/System.Web/HttpContext.cs b/mcs/class/System.Web/System.Web/HttpContext.cs index 27ca76ff8a5..4d28af400ad 100644 --- a/mcs/class/System.Web/System.Web/HttpContext.cs +++ b/mcs/class/System.Web/System.Web/HttpContext.cs @@ -287,7 +287,7 @@ namespace System.Web internal void BeginTimeoutPossible () { timeoutPossible = 1; - timeoutBegin = DateTime.Now.Ticks; + timeoutBegin = DateTime.UtcNow.Ticks; } internal void EndTimeoutPossible () @@ -403,7 +403,7 @@ namespace System.Web throw new HttpException (404, "The virtual path '" + path + "' maps to another application."); - Request.SetFilePath (path); + Request.SetCurrentExePath (path); Request.QueryStringRaw = query; } diff --git a/mcs/class/System.Web/System.Web/HttpRequest.cs b/mcs/class/System.Web/System.Web/HttpRequest.cs index 5b1cbef349c..48140d4c1f9 100644 --- a/mcs/class/System.Web/System.Web/HttpRequest.cs +++ b/mcs/class/System.Web/System.Web/HttpRequest.cs @@ -88,6 +88,7 @@ namespace System.Web { Stream userFilter; HttpRequestStream requestFilter; string clientTarget; + string currentExePath; #if NET_1_1 bool validateCookies; bool validateForm; @@ -503,6 +504,9 @@ namespace System.Web { public string CurrentExecutionFilePath { get { + if (currentExePath != null) + return currentExePath; + return FilePath; } } @@ -1139,9 +1143,9 @@ namespace System.Web { } #endif - internal void SetFilePath (string filePath) + internal void SetCurrentExePath (string filePath) { - _sFilePath = filePath; + currentExePath = filePath; _sRequestRootVirtualDir = null; baseVirtualDir = null; } diff --git a/mcs/class/System.Web/System.Web/HttpResponse.cs b/mcs/class/System.Web/System.Web/HttpResponse.cs index 45128ce4415..fa8c2892af8 100644 --- a/mcs/class/System.Web/System.Web/HttpResponse.cs +++ b/mcs/class/System.Web/System.Web/HttpResponse.cs @@ -190,7 +190,7 @@ namespace System.Web CultureInfo oSavedInfo = Thread.CurrentThread.CurrentCulture; Thread.CurrentThread.CurrentCulture = CultureInfo.InvariantCulture; - string date = DateTime.Now.ToUniversalTime ().ToString ("ddd, d MMM yyyy HH:mm:ss "); + string date = DateTime.UtcNow.ToString ("ddd, d MMM yyyy HH:mm:ss "); HttpResponseHeader date_header = new HttpResponseHeader ("Date", date + "GMT"); oHeaders.Add (date_header); @@ -618,9 +618,6 @@ namespace System.Web } set { - if (_bHeadersSent) - throw new HttpException ("Headers has been sent to the client"); - _bSuppressContent = true; } } @@ -846,6 +843,9 @@ namespace System.Web if (!_bSuppressContent && Request.HttpMethod == "HEAD") _bSuppressContent = true; + if (_bSuppressContent) + _Writer.Clear (); + if (!_bSuppressContent) { _bClientDisconnected = false; if (_bChunked) { diff --git a/mcs/class/System.Web/System.Web/HttpServerUtility.cs b/mcs/class/System.Web/System.Web/HttpServerUtility.cs index 0abb629c828..86c925de04b 100644 --- a/mcs/class/System.Web/System.Web/HttpServerUtility.cs +++ b/mcs/class/System.Web/System.Web/HttpServerUtility.cs @@ -192,19 +192,26 @@ namespace System.Web } else { query = ""; } - - string filePath = _Context.Request.MapPath (path); + + HttpRequest request = _Context.Request; HttpResponse response = _Context.Response; + + string oldQuery = request.QueryStringRaw; + request.QueryStringRaw = query; + + HttpValueCollection oldForm = null; + if (!preserveQuery) { + oldForm = _Context.Request.Form as HttpValueCollection; + _Context.Request.SetForm (new HttpValueCollection ()); + } + + string filePath = _Context.Request.MapPath (path); TextWriter output = writer; if (output == null) output = response.Output; - HttpRequest request = _Context.Request; string oldFilePath = request.FilePath; - request.SetFilePath (UrlUtils.Combine (_Context.Request.BaseVirtualDir, path)); - string oldQuery = request.QueryStringRaw; - - if (!preserveQuery) request.QueryStringRaw = query; + request.SetCurrentExePath (UrlUtils.Combine (_Context.Request.BaseVirtualDir, path)); IHttpHandler handler = _Context.ApplicationInstance.CreateHttpHandler (_Context, request.RequestType, path, @@ -221,9 +228,11 @@ namespace System.Web asyncHandler.EndProcessRequest (ar); } } finally { - request.SetFilePath (oldFilePath); + request.SetCurrentExePath (oldFilePath); request.QueryStringRaw = oldQuery; response.SetTextWriter (previous); + if (!preserveQuery) + _Context.Request.SetForm (oldForm); } } @@ -324,16 +333,7 @@ namespace System.Web /// they are cleared. The default is false. </param> public void Transfer (string path, bool preserveForm) { - HttpValueCollection oldForm = null; - if (!preserveForm) { - oldForm = _Context.Request.Form as HttpValueCollection; - _Context.Request.SetForm (new HttpValueCollection ()); - } - Execute (path, null, preserveForm); - if (!preserveForm) - _Context.Request.SetForm (oldForm); - _Context.Response.End (); } diff --git a/mcs/class/System.Web/System.Web/HttpUtility.cs b/mcs/class/System.Web/System.Web/HttpUtility.cs index d1a2d0dbb07..c7f3fecf63b 100644 --- a/mcs/class/System.Web/System.Web/HttpUtility.cs +++ b/mcs/class/System.Web/System.Web/HttpUtility.cs @@ -829,7 +829,7 @@ namespace System.Web { }
#if NET_1_1
- public string UrlPathEncode (string s)
+ public static string UrlPathEncode (string s)
{
if (s == null)
return null;
diff --git a/mcs/class/System.Web/System.Web/TimeoutManager.cs b/mcs/class/System.Web/System.Web/TimeoutManager.cs index d686568cc88..2fbdd35e3f6 100644 --- a/mcs/class/System.Web/System.Web/TimeoutManager.cs +++ b/mcs/class/System.Web/System.Web/TimeoutManager.cs @@ -106,7 +106,7 @@ namespace System.Web return; } - DateTime now = DateTime.Now; + DateTime now = DateTime.UtcNow; ArrayList clist = new ArrayList (); lock (this) { // The lock prevents Keys enumerator from being out of synch |