callscgi: Log exec errors.
[ashd.git] / src / callscgi.c
index 86abb5b..6adccc5 100644 (file)
@@ -194,6 +194,7 @@ static void startlisten(void)
        for(i = 3; i < FD_SETSIZE; i++)
            close(i);
        execvp(*progspec, progspec);
+       flog(LOG_ERR, "callscgi: %s: %s", *progspec, strerror(errno));
        exit(127);
     }
     close(fd);
@@ -217,6 +218,7 @@ static void startnolisten(void)
        dup2(fd, 0);
        close(fd);
        execvp(*progspec, progspec);
+       flog(LOG_ERR, "callscgi: %s: %s", *progspec, strerror(errno));
        exit(127);
     }
 }
@@ -430,7 +432,7 @@ static void mkcgienv(struct hthead *req, struct charbuf *dst)
        bufaddenv(dst, "SERVER_NAME", "%s", h);
     if((h = getheader(req, "X-Ash-Server-Port")) != NULL)
        bufaddenv(dst, "SERVER_PORT", "%s", h);
-    if(((h = getheader(req, "X-Ash-Server-Protocol")) != NULL) && !strcmp(h, "https"))
+    if(((h = getheader(req, "X-Ash-Protocol")) != NULL) && !strcmp(h, "https"))
        bufaddenv(dst, "HTTPS", "on");
     if((h = getheader(req, "X-Ash-Address")) != NULL)
        bufaddenv(dst, "REMOTE_ADDR", "%s", h);