Fixed GOAWAY length in SPDY/3

This commit is contained in:
Tatsuhiro Tsujikawa 2012-02-26 01:48:18 +09:00
parent c6c3cbce46
commit 88cd97843f
1 changed files with 7 additions and 1 deletions

View File

@ -454,7 +454,13 @@ void spdylay_frame_goaway_init(spdylay_goaway *frame,
memset(frame, 0, sizeof(spdylay_goaway)); memset(frame, 0, sizeof(spdylay_goaway));
frame->hd.version = version; frame->hd.version = version;
frame->hd.type = SPDYLAY_GOAWAY; frame->hd.type = SPDYLAY_GOAWAY;
if(version == SPDYLAY_PROTO_SPDY2) {
frame->hd.length = 4; frame->hd.length = 4;
} else if(version == SPDYLAY_PROTO_SPDY3) {
frame->hd.length = 8;
} else {
frame->hd.length = 0;
}
frame->last_good_stream_id = last_good_stream_id; frame->last_good_stream_id = last_good_stream_id;
frame->status_code = 0; /* TODO Add status_code arg for spdy/3 */ frame->status_code = 0; /* TODO Add status_code arg for spdy/3 */
} }