Added handling of received RST_STREAM

This commit is contained in:
Tatsuhiro Tsujikawa 2012-01-27 23:22:27 +09:00
parent 0ecf581e63
commit 9f2f6454f3
2 changed files with 23 additions and 0 deletions

View File

@ -713,6 +713,12 @@ int spdylay_session_on_syn_reply_received(spdylay_session *session,
return r; return r;
} }
int spdylay_session_on_rst_stream_received(spdylay_session *session,
spdylay_frame *frame)
{
spdylay_session_close_stream(session, frame->rst_stream.stream_id);
}
int spdylay_session_on_ping_received(spdylay_session *session, int spdylay_session_on_ping_received(spdylay_session *session,
spdylay_frame *frame) spdylay_frame *frame)
{ {
@ -831,6 +837,17 @@ int spdylay_session_process_ctrl_frame(spdylay_session *session)
spdylay_frame_syn_reply_free(&frame.syn_reply); spdylay_frame_syn_reply_free(&frame.syn_reply);
} }
break; break;
case SPDYLAY_RST_STREAM:
r = spdylay_frame_unpack_rst_stream(&frame.rst_stream,
session->iframe.headbuf,
sizeof(session->iframe.headbuf),
session->iframe.buf,
session->iframe.len);
if(r == 0) {
r = spdylay_session_on_rst_stream_received(session, &frame);
spdylay_frame_rst_stream_free(&frame.rst_stream);
}
break;
case SPDYLAY_PING: case SPDYLAY_PING:
r = spdylay_frame_unpack_ping(&frame.ping, r = spdylay_frame_unpack_ping(&frame.ping,
session->iframe.headbuf, session->iframe.headbuf,

View File

@ -155,6 +155,12 @@ int spdylay_session_on_syn_reply_received(spdylay_session *session,
spdylay_frame *frame); spdylay_frame *frame);
/*
* Called when RST_STREAM is received. Received frame is |frame|.
*/
int spdylay_session_on_rst_stream_received(spdylay_session *session,
spdylay_frame *frame);
/* /*
* Called when HEADERS is recieved. Received frame is |frame|. * Called when HEADERS is recieved. Received frame is |frame|.
*/ */