nss: fix NPN/ALPN protocol negotiation
Correctly check for memcmp() return value (it returns 0 if the strings match). This is not really important, since curl is going to use http/1.1 anyway, but it's still a bug I guess.
This commit is contained in:
parent
633b3895d7
commit
63b4b8c7bd
@ -718,12 +718,11 @@ static void HandshakeCallback(PRFileDesc *sock, void *arg)
|
|||||||
}
|
}
|
||||||
|
|
||||||
if(buflen == NGHTTP2_PROTO_VERSION_ID_LEN &&
|
if(buflen == NGHTTP2_PROTO_VERSION_ID_LEN &&
|
||||||
memcmp(NGHTTP2_PROTO_VERSION_ID, buf, NGHTTP2_PROTO_VERSION_ID_LEN)
|
!memcmp(NGHTTP2_PROTO_VERSION_ID, buf, NGHTTP2_PROTO_VERSION_ID_LEN)) {
|
||||||
== 0) {
|
|
||||||
conn->negnpn = NPN_HTTP2;
|
conn->negnpn = NPN_HTTP2;
|
||||||
}
|
}
|
||||||
else if(buflen == ALPN_HTTP_1_1_LENGTH && memcmp(ALPN_HTTP_1_1, buf,
|
else if(buflen == ALPN_HTTP_1_1_LENGTH &&
|
||||||
ALPN_HTTP_1_1_LENGTH)) {
|
!memcmp(ALPN_HTTP_1_1, buf, ALPN_HTTP_1_1_LENGTH)) {
|
||||||
conn->negnpn = NPN_HTTP1_1;
|
conn->negnpn = NPN_HTTP1_1;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user