Handle non-fatal error from nghttp2_submit_data

This commit is contained in:
Tatsuhiro Tsujikawa 2013-08-10 15:24:11 +09:00
parent a52ca391a2
commit 3ee7ca2cdd
1 changed files with 10 additions and 8 deletions

View File

@ -1277,11 +1277,12 @@ static int nghttp2_session_after_frame_sent(nghttp2_session *session)
r = nghttp2_submit_data(session, NGHTTP2_FLAG_END_STREAM,
frame->hd.stream_id, aux_data->data_prd);
if(r != 0) {
/* FATAL error */
assert(r < NGHTTP2_ERR_FATAL);
/* TODO If r is not FATAL, we should send RST_STREAM. */
if(nghttp2_is_fatal(r)) {
return r;
}
/* If r is not fatal, the only possible error is closed
stream, so we have nothing to do here. */
}
}
break;
}
@ -1299,11 +1300,12 @@ static int nghttp2_session_after_frame_sent(nghttp2_session *session)
r = nghttp2_submit_data(session, NGHTTP2_FLAG_END_STREAM,
frame->hd.stream_id, aux_data->data_prd);
if(r != 0) {
/* FATAL error */
assert(r < NGHTTP2_ERR_FATAL);
/* TODO If r is not FATAL, we should send RST_STREAM. */
if(nghttp2_is_fatal(r)) {
return r;
}
/* If r is not fatal, the only possible error is closed
stream, so we have nothing to do here. */
}
}
break;
case NGHTTP2_HCAT_HEADERS: