httpd-cvs mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From bnicho...@apache.org
Subject cvs commit: httpd-2.0/modules/arch/netware mod_netware.c
Date Thu, 04 Dec 2003 21:31:22 GMT
bnicholes    2003/12/04 13:31:22

  Modified:    modules/arch/netware Tag: APACHE_2_0_BRANCH mod_netware.c
  Log:
  Allow for binary CGI's to have file extensions other than .NLM
  
  Submitted by: GŁnter Knauf <gk@gknw.de>
  
  Revision  Changes    Path
  No                   revision
  No                   revision
  1.5.2.5   +23 -18    httpd-2.0/modules/arch/netware/mod_netware.c
  
  Index: mod_netware.c
  ===================================================================
  RCS file: /home/cvs/httpd-2.0/modules/arch/netware/mod_netware.c,v
  retrieving revision 1.5.2.4
  retrieving revision 1.5.2.5
  diff -u -r1.5.2.4 -r1.5.2.5
  --- mod_netware.c	12 Feb 2003 22:52:16 -0000	1.5.2.4
  +++ mod_netware.c	4 Dec 2003 21:31:22 -0000	1.5.2.5
  @@ -93,6 +93,8 @@
       new->file_handler_mode = apr_table_make(p, 10);
       new->extra_env_vars = apr_table_make(p, 10);
   
  +    apr_table_set(new->file_type_handlers, "NLM", "OS");
  +
       return new;
   }
   
  @@ -170,7 +172,7 @@
       *ptr = '\0';
   
       /* Figure out what the extension is so that we can matche it. */
  -    ext = strrchr(apr_filename_of_pathname(cmd_only), '.');
  +    ext = strrchr(apr_filepath_name_get(cmd_only), '.');
   
       /* If there isn't an extension then give it an empty string */
       if (!ext) {
  @@ -181,16 +183,18 @@
       if (*ext == '.')
           ++ext;
   
  -    /* If it is an NLM then just execute it. */
  -    if (stricmp(ext, "nlm")) {
  -        /* check if we have a registered command for the extension*/
  -        *cmd = apr_table_get(d->file_type_handlers, ext);
  -        if (*cmd == NULL) {
  -            ap_log_rerror(APLOG_MARK, APLOG_ERR, 0, r,
  -                      "Could not find a command associated with the %s extension", ext);
  -            return APR_EBADF;
  -        }
  -
  +    /* check if we have a registered command for the extension*/
  +    *cmd = apr_table_get(d->file_type_handlers, ext);
  +    if (*cmd == NULL) {
  +        ap_log_rerror(APLOG_MARK, APLOG_ERR, 0, r,
  +                  "Could not find a command associated with the %s extension", ext);
  +        return APR_EBADF;
  +    }
  +    if (!stricmp(*cmd, "OS")) {
  +        /* If it is an NLM then restore *cmd and just execute it */
  +        *cmd = cmd_only;
  +    }
  +    else {
           /* If we have a registered command then add the file that was passed in as a
             parameter to the registered command. */
           *cmd = apr_pstrcat (p, *cmd, " ", cmd_only, NULL);
  @@ -198,11 +202,11 @@
           /* Run in its own address space if specified */
           detached = apr_table_get(d->file_handler_mode, ext);
           if (detached) {
  -		    e_info->cmd_type = APR_PROGRAM_ENV;
  +            e_info->cmd_type = APR_PROGRAM_ENV;
  +        }
  +        else {
  +            e_info->cmd_type = APR_PROGRAM;
           }
  -		else {
  -		    e_info->cmd_type = APR_PROGRAM;
  -		}
       }
   
       /* Tokenize the full command string into its arguments */
  @@ -222,9 +226,10 @@
   
   static const command_rec netware_cmds[] = {
   AP_INIT_TAKE23("CGIMapExtension", set_extension_map, NULL, OR_FILEINFO, 
  -              "Full path to the CGI NLM module followed by a file extension. "
  -              "The optional parameter \"detach\" can be specified if the NLM should "
  -              "be launched in its own address space."),
  +              "Full path to the CGI NLM module followed by a file extension. If the "
  +              "first parameter is set to \"OS\" then the following file extension is "
  +              "treated as NLM. The optional parameter \"detach\" can be specified if "
  +              "the NLM should be launched in its own address space."),
   { NULL }
   };
   
  
  
  

Mime
View raw message