[Mono-bugs] [Bug 71587][Maj] Changed - Cannot access HttpWorkerRequest from HttpModule

bugzilla-daemon@bugzilla.ximian.com bugzilla-daemon@bugzilla.ximian.com
Fri, 21 Jan 2005 21:34:46 -0500 (EST)


Please do not reply to this email- if you want to comment on the bug, go to the
URL shown below and enter your comments there.

Changed by chrish@assistedsolutions.com.

http://bugzilla.ximian.com/show_bug.cgi?id=71587

--- shadow/71587	2005-01-21 20:06:17.000000000 -0500
+++ shadow/71587.tmp.12011	2005-01-21 21:34:46.000000000 -0500
@@ -132,6 +132,35 @@
 different in the 2.0 version of MS? That code will break.
 
 Moreover, the request is not read into memory and the same check that
 you try to do is done in HttpRequest.cs
 
 This is not a bug.
+
+------- Additional Comments From chrish@assistedsolutions.com  2005-01-21 21:34 -------
+First of all, thank you for your time. If I had a working Mono box, 
+I'd be able to track down the issue myself, whether it was in Mono or 
+my code. That being the case, I'm forced to rely on your generosity.
+
+According to Weston Weems, commenting out the entirety of the 
+offending code does not fix the problem. Thus, I come to the 
+conclusion that the issue is not in my code, or at least not in that 
+part of it. I am eager to track down the problem and fix it.
+
+Let me explain a bit more why I have coded this the way I have. The 
+whole purpose of this exercise is to avoid having the whole request 
+loaded into memory. If it is smaller than maxRequestLength, at least 
+on the MS runtime, accessing the request stream in any way through 
+the HttpRequest object causes it to be loaded into memory. In order 
+to circumvent that behavior, in the case of a large upload, I 
+intercept the request with an HttpModule and get the data from the 
+HttpWorkerRequest, thus bypassing the maxRequestLength check in 
+HttpRequest. Therefore, I must do the check myself.
+
+Furthermore, the existance of a web.config file, the existance of a 
+configuration key, web.config key, httpRuntime key, and finally a 
+maxRequestLength property inside that file are in the publicly 
+defined interface of .NET. The HttpContext.GetConfig method, while 
+not strongly typed, has an implied contract of returning an object 
+with properties corresponding to the attributes of the specified key 
+in the web.config file. This is the publicly defined interface with 
+which to interface to the web.config file.