[Mono-bugs] [Bug 67722][Nor] New - cacheability public -> 'Directory does not exists'
bugzilla-daemon@bugzilla.ximian.com
bugzilla-daemon@bugzilla.ximian.com
Wed, 6 Oct 2004 18:19:13 -0400 (EDT)
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 martin@franz63.de.
http://bugzilla.ximian.com/show_bug.cgi?id=67722
--- shadow/67722 2004-10-06 18:19:13.000000000 -0400
+++ shadow/67722.tmp.18899 2004-10-06 18:19:13.000000000 -0400
@@ -0,0 +1,136 @@
+Bug#: 67722
+Product: Mono: Class Libraries
+Version: unspecified
+OS: All
+OS Details:
+Status: NEW
+Resolution:
+Severity:
+Priority: Normal
+Component: Sys.Web
+AssignedTo: mono-bugs@ximian.com
+ReportedBy: martin@franz63.de
+QAContact: mono-bugs@ximian.com
+TargetMilestone: ---
+URL:
+Cc:
+Summary: cacheability public -> 'Directory does not exists'
+
+Description of Problem:
+
+hi,
+i tried this with mono 1.0.1 and 1.0.2.
+I am using a httpHandler to pass every request of a certain url or
+directory to a single Handler-Class. e.g. by using this config in a
+web.config file:
+<add verb="*" path="*.aspx" validate="false" type="test, test" />
+
+That Handler Class sets the response Cacheability to
+HttpCacheability.Public, and does nothing more.
+When i request an url like http://server/blablabla.aspx the handler gets
+called, everything fine..
+but when i request http://server/dir/blablabla.aspx i get this exception
+from the Caching mechanism:
+
+---
+System.ArgumentException: Directory does not exists
+Parameter name: value
+in <0x000e4> System.IO.FileSystemWatcher:set_Path (string)
+in <0x00056> (wrapper remoting-invoke-with-check)
+System.IO.FileSystemWatcher:set_Path (string)
+in <0x00055> System.Web.Caching.CacheDependency:CreateWatcher (string)
+in <0x003c7> System.Web.Caching.CacheDependency:.ctor
+(string[],string[],System.Web.Caching.CacheDependency,System.DateTime)
+in <0x00029> System.Web.Caching.CacheDependency:.ctor (string[],string[])
+in <0x001c0> System.Web.Caching.OutputCacheModule:DoCacheInsert
+(System.Web.HttpContext)
+in <0x000e3> System.Web.Caching.OutputCacheModule:OnBeginUpdateCache
+(object,System.EventArgs,System.AsyncCallback,object)
+in <0x0007f> (wrapper delegate-invoke)
+System.MulticastDelegate:invoke_IAsyncResult_object_EventArgs_AsyncCallback_object
+(object,System.EventArgs,System.AsyncCallback,object)
+in <0x0002a> AsyncEventState:Execute ()
+in <0x00084> StateMachine:ExecuteState
+(System.Web.HttpApplication/IStateHandler,bool&)
+---
+
+Steps to reproduce the problem:
+
+
+1. set up web.config file (web.config):
+<?xml version="1.0" encoding="utf-8" ?>
+<configuration>
+ <system.web>
+ <httpHandlers>
+ <add verb="*" path="*.aspx" validate="false" type="test,
+test" />
+ </httpHandlers>
+ </system.web>
+</configuration>
+
+
+2. compile test handler (test.cs):
+using System;
+using System.Web;
+
+public class test : IHttpHandler {
+
+ public void ProcessRequest(HttpContext context) {
+
+context.Response.Cache.SetCacheability(HttpCacheability.Public);
+ context.Response.Write("test");
+ }
+
+ public bool IsReusable {
+ get { return true; }
+ }
+}
+
+
+3.
+request http://server/blablabla.aspx ->works
+request http://server/dir/blabla.aspx -> exception
+
+Actual Results:
+
+directory not found exception
+
+Expected Results:
+
+no exception ;)
+
+
+How often does this happen?
+
+always
+
+Additional Information:
+
+i found this problem when i tried to get nGallery 1.6.1
+(http://www.ngallery.org) running under mono.
+nGallery uses the above config and is mainly developed under windows / ms .net.
+So i suppose this setup works fine with ms .net and iis.
+I Also read a couple of messages where other people were having the same
+problem with nGallery under mono.
+
+
+The server side caching mechanism tries to set a FileSystemWatcher on the
+request filename,
+but since this filename is only 'virtual', we get an exception here.
+
+so, why does the server try to cache files with cacheability 'public' ?
+doesn't public mean 'cacheable for shared proxies and clients' ?!
+
+if i am right here, the bug might be fixed by changing the order in
+System.Web.HttpCacheability.cs, so that public < server.
+then everything like 'server%' should get cached at the server.
+(if i read the rest of the sourcecode correclty ;)
+...i guess you now better ;)
+
+if that is not the desired behaviour,
+then one might add some directory.exists() checking to the CacheDependancy,
+or even in the OnCacheabilityUpdated method in the httpResponse.
+
+greets,
+
+martin