summaryrefslogtreecommitdiff
path: root/lib/http.h
Commit message (Collapse)AuthorAgeFilesLines
* whitespace fixesViktor Szakats2018-09-231-1/+0
| | | | | | | | | | | - replace tabs with spaces where possible - remove line ending spaces - remove double/triple newlines at EOF - fix a non-UTF-8 character - cleanup a few indentations/line continuations in manual examples Closes https://github.com/curl/curl/pull/3037
* http: made Curl_add_buffer functions take a pointer-pointerDaniel Stenberg2018-09-161-7/+11
| | | | | | | ... so that they can clear the original pointer on failure, which makes the error-paths and their cleanups easier. Closes #2992
* http2: use the correct function pointer typedefDaniel Stenberg2018-05-141-6/+2
| | | | | | | Fixes gcc-8 picky compiler warnings Reported-by: Rikard Falkeborn Bug: #2560 Closes #2568
* cleanup: misc typos in strings and commentsluz.paz2018-03-161-1/+1
| | | | | | Found via `codespell` Closes #2389
* http2: mark the connection for close on GOAWAYDaniel Stenberg2018-03-121-3/+2
| | | | | | | | | ... don't consider it an error! Assisted-by: Jay Satiro Reported-by: Ɓukasz Domeradzki Fixes #2365 Closes #2375
* Curl_checkheaders: make it available for IMAP and SMTP tooDaniel Stenberg2017-09-111-2/+0
| | | | | | ... not only HTTP uses this now. Closes #1875
* mime: unified to use the typedef'd mime structs everywhereDaniel Stenberg2017-09-051-2/+2
| | | | ... and slightly edited to follow our code style better.
* mime: new MIME API.Patrick Monnerat2017-09-021-2/+2
| | | | | | | Available in HTTP, SMTP and IMAP. Deprecates the FORM API. See CURLOPT_MIMEPOST. Lib code and associated documentation.
* http: s/TINY_INITIAL_POST_SIZE/EXPECT_100_THRESHOLDDaniel Stenberg2017-07-061-3/+8
| | | | | Make the name reflect its use better, and add a short comment describing what it's for.
* http2: disable server push if not requestedAlessandro Ghedini2017-01-151-0/+4
| | | | Ref: https://github.com/curl/curl/pull/1160
* http2: handle closed streams when uploadingTatsuhiro Tsujikawa2016-08-281-0/+1
| | | | Fixes #986
* internals: rename the SessionHandle struct to Curl_easyDaniel Stenberg2016-06-221-4/+4
|
* http2: Use size_t type for data drain countJay Satiro2016-04-121-1/+1
| | | | | Ref: https://github.com/curl/curl/issues/659 Ref: https://github.com/curl/curl/pull/663
* http2: Ensure that http2_handle_stream_close is calledTatsuhiro Tsujikawa2016-04-111-0/+1
| | | | | | | | | | | | | | | | | | | This commit ensures that streams which was closed in on_stream_close callback gets passed to http2_handle_stream_close. Previously, this might not happen. To achieve this, we increment drain property to forcibly call recv function for that stream. To more accurately check that we have no pending event before shutting down HTTP/2 session, we sum up drain property into http_conn.drain_total. We only shutdown session if that value is 0. With this commit, when stream was closed before reading response header fields, error code CURLE_HTTP2_STREAM is returned even if HTTP/2 level error is NO_ERROR. This signals the upper layer that stream was closed by error just like TCP connection close in HTTP/1. Ref: https://github.com/curl/curl/issues/659 Ref: https://github.com/curl/curl/pull/663
* URLs: change all http:// URLs to https://Daniel Stenberg2016-02-031-1/+1
|
* http2: Support trailer fieldsTatsuhiro Tsujikawa2015-12-151-0/+1
| | | | | | | | | | | | | | | | | | | | | | | This commit adds trailer support in HTTP/2. In HTTP/1.1, chunked encoding must be used to send trialer fields. HTTP/2 deprecated any trandfer-encoding, including chunked. But trailer fields are now always available. Since trailer fields are relatively rare these days (gRPC uses them extensively though), allocating buffer for trailer fields is done when we detect that HEADERS frame containing trailer fields is started. We use Curl_add_buffer_* functions to buffer all trailers, just like we do for regular header fields. And then deliver them when stream is closed. We have to be careful here so that all data are delivered to upper layer before sending trailers to the application. We can deliver trailer field one by one using NGHTTP2_ERR_PAUSE mechanism, but current method is far more simple. Another possibility is use chunked encoding internally for HTTP/2 traffic. I have not tested it, but it could add another overhead. Closes #564
* http2: discard frames with no SessionHandleAnders Bakken2015-08-111-1/+0
| | | | | | | | | | | | Return 0 instead of NGHTTP2_ERR_CALLBACK_FAILURE if we can't locate the SessionHandle. Apparently mod_h2 will sometimes send a frame for a stream_id we're finished with. Use nghttp2_session_get_stream_user_data and nghttp2_session_set_stream_user_data to identify SessionHandles instead of a hash. Closes #372
* http2: fixed the header accessor functions for the push callbackDaniel Stenberg2015-06-241-1/+4
|
* http2: setup the new pushed stream properlyDaniel Stenberg2015-06-241-0/+1
|
* http: Add some include guards for the new HTTP/2 stuffJay Satiro2015-05-181-0/+4
|
* http2: store upload state per streamDaniel Stenberg2015-05-181-3/+4
| | | | Use a curl_off_t for upload left
* http2: rename s/data/pausedataDaniel Stenberg2015-05-181-2/+2
|
* http2: separate multiplex/pipelining + cleanup memory leaksDaniel Stenberg2015-05-181-0/+1
|
* http2: Don't call nghttp2_session_mem_recv while it is paused by a streamTatsuhiro Tsujikawa2015-05-181-0/+2
|
* http2: Read data left in connection buffer after pauseTatsuhiro Tsujikawa2015-05-181-0/+2
| | | | | | | | 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.
* http2: store incoming h2 SETTINGSDaniel Stenberg2015-05-181-0/+8
|
* http2: force "drainage" of streamsDaniel Stenberg2015-05-181-0/+1
| | | | | ... which is necessary since the socket won't be readable but there is data waiting in the buffer.
* http2: move the mem+len pair to the stream structDaniel Stenberg2015-05-181-2/+3
|
* http2: more stream-oriented data, stream ID 0 is for connectionsDaniel Stenberg2015-05-181-2/+2
|
* http2: move lots of state data to the 'stream' structDaniel Stenberg2015-05-181-6/+5
| | | | | | | | | ... 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.
* HTTP: partial start at fixing up hash-lookups on http2 frame receivalDaniel Stenberg2015-05-181-5/+5
|
* http: a stream hash for h2 multiplexingDaniel Stenberg2015-05-181-0/+3
|
* http2: move stream_id to the HTTP struct (per-stream)Daniel Stenberg2015-05-181-1/+3
|
* http2: Return error if stream was closed with other than NO_ERRORTatsuhiro Tsujikawa2015-02-271-1/+2
| | | | | | | | 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.
* HTTP2: Support expect: 100-continueTatsuhiro Tsujikawa2014-08-021-1/+4
| | | | | | | "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.
* CURLOPT_PROXYHEADER: set headers for proxy-onlyDaniel Stenberg2014-04-041-2/+7
| | | | | | Includes docs and new test cases: 1525, 1526 and 1527 Co-written-by: Vijay Panghal
* http2: Support HTTP POST/PUTTatsuhiro Tsujikawa2014-02-171-1/+9
| | | | | | | | | 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.
* http2: handle incoming data larger than remaining bufferTatsuhiro Tsujikawa2014-02-041-0/+4
|
* http2: Check stream ID we are interested inTatsuhiro Tsujikawa2014-02-041-0/+1
|
* http2: store response header in temporary bufferTatsuhiro Tsujikawa2014-02-041-0/+3
|
* HTTP2: add layer between existing http and socket(TLS) layerTatsuhiro Tsujikawa2014-02-041-0/+6
| | | | | | | | | | | | | | | | | | 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.
* http2: add CRLF when first data arrivesDaniel Stenberg2014-01-301-1/+1
|
* http2: convert HEADER frames to HTTP1-like headersDaniel Stenberg2014-01-301-1/+1
| | | | ... and then go through the "normal" HTTP engine.
* http2: do the POST Upgrade dance properlyDaniel Stenberg2014-01-301-1/+4
|
* http2: switch recv/send functions to http2 ones after 101Daniel Stenberg2014-01-291-0/+3
|
* http: Post base64 decoding tidy upSteve Holme2013-11-031-4/+4
| | | | | | | | | | | Renamed copy_header_value() to Curl_copy_header_value() as this function is now non static. Simplified proxy flag in Curl_http_input_auth() when calling sub-functions. Removed unnecessary white space removal when using negotiate as it had been missed in commit cdccb422671aeb.
* http: Added proxy tunnel authentication message header value extractionSteve Holme2013-11-021-1/+2
| | | | | | ...following recent changes to Curl_base64_decode() rather than trying to parse a header line for the authentication mechanisms which is CRLF terminated and inline zero terminate it.
* http: fix build warning under LLVMNick Zitzmann2013-09-071-0/+2
| | | | | | | When building the code using LLVM Clang without NGHTTP2, I was getting this warning: ../lib/http.h:155:1: warning: empty struct is a GNU extension [-Wgnu] Placing a dummy variable into the data structure silenced the warning.
* http2: actually init nghttp2 and send HTTP2-Settings properlyDaniel Stenberg2013-09-071-0/+12
|
* urldata: clean up the use of the protocol specific structsDaniel Stenberg2013-08-121-1/+2
| | | | | | | | 1 - always allocate the struct in protocol->setup_connection. Some protocol handlers had to get this function added. 2 - always free at the end of a request. This is also an attempt to keep less memory in the handle after it is completed.