Daniel Stenberg [Sat, 23 May 2015 22:09:23 +0000 (00:09 +0200)]
log2changes.pl: moved to scripts/
Alessandro Ghedini [Thu, 7 May 2015 14:07:24 +0000 (16:07 +0200)]
scripts: add zsh.pl for generating zsh completion
Dan Fandrich [Sat, 23 May 2015 14:27:49 +0000 (16:27 +0200)]
test1510: another flaky test
Daniel Stenberg [Fri, 22 May 2015 14:52:03 +0000 (16:52 +0200)]
security: fix "Unchecked return value" from sscanf()
By (void) prefixing it and adding a comment. Did some minor related
cleanups.
Coverity CID
1299423.
Daniel Stenberg [Fri, 22 May 2015 14:43:58 +0000 (16:43 +0200)]
security: simplify choose_mech
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.
Daniel Stenberg [Fri, 22 May 2015 14:32:42 +0000 (16:32 +0200)]
RTSP: catch attempted unsupported requests better
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.
Daniel Stenberg [Fri, 22 May 2015 14:26:14 +0000 (16:26 +0200)]
share_init: fix OOM crash
A failed calloc() would lead to NULL pointer use.
Coverity CID
1299427.
Daniel Stenberg [Fri, 22 May 2015 07:06:44 +0000 (09:06 +0200)]
parse_proxy: switch off tunneling if non-HTTP proxy
non-HTTP proxy implies not using CURLOPT_HTTPPROXYTUNNEL
Bug: http://curl.haxx.se/mail/lib-2015-05/0056.html
Reported-by: Sean Boudreau
Daniel Stenberg [Fri, 22 May 2015 14:18:36 +0000 (16:18 +0200)]
curl: fix potential NULL dereference
Coverity CID
1299428: Dereference after null check (FORWARD_NULL)
Daniel Stenberg [Fri, 22 May 2015 13:17:16 +0000 (15:17 +0200)]
http2: on_frame_recv: return early on stream 0
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.
Daniel Stenberg [Fri, 22 May 2015 07:57:16 +0000 (09:57 +0200)]
http: removed self assignment
Follow-up fix from
b0143a2a33f0
Detected by coverity. CID
1299429
Tatsuhiro Tsujikawa [Thu, 21 May 2015 16:21:59 +0000 (01:21 +0900)]
http2: Make HTTP Upgrade work
This commit just add implicitly opened stream 1 to streams hash.
Jay Satiro [Fri, 22 May 2015 06:30:38 +0000 (02:30 -0400)]
strerror: Change SEC_E_ILLEGAL_MESSAGE description
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
Jay Satiro [Fri, 22 May 2015 03:26:32 +0000 (23:26 -0400)]
telnet: Fix read-callback change for Windows builds
Refer to
b0143a2 for more information on the read-callback change.
Daniel Stenberg [Thu, 21 May 2015 12:17:17 +0000 (14:17 +0200)]
CURLOPT_HTTPPROXYTUNNEL.3: only works with a HTTP proxy!
Dan Fandrich [Thu, 21 May 2015 07:10:31 +0000 (09:10 +0200)]
testcurl.pl: allow source to be in an arbitrary directory
This way, the build directory can be located on an entirely different
filesystem from the source code (e.g. a tmpfs).
Daniel Stenberg [Wed, 20 May 2015 12:33:04 +0000 (14:33 +0200)]
read_callback: move to SessionHandle from connectdata
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.
Daniel Stenberg [Wed, 20 May 2015 12:27:08 +0000 (14:27 +0200)]
http2: show stream IDs in decimal
It makes them easier to match output from the nghttpd test server.
Tatsuhiro Tsujikawa [Wed, 20 May 2015 14:11:43 +0000 (23:11 +0900)]
http2: Faster http2 upload
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.
Dmitry Eremin-Solenikov [Wed, 20 May 2015 19:50:55 +0000 (22:50 +0300)]
gtls: don't fail on non-fatal alerts during handshake
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.
Daniel Stenberg [Wed, 20 May 2015 06:21:27 +0000 (08:21 +0200)]
curl_easy_unescape.3: update RFC reference
Reported-by: bsammon
Bug: https://github.com/bagder/curl/issues/282
Jay Satiro [Wed, 20 May 2015 05:48:31 +0000 (01:48 -0400)]
CURLOPT_POSTFIELDS.3: Mention curl_easy_escape
.. also correct some variable naming in curl_easy_escape.3
Bug: https://github.com/bagder/curl/issues/281
Reported-by: bsammon@users.noreply.github.com
Brian Prodoehl [Tue, 19 May 2015 15:10:28 +0000 (11:10 -0400)]
openssl: Use SSL_CTX_set_msg_callback and SSL_CTX_set_msg_callback_arg
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
Jay Satiro [Tue, 19 May 2015 19:43:11 +0000 (15:43 -0400)]
curl.1: fix missing space in section --data
Daniel Stenberg [Tue, 19 May 2015 11:58:13 +0000 (13:58 +0200)]
transfer: remove erroneous and misleading comment
Kamil Dudka [Tue, 19 May 2015 10:51:40 +0000 (12:51 +0200)]
http: silence compile-time warnings without USE_NGHTTP2
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]
Jay Satiro [Tue, 19 May 2015 06:23:55 +0000 (02:23 -0400)]
transfer: Replace __func__ instances with function name
.. 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__.
Viktor Szakats [Mon, 18 May 2015 23:42:29 +0000 (01:42 +0200)]
build: bump version in default nghttp2 paths
Daniel Stenberg [Tue, 19 May 2015 05:41:01 +0000 (07:41 +0200)]
INTERNALS: we require nghttp2 1.0.0+ now
Jay Satiro [Tue, 19 May 2015 00:53:58 +0000 (20:53 -0400)]
http: Add some include guards for the new HTTP/2 stuff
Daniel Stenberg [Mon, 18 May 2015 12:01:38 +0000 (14:01 +0200)]
http2: store upload state per stream
Use a curl_off_t for upload left
Daniel Stenberg [Mon, 18 May 2015 12:09:32 +0000 (14:09 +0200)]
http2: fix build when NOT h2-enabled
Daniel Stenberg [Mon, 18 May 2015 09:41:16 +0000 (11:41 +0200)]
http2: switch to use Curl_hash_destroy()
as after
4883f7019d3, the *_clean() function only flushes the hash.
Daniel Stenberg [Mon, 18 May 2015 09:28:44 +0000 (11:28 +0200)]
curlver: restore LIBCURL_VERSION_NUM defined as a full number
As it breaks configure, curl-config and test 1023 if not.
Anthony Avina [Sat, 2 May 2015 18:49:55 +0000 (13:49 -0500)]
hostip: fix unintended destruction of hash table
.. and added unit1602 for hash.c
Daniel Stenberg [Thu, 14 May 2015 21:33:27 +0000 (23:33 +0200)]
curlver: introducing new version number (checking) macros
Daniel Stenberg [Mon, 18 May 2015 08:10:55 +0000 (10:10 +0200)]
runtests.pl: use 'h2c' now, no -14 anymore
Tatsuhiro Tsujikawa [Sat, 16 May 2015 09:13:10 +0000 (18:13 +0900)]
http2: Ignore if we have stream ID not in hash in on_stream_close
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.
Tatsuhiro Tsujikawa [Sat, 16 May 2015 09:03:47 +0000 (18:03 +0900)]
Require nghttp2 v1.0.0
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.
Daniel Stenberg [Thu, 14 May 2015 12:02:21 +0000 (14:02 +0200)]
http2: infof length in on_frame_send()
Daniel Stenberg [Wed, 13 May 2015 12:24:30 +0000 (14:24 +0200)]
pipeline: switch some code over to functions
... to "compartmentalize" a bit and make it easier to change behavior
when multiplexing is used instead of good old pipelining.
Daniel Stenberg [Tue, 12 May 2015 13:06:18 +0000 (15:06 +0200)]
symbols-in-versions: add CURLOPT_PIPEWAIT
Daniel Stenberg [Tue, 12 May 2015 12:18:46 +0000 (14:18 +0200)]
CURLOPT_PIPEWAIT: added
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.
Daniel Stenberg [Tue, 12 May 2015 09:47:33 +0000 (11:47 +0200)]
Curl_http_readwrite_headers: minor code simplification
Daniel Stenberg [Tue, 12 May 2015 09:46:58 +0000 (11:46 +0200)]
IsPipeliningPossible: fixed for http2
Daniel Stenberg [Mon, 11 May 2015 21:18:21 +0000 (23:18 +0200)]
http2: bump the h2 buffer size to 32K for speed
Daniel Stenberg [Mon, 11 May 2015 21:17:36 +0000 (23:17 +0200)]
http2: remove the stream from the hash in stream_close callback
... and suddenly things work much better!
Daniel Stenberg [Mon, 11 May 2015 13:54:50 +0000 (15:54 +0200)]
http2: if there is paused data, do not clear the drain field
Daniel Stenberg [Mon, 11 May 2015 13:10:21 +0000 (15:10 +0200)]
http2: rename s/data/pausedata
Daniel Stenberg [Mon, 11 May 2015 12:30:36 +0000 (14:30 +0200)]
http2: "stream %x" in all outputs to make it easier to search for
Daniel Stenberg [Mon, 11 May 2015 12:18:53 +0000 (14:18 +0200)]
http2: Curl_expire() all handles with incoming traffic
... so that they'll get handled next in the multi loop.
Daniel Stenberg [Mon, 11 May 2015 10:05:14 +0000 (12:05 +0200)]
http2: don't signal settings change for same values
Daniel Stenberg [Mon, 11 May 2015 09:41:10 +0000 (11:41 +0200)]
http2: set default concurrency, fix ConnectionExists for multiplex
Daniel Stenberg [Mon, 18 May 2015 06:56:29 +0000 (08:56 +0200)]
bundles: store no/default/pipeline/multiplex
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.
Daniel Stenberg [Fri, 8 May 2015 13:53:18 +0000 (15:53 +0200)]
http2: lazy init header_recvbuf
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!
Daniel Stenberg [Fri, 8 May 2015 12:42:59 +0000 (14:42 +0200)]
http2: separate multiplex/pipelining + cleanup memory leaks
Daniel Stenberg [Fri, 8 May 2015 08:43:36 +0000 (10:43 +0200)]
CURLMOPT_PIPELINE: bit 1 is for multiplexing
Tatsuhiro Tsujikawa [Thu, 7 May 2015 14:19:08 +0000 (23:19 +0900)]
http2: Fix bug that data to be drained are overwritten by pending "paused" data
Tatsuhiro Tsujikawa [Thu, 7 May 2015 15:52:48 +0000 (17:52 +0200)]
http2: Don't call nghttp2_session_mem_recv while it is paused by a stream
Tatsuhiro Tsujikawa [Thu, 7 May 2015 08:22:57 +0000 (17:22 +0900)]
http2: Read data left in connection buffer after pause
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.
Tatsuhiro Tsujikawa [Thu, 7 May 2015 05:51:32 +0000 (14:51 +0900)]
http2: Fix streams get stuck
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.
Daniel Stenberg [Thu, 7 May 2015 14:44:00 +0000 (16:44 +0200)]
http2: store incoming h2 SETTINGS
Daniel Stenberg [Thu, 7 May 2015 07:00:20 +0000 (09:00 +0200)]
pipeline: move function to pipeline.c and make static
... as it was only used from there.
Daniel Stenberg [Thu, 7 May 2015 06:59:28 +0000 (08:59 +0200)]
IsPipeliningPossible: http2 can always "pipeline" (multiplex)
Daniel Stenberg [Mon, 4 May 2015 12:03:29 +0000 (14:03 +0200)]
http2: remove debug logging from on_frame_recv
Daniel Stenberg [Mon, 4 May 2015 08:14:42 +0000 (10:14 +0200)]
http2: remove the closed check in http2_recv
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.
Daniel Stenberg [Mon, 4 May 2015 08:14:27 +0000 (10:14 +0200)]
http2: bump the h2 buffer to 8K
Daniel Stenberg [Mon, 4 May 2015 08:03:07 +0000 (10:03 +0200)]
http2: Curl_read should not use the single buffer
... as it does for pipelining when we're multiplexing, as we need the
different buffers to store incoming data correctly for all streams.
Daniel Stenberg [Thu, 30 Apr 2015 16:34:41 +0000 (18:34 +0200)]
http2: more debug outputs
Daniel Stenberg [Thu, 30 Apr 2015 13:25:06 +0000 (15:25 +0200)]
http2: leave WAITPERFORM when conn is multiplexed
No need to wait for our "spot" like for pipelining
Daniel Stenberg [Thu, 30 Apr 2015 06:20:49 +0000 (08:20 +0200)]
http2: force "drainage" of streams
... which is necessary since the socket won't be readable but there is
data waiting in the buffer.
Daniel Stenberg [Wed, 29 Apr 2015 15:00:53 +0000 (17:00 +0200)]
http2: move the mem+len pair to the stream struct
Daniel Stenberg [Wed, 29 Apr 2015 13:21:45 +0000 (15:21 +0200)]
http2: more stream-oriented data, stream ID 0 is for connections
Daniel Stenberg [Wed, 29 Apr 2015 12:19:39 +0000 (14:19 +0200)]
http2: move lots of state data to the 'stream' struct
... 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.
Daniel Stenberg [Tue, 28 Apr 2015 18:39:47 +0000 (20:39 +0200)]
HTTP: partial start at fixing up hash-lookups on http2 frame receival
Daniel Stenberg [Tue, 28 Apr 2015 11:10:04 +0000 (13:10 +0200)]
http: a stream hash for h2 multiplexing
Daniel Stenberg [Tue, 28 Apr 2015 11:10:04 +0000 (13:10 +0200)]
http: a stream hash for h2 multiplexing
Daniel Stenberg [Mon, 27 Apr 2015 12:46:20 +0000 (14:46 +0200)]
http2: debug log when receiving unexpected stream_id
Daniel Stenberg [Mon, 27 Apr 2015 11:54:47 +0000 (13:54 +0200)]
http2: move stream_id to the HTTP struct (per-stream)
Daniel Stenberg [Mon, 27 Apr 2015 10:52:07 +0000 (12:52 +0200)]
Curl_http2_setup: only do it once and enable multiplex on the server
Once we know we are HTTP/2 enabled we know the server can multiplex.
Daniel Stenberg [Mon, 27 Apr 2015 10:51:29 +0000 (12:51 +0200)]
http: switch on "pipelining" (multiplexing) for HTTP/2 servers
... and do not blacklist any.
Daniel Stenberg [Fri, 15 May 2015 20:32:15 +0000 (22:32 +0200)]
README.pipelining: removed
All the details mentioned here are better documented in man pages
Dan Fandrich [Thu, 14 May 2015 12:55:48 +0000 (14:55 +0200)]
build: removed bundles.c from make files
This file was removed in commit
fd137786
Daniel Stenberg [Thu, 14 May 2015 12:06:44 +0000 (14:06 +0200)]
Curl_conncache_add_conn: fix memory leak on OOM
Daniel Stenberg [Tue, 12 May 2015 21:47:01 +0000 (23:47 +0200)]
CURLMOPT_MAX_HOST_CONNECTIONS: host = host name + port number
Daniel Stenberg [Tue, 12 May 2015 21:40:10 +0000 (23:40 +0200)]
conncache: keep bundles on host+port bases, not only host names
Previously we counted all connections to a specific host name and that
would be used for the CURLMOPT_MAX_HOST_CONNECTIONS check for example,
while servers on different port numbers are normally considered
different "origins" on the web and should thus be considered different
hosts.
Daniel Stenberg [Tue, 12 May 2015 21:06:11 +0000 (23:06 +0200)]
bundles: merged into conncache.c
All the existing Curl_bundle* functions were only ever used from within
the conncache.c file, so I moved them over and made them static (and
removed the Curl_ prefix).
Daniel Stenberg [Tue, 12 May 2015 07:46:53 +0000 (09:46 +0200)]
hostcache: made all host caches use structs, not pointers
This avoids unnecessary dynamic allocs and as this also removed the last
users of *hash_alloc() and *hash_destroy(), those two functions are now
removed.
Daniel Stenberg [Tue, 12 May 2015 07:28:37 +0000 (09:28 +0200)]
multi: converted socket hash into non-allocated struct
avoids extra dynamic allocation
Daniel Stenberg [Tue, 12 May 2015 07:15:02 +0000 (09:15 +0200)]
connection cache: avoid Curl_hash_alloc()
... by using plain structs instead of pointers for the connection cache,
we can avoid several dynamic allocations that weren't necessary.
Daniel Stenberg [Fri, 8 May 2015 11:00:18 +0000 (13:00 +0200)]
proxy: add newline to info message
Patrick Monnerat [Fri, 8 May 2015 13:26:59 +0000 (15:26 +0200)]
FTP: fix dangling conn->ip_addr dereference on verbose EPSV.
Patrick Monnerat [Fri, 8 May 2015 11:55:15 +0000 (13:55 +0200)]
FTP: Make EPSV use the control IP address rather than the original host.
This ensures an alternate address is not used.
Does not apply to proxy tunnel.
Alessandro Ghedini [Thu, 7 May 2015 13:34:30 +0000 (15:34 +0200)]
tool_help: fix formatting for --next option
Egon Eckert [Fri, 8 May 2015 06:26:37 +0000 (08:26 +0200)]
opts: improved the TCP keepalive examples
Jay Satiro [Fri, 8 May 2015 05:09:57 +0000 (01:09 -0400)]
winbuild: Document the option used to statically link the CRT
- Document option RTLIBCFG (runtime library configuration).
Bug: https://github.com/bagder/curl/issues/254
Reported-by: Bert Huijben
Orgad Shaneh [Wed, 6 May 2015 06:33:57 +0000 (02:33 -0400)]
netrc: Read in text mode when cygwin
Use text mode when cygwin to eliminate trailing carriage returns.
Bug: https://github.com/bagder/curl/pull/258
Patrick Monnerat [Tue, 5 May 2015 12:05:41 +0000 (14:05 +0200)]
OS400: Add SPNEGO service name options to ILE/RPG binding.
Daniel Stenberg [Mon, 4 May 2015 21:45:25 +0000 (23:45 +0200)]
curl_multi_info_read.3: fix typo
Reported-by: Liviu Chircu
Daniel Stenberg [Mon, 4 May 2015 12:17:28 +0000 (14:17 +0200)]
MANUAL: language fix
Reported-by: Fred Stluka
Bug: https://github.com/bagder/curl/issues/255