-*- coding: utf-8 -*-
Changes with Apache 2.2.12
+ *) CGI: return 504 (Gateway timeout) rather than 500 when a script
+ times out before returning status line/headers.
+ PR 42190 [Nick Kew]
+
*) prefork: Log an error instead of segfaulting when child startup fails
due to pollset creation failures. PR 46467. [Jeff Trawick]
trunk works
+1 covener, niq, rpluem
- * util_script (CGI): return 504 (Gateway timeout) rather than 500
- when a script times out before returning status line/headers.
- PR 42190
- http://svn.apache.org/viewvc?view=rev&revision=729586
- http://svn.apache.org/viewvc?view=rev&revision=732504
- +1: niq, rpluem, jim
-
PATCHES PROPOSED TO BACKPORT FROM TRUNK:
[ New proposals should be added at the end of the list ]
"request due to maintenance downtime or capacity\n"
"problems. Please try again later.</p>\n");
case HTTP_GATEWAY_TIME_OUT:
- return("<p>The proxy server did not receive a timely response\n"
- "from the upstream server.</p>\n");
+ return("<p>The gateway did not receive a timely response\n"
+ "from the upstream server or application.</p>\n");
case HTTP_NOT_EXTENDED:
return("<p>A mandatory extension policy in the request is not\n"
"accepted by the server for this resource.</p>\n");
while (1) {
- if ((*getsfunc) (w, MAX_STRING_LEN - 1, getsfunc_data) == 0) {
+ int rv = (*getsfunc) (w, MAX_STRING_LEN - 1, getsfunc_data);
+ if (rv == 0) {
ap_log_rerror(APLOG_MARK, APLOG_ERR|APLOG_TOCLIENT, 0, r,
"Premature end of script headers: %s",
apr_filepath_name_get(r->filename));
return HTTP_INTERNAL_SERVER_ERROR;
}
+ else if (rv == -1) {
+ ap_log_rerror(APLOG_MARK, APLOG_ERR|APLOG_TOCLIENT, 0, r,
+ "Script timed out before returning headers: %s",
+ apr_filepath_name_get(r->filename));
+ return HTTP_GATEWAY_TIME_OUT;
+ }
/* Delete terminal (CR?)LF */
rv = apr_bucket_read(e, &bucket_data, &bucket_data_len,
APR_BLOCK_READ);
if (rv != APR_SUCCESS || (bucket_data_len == 0)) {
- return 0;
+ return APR_STATUS_IS_TIMEUP(rv) ? -1 : 0;
}
src = bucket_data;
src_end = bucket_data + bucket_data_len;