UNIDIRECTIONAL handling when SYN_REPLY and HEADERS are received.

This commit is contained in:
Tatsuhiro Tsujikawa 2012-01-27 23:17:03 +09:00
parent d1c4c59aad
commit 0ecf581e63
1 changed files with 4 additions and 1 deletions

View File

@ -686,7 +686,7 @@ int spdylay_session_on_syn_reply_received(spdylay_session *session,
if(spdylay_session_is_my_stream_id(session, frame->syn_reply.stream_id)) { if(spdylay_session_is_my_stream_id(session, frame->syn_reply.stream_id)) {
spdylay_stream *stream = spdylay_session_get_stream spdylay_stream *stream = spdylay_session_get_stream
(session, frame->syn_reply.stream_id); (session, frame->syn_reply.stream_id);
if(stream) { if(stream && (stream->flags & SPDYLAY_FLAG_UNIDIRECTIONAL) == 0) {
if(stream->state == SPDYLAY_STREAM_OPENING) { if(stream->state == SPDYLAY_STREAM_OPENING) {
valid = 1; valid = 1;
stream->state = SPDYLAY_STREAM_OPENED; stream->state = SPDYLAY_STREAM_OPENED;
@ -782,6 +782,9 @@ int spdylay_session_on_headers_received(spdylay_session *session,
if(frame->headers.hd.flags & SPDYLAY_FLAG_FIN) { if(frame->headers.hd.flags & SPDYLAY_FLAG_FIN) {
stream->flags |= SPDYLAY_FLAG_FIN; stream->flags |= SPDYLAY_FLAG_FIN;
} }
if(stream->flags & SPDYLAY_FLAG_UNIDIRECTIONAL) {
spdylay_session_close_stream(session, frame->headers.stream_id);
}
} }
} }
} }