From 88599228f83a01c9ade76f7a5d1c594fe27bc6a1 Mon Sep 17 00:00:00 2001 From: Tatsuhiro Tsujikawa Date: Sat, 12 May 2012 18:23:17 +0900 Subject: [PATCH] Prefer spdy/3 to spdy/2 in spdylay_select_next_protocol() --- lib/spdylay_npn.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/lib/spdylay_npn.c b/lib/spdylay_npn.c index 5d3473c7..fbbffada 100644 --- a/lib/spdylay_npn.c +++ b/lib/spdylay_npn.c @@ -38,8 +38,8 @@ int spdylay_select_next_protocol(unsigned char **out, unsigned char *outlen, int http_selected = 0; unsigned int i = 0; static const spdylay_npn_proto proto_list[] = { - { (const unsigned char*)"spdy/2", 6, SPDYLAY_PROTO_SPDY2 }, - { (const unsigned char*)"spdy/3", 6, SPDYLAY_PROTO_SPDY3 } + { (const unsigned char*)"spdy/3", 6, SPDYLAY_PROTO_SPDY3 }, + { (const unsigned char*)"spdy/2", 6, SPDYLAY_PROTO_SPDY2 } }; for(; i < inlen; i += in[i]+1) { unsigned int j; @@ -55,7 +55,7 @@ int spdylay_select_next_protocol(unsigned char **out, unsigned char *outlen, http_selected = 1; *out = (unsigned char*)&in[i+1]; *outlen = in[i]; - /* Go through to the next iteration, because "spdy/2" may be + /* Go through to the next iteration, because "spdy/X" may be there */ } }