[cvs-annodex] commit (/annodex): mod_annodex-ap20/trunk/mod_annodex.c

conrad nobody at lists.annodex.net
Thu Apr 14 22:36:17 EST 2005


Update of /annodex (new revision 1252)

Modified files:
   mod_annodex-ap20/trunk/mod_annodex.c

Log Message:
handle OPTIONS, and disallow methods other than OPTIONS, GET, HEAD etc.
For ticket:92


Modified: mod_annodex-ap20/trunk/mod_annodex.c
===================================================================
--- mod_annodex-ap20/trunk/mod_annodex.c	2005-04-14 12:32:29 UTC (rev 1251)
+++ mod_annodex-ap20/trunk/mod_annodex.c	2005-04-14 12:36:16 UTC (rev 1252)
@@ -355,11 +355,6 @@
   if (sep_pos) *sep_pos = '\0';
   chdir (newdir);
 
-#ifdef DEBUG
-  ap_log_rerror(APLOG_MARK, APLOG_NOERRNO|APLOG_ERR, 0, r,
-		"ma_anxenc path_sep %s, newdir %s", path_sep, newdir);
-#endif
-
   /* Get the start/end times or id */
   val = (char *)apr_table_get (cgi_table, "t");
   id = (char *)apr_table_get (cgi_table, "id");
@@ -390,7 +385,7 @@
     apr_table_set (r->headers_out, (const char *)"X-Content-Bitrate-Average",
                    apr_ltoa (r->pool, (long)header_value));
   }
-  
+
   while ((n = anx_write_output (anx, buf, MEDIA_BUF_LEN)) > 0) {
     ap_rwrite (buf, n, r);
   }
@@ -779,6 +774,15 @@
     return DECLINED;
   }
 
+  if (r->method_number == M_OPTIONS) {
+    r->allowed = (1 << M_GET);
+    return DECLINED;
+  }
+
+  if (r->method_number != M_GET) {
+    return HTTP_METHOD_NOT_ALLOWED;
+  }
+
   /* check if file exists */
   if (r->finfo.filetype == APR_NOFILE) {
     apr_file_t * f;


-- 
conrad



More information about the cvs-annodex mailing list