openssl: set up hooks with to perform NPN

NPN is what is available in the wild today to negotiate SPDY or HTTP/2.0
connections. It is expected to be replaced by ALPN in the future. If
HTTP/2.0 is negotiated, this is indicated for the entire connection and
http.c is expected to initialize itself for HTTP/2.0 instead of
HTTP/1.1.

see:
http://technotes.googlecode.com/git/nextprotoneg.html
http://tools.ietf.org/html/draft-ietf-tls-applayerprotoneg-04
This commit is contained in:
Fabian Frank
2014-01-29 21:18:03 -08:00
committed by Daniel Stenberg
parent c3fe3d9926
commit 22c198fa89
2 changed files with 43 additions and 0 deletions

View File

@@ -597,6 +597,12 @@ enum upgrade101 {
UPGR101_WORKING /* talking upgraded protocol */
};
enum negotiatenpn {
NPN_INIT, /* default state */
NPN_HTTP1_1, /* HTTP/1.1 negotiated */
NPN_HTTP2_DRAFT09 /* HTTP-draft-0.9/2.0 negotiated */
};
/*
* Request specific data in the easy handle (SessionHandle). Previously,
* these members were on the connectdata struct but since a conn struct may
@@ -1048,6 +1054,8 @@ struct connectdata {
TUNNEL_COMPLETE /* CONNECT response received completely */
} tunnel_state[2]; /* two separate ones to allow FTP */
struct connectbundle *bundle; /* The bundle we are member of */
enum negotiatenpn negnpn;
};
/* The end of connectdata. */