The following reply was made to PR mod_cgi/1291; it has been noted by GNATS.
From: Marc Slemko <[EMAIL PROTECTED]>
To: Apache bugs database <[EMAIL PROTECTED]>
Cc: Subject: Re: mod_cgi/1291: CGI problems are reported as "Server problem -
contact the webmaster" (fwd)
Date: Mon, 27 Oct 1997 08:53:35 -0700 (MST)
This message is in MIME format. The first part should be readable text,
while the remaining parts are likely unreadable without MIME-aware tools.
Send mail to [EMAIL PROTECTED] for more info.
--===_0_Mon_Oct_27_14:58:42_GMT_1997
Content-Type: TEXT/PLAIN; CHARSET=us-ascii
Content-ID: <[EMAIL PROTECTED]>
---------- Forwarded message ----------
Date: Mon, 27 Oct 1997 14:59:29 +0000
From: Dave Shield <[EMAIL PROTECTED]>
To: [EMAIL PROTECTED]
Cc: [EMAIL PROTECTED], [EMAIL PROTECTED]
Subject: Re: mod_cgi/1291: CGI problems are reported as "Server problem -
contact the webmaster"
[I'll resend this, as the original seems to have got lost]
> Synopsis: CGI problems are reported as "Server problem - contact the
> webmaster"
>
> State-Changed-From-To: open-feedback
> State-Changed-By: coar
> State-Changed-When: Tue Oct 21 08:03:46 PDT 1997
> State-Changed-Why:
> As far as the external user is concerned, the problem is
> with a service the Web server is providing - so the
> error is appropriate.
This is an assumption that may not necessarily be correct in a particular
situation.
As far as the external user is concerned, something went wrong and they
need to be able to report it to the appropriate person - they don't really
care who. Ideally, this should be the person who actully maintains the CGI
script, who need not be the overall webmaster (otherwise the webmaster has
to determine who's responsible, and pass on the comment - all extra work).
With the apache server as distributed, it isn't possible to make this
distinction. The patch I offer (appended) allows this to be configured,
thus allowing this possibility if a particular site so chooses.
The other time this is useful is when a server is being used to teach
CGI programming. In this situation, the "external user" is likely to be
the person writing the script - in which case they do need to know that
the CGI went wrong, rather than a "real" server error.
This is the scenario that led to the development of this patch here.
The webmasters were getting a steady stream of "server problem" reports,
which all stemmed from minor CGI errors. By distinguishing these two cases,
we are able to provide a "CGI error" web page, which includes advice on
identifying and solving the problem.
> Please reply to this message with
> your patch ("diff -c", please) so we can take a look at it.
OK - appended below.
I believe that this (very simple) patch offers a useful additional
capability, without impacting in any significant way on those who do
not wish to use it.
Dave
--===_0_Mon_Oct_27_14:58:42_GMT_1997
Content-Type: TEXT/PLAIN; CHARSET=us-ascii
Content-ID: <[EMAIL PROTECTED]>
Content-Description: apache124.diff
*** http_protocol.c.cln Fri Aug 15 18:08:51 1997
--- http_protocol.c Tue Oct 21 15:24:50 1997
***************
*** 991,997 ****
"503 Service Temporarily Unavailable",
"504 Gateway Time-out",
"505 HTTP Version Not Supported",
! "506 Variant Also Varies"
};
/* The index is found by its offset from the x00 code of each level.
--- 991,998 ----
"503 Service Temporarily Unavailable",
"504 Gateway Time-out",
"505 HTTP Version Not Supported",
! "506 Variant Also Varies",
! "507 Internal CGI Error"
};
/* The index is found by its offset from the x00 code of each level.
*** httpd.h.cln Fri Aug 22 08:11:53 1997
--- httpd.h Tue Oct 21 15:25:57 1997
***************
*** 277,283 ****
/* ----------------------- HTTP Status Codes ------------------------- */
! #define RESPONSE_CODES 38
#define HTTP_CONTINUE 100
#define HTTP_SWITCHING_PROTOCOLS 101
--- 277,283 ----
/* ----------------------- HTTP Status Codes ------------------------- */
! #define RESPONSE_CODES 39
#define HTTP_CONTINUE 100
#define HTTP_SWITCHING_PROTOCOLS 101
***************
*** 317,322 ****
--- 317,323 ----
#define HTTP_GATEWAY_TIME_OUT 504
#define HTTP_VERSION_NOT_SUPPORTED 505
#define HTTP_VARIANT_ALSO_VARIES 506
+ #define HTTP_INTERNAL_CGI_ERROR 507
#define DOCUMENT_FOLLOWS HTTP_OK
#define PARTIAL_CONTENT HTTP_PARTIAL_CONTENT
***************
*** 336,341 ****
--- 337,343 ----
#define NOT_IMPLEMENTED HTTP_NOT_IMPLEMENTED
#define BAD_GATEWAY HTTP_BAD_GATEWAY
#define VARIANT_ALSO_VARIES HTTP_VARIANT_ALSO_VARIES
+ #define CGI_ERROR HTTP_INTERNAL_CGI_ERROR
#define is_HTTP_INFO(x) (((x) >= 100)&&((x) < 200))
#define is_HTTP_SUCCESS(x) (((x) >= 200)&&((x) < 300))
***************
*** 350,355 ****
--- 352,358 ----
((x) == HTTP_REQUEST_ENTITY_TOO_LARGE)
|| \
((x) == HTTP_REQUEST_URI_TOO_LARGE) || \
((x) == HTTP_INTERNAL_SERVER_ERROR) || \
+ ((x) == HTTP_INTERNAL_CGI_ERROR) || \
((x) == HTTP_SERVICE_UNAVAILABLE))
*** mod_cgi.c.cln Fri Jun 27 03:28:54 1997
--- mod_cgi.c Tue Oct 21 15:26:12 1997
***************
*** 422,428 ****
&script_err))) {
#endif
log_reason ("couldn't spawn child process", r->filename, r);
! return SERVER_ERROR;
}
/* Transfer any put/post args, CERN style...
--- 422,428 ----
&script_err))) {
#endif
log_reason ("couldn't spawn child process", r->filename, r);
! return CGI_ERROR;
}
/* Transfer any put/post args, CERN style...
*** util_script.c..cln Fri Jun 27 03:28:56 1997
--- util_script.c Tue Oct 21 15:26:24 1997
***************
*** 329,335 ****
if (fgets(w, MAX_STRING_LEN-1, f) == NULL) {
kill_timeout (r);
log_reason ("Premature end of script headers", r->filename, r);
! return SERVER_ERROR;
}
/* Delete terminal (CR?)LF */
--- 329,335 ----
if (fgets(w, MAX_STRING_LEN-1, f) == NULL) {
kill_timeout (r);
log_reason ("Premature end of script headers", r->filename, r);
! return CGI_ERROR;
}
/* Delete terminal (CR?)LF */
***************
*** 360,366 ****
kill_timeout (r);
log_reason (malformed, r->filename, r);
! return SERVER_ERROR;
}
*l++ = '\0';
--- 360,366 ----
kill_timeout (r);
log_reason (malformed, r->filename, r);
! return CGI_ERROR;
}
*l++ = '\0';
--===_0_Mon_Oct_27_14:58:42_GMT_1997--