more bug fixes for apache-fastcgi-2.0b1

Sonya Rikhtverchik (rikhtver@OpenMarket.com)
Wed, 20 Aug 1997 10:13:10 -0400

Message-Id: <199708201413.KAA03341@u4-138.openmarket.com>
To: fastcgi-developers@OpenMarket.com
Subject: more bug fixes for apache-fastcgi-2.0b1 
Date: Wed, 20 Aug 1997 10:13:10 -0400
From: Sonya Rikhtverchik <rikhtver@OpenMarket.com>

Date: Wed, 20 Aug 1997 09:46:21 -0400 (EDT)
Message-Id: <JAA04449.199708201346@catapult.va.pubnix.com>
From: "David J. MacKenzie" <djm@va.pubnix.com>
To: fastcgi-developers@openmarket.com
cc: djm@va.pubnix.com
Subject: more bug fixes for apache-fastcgi-2.0b1 
X-Quote: 
   I got a new shadow. I had to get rid of the other one -- it wasn't
   doing what I was doing. -- Stephen Wright

Some of the documentation is garbled or incomplete.  And when a
FastCGI application can't be execl'd, the code uses a value of errno
that may have been stomped on by intervening system calls.  That
happens on BSD/OS 2.1, where the error_log was reporting errno=25
(NOTTY) instead of the correct errno=13 (EACCES).  An intervening
stdio call was setting errno as a side-effect, which it has the right
to do.

- --- ./mod_fastcgi.html	1997/04/30 17:50:55	1.1
+++ ./mod_fastcgi.html	1997/08/20 05:24:52
@@ -346,7 +346,8 @@
 
   <li>
     <B>minProcesses:</B> a minimum number of the dynamic FastCGI
- -    applications that are running on the system at any one time.  This
+    applications that can be running on the system at any one time
+    without being killed off by the process manager.  This
     value is used in the implementation of the killing policy for dynamic
     fastcgi applications and is used to reduce the response time during
     the spike of requests to FastCGI applications.  The default value for 
@@ -378,10 +379,10 @@
     300 seconds.<p>
 
   <li>
- -    <B>gainValue:</B> a floating point value between 0 and 1 that is in 
- -    computation of the load factor of the currently running dynamic FastCGI
- -    application.full pathname of a file that will be used by the web
- -    server to send messages to the fastcgi process manager.  The default
+    <B>gainValue:</B> a floating point value between 0 and 1 that is
+    used as an exponent in the computation of the exponentially decayed
+    load factor of the currently running dynamic FastCGI
+    application.  The default
     value for this attribute is 0.5.<p>
 
   <li>
@@ -535,7 +536,7 @@
     See the <a href="README"><code>README</code></a> file for a complete
     list of known bugs in this version of <code>mod_fastcgi</code>.<p>
 
- -</ul>
+</ol>
 
 
 <h2>Notes on CGI response headers</h2>
- --- ./src/mod_fastcgi.c	1997/08/20 05:26:27	1.1
+++ ./src/mod_fastcgi.c	1997/08/20 05:26:43
@@ -1110,6 +1110,12 @@
     DString dirName;
     char *dnEnd, *failedSysCall;
     FILE *errorLogFile;
+    int save_errno;
 
     /*
      * Fork the fcgi process.
@@ -1167,15 +1173,16 @@
     } while(errno == EINTR);
 
 ErrorExit:
+    save_errno = errno;
     /*
      * We had to close all files but the FCGI listener socket in order to
      * exec the application.  So if we want to report exec errors (we do!)
@@ -1188,7 +1195,7 @@
             get_time(), programName, getpid(), failedSysCall,
             strerror(errno));
     fflush(errorLogFile);
- -    exit(errno);
+    exit(save_errno);
 }
 
 /*
@@ -2162,6 +2169,7 @@
 	    return "Unable to create \"dynamic\" subdirectory";
 	}
     }
+    chown(ipcDynamicDir, uid, gid);
 DoMbox:
     /* delete everything in the directory */
     dpentry = Malloc(strlen(ipcDynamicDir)+255);
@@ -2187,6 +2195,7 @@
         return
             "Unable to create mbox file in dynamic subdirectory";
     }
+    fchown(fd, uid, gid);
     close(fd);
     return NULL;
 }

------- End of Forwarded Message