mturk       2003/10/04 04:43:14

  Modified:    jk/native/apache-2.0 mod_jk.c
  Log:
  Let the open_log retuns int instead calling exit(1),
  so we can return INTERNL_SERVER_ERROR, instead
  getting into endles child create/exit loop.
  
  Revision  Changes    Path
  1.88      +13 -11    jakarta-tomcat-connectors/jk/native/apache-2.0/mod_jk.c
  
  Index: mod_jk.c
  ===================================================================
  RCS file: /home/cvs/jakarta-tomcat-connectors/jk/native/apache-2.0/mod_jk.c,v
  retrieving revision 1.87
  retrieving revision 1.88
  diff -u -r1.87 -r1.88
  --- mod_jk.c  4 Oct 2003 09:26:00 -0000       1.87
  +++ mod_jk.c  4 Oct 2003 11:43:14 -0000       1.88
  @@ -2092,7 +2092,7 @@
       return APR_SUCCESS;
   }
   
  -static void open_jklog(server_rec *s, apr_pool_t *p)
  +static int open_jklog(server_rec *s, apr_pool_t *p)
   {
       jk_server_conf_t *conf;
       const char *fname;
  @@ -2107,13 +2107,13 @@
   
       if (main_log != NULL) {
           conf->log = main_log;
  -        return;
  +        return 0;
       }
       if (conf->log_file == NULL) {
  -        return;
  +        return 0;
       }
       if (*(conf->log_file) == '\0') {
  -        return;
  +        return 0;
       }
   
       if (*conf->log_file == '|') {
  @@ -2121,17 +2121,17 @@
               ap_log_error(APLOG_MARK, APLOG_ERR, 0, s,
                            "mod_jk: could not open reliable pipe "
                            "to jk log %s", conf->log_file+1);
  -            exit(1);
  +            return -1;
           }
           conf->jklogfp = (void *)ap_piped_log_write_fd(pl);
       }
  -    else if (*conf->log_file != '\0') {
  +    else {
           fname = ap_server_root_relative(p, conf->log_file);
           if (!fname) {
               ap_log_error(APLOG_MARK, APLOG_ERR, APR_EBADPATH, s,
                            "mod_jk: Invalid JkLog "
                            "path %s", conf->log_file);
  -            exit(1);
  +            return -1;
           }
           if ((rc = apr_file_open(&conf->jklogfp, fname,
                                   jklog_flags, jklog_mode, p))
  @@ -2139,7 +2139,7 @@
               ap_log_error(APLOG_MARK, APLOG_ERR, rc, s,
                            "mod_jk: could not open JkLog "
                            "file %s", fname);
  -            exit(1);
  +            return -1;
           }
           apr_file_inherit_set(conf->jklogfp);
       }
  @@ -2154,10 +2154,10 @@
           if (main_log == NULL)
               main_log = conf->log;
           apr_pool_cleanup_register(p, main_log, jklog_cleanup, jklog_cleanup);
  -        return;
  +        return 0;
       }
   
  -    exit(1);
  +    return -1;
   }
   
   
  @@ -2248,7 +2248,9 @@
        * - open each jk logfile
        */    
       for (; s; s = s->next) {
  -        open_jklog(s, pconf);
  +        if (open_jklog(s, pconf))
  +            return HTTP_INTERNAL_SERVER_ERROR;
  +
       }
   
       return OK;
  
  
  

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to