Commit 3ee7ca2c authored by Tatsuhiro Tsujikawa's avatar Tatsuhiro Tsujikawa

Handle non-fatal error from nghttp2_submit_data

parent a52ca391
...@@ -1277,11 +1277,12 @@ static int nghttp2_session_after_frame_sent(nghttp2_session *session) ...@@ -1277,11 +1277,12 @@ static int nghttp2_session_after_frame_sent(nghttp2_session *session)
r = nghttp2_submit_data(session, NGHTTP2_FLAG_END_STREAM, r = nghttp2_submit_data(session, NGHTTP2_FLAG_END_STREAM,
frame->hd.stream_id, aux_data->data_prd); frame->hd.stream_id, aux_data->data_prd);
if(r != 0) { if(r != 0) {
/* FATAL error */ if(nghttp2_is_fatal(r)) {
assert(r < NGHTTP2_ERR_FATAL);
/* TODO If r is not FATAL, we should send RST_STREAM. */
return r; return r;
} }
/* If r is not fatal, the only possible error is closed
stream, so we have nothing to do here. */
}
} }
break; break;
} }
...@@ -1299,11 +1300,12 @@ static int nghttp2_session_after_frame_sent(nghttp2_session *session) ...@@ -1299,11 +1300,12 @@ static int nghttp2_session_after_frame_sent(nghttp2_session *session)
r = nghttp2_submit_data(session, NGHTTP2_FLAG_END_STREAM, r = nghttp2_submit_data(session, NGHTTP2_FLAG_END_STREAM,
frame->hd.stream_id, aux_data->data_prd); frame->hd.stream_id, aux_data->data_prd);
if(r != 0) { if(r != 0) {
/* FATAL error */ if(nghttp2_is_fatal(r)) {
assert(r < NGHTTP2_ERR_FATAL);
/* TODO If r is not FATAL, we should send RST_STREAM. */
return r; return r;
} }
/* If r is not fatal, the only possible error is closed
stream, so we have nothing to do here. */
}
} }
break; break;
case NGHTTP2_HCAT_HEADERS: case NGHTTP2_HCAT_HEADERS:
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment