Skip to content

Commit 32e185c

Browse files
rainerjungFelipe Zimmerle
authored andcommitted
When the input filter finishes, check whether we returned data during the last read and if not, delegate to the remaining filter chain.
Without that, ProcessPartial for the request body breaks forwarding of uploaded files using mod_proxy_ajp and mod_wl. See issue #2091.
1 parent 0d66361 commit 32e185c

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

apache2/apache2_io.c

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,7 @@ apr_status_t input_filter(ap_filter_t *f, apr_bucket_brigade *bb_out,
3636
msc_data_chunk *chunk = NULL;
3737
apr_bucket *bucket;
3838
apr_status_t rc;
39+
int no_data = 1;
3940
char *my_error_msg = NULL;
4041

4142
if (msr == NULL) {
@@ -110,6 +111,7 @@ apr_status_t input_filter(ap_filter_t *f, apr_bucket_brigade *bb_out,
110111

111112
if (bucket == NULL) return APR_EGENERAL;
112113
APR_BRIGADE_INSERT_TAIL(bb_out, bucket);
114+
no_data = 0;
113115

114116
if (msr->txcfg->debuglog_level >= 4) {
115117
msr_log(msr, 4, "Input filter: Forwarded %" APR_SIZE_T_FMT " bytes.", chunk->length);
@@ -130,6 +132,7 @@ apr_status_t input_filter(ap_filter_t *f, apr_bucket_brigade *bb_out,
130132

131133
if (bucket == NULL) return APR_EGENERAL;
132134
APR_BRIGADE_INSERT_TAIL(bb_out, bucket);
135+
no_data = 0;
133136

134137
if (msr->txcfg->debuglog_level >= 4) {
135138
msr_log(msr, 4, "Input stream filter: Forwarded %" APR_SIZE_T_FMT " bytes.", msr->stream_input_length);
@@ -145,6 +148,7 @@ apr_status_t input_filter(ap_filter_t *f, apr_bucket_brigade *bb_out,
145148
bucket = apr_bucket_eos_create(f->r->connection->bucket_alloc);
146149
if (bucket == NULL) return APR_EGENERAL;
147150
APR_BRIGADE_INSERT_TAIL(bb_out, bucket);
151+
no_data = 0;
148152

149153
if (msr->txcfg->debuglog_level >= 4) {
150154
msr_log(msr, 4, "Input filter: Sent EOS.");
@@ -158,6 +162,10 @@ apr_status_t input_filter(ap_filter_t *f, apr_bucket_brigade *bb_out,
158162
if (msr->txcfg->debuglog_level >= 4) {
159163
msr_log(msr, 4, "Input filter: Input forwarding complete.");
160164
}
165+
166+
if (no_data) {
167+
return ap_get_brigade(f->next, bb_out, mode, block, nbytes);
168+
}
161169
}
162170

163171
return APR_SUCCESS;

0 commit comments

Comments
 (0)