You are viewing a plain text version of this content. The canonical link for it is here.
Posted to cvs@httpd.apache.org by bn...@apache.org on 2003/12/04 22:30:09 UTC

cvs commit: httpd-2.0/modules/arch/netware mod_netware.c

bnicholes    2003/12/04 13:30:09

  Modified:    modules/arch/netware 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
  1.11      +22 -17    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.10
  retrieving revision 1.11
  diff -u -r1.10 -r1.11
  --- mod_netware.c	3 Sep 2003 19:27:01 -0000	1.10
  +++ mod_netware.c	4 Dec 2003 21:30:09 -0000	1.11
  @@ -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;
   }
   
  @@ -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 }
   };