aboutsummaryrefslogtreecommitdiff
path: root/lib/http2.c
diff options
context:
space:
mode:
authorDaniel Stenberg <daniel@haxx.se>2013-09-07 11:03:23 +0200
committerDaniel Stenberg <daniel@haxx.se>2013-09-07 11:28:12 +0200
commit13dbb41c4991bdd87768e0d3b6d3398cb1869676 (patch)
tree06570305ca58f988315066cfef4c2cf78c322e16 /lib/http2.c
parente5c2354fd537968f034b35532d53b42c6cdf5169 (diff)
http2: first embryo toward Upgrade:
Diffstat (limited to 'lib/http2.c')
-rw-r--r--lib/http2.c19
1 files changed, 19 insertions, 0 deletions
diff --git a/lib/http2.c b/lib/http2.c
index 21be17ba7..1b4300aa9 100644
--- a/lib/http2.c
+++ b/lib/http2.c
@@ -27,7 +27,9 @@
#include <curl/mprintf.h>
#include <nghttp2/nghttp2.h>
+#include "urldata.h"
#include "http2.h"
+#include "http.h"
/*
* Store nghttp2 version info in this buffer, Prefix with a space. Return
@@ -39,4 +41,21 @@ int Curl_http2_ver(char *p, size_t len)
return snprintf(p, len, " nghttp2/%s", h2->version_str);
}
+/*
+ * Append headers to ask for a HTTP1.1 to HTTP2 upgrade.
+ */
+CURLcode Curl_http2_request(Curl_send_buffer *req,
+ struct connectdata *conn)
+{
+ const char *base64="AABBCC"; /* a fake string to start with */
+ CURLcode result =
+ Curl_add_bufferf(req,
+ "Connection: Upgrade, HTTP2-Settings\r\n"
+ "Upgrade: HTTP/2.0\r\n"
+ "HTTP2-Settings: %s\r\n",
+ base64);
+ (void)conn;
+ return result;
+}
+
#endif