Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commitb8636a7

Browse files
gravagliFelipe Zimmerle
authored and
Felipe Zimmerle
committed
added "empy chunk" check
1 parent9c51671 commitb8636a7

File tree

1 file changed

+25
-23
lines changed

1 file changed

+25
-23
lines changed

‎apache2/apache2_io.c‎

Lines changed: 25 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -85,10 +85,11 @@ apr_status_t input_filter(ap_filter_t *f, apr_bucket_brigade *bb_out,
8585
returnAPR_EGENERAL;
8686
}
8787

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);
9293

9394
#if0
9495

@@ -107,33 +108,34 @@ apr_status_t input_filter(ap_filter_t *f, apr_bucket_brigade *bb_out,
107108

108109
#endif
109110

110-
if (bucket==NULL)returnAPR_EGENERAL;
111-
APR_BRIGADE_INSERT_TAIL(bb_out,bucket);
111+
if (bucket==NULL)returnAPR_EGENERAL;
112+
APR_BRIGADE_INSERT_TAIL(bb_out,bucket);
112113

113-
if (msr->txcfg->debuglog_level >=4) {
114-
msr_log(msr,4,"Input filter: Forwarded %"APR_SIZE_T_FMT" bytes.",chunk->length);
115-
}
116-
}elseif (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+
}elseif (msr->stream_input_data!=NULL) {
117118

118-
msr->if_stream_changed=0;
119+
msr->if_stream_changed=0;
119120

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);
122123

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+
}
127129
}
128-
}
129130

130-
if (bucket==NULL)returnAPR_EGENERAL;
131-
APR_BRIGADE_INSERT_TAIL(bb_out,bucket);
131+
if (bucket==NULL)returnAPR_EGENERAL;
132+
APR_BRIGADE_INSERT_TAIL(bb_out,bucket);
132133

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+
}
136137

138+
}
137139
}
138140

139141
if (rc==0) {

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp