From 7272782f67259ee8cc7cb328a1b0c22eaf0c2b60 Mon Sep 17 00:00:00 2001 From: Tatsuhiro Tsujikawa Date: Fri, 27 Jan 2012 17:15:24 +0900 Subject: [PATCH] Close the stream if SYN_REPLY with FIN bit set is received. --- lib/spdylay_session.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/lib/spdylay_session.c b/lib/spdylay_session.c index 78a099e..af71bc0 100644 --- a/lib/spdylay_session.c +++ b/lib/spdylay_session.c @@ -642,6 +642,12 @@ int spdylay_session_on_syn_reply_received(spdylay_session *session, stream->state = SPDYLAY_STREAM_OPENED; spdylay_session_call_on_ctrl_frame_received(session, SPDYLAY_SYN_REPLY, frame); + if(frame->syn_reply.hd.flags & SPDYLAY_FLAG_FIN) { + /* This is the last frame of this stream, so close the + stream. This also happens when DATA and HEADERS frame + with FIN bit set. */ + spdylay_session_close_stream(session, frame->syn_reply.stream_id); + } } else if(stream->state == SPDYLAY_STREAM_CLOSING) { /* This is race condition. SPDYLAY_STREAM_CLOSING indicates that we queued RST_STREAM but it has not been sent. It will