aboutsummaryrefslogtreecommitdiff
path: root/lib/http2.c
AgeCommit message (Collapse)Author
2015-05-18http2: lazy init header_recvbufDaniel Stenberg
It makes us use less memory when not doing HTTP/2 and subsequently also makes us not have to cleanup HTTP/2 related data when not using HTTP/2!
2015-05-18http2: separate multiplex/pipelining + cleanup memory leaksDaniel Stenberg
2015-05-18http2: Fix bug that data to be drained are overwritten by pending "paused" dataTatsuhiro Tsujikawa
2015-05-18http2: Don't call nghttp2_session_mem_recv while it is paused by a streamTatsuhiro Tsujikawa
2015-05-18http2: Read data left in connection buffer after pauseTatsuhiro Tsujikawa
Previously when we do pause because of out of buffer, we just throw away unread data in connection buffer. This just broke protocol framing, and I saw occasional FRAME_SIZE_ERROR. This commit fix this issue by remembering how much data read, and in the next iteration, we process remaining data.
2015-05-18http2: Fix streams get stuckTatsuhiro Tsujikawa
This commit fixes the bug that streams get stuck if stream gets some DATA, and stream->closed becomes true at the same time. Previously, in this condition, after we processed DATA, we are going to try to read data from underlying transport, but there is no data, and gets EAGAIN. There was no code path to evaludate stream->closed.
2015-05-18http2: store incoming h2 SETTINGSDaniel Stenberg
2015-05-18http2: remove debug logging from on_frame_recvDaniel Stenberg
2015-05-18http2: remove the closed check in http2_recvDaniel Stenberg
With the "drained" functionality we can get here slightly asynchronously so the stream have have been closed but there is pending data left to read.
2015-05-18http2: bump the h2 buffer to 8KDaniel Stenberg
2015-05-18http2: more debug outputsDaniel Stenberg
2015-05-18http2: leave WAITPERFORM when conn is multiplexedDaniel Stenberg
No need to wait for our "spot" like for pipelining
2015-05-18http2: force "drainage" of streamsDaniel Stenberg
... which is necessary since the socket won't be readable but there is data waiting in the buffer.
2015-05-18http2: move the mem+len pair to the stream structDaniel Stenberg
2015-05-18http2: more stream-oriented data, stream ID 0 is for connectionsDaniel Stenberg
2015-05-18http2: move lots of state data to the 'stream' structDaniel Stenberg
... from the connection struct. The stream one being the 'struct HTTP' which is kept in the SessionHandle struct (easy handle). lookup streams for incoming frames in the stream hash, hashing is based on the stream id and we get the SessionHandle for the incoming stream that way.
2015-05-18HTTP: partial start at fixing up hash-lookups on http2 frame receivalDaniel Stenberg
2015-05-18http: a stream hash for h2 multiplexingDaniel Stenberg
2015-05-18http: a stream hash for h2 multiplexingDaniel Stenberg
2015-05-18http2: debug log when receiving unexpected stream_idDaniel Stenberg
2015-05-18http2: move stream_id to the HTTP struct (per-stream)Daniel Stenberg
2015-05-18Curl_http2_setup: only do it once and enable multiplex on the serverDaniel Stenberg
Once we know we are HTTP/2 enabled we know the server can multiplex.
2015-04-27http2: unify http_conn variable names to 'c'Daniel Stenberg
2015-04-02http2: Fix missing nghttp2_session_send call in Curl_http2_switchedTatsuhiro Tsujikawa
Previously in Curl_http2_switched, we called nghttp2_session_mem_recv to parse incoming data which were already received while curl was handling upgrade. But we didn't call nghttp2_session_send, and it led to make curl not send any response to the received frames. Most likely, we received SETTINGS from server at this point, so we missed opportunity to send SETTINGS + ACK. This commit adds missing nghttp2_session_send call in Curl_http2_switched to fix this issue. Bug: https://github.com/bagder/curl/issues/192 Reported-by: Stefan Eissing
2015-03-24curl_memory: make curl_memory.h the second-last header file loadedDan Fandrich
This header file must be included after all header files except memdebug.h, as it does similar memory function redefinitions and can be similarly affected by conflicting definitions in system or dependent library headers.
2015-03-23http2: move the init too for when its actually neededDaniel Stenberg
... it would otherwise lead to memory leakage if we never actually do the switch.
2015-03-19HTTP: don't switch to HTTP/2 from 1.1 until we get the 101Daniel Stenberg
We prematurely changed protocol handler to HTTP/2 which made things very slow (and wrong). Reported-by: Stefan Eissing Bug: https://github.com/bagder/curl/issues/169
2015-03-16free: instead of Curl_safefree()Daniel Stenberg
Since we just started make use of free(NULL) in order to simplify code, this change takes it a step further and: - converts lots of Curl_safefree() calls to good old free() - makes Curl_safefree() not check the pointer before free() The (new) rule of thumb is: if you really want a function call that frees a pointer and then assigns it to NULL, then use Curl_safefree(). But we will prefer just using free() from now on.
2015-03-14http2: detect prematures close without data transferedDaniel Stenberg
... by using the regular Curl_http_done() method which checks for that. This makes test 1801 fail consistently with error 56 (which seems fine) to that test is also updated here. Reported-by: Ben Darnell Bug: https://github.com/bagder/curl/issues/166
2015-03-07http2: make the info-message about receiving HTTP2 headers debug-onlyDaniel Stenberg
2015-03-03mprintf.h: remove #ifdef CURLDEBUGDaniel Stenberg
... and as a consequence, introduce curl_printf.h with that re-define magic instead and make all libcurl code use that instead.
2015-02-27http2: Return error if stream was closed with other than NO_ERRORTatsuhiro Tsujikawa
Previously, we just ignored error code passed to on_stream_close_callback and just return 0 (success) after stream closure even if stream was reset with error. This patch records error code in on_stream_close_callback, and return -1 and use CURLE_HTTP2 error code on abnormal stream closure.
2015-02-25http2: return recv error on unexpected EOFDaniel Stenberg
Pointed-out-by: Tatsuhiro Tsujikawa Bug: http://curl.haxx.se/bug/view.cgi?id=1487
2015-02-25http2: move lots of verbose output to be debug-onlyDaniel Stenberg
2015-02-09http2: Fix bug that associated stream canceled on PUSH_PROMISETatsuhiro Tsujikawa
Previously we don't ignore PUSH_PROMISE header fields in on_header callback. It makes header values mixed with following HEADERS, resulting protocol error.
2014-12-14http2: Use 'CURLcode result' for curl result codesSteve Holme
2014-11-13http2: Deal with HTTP/2 data inside response header bufferTatsuhiro Tsujikawa
Previously if HTTP/2 traffic is appended to HTTP Upgrade response header (thus they are in the same buffer), the trailing HTTP/2 traffic is not processed and lost. The appended data is most likely SETTINGS frame. If it is lost, nghttp2 library complains server does not obey the HTTP/2 protocol and issues GOAWAY frame and curl eventually drops connection. This commit fixes this problem and now trailing data is processed.
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