From 45801883ba9e75b373e9f215b1e39c1a6b267e77 Mon Sep 17 00:00:00 2001 From: Tatsuhiro Tsujikawa Date: Fri, 28 Nov 2014 01:35:12 +0900 Subject: [PATCH] Cleanup previous commit --- lib/nghttp2_session.c | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/lib/nghttp2_session.c b/lib/nghttp2_session.c index 794dc8a9..310cb3c4 100644 --- a/lib/nghttp2_session.c +++ b/lib/nghttp2_session.c @@ -2997,11 +2997,14 @@ int nghttp2_session_on_request_headers_received(nghttp2_session *session, /* If client recieves idle stream from server, it is invalid regardless stream ID is even or odd. This is because client is not expected to receive request from server. */ - if (!session->server && - session_detect_idle_stream(session, frame->hd.stream_id)) { - return session_inflate_handle_invalid_connection( - session, frame, NGHTTP2_PROTOCOL_ERROR, - "request HEADERS: client received request"); + if (!session->server) { + if (session_detect_idle_stream(session, frame->hd.stream_id)) { + return session_inflate_handle_invalid_connection( + session, frame, NGHTTP2_PROTOCOL_ERROR, + "request HEADERS: client received request"); + } + + return NGHTTP2_ERR_IGN_HEADER_BLOCK; } if (!session_is_new_peer_stream_id(session, frame->hd.stream_id)) {