nghttpd: Use Http2Handler::submit_rst_stream

This commit is contained in:
Tatsuhiro Tsujikawa 2015-01-15 23:11:14 +09:00
parent d142830109
commit c3aa02f003
1 changed files with 3 additions and 11 deletions

View File

@ -1025,8 +1025,7 @@ int on_header_callback(nghttp2_session *session, const nghttp2_frame *frame,
} }
if (!http2::check_nv(name, namelen, value, valuelen)) { if (!http2::check_nv(name, namelen, value, valuelen)) {
nghttp2_submit_rst_stream(session, NGHTTP2_FLAG_NONE, frame->hd.stream_id, hd->submit_rst_stream(stream, NGHTTP2_PROTOCOL_ERROR);
NGHTTP2_PROTOCOL_ERROR);
return NGHTTP2_ERR_TEMPORAL_CALLBACK_FAILURE; return NGHTTP2_ERR_TEMPORAL_CALLBACK_FAILURE;
} }
@ -1037,15 +1036,13 @@ int on_header_callback(nghttp2_session *session, const nghttp2_frame *frame,
stream->headers.back().name.c_str()[0] != ':') || stream->headers.back().name.c_str()[0] != ':') ||
!http2::check_http2_request_pseudo_header(stream->hdidx, token)) { !http2::check_http2_request_pseudo_header(stream->hdidx, token)) {
nghttp2_submit_rst_stream(session, NGHTTP2_FLAG_NONE, frame->hd.stream_id, hd->submit_rst_stream(stream, NGHTTP2_PROTOCOL_ERROR);
NGHTTP2_PROTOCOL_ERROR);
return NGHTTP2_ERR_TEMPORAL_CALLBACK_FAILURE; return NGHTTP2_ERR_TEMPORAL_CALLBACK_FAILURE;
} }
} }
if (!http2::http2_header_allowed(token)) { if (!http2::http2_header_allowed(token)) {
nghttp2_submit_rst_stream(session, NGHTTP2_FLAG_NONE, frame->hd.stream_id, hd->submit_rst_stream(stream, NGHTTP2_PROTOCOL_ERROR);
NGHTTP2_PROTOCOL_ERROR);
return NGHTTP2_ERR_TEMPORAL_CALLBACK_FAILURE; return NGHTTP2_ERR_TEMPORAL_CALLBACK_FAILURE;
} }
@ -1159,11 +1156,6 @@ int hd_on_frame_recv_callback(nghttp2_session *session,
hd->remove_settings_timer(); hd->remove_settings_timer();
} }
break; break;
case NGHTTP2_PUSH_PROMISE:
nghttp2_submit_rst_stream(session, NGHTTP2_FLAG_NONE,
frame->push_promise.promised_stream_id,
NGHTTP2_REFUSED_STREAM);
break;
default: default:
break; break;
} }