Sort nv after 3to2 and 2to3 translation.

This commit is contained in:
Tatsuhiro Tsujikawa 2012-03-14 22:53:14 +09:00
parent 9a4be04c79
commit 488b5acec7
1 changed files with 6 additions and 0 deletions

View File

@ -741,6 +741,7 @@ static ssize_t spdylay_session_prep_frame(spdylay_session *session,
session->next_stream_id += 2; session->next_stream_id += 2;
if(session->version == SPDYLAY_PROTO_SPDY2) { if(session->version == SPDYLAY_PROTO_SPDY2) {
spdylay_frame_nv_3to2(item->frame->syn_stream.nv); spdylay_frame_nv_3to2(item->frame->syn_stream.nv);
spdylay_frame_nv_sort(item->frame->syn_stream.nv);
} }
framebuflen = spdylay_frame_pack_syn_stream(&session->aob.framebuf, framebuflen = spdylay_frame_pack_syn_stream(&session->aob.framebuf,
&session->aob.framebufmax, &session->aob.framebufmax,
@ -750,6 +751,7 @@ static ssize_t spdylay_session_prep_frame(spdylay_session *session,
&session->hd_deflater); &session->hd_deflater);
if(session->version == SPDYLAY_PROTO_SPDY2) { if(session->version == SPDYLAY_PROTO_SPDY2) {
spdylay_frame_nv_2to3(item->frame->syn_stream.nv); spdylay_frame_nv_2to3(item->frame->syn_stream.nv);
spdylay_frame_nv_sort(item->frame->syn_stream.nv);
} }
if(framebuflen < 0) { if(framebuflen < 0) {
return framebuflen; return framebuflen;
@ -773,6 +775,7 @@ static ssize_t spdylay_session_prep_frame(spdylay_session *session,
} }
if(session->version == SPDYLAY_PROTO_SPDY2) { if(session->version == SPDYLAY_PROTO_SPDY2) {
spdylay_frame_nv_3to2(item->frame->syn_reply.nv); spdylay_frame_nv_3to2(item->frame->syn_reply.nv);
spdylay_frame_nv_sort(item->frame->syn_reply.nv);
} }
framebuflen = spdylay_frame_pack_syn_reply(&session->aob.framebuf, framebuflen = spdylay_frame_pack_syn_reply(&session->aob.framebuf,
&session->aob.framebufmax, &session->aob.framebufmax,
@ -782,6 +785,7 @@ static ssize_t spdylay_session_prep_frame(spdylay_session *session,
&session->hd_deflater); &session->hd_deflater);
if(session->version == SPDYLAY_PROTO_SPDY2) { if(session->version == SPDYLAY_PROTO_SPDY2) {
spdylay_frame_nv_2to3(item->frame->syn_reply.nv); spdylay_frame_nv_2to3(item->frame->syn_reply.nv);
spdylay_frame_nv_sort(item->frame->syn_reply.nv);
} }
if(framebuflen < 0) { if(framebuflen < 0) {
return framebuflen; return framebuflen;
@ -825,6 +829,7 @@ static ssize_t spdylay_session_prep_frame(spdylay_session *session,
} }
if(session->version == SPDYLAY_PROTO_SPDY2) { if(session->version == SPDYLAY_PROTO_SPDY2) {
spdylay_frame_nv_3to2(item->frame->headers.nv); spdylay_frame_nv_3to2(item->frame->headers.nv);
spdylay_frame_nv_sort(item->frame->headers.nv);
} }
framebuflen = spdylay_frame_pack_headers(&session->aob.framebuf, framebuflen = spdylay_frame_pack_headers(&session->aob.framebuf,
&session->aob.framebufmax, &session->aob.framebufmax,
@ -834,6 +839,7 @@ static ssize_t spdylay_session_prep_frame(spdylay_session *session,
&session->hd_deflater); &session->hd_deflater);
if(session->version == SPDYLAY_PROTO_SPDY2) { if(session->version == SPDYLAY_PROTO_SPDY2) {
spdylay_frame_nv_2to3(item->frame->headers.nv); spdylay_frame_nv_2to3(item->frame->headers.nv);
spdylay_frame_nv_sort(item->frame->headers.nv);
} }
if(framebuflen < 0) { if(framebuflen < 0) {
return framebuflen; return framebuflen;