@@ -85,10 +85,11 @@ apr_status_t input_filter(ap_filter_t *f, apr_bucket_brigade *bb_out,
85
85
return APR_EGENERAL ;
86
86
}
87
87
88
- if (chunk && (!msr -> txcfg -> stream_inbody_inspection || (msr -> txcfg -> stream_inbody_inspection && msr -> if_stream_changed == 0 ))) {
89
- /* Copy the data we received in the chunk */
90
- bucket = apr_bucket_heap_create (chunk -> data , chunk -> length , NULL ,
91
- f -> r -> connection -> bucket_alloc );
88
+ if (chunk -> length > 0 ) {
89
+ if (chunk && (!msr -> txcfg -> stream_inbody_inspection || (msr -> txcfg -> stream_inbody_inspection && msr -> if_stream_changed == 0 ))) {
90
+ /* Copy the data we received in the chunk */
91
+ bucket = apr_bucket_heap_create (chunk -> data , chunk -> length , NULL ,
92
+ f -> r -> connection -> bucket_alloc );
92
93
93
94
#if 0
94
95
@@ -107,33 +108,34 @@ apr_status_t input_filter(ap_filter_t *f, apr_bucket_brigade *bb_out,
107
108
108
109
#endif
109
110
110
- if (bucket == NULL ) return APR_EGENERAL ;
111
- APR_BRIGADE_INSERT_TAIL (bb_out , bucket );
111
+ if (bucket == NULL ) return APR_EGENERAL ;
112
+ APR_BRIGADE_INSERT_TAIL (bb_out , bucket );
112
113
113
- if (msr -> txcfg -> debuglog_level >= 4 ) {
114
- msr_log (msr , 4 , "Input filter: Forwarded %" APR_SIZE_T_FMT " bytes." , chunk -> length );
115
- }
116
- } else if (msr -> stream_input_data != NULL ) {
114
+ if (msr -> txcfg -> debuglog_level >= 4 ) {
115
+ msr_log (msr , 4 , "Input filter: Forwarded %" APR_SIZE_T_FMT " bytes." , chunk -> length );
116
+ }
117
+ } else if (msr -> stream_input_data != NULL ) {
117
118
118
- msr -> if_stream_changed = 0 ;
119
+ msr -> if_stream_changed = 0 ;
119
120
120
- bucket = apr_bucket_heap_create (msr -> stream_input_data , msr -> stream_input_length , NULL ,
121
- f -> r -> connection -> bucket_alloc );
121
+ bucket = apr_bucket_heap_create (msr -> stream_input_data , msr -> stream_input_length , NULL ,
122
+ f -> r -> connection -> bucket_alloc );
122
123
123
- if (msr -> txcfg -> stream_inbody_inspection ) {
124
- if (msr -> stream_input_data != NULL ) {
125
- free (msr -> stream_input_data );
126
- msr -> stream_input_data = NULL ;
124
+ if (msr -> txcfg -> stream_inbody_inspection ) {
125
+ if (msr -> stream_input_data != NULL ) {
126
+ free (msr -> stream_input_data );
127
+ msr -> stream_input_data = NULL ;
128
+ }
127
129
}
128
- }
129
130
130
- if (bucket == NULL ) return APR_EGENERAL ;
131
- APR_BRIGADE_INSERT_TAIL (bb_out , bucket );
131
+ if (bucket == NULL ) return APR_EGENERAL ;
132
+ APR_BRIGADE_INSERT_TAIL (bb_out , bucket );
132
133
133
- if (msr -> txcfg -> debuglog_level >= 4 ) {
134
- msr_log (msr , 4 , "Input stream filter: Forwarded %" APR_SIZE_T_FMT " bytes." , msr -> stream_input_length );
135
- }
134
+ if (msr -> txcfg -> debuglog_level >= 4 ) {
135
+ msr_log (msr , 4 , "Input stream filter: Forwarded %" APR_SIZE_T_FMT " bytes." , msr -> stream_input_length );
136
+ }
136
137
138
+ }
137
139
}
138
140
139
141
if (rc == 0 ) {
0 commit comments