mvolo:
I dont see a reason why the filter couldnt run during the preloading process, but this is not something we can change at this point in the product cycle ... may make a good feature request for the next release.
Is there anything I need to do to formally make that feature request?
FYI, being able to use Request.Filter would have the additional advantage of working in a medium trust environment. Right now, upload components need to get the current HttpWorkerRequest but that is not permitted under medium trust. The only workaround is to install in the GAC.
mvolo:
At this point, I dont see any other way other then private reflection (I havent thought about exactly how),
Here is an example (from here):
private void PushRequestToIIS(HttpWorkerRequest request,
byte[] textParts)
{
BindingFlags bindingFlags = BindingFlags.Instance
| BindingFlags.NonPublic;
Type type = request.GetType();
while ((type != null) && (type.FullName !=
"System.Web.Hosting.ISAPIWorkerRequest"))
type = type.BaseType;
if (type != null)
{
type.GetField("_contentAvailLength",
bindingFlags).SetValue(request, textParts.Length);
type.GetField("_contentTotalLength",
bindingFlags).SetValue(request, textParts.Length);
type.GetField("_preloadedContent",
bindingFlags).SetValue(request, textParts);
type.GetField("_preloadedContentRead",
bindingFlags).SetValue(request, true);
}
}
Actually, this points to a fix that you might be more willing to make at this stage. Can you add:
public virtual void SetEntityBody(byte[] body)
{
throw new NotSupportedException();
}
to HttpWorkerRequest and then override that in ISAPIWorkerRequest to do what you see happening via private reflection above?
mvolo:
or going with a native module.
Correct me if I'm wrong, but wouldn't such a module need to be installed at the server level, instead of the website level? If so, it's probably a non-starter for me, since many of my users are using shared hosting. Not to mention the fact that it would require a major rewrite of my code and maintaining multiple versions... :)
mvolo:
Let me investigate if restoring ProcessRequest's functionality is something that is feasible, and get back to you.
Thanks!
--Dean