diff options
author | Tatsuhiro Tsujikawa <tatsuhiro.t@gmail.com> | 2014-02-01 00:51:24 +0900 |
---|---|---|
committer | Daniel Stenberg <daniel@haxx.se> | 2014-02-04 14:49:49 +0100 |
commit | 63b26d889f58ba25fc45a2ff02ed41ea08c63dbd (patch) | |
tree | fe3b19104f012a492eefd7c35f114de86b6b9af5 /lib/http.c | |
parent | 4d8db595cab1222927a251a9b836ac4947b7d73d (diff) |
HTTP2: add layer between existing http and socket(TLS) layer
This patch chooses different approach to integrate HTTP2 into HTTP curl
stack. The idea is that we insert HTTP2 layer between HTTP code and
socket(TLS) layer. When HTTP2 is initialized (either in NPN or Upgrade),
we replace the Curl_recv/Curl_send callbacks with HTTP2's, but keep the
original callbacks in http_conn struct. When sending serialized data by
nghttp2, we use original Curl_send callback. Likewise, when reading data
from network, we use original Curl_recv callback. In this way we can
treat both TLS and non-TLS connections.
With this patch, one can transfer contents from https://twitter.com and
from nghttp2 test server in plain HTTP as well.
The code still has rough edges. The notable one is I could not figure
out how to call nghttp2_session_send() when underlying socket is
writable.
Diffstat (limited to 'lib/http.c')
-rw-r--r-- | lib/http.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/lib/http.c b/lib/http.c index 063e1fa51..2ea6f7ea5 100644 --- a/lib/http.c +++ b/lib/http.c @@ -1056,6 +1056,7 @@ CURLcode Curl_add_buffer_send(Curl_send_buffer *in, return res; } + if(conn->handler->flags & PROTOPT_SSL) { /* We never send more than CURL_MAX_WRITE_SIZE bytes in one single chunk when we speak HTTPS, as if only a fraction of it is sent now, this data @@ -1673,7 +1674,6 @@ CURLcode Curl_http(struct connectdata *conn, bool *done) infof(data, "http, we have to use HTTP-draft-09/2\n"); Curl_http2_init(conn); Curl_http2_switched(conn); - Curl_http2_send_request(conn); break; case NPN_HTTP1_1: /* continue with HTTP/1.1 when explicitly requested */ |