summaryrefslogtreecommitdiff
path: root/lib
Commit message (Collapse)AuthorAgeFilesLines
* security: fix "Unchecked return value" from sscanf()Daniel Stenberg2015-05-221-9/+9
| | | | | | | By (void) prefixing it and adding a comment. Did some minor related cleanups. Coverity CID 1299423.
* security: simplify choose_mechDaniel Stenberg2015-05-221-33/+19
| | | | | | | | Coverity CID 1299424 identified dead code because of checks that could never equal true (if the mechanism's name was NULL). Simplified the function by removing a level of pointers and removing the loop and array that weren't used.
* RTSP: catch attempted unsupported requests betterDaniel Stenberg2015-05-221-3/+2
| | | | | | | | Replace use of assert with code that properly catches bad input at run-time even in non-debug builds. This flaw was sort of detected by Coverity CID 1299425 which claimed the "case RTSPREQ_NONE" was dead code.
* share_init: fix OOM crashDaniel Stenberg2015-05-221-4/+5
| | | | | | A failed calloc() would lead to NULL pointer use. Coverity CID 1299427.
* parse_proxy: switch off tunneling if non-HTTP proxyDaniel Stenberg2015-05-221-2/+3
| | | | | | | non-HTTP proxy implies not using CURLOPT_HTTPPROXYTUNNEL Bug: http://curl.haxx.se/mail/lib-2015-05/0056.html Reported-by: Sean Boudreau
* http2: on_frame_recv: return early on stream 0Daniel Stenberg2015-05-221-0/+3
| | | | | | | Coverity CID 1299426 warned about possible NULL dereference otherwise, but that would only ever happen if we get invalid HTTP/2 data with frames for stream 0. Avoid this risk by returning early when stream 0 is used.
* http: removed self assignmentDaniel Stenberg2015-05-221-2/+0
| | | | | | Follow-up fix from b0143a2a33f0 Detected by coverity. CID 1299429
* http2: Make HTTP Upgrade workTatsuhiro Tsujikawa2015-05-221-0/+7
| | | | This commit just add implicitly opened stream 1 to streams hash.
* strerror: Change SEC_E_ILLEGAL_MESSAGE descriptionJay Satiro2015-05-221-0/+6
| | | | | | | | | Prior to this change the description for SEC_E_ILLEGAL_MESSAGE was OS and language specific, and invariably translated to something not very helpful like: "The message received was unexpected or badly formatted." Bug: https://github.com/bagder/curl/issues/267 Reported-by: Michael Osipov
* telnet: Fix read-callback change for Windows buildsJay Satiro2015-05-211-1/+2
| | | | Refer to b0143a2 for more information on the read-callback change.
* read_callback: move to SessionHandle from connectdataDaniel Stenberg2015-05-2010-38/+31
| | | | | | | With many easy handles using the same connection for multiplexing, it is important we store and keep the transfer-oriented stuff in the SessionHandle so that callbacks and callback data work fine even when many easy handles share the same physical connection.
* http2: show stream IDs in decimalDaniel Stenberg2015-05-201-19/+19
| | | | It makes them easier to match output from the nghttpd test server.
* http2: Faster http2 uploadTatsuhiro Tsujikawa2015-05-201-0/+13
| | | | | | | | | | | | | | Previously, when we send all given buffer in data_source_callback, we return NGHTTP2_ERR_DEFERRED, and nghttp2 library removes this stream temporarily for writing. This itself is good. If this is the sole stream in the session, nghttp2_session_want_write() returns zero, which means that libcurl does not check writeability of the underlying socket. This leads to very slow upload, because it seems curl only upload 16k something per 1 second. To fix this, if we still have data to send, call nghttp2_session_resume_data after nghttp2_session_send. This makes nghttp2_session_want_write() returns nonzero (if connection window still opens), and as a result, socket writeability is checked, and upload speed becomes normal.
* gtls: don't fail on non-fatal alerts during handshakeDmitry Eremin-Solenikov2015-05-201-1/+2
| | | | | | Stop curl from failing when non-fatal alert is received during handshake. This e.g. fixes lots of problems when working with https sites through proxies.
* openssl: Use SSL_CTX_set_msg_callback and SSL_CTX_set_msg_callback_argBrian Prodoehl2015-05-191-12/+6
| | | | | | | | BoringSSL removed support for direct callers of SSL_CTX_callback_ctrl and SSL_CTX_ctrl, so move to a way that should work on BoringSSL and OpenSSL. re #275
* transfer: remove erroneous and misleading commentDaniel Stenberg2015-05-191-7/+0
|
* http: silence compile-time warnings without USE_NGHTTP2Kamil Dudka2015-05-191-2/+4
| | | | | | | | | Error: CLANG_WARNING: lib/http.c:173:16: warning: Value stored to 'http' during its initialization is never read Error: COMPILER_WARNING: lib/http.c: scope_hint: In function ‘http_disconnect’ lib/http.c:173:16: warning: unused variable ‘http’ [-Wunused-variable]
* transfer: Replace __func__ instances with function nameJay Satiro2015-05-192-3/+4
| | | | | | | .. also make __func__ replacement in multi. Prior to this change debug builds would fail to build if the compiler was building pre-c99 and didn't support __func__.
* build: bump version in default nghttp2 pathsViktor Szakats2015-05-191-1/+1
|
* http: Add some include guards for the new HTTP/2 stuffJay Satiro2015-05-182-0/+8
|
* http2: store upload state per streamDaniel Stenberg2015-05-182-20/+51
| | | | Use a curl_off_t for upload left
* http2: fix build when NOT h2-enabledDaniel Stenberg2015-05-183-15/+17
|
* http2: switch to use Curl_hash_destroy()Daniel Stenberg2015-05-181-1/+1
| | | | as after 4883f7019d3, the *_clean() function only flushes the hash.
* hostip: fix unintended destruction of hash tableAnthony Avina2015-05-186-9/+24
| | | | .. and added unit1602 for hash.c
* http2: Ignore if we have stream ID not in hash in on_stream_closeTatsuhiro Tsujikawa2015-05-181-4/+6
| | | | | | We could get stream ID not in the hash in on_stream_close. For example, if we decided to reject stream (e.g., PUSH_PROMISE), then we don't create stream and store it in hash with its stream ID.
* Require nghttp2 v1.0.0Tatsuhiro Tsujikawa2015-05-181-103/+29
| | | | | | | | | | | | | | | | | | | This commit requires nghttp2 v1.0.0 to compile, and migrate to v1.0.0, and utilize recent version of nghttp2 to simplify the code, First we use nghttp2_option_set_no_recv_client_magic function to detect nghttp2 v1.0.0. That function only exists since v1.0.0. Since nghttp2 v0.7.5, nghttp2 ensures header field ordering, and validates received header field. If it found error, RST_STREAM with PROTOCOL_ERROR is issued. Since we require v1.0.0, we can utilize this feature to simplify libcurl code. This commit does this. Migration from 0.7 series are done based on nghttp2 migration document. For libcurl, we removed the code sending first 24 bytes client magic. It is now done by nghttp2 library. on_invalid_frame_recv callback signature changed, and is updated accordingly.
* http2: infof length in on_frame_send()Daniel Stenberg2015-05-181-1/+2
|
* pipeline: switch some code over to functionsDaniel Stenberg2015-05-185-59/+118
| | | | | ... to "compartmentalize" a bit and make it easier to change behavior when multiplexing is used instead of good old pipelining.
* CURLOPT_PIPEWAIT: addedDaniel Stenberg2015-05-182-13/+35
| | | | | By setting this option to 1 libcurl will wait for a connection to reveal if it is possible to pipeline/multiplex on before it continues.
* Curl_http_readwrite_headers: minor code simplificationDaniel Stenberg2015-05-181-5/+2
|
* IsPipeliningPossible: fixed for http2Daniel Stenberg2015-05-181-5/+10
|
* http2: bump the h2 buffer size to 32K for speedDaniel Stenberg2015-05-181-1/+1
|
* http2: remove the stream from the hash in stream_close callbackDaniel Stenberg2015-05-182-11/+6
| | | | ... and suddenly things work much better!
* http2: if there is paused data, do not clear the drain fieldDaniel Stenberg2015-05-181-8/+17
|
* http2: rename s/data/pausedataDaniel Stenberg2015-05-183-18/+19
|
* http2: "stream %x" in all outputs to make it easier to search forDaniel Stenberg2015-05-181-2/+2
|
* http2: Curl_expire() all handles with incoming trafficDaniel Stenberg2015-05-181-2/+5
| | | | ... so that they'll get handled next in the multi loop.
* http2: don't signal settings change for same valuesDaniel Stenberg2015-05-181-4/+10
|
* http2: set default concurrency, fix ConnectionExists for multiplexDaniel Stenberg2015-05-187-12/+94
|
* bundles: store no/default/pipeline/multiplexDaniel Stenberg2015-05-187-35/+46
| | | | | | | to allow code to act differently on the situation. Also added some more info message for the connection re-use function to make it clearer when connections are not re-used.
* http2: lazy init header_recvbufDaniel Stenberg2015-05-182-1/+3
| | | | | 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!
* http2: separate multiplex/pipelining + cleanup memory leaksDaniel Stenberg2015-05-187-40/+62
|
* CURLMOPT_PIPELINE: bit 1 is for multiplexingDaniel Stenberg2015-05-186-27/+23
|
* http2: Fix bug that data to be drained are overwritten by pending "paused" dataTatsuhiro Tsujikawa2015-05-181-17/+16
|
* http2: Don't call nghttp2_session_mem_recv while it is paused by a streamTatsuhiro Tsujikawa2015-05-182-3/+28
|
* http2: Read data left in connection buffer after pauseTatsuhiro Tsujikawa2015-05-182-20/+46
| | | | | | | | 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: Fix streams get stuckTatsuhiro Tsujikawa2015-05-181-20/+22
| | | | | | | | 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.
* http2: store incoming h2 SETTINGSDaniel Stenberg2015-05-182-7/+34
|
* pipeline: move function to pipeline.c and make staticDaniel Stenberg2015-05-182-9/+10
| | | | ... as it was only used from there.
* IsPipeliningPossible: http2 can always "pipeline" (multiplex)Daniel Stenberg2015-05-181-5/+12
|