Author: breser
Date: Fri Aug  9 19:56:45 2013
New Revision: 1512471

URL: http://svn.apache.org/r1512471
Log:
Fix info message from http core about missing filename.  Followup to r1512432.

* subversion/mod_dav_svn/mod_dav_svn.c
  (dav_svn__translate_name): Leave a note for map_to_storage hook.
  (dav_svn__map_to_storage): New function.
  (register_hooks): Register map_to_storage hook.

Modified:
    subversion/trunk/subversion/mod_dav_svn/mod_dav_svn.c

Modified: subversion/trunk/subversion/mod_dav_svn/mod_dav_svn.c
URL: 
http://svn.apache.org/viewvc/subversion/trunk/subversion/mod_dav_svn/mod_dav_svn.c?rev=1512471&r1=1512470&r2=1512471&view=diff
==============================================================================
--- subversion/trunk/subversion/mod_dav_svn/mod_dav_svn.c (original)
+++ subversion/trunk/subversion/mod_dav_svn/mod_dav_svn.c Fri Aug  9 19:56:45 
2013
@@ -1106,9 +1106,26 @@ static int dav_svn__translate_name(reque
   /* Be paranoid and set it to NULL just in case some other module set it
    * before we got called. */ 
   r->filename = NULL;
+
+  /* Leave a note to ourselves so that we know not to decline in the 
+   * map_to_storage hook. */
+  apr_table_setn(r->notes, "dav_svn-no-map-to-storage", (const char*)1); 
   return OK;
 }
 
+/* Prevent core_map_to_storage from running if we prevented the r->filename
+ * from being set since core_map_to_storage doesn't like r->filename being
+ * NULL. */
+static int dav_svn__map_to_storage(request_rec *r)
+{
+  /* Check a note we left in translate_name since map_to_storage doesn't
+   * have access to our configuration. */
+  if (apr_table_get(r->notes, "dav_svn-no-map-to-storage"))
+    return OK;
+
+  return DECLINED;
+}
+
 
 
 /** Module framework stuff **/
@@ -1284,6 +1301,9 @@ register_hooks(apr_pool_t *pconf)
   /* translate_name hook is LAST so that it doesn't interfere with modules
    * like mod_alias that are MIDDLE. */
   ap_hook_translate_name(dav_svn__translate_name, NULL, NULL, APR_HOOK_LAST);
+  /* map_to_stroage hook is LAST to avoid interferring with mod_http's
+   * handling of OPTIONS and TRACE. */
+  ap_hook_map_to_storage(dav_svn__map_to_storage, NULL, NULL, APR_HOOK_FIRST);
 }
 
 


Reply via email to