cvs commit: apache-1.3/htdocs/manual/mod mod_actions.html

1999-12-08 Thread coar
coar99/12/08 11:02:24

  Modified:src  CHANGES
   src/modules/standard mod_actions.c
   htdocs/manual/mod mod_actions.html
  Log:
Add ability to handle arbitrary methods to Script directive.
  
  Revision  ChangesPath
  1.1473+6 -0  apache-1.3/src/CHANGES
  
  Index: CHANGES
  ===
  RCS file: /home/cvs/apache-1.3/src/CHANGES,v
  retrieving revision 1.1472
  retrieving revision 1.1473
  diff -u -r1.1472 -r1.1473
  --- CHANGES   1999/12/06 22:33:57 1.1472
  +++ CHANGES   1999/12/08 19:01:13 1.1473
  @@ -1,5 +1,11 @@
   Changes with Apache 1.3.10
   
  +  *) Enhance mod_actions' Script handling to be able to deal with
  + arbitrary methods and not just the well-known ones.  This allows
  + experimental or organisation-private methods to be used without
  + waiting for Apache to catch up.
  + [Ken Coar]
  +
 *) Fix various compile time warnings in hashbang_emul code which
prevent successful compilation on OS/390  [Ovies Brabson
<[EMAIL PROTECTED]>, Paul Gilmartin <[EMAIL PROTECTED]>]
  
  
  
  1.32  +83 -21apache-1.3/src/modules/standard/mod_actions.c
  
  Index: mod_actions.c
  ===
  RCS file: /home/cvs/apache-1.3/src/modules/standard/mod_actions.c,v
  retrieving revision 1.31
  retrieving revision 1.32
  diff -u -r1.31 -r1.32
  --- mod_actions.c 1999/01/01 19:05:06 1.31
  +++ mod_actions.c 1999/12/08 19:01:48 1.32
  @@ -87,8 +87,18 @@
   #include "util_script.h"
   
   typedef struct {
  +char *method;
  +char *script;
  +} xmethod_t;
  +
  +/*
  + * HTTP methods are case-sensitive, so we can't use a table structure to
  + * track extension method mappings -- table keys are case-INsensitive.
  + */
  +typedef struct {
   table *action_types;   /* Added with Action... */
   char *scripted[METHODS];   /* Added with Script... */
  +array_header *xmethods;/* Added with Script -- extension methods */
   } action_dir_config;
   
   module action_module;
  @@ -96,11 +106,11 @@
   static void *create_action_dir_config(pool *p, char *dummy)
   {
   action_dir_config *new =
  -(action_dir_config *) ap_palloc(p, sizeof(action_dir_config));
  + (action_dir_config *) ap_palloc(p, sizeof(action_dir_config));
   
   new->action_types = ap_make_table(p, 4);
   memset(new->scripted, 0, sizeof(new->scripted));
  -
  +new->xmethods = ap_make_array(p, 4, sizeof(xmethod_t));
   return new;
   }
   
  @@ -119,29 +129,56 @@
   new->scripted[i] = add->scripted[i] ? add->scripted[i]
   : base->scripted[i];
   }
  +new->xmethods = ap_append_arrays(p, add->xmethods, base->xmethods);
   return new;
   }
   
  -static const char *add_action(cmd_parms *cmd, action_dir_config * m, char 
*type,
  +static const char *add_action(cmd_parms *cmd, action_dir_config *m, char 
*type,
  char *script)
   {
   ap_table_setn(m->action_types, type, script);
   return NULL;
   }
   
  -static const char *set_script(cmd_parms *cmd, action_dir_config * m,
  +static const char *set_script(cmd_parms *cmd, action_dir_config *m,
 char *method, char *script)
   {
   int methnum;
   
   methnum = ap_method_number_of(method);
  -if (methnum == M_TRACE)
  -return "TRACE not allowed for Script";
  -else if (methnum == M_INVALID)
  -return "Unknown method type for Script";
  -else
  +if (methnum == M_TRACE) {
  + return "TRACE not allowed for Script";
  +}
  +else if (methnum != M_INVALID) {
   m->scripted[methnum] = script;
  -
  +}
  +else {
  + /*
  +  * We used to return "Unknown method type for Script"
  +  * but now we actually handle unknown methods.
  +  */
  + xmethod_t *xm;
  + xmethod_t *list;
  + int i;
  +
  + /*
  +  * Scan through the list; if the method already has a script
  +  * defined, overwrite it.  Otherwise, add it.
  +  */
  + list = (xmethod_t *) m->xmethods->elts;
  + for (i = 0; i < m->xmethods->nelts; ++i) {
  + xm = &list[i];
  + if (strcmp(method, xm->method) == 0) {
  + xm->script = script;
  + break;
  + }
  + }
  + if (i <= m->xmethods->nelts) {
  + xm = ap_push_array(m->xmethods);
  + xm->method = method;
  + xm->script = script;
  + }
  +}
   return NULL;
   }
   
  @@ -164,41 +201,66 @@
   
   /* Set allowed stuff */
   for (i = 0; i < METHODS; ++i) {
  -if (conf->scripted[i])
  -r->allowed |= (1 << i);
  + if (conf->scripted[i]) {
  + r->allowed |= (1 << i);
  + }
   }
   
   /* First, check for the method-handling scripts */
  

cvs commit: apache-1.3/htdocs/manual/mod mod_actions.html

1998-11-18 Thread rse
rse 98/11/18 01:15:27

  Modified:src  CHANGES
   htdocs/manual/mod mod_actions.html
  Log:
  Fix documentation of `Action' directive: It can activate a CGI script when
  either a handler or a MIME content type is triggered by the request. We forgot
  to mention the handler-based variant here.
  
  Submitted by: Andrew Pimlott <[EMAIL PROTECTED]>
  Reviewed by: Ralf S. Engelschall
  PR: 3340
  
  Revision  ChangesPath
  1.1148+4 -0  apache-1.3/src/CHANGES
  
  Index: CHANGES
  ===
  RCS file: /export/home/cvs/apache-1.3/src/CHANGES,v
  retrieving revision 1.1147
  retrieving revision 1.1148
  diff -u -r1.1147 -r1.1148
  --- CHANGES   1998/11/18 08:54:34 1.1147
  +++ CHANGES   1998/11/18 09:15:25 1.1148
  @@ -1,5 +1,9 @@
   Changes with Apache 1.3.4
   
  +  *) Fix documentation of `Action' directive: It can activate a CGI script
  + when either a handler or a MIME content type is triggered by the 
request.
  + [Andrew Pimlott <[EMAIL PROTECTED]>] PR#3340
  +
 *) Document the `add' command of `dbmmanage' in `dbmmanage.1' manpage.
[David MacKenzie <[EMAIL PROTECTED]>] PR#3394
   
  
  
  
  1.13  +5 -4  apache-1.3/htdocs/manual/mod/mod_actions.html
  
  Index: mod_actions.html
  ===
  RCS file: /export/home/cvs/apache-1.3/htdocs/manual/mod/mod_actions.html,v
  retrieving revision 1.12
  retrieving revision 1.13
  diff -u -r1.12 -r1.13
  --- mod_actions.html  1998/09/17 14:14:56 1.12
  +++ mod_actions.html  1998/11/18 09:15:27 1.13
  @@ -39,7 +39,7 @@
   Syntax: Action MIME-type cgi-script
  +>Syntax: Action action-type cgi-script
   
   
   This directive adds an action, which will activate cgi-script when
  -a file of content type MIME-type is requested. It sends the
  -URL and file path of the requested document using the standard
  -CGI PATH_INFO and PATH_TRANSLATED environment variables.
  +action-type is triggered by the request. The action-type 
can
  +be either a handler or a MIME content type.  It
  +sends the URL and file path of the requested document using the standard CGI
  +PATH_INFO and PATH_TRANSLATED environment variables.