aboutsummaryrefslogtreecommitdiff
path: root/lib/http2.c
AgeCommit message (Collapse)Author
2014-09-13http2: Fix busy loop when EOF is encounteredTatsuhiro Tsujikawa
Previously we did not handle EOF from underlying transport socket and wrongly just returned error code CURL_AGAIN from http2_recv, which caused busy loop since socket has been closed. This patch adds the code to handle EOF situation and tells the upper layer that we got EOF.
2014-08-26Compile with latest nghttp2Tatsuhiro Tsujikawa
2014-08-07http2: added some more logging for debugging stream problemsDaniel Stenberg
2014-08-07HTTP/2: Reset promised stream, not its associated stream.Tatsuhiro Tsujikawa
2014-08-07HTTP/2: Move :authority before non-pseudo header fieldsTatsuhiro Tsujikawa
2014-08-07http2: show the received header for better debuggingDaniel Stenberg
2014-08-03HTTP/2: Fix infinite loop in readwrite_data()Tatsuhiro Tsujikawa
To prevent infinite loop in readwrite_data() function when stream is reset before any response body comes, reset closed flag to false once it is evaluated to true.
2014-08-02HTTP2: Support expect: 100-continueTatsuhiro Tsujikawa
"Expect: 100-continue", which was once deprecated in HTTP/2, is now resurrected in HTTP/2 draft 14. This change adds its support to HTTP/2 code. This change also includes stricter header field checking.
2014-07-25base64: added Curl_base64url_encode()Daniel Stenberg
This is now used by the http2 code. It has two different symbols at the end of the base64 table to make the output "url safe". Bug: https://github.com/tatsuhiro-t/nghttp2/issues/62
2014-07-23http2: more and better error checkingDaniel Stenberg
1 - fixes the warnings when built without http2 support 2 - adds CURLE_HTTP2, a new error code for errors detected by nghttp2 basically when they are about http2 specific things.
2014-06-14http2: better return code error checkingDaniel Stenberg
2014-06-12http2: avoid segfault when usint the plain-text http2Daniel Stenberg
This regression was introduced when *init was split into *init and *setup...
2014-05-20http2: make connection re-use workDaniel Stenberg
Http2 connections would wrongly get closed after each individual request. Co-authored-by: Tatsuhiro Tsujikawa Bug: http://curl.haxx.se/bug/view.cgi?id=1374
2014-05-07http2: Compile with latest nghttp2Tatsuhiro Tsujikawa
Now nghttp2_submit_request returns assigned stream ID, we don't have to check stream ID using before_stream_send_callback. The adjust_priority_callback was removed.
2014-04-27http2: Compile with latest nghttp2Tatsuhiro Tsujikawa
commit 6d5f40238028f2d8c (Apr 27) or later nghttp2 is now required
2014-04-23handler: make 'protocol' always specified as a single bitDaniel Stenberg
This makes the findprotocol() function work as intended so that libcurl can properly be restricted to not support HTTP while still supporting HTTPS - since the HTTPS handler previously set both the HTTP and HTTPS bits in the protocol field. This fixes --proto and --proto-redir for most SSL protocols. This is done by adding a few new convenience defines that groups HTTP and HTTPS, FTP and FTPS etc that should then be used when the code wants to check for both protocols at once. PROTO_FAMILY_[protocol] style. Bug: https://github.com/bagder/curl/pull/97 Reported-by: drizzt
2014-04-05http2: Compile with current nghttp2, which supports h2-11Tatsuhiro Tsujikawa
2014-03-10http2: free resources on disconnectTatsuhiro Tsujikawa
... and use Curl_safefree() instead of free()
2014-02-28Fix bug that HTTP/2 hangs if whole response body is read with headersTatsuhiro Tsujikawa
For HTTP/2, we may read up everything including responde body with header fields in Curl_http_readwrite_headers. If no content-length is provided, curl waits for the connection close, which we emulate it using conn->proto.httpc.closed = TRUE. The thing is if we read everything, then http2_recv won't be called and we cannot signal the HTTP/2 stream has closed. As a workaround, we return nonzero from data_pending to call http2_recv.
2014-02-28http2: build with current nghttp2 versionDaniel Stenberg
nghttp2 has yet again extended its callback struct and this is an attempt to make curl compile with nghttp2 from current git
2014-02-17http2: Support HTTP POST/PUTTatsuhiro Tsujikawa
This patch enables HTTP POST/PUT in HTTP2. We disabled Expect header field and chunked transfer encoding since HTTP2 forbids them. In HTTP1, Curl sends small upload data with request headers, but HTTP2 requires upload data must be in DATA frame separately. So we added some conditionals to achieve this.
2014-02-05http2: rely on content-encoding headerFabian Frank
A server might respond with a content-encoding header and a response that was encoded accordingly in HTTP-draft-09/2.0 mode, even if the client did not send an accept-encoding header earlier. The server might not send a content-encoding header if the identity encoding was used to encode the response. See: http://tools.ietf.org/html/draft-ietf-httpbis-http2-09#section-9.3
2014-02-04http2: enforce gzip auto-decompressDaniel Stenberg
As this is mandated by the http2 spec draft-09
2014-02-04http2: handle incoming data larger than remaining bufferTatsuhiro Tsujikawa
2014-02-04http2: Check stream ID we are interested inTatsuhiro Tsujikawa
2014-02-04http2: store response header in temporary bufferTatsuhiro Tsujikawa
2014-02-04HTTP2: add layer between existing http and socket(TLS) layerTatsuhiro Tsujikawa
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.
2014-01-30http2: fix size check in on_data_chunk_recvDaniel Stenberg
2014-01-30http2: add CRLF when first data arrivesDaniel Stenberg
2014-01-30http2_recv: Return written length on CURLE_AGAINTatsuhiro Tsujikawa
2014-01-30http2: Use nghttp2_session_mem_recv and nghttp2_session_upgradeTatsuhiro Tsujikawa
2014-01-30http2: basic version of receiving DATADaniel Stenberg
2014-01-30http2: convert HEADER frames to HTTP1-like headersDaniel Stenberg
... and then go through the "normal" HTTP engine.
2014-01-30http2: fix EWOULDBLOCK in recv_callback()Daniel Stenberg
2014-01-30http2: do the POST Upgrade dance properlyDaniel Stenberg
2014-01-30http2: switch into http2 mode if NPN indicatesFabian Frank
Check the NPN result before preparing an HTTP request and switch into HTTP/2.0 mode if necessary. This is a work in progress, the actual code to prepare and send the request using nghttp2 is still missing from Curl_http2_send_request().
2014-01-30http2: s/Curl_http2_request/Curl_http2_request_upgradeDaniel Stenberg
To better reflect its purpose
2014-01-30http2: added stubs for all nghttp2 callbacksDaniel Stenberg
This makes it easier to trace what's happening.
2014-01-29http2: use FIRSTSOCKET instead of 0 to index the sockets arrayDaniel Stenberg
2014-01-29http2: receive and log the received header framesDaniel Stenberg
2014-01-29http2_recv: log nghttp2 return codes for debugging purposesDaniel Stenberg
2014-01-29HTTP2: reject nghttp2 versions before 0.3.0Daniel Stenberg
2014-01-29http2: adjusted to newer nghttp2_session_callbacks structGisle Vanem
the number of elements in the 'nghttp2_session_callbacks' structure is now reduced by 2 in version 0.3.0 (I'm not sure when the change happened, but checking for ver 0.3.0 work for me).
2014-01-29HTTP2: Wrong NgHTTP2 user-dataGisle Vanem
Something is wrong in 'userp' for the HTTP2 recv_callback(). The session is created using bogus user-data; '&conn' and not 'conn'. I noticed this since the socket-value in Curl_read_plain() was set to a impossible high value.
2014-01-29http2: switch recv/send functions to http2 ones after 101Daniel Stenberg
2014-01-29http2: handle 101 responses and switch to HTTP2Daniel Stenberg
2013-09-10http2: use the support HTTP2 draft version in the upgrade headerDaniel Stenberg
... instead of HTTP/2.0 to work fine with the nghttpx proxy/server.
2013-09-09http2: adjust to new nghttp2_pack_settings_payload protoDaniel Stenberg
This function was modified in nghttp2 git commit a1c3f89c72e51
2013-09-07http2: include curl_memory.hDaniel Stenberg
Detected by test 1132
2013-09-07http2: actually init nghttp2 and send HTTP2-Settings properlyDaniel Stenberg