Skip to content

Commit 564a161

Browse files
committed
Revert "Merge branch 'bugfix_timeout_61471' of https://github.com/axot/php-src into PHP-7.0"
This reverts commit a8931df, reversing changes made to f2f35a2. (cherry picked from commit 57736cc)
1 parent 20d9ebc commit 564a161

File tree

1 file changed

+1
-44
lines changed

1 file changed

+1
-44
lines changed

Diff for: sapi/apache2handler/sapi_apache2.c

+1-44
Original file line numberDiff line numberDiff line change
@@ -69,33 +69,6 @@ char *apache2_php_ini_path_override = NULL;
6969
ZEND_TSRMLS_CACHE_DEFINE()
7070
#endif
7171

72-
/* if apache's version is newer than 2.2.31 or 2.4.16 */
73-
#if MODULE_MAGIC_COOKIE == 0x41503232UL && AP_MODULE_MAGIC_AT_LEAST(20051115,40) || \
74-
MODULE_MAGIC_COOKIE == 0x41503234UL && AP_MODULE_MAGIC_AT_LEAST(20120211,47)
75-
#define php_ap_map_http_request_error ap_map_http_request_error
76-
#else
77-
static int php_ap_map_http_request_error(apr_status_t rv, int status)
78-
{
79-
switch (rv) {
80-
case AP_FILTER_ERROR: {
81-
return AP_FILTER_ERROR;
82-
}
83-
case APR_ENOSPC: {
84-
return HTTP_REQUEST_ENTITY_TOO_LARGE;
85-
}
86-
case APR_ENOTIMPL: {
87-
return HTTP_NOT_IMPLEMENTED;
88-
}
89-
case APR_ETIMEDOUT: {
90-
return HTTP_REQUEST_TIME_OUT;
91-
}
92-
default: {
93-
return status;
94-
}
95-
}
96-
}
97-
#endif
98-
9972
static size_t
10073
php_apache_sapi_ub_write(const char *str, size_t str_length)
10174
{
@@ -211,7 +184,6 @@ php_apache_sapi_read_post(char *buf, size_t count_bytes)
211184
php_struct *ctx = SG(server_context);
212185
request_rec *r;
213186
apr_bucket_brigade *brigade;
214-
apr_status_t ret;
215187

216188
r = ctx->r;
217189
brigade = ctx->brigade;
@@ -223,7 +195,7 @@ php_apache_sapi_read_post(char *buf, size_t count_bytes)
223195
* need to make sure that if data is available we fill the buffer completely.
224196
*/
225197

226-
while ((ret=ap_get_brigade(r->input_filters, brigade, AP_MODE_READBYTES, APR_BLOCK_READ, len)) == APR_SUCCESS) {
198+
while (ap_get_brigade(r->input_filters, brigade, AP_MODE_READBYTES, APR_BLOCK_READ, len) == APR_SUCCESS) {
227199
apr_brigade_flatten(brigade, buf, &len);
228200
apr_brigade_cleanup(brigade);
229201
tlen += len;
@@ -234,14 +206,6 @@ php_apache_sapi_read_post(char *buf, size_t count_bytes)
234206
len = count_bytes - tlen;
235207
}
236208

237-
if (ret != APR_SUCCESS) {
238-
if (APR_STATUS_IS_TIMEUP(ret)) {
239-
SG(sapi_headers).http_response_code = php_ap_map_http_request_error(ret, HTTP_REQUEST_TIME_OUT);
240-
} else {
241-
SG(sapi_headers).http_response_code = php_ap_map_http_request_error(ret, HTTP_BAD_REQUEST);
242-
}
243-
}
244-
245209
return tlen;
246210
}
247211

@@ -692,13 +656,6 @@ zend_first_try {
692656
brigade = ctx->brigade;
693657
}
694658

695-
if (SG(request_info).content_length > SG(read_post_bytes)) {
696-
ap_log_rerror(APLOG_MARK, APLOG_ERR, 0, r, "Error while attempting to read POST data: %d", SG(sapi_headers).http_response_code);
697-
apr_brigade_cleanup(brigade);
698-
PHPAP_INI_OFF;
699-
return SG(sapi_headers).http_response_code;
700-
}
701-
702659
if (AP2(last_modified)) {
703660
ap_update_mtime(r, r->finfo.mtime);
704661
ap_set_last_modified(r);

0 commit comments

Comments
 (0)