Skip to content

Commit ef8632c

Browse files
committed
Revert "Fixed bug #61471"
This reverts commit 80c8d84.
1 parent ddad991 commit ef8632c

File tree

2 files changed

+1
-47
lines changed

2 files changed

+1
-47
lines changed

sapi/apache2handler/php_apache.h

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,6 @@ typedef struct {
7373
zend_bool engine;
7474
zend_bool xbithack;
7575
zend_bool last_modified;
76-
zend_bool post_read_error;
7776
} php_apache2_info_struct;
7877

7978
extern zend_module_entry apache2_module_entry;

sapi/apache2handler/sapi_apache2.c

Lines changed: 1 addition & 46 deletions
Original file line numberDiff line numberDiff line change
@@ -63,33 +63,6 @@
6363
#define PHP_SOURCE_MAGIC_TYPE "application/x-httpd-php-source"
6464
#define PHP_SCRIPT "php7-script"
6565

66-
/* if apache's version is newer than 2.2.31 or 2.4.16 */
67-
#if MODULE_MAGIC_COOKIE == 0x41503232UL && AP_MODULE_MAGIC_AT_LEAST(20051115,40) || \
68-
MODULE_MAGIC_COOKIE == 0x41503234UL && AP_MODULE_MAGIC_AT_LEAST(20120211,47)
69-
#define php_ap_map_http_request_error ap_map_http_request_error
70-
#else
71-
static int php_ap_map_http_request_error(apr_status_t rv, int status)
72-
{
73-
switch (rv) {
74-
case AP_FILTER_ERROR: {
75-
return AP_FILTER_ERROR;
76-
}
77-
case APR_ENOSPC: {
78-
return HTTP_REQUEST_ENTITY_TOO_LARGE;
79-
}
80-
case APR_ENOTIMPL: {
81-
return HTTP_NOT_IMPLEMENTED;
82-
}
83-
case APR_ETIMEDOUT: {
84-
return HTTP_REQUEST_TIME_OUT;
85-
}
86-
default: {
87-
return status;
88-
}
89-
}
90-
}
91-
#endif
92-
9366
/* A way to specify the location of the php.ini dir in an apache directive */
9467
char *apache2_php_ini_path_override = NULL;
9568
#if defined(PHP_WIN32) && defined(ZTS)
@@ -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,15 +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-
AP2(post_read_error) = 1;
239-
if (APR_STATUS_IS_TIMEUP(ret)) {
240-
SG(sapi_headers).http_response_code = php_ap_map_http_request_error(ret, HTTP_REQUEST_TIME_OUT);
241-
} else {
242-
SG(sapi_headers).http_response_code = php_ap_map_http_request_error(ret, HTTP_BAD_REQUEST);
243-
}
244-
}
245-
246209
return tlen;
247210
}
248211

@@ -524,7 +487,6 @@ static int php_apache_request_ctor(request_rec *r, php_struct *ctx)
524487
SG(request_info).proto_num = r->proto_num;
525488
SG(request_info).request_uri = apr_pstrdup(r->pool, r->uri);
526489
SG(request_info).path_translated = apr_pstrdup(r->pool, r->filename);
527-
AP2(post_read_error) = 0;
528490
r->no_local_copy = 1;
529491

530492
content_length = (char *) apr_table_get(r->headers_in, "Content-Length");
@@ -694,13 +656,6 @@ zend_first_try {
694656
brigade = ctx->brigade;
695657
}
696658

697-
if (AP2(post_read_error)) {
698-
ap_log_rerror(APLOG_MARK, APLOG_ERR, 0, r, "Error while attempting to read POST data: %d", SG(sapi_headers).http_response_code);
699-
apr_brigade_cleanup(brigade);
700-
PHPAP_INI_OFF;
701-
return SG(sapi_headers).http_response_code;
702-
}
703-
704659
if (AP2(last_modified)) {
705660
ap_update_mtime(r, r->finfo.mtime);
706661
ap_set_last_modified(r);

0 commit comments

Comments
 (0)