You are viewing a plain text version of this content. The canonical link for it is here.
Posted to cvs@httpd.apache.org by tr...@apache.org on 2002/11/12 13:23:43 UTC

cvs commit: httpd-2.0/modules/generators mod_cgid.c

trawick     2002/11/12 04:23:43

  Modified:    modules/generators mod_cgid.c
  Log:
  watch out for the should-not-occur condition where the daemon can't
  find the script pid in the hash and returns zero...  if we send
  sigterm to pid zero, we knock out ourself
  
  change the cleanup to return any error from cleanup_nonchild_process()
  
  Revision  Changes    Path
  1.144     +7 -3      httpd-2.0/modules/generators/mod_cgid.c
  
  Index: mod_cgid.c
  ===================================================================
  RCS file: /home/cvs/httpd-2.0/modules/generators/mod_cgid.c,v
  retrieving revision 1.143
  retrieving revision 1.144
  diff -u -r1.143 -r1.144
  --- mod_cgid.c	11 Nov 2002 23:07:29 -0000	1.143
  +++ mod_cgid.c	12 Nov 2002 12:23:42 -0000	1.144
  @@ -1126,9 +1126,13 @@
       }
       close(sd);
   
  -    cleanup_nonchild_process(info->r, pid);
  -
  -    return APR_SUCCESS;
  +    if (pid == 0) {
  +        ap_log_rerror(APLOG_MARK, APLOG_ERR, 0, info->r,
  +                      "daemon couldn't find CGI process for connection %lu",
  +                      info->conn_id);
  +        return APR_EGENERAL;
  +    }
  +    return cleanup_nonchild_process(info->r, pid);
   }
   
   static int cgid_handler(request_rec *r)