From 3673b1303a5d187d5332aa8b84c8b8b330a08aca Mon Sep 17 00:00:00 2001 From: Tatsuhiro Tsujikawa Date: Sat, 21 Nov 2015 15:44:12 +0900 Subject: [PATCH] python: Do the same thing in 8481bc6 with HEADERS + END_STREAM flag set --- python/nghttp2.pyx | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/python/nghttp2.pyx b/python/nghttp2.pyx index 4ebbf178..633cc337 100644 --- a/python/nghttp2.pyx +++ b/python/nghttp2.pyx @@ -473,6 +473,13 @@ cdef int server_on_frame_send(cnghttp2.nghttp2_session *session, if (frame.hd.flags & cnghttp2.NGHTTP2_FLAG_ACK) != 0: return 0 http2._start_settings_timer() + elif frame.hd.type == cnghttp2.NGHTTP2_HEADERS: + if (frame.hd.flags & cnghttp2.NGHTTP2_FLAG_END_STREAM) and \ + cnghttp2.nghttp2_session_check_server_session(session): + # Send RST_STREAM if remote is not closed yet + if cnghttp2.nghttp2_session_get_stream_remote_close( + session, frame.hd.stream_id) == 0: + http2._rst_stream(frame.hd.stream_id, cnghttp2.NGHTTP2_NO_ERROR) cdef int server_on_frame_not_send(cnghttp2.nghttp2_session *session, const cnghttp2.nghttp2_frame *frame,