Skip to content

Commit 265b8cc

Browse files
committed
Merge branch 'PHP-7.1'
* PHP-7.1: Revert "Merge branch 'bugfix_timeout_61471' of https://github.com/axot/php-src into PHP-7.0"
2 parents c1b0bae + 34c1040 commit 265b8cc

File tree

1 file changed

+1
-44
lines changed

1 file changed

+1
-44
lines changed

sapi/apache2handler/sapi_apache2.c

Lines changed: 1 addition & 44 deletions
Original file line numberDiff line numberDiff line change
@@ -65,33 +65,6 @@ char *apache2_php_ini_path_override = NULL;
6565
ZEND_TSRMLS_CACHE_DEFINE()
6666
#endif
6767

68-
/* if apache's version is newer than 2.2.31 or 2.4.16 */
69-
#if MODULE_MAGIC_COOKIE == 0x41503232UL && AP_MODULE_MAGIC_AT_LEAST(20051115,40) || \
70-
MODULE_MAGIC_COOKIE == 0x41503234UL && AP_MODULE_MAGIC_AT_LEAST(20120211,47)
71-
#define php_ap_map_http_request_error ap_map_http_request_error
72-
#else
73-
static int php_ap_map_http_request_error(apr_status_t rv, int status)
74-
{
75-
switch (rv) {
76-
case AP_FILTER_ERROR: {
77-
return AP_FILTER_ERROR;
78-
}
79-
case APR_ENOSPC: {
80-
return HTTP_REQUEST_ENTITY_TOO_LARGE;
81-
}
82-
case APR_ENOTIMPL: {
83-
return HTTP_NOT_IMPLEMENTED;
84-
}
85-
case APR_ETIMEDOUT: {
86-
return HTTP_REQUEST_TIME_OUT;
87-
}
88-
default: {
89-
return status;
90-
}
91-
}
92-
}
93-
#endif
94-
9568
static size_t
9669
php_apache_sapi_ub_write(const char *str, size_t str_length)
9770
{
@@ -207,7 +180,6 @@ php_apache_sapi_read_post(char *buf, size_t count_bytes)
207180
php_struct *ctx = SG(server_context);
208181
request_rec *r;
209182
apr_bucket_brigade *brigade;
210-
apr_status_t ret;
211183

212184
r = ctx->r;
213185
brigade = ctx->brigade;
@@ -219,7 +191,7 @@ php_apache_sapi_read_post(char *buf, size_t count_bytes)
219191
* need to make sure that if data is available we fill the buffer completely.
220192
*/
221193

222-
while ((ret=ap_get_brigade(r->input_filters, brigade, AP_MODE_READBYTES, APR_BLOCK_READ, len)) == APR_SUCCESS) {
194+
while (ap_get_brigade(r->input_filters, brigade, AP_MODE_READBYTES, APR_BLOCK_READ, len) == APR_SUCCESS) {
223195
apr_brigade_flatten(brigade, buf, &len);
224196
apr_brigade_cleanup(brigade);
225197
tlen += len;
@@ -230,14 +202,6 @@ php_apache_sapi_read_post(char *buf, size_t count_bytes)
230202
len = count_bytes - tlen;
231203
}
232204

233-
if (ret != APR_SUCCESS) {
234-
if (APR_STATUS_IS_TIMEUP(ret)) {
235-
SG(sapi_headers).http_response_code = php_ap_map_http_request_error(ret, HTTP_REQUEST_TIME_OUT);
236-
} else {
237-
SG(sapi_headers).http_response_code = php_ap_map_http_request_error(ret, HTTP_BAD_REQUEST);
238-
}
239-
}
240-
241205
return tlen;
242206
}
243207

@@ -715,13 +679,6 @@ zend_first_try {
715679
brigade = ctx->brigade;
716680
}
717681

718-
if (SG(request_info).content_length > SG(read_post_bytes)) {
719-
ap_log_rerror(APLOG_MARK, APLOG_ERR, 0, r, "Error while attempting to read POST data: %d", SG(sapi_headers).http_response_code);
720-
apr_brigade_cleanup(brigade);
721-
PHPAP_INI_OFF;
722-
return SG(sapi_headers).http_response_code;
723-
}
724-
725682
if (AP2(last_modified)) {
726683
ap_update_mtime(r, r->finfo.mtime);
727684
ap_set_last_modified(r);

0 commit comments

Comments
 (0)