From 15d1ab7b230cae962f39e98849328c76eae456ff Mon Sep 17 00:00:00 2001 From: interp Date: Sun, 14 Apr 2002 16:57:38 +0000 Subject: [PATCH] * Changed calls to HTTP-LOG to calls to HTTP-SYSLOG (spec of httpd changed) * Corrected test for NPH- scripts (prefix) (formerly -NPH scripts (suffix)) according to the CGI/1.1 spec. --- cgi-server.scm | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/cgi-server.scm b/cgi-server.scm index 12bf638..1a49a32 100644 --- a/cgi-server.scm +++ b/cgi-server.scm @@ -71,7 +71,7 @@ ;;; - If the script begins with "nph-" its output is the entire reply. ;;; Otherwise, it replies to the server, we peel off a little header ;;; that is used to construct the real header for the reply. -;;; See the "spec" for further details. +;;; See the "spec" for further details. (URL above). ;;; ;;; The "spec" also talks about PUT, but when I tried this on a dummy script, ;;; the NSCA httpd server generated buggy output. So I am only implementing @@ -96,7 +96,8 @@ (http-error http-reply/bad-request req (format #f "CGI scripts may not contain \"..\" elements.")))) - (nph? (string-suffix? "-nph" prog)) ; PROG end in "-nph" ? + (nph? (string-prefix? "nph-" prog)) ; PROG starts with "nph-" ? + ; why did we had (string-suffix? "-nph" prog) here? (search (http-url:search (request:url req))) ; Compute the (argv (if (and search (not (string-index search #\=))) ; argv list. @@ -110,7 +111,7 @@ (dup->outport (current-output-port) 1) (apply exec/env filename env argv)))) - (http-log "search: ~s, argv: ~s~%" search argv) + (http-syslog (syslog-level debug) "[cgi-server] search: ~s, argv: ~s~%" search argv) (let ((request-method (request:method req))) (cond ((or (string=? request-method "GET") @@ -256,7 +257,7 @@ "CGI script generated multi-line status header"))))) (out (current-output-port))) - (http-log "headers: ~s~%" headers) + (http-syslog (syslog-level debug) "[cgi-server] headers: ~s~%" headers) ;; Send the reply header back to the client ;; (unless it's a headerless HTTP 0.9 reply). (if (not (v0.9-request? req)) @@ -266,7 +267,7 @@ (if loc (format out "Location: ~a\r~%" loc)) (write-crlf out))) - (http-log "request:method=~a~%" (request:method req)) + (http-syslog (syslog-level debug) "[cgi-server] request:method=~a~%" (request:method req)) ;; Copy the reply body back to the client and close the script port ;; (unless it's a bodiless HEAD transaction). (if (not (string=? (request:method req) "HEAD"))