h2load: Robust error handling in POST data

This commit is contained in:
Tatsuhiro Tsujikawa 2016-05-14 00:40:35 +09:00
parent d00788ceeb
commit de3f2951b3
1 changed files with 6 additions and 1 deletions

View File

@ -149,8 +149,13 @@ ssize_t file_read_callback(nghttp2_session *session, int32_t stream_id,
req_stat->data_offset += nread;
if (nread == 0 || req_stat->data_offset == config->data_length) {
if (req_stat->data_offset == config->data_length) {
*data_flags |= NGHTTP2_DATA_FLAG_EOF;
return nread;
}
if (req_stat->data_offset > config->data_length || nread == 0) {
return NGHTTP2_ERR_TEMPORAL_CALLBACK_FAILURE;
}
return nread;