1
0
mirror of https://github.com/moparisthebest/curl synced 2024-08-13 17:03:50 -04:00
Commit Graph

8638 Commits

Author SHA1 Message Date
Steve Holme
97c9d2ae8c imap.c: Fixed compilation warning with /Wall enabled
warning C4701: potentially uninitialized local variable 'size' used

Technically this can't happen, as the usage of 'size' is protected by
'if(parsed)' and 'parsed' is only set after 'size' has been parsed.

Anyway, lets keep the compiler happy.
2016-03-19 11:01:36 +00:00
Steve Holme
7e312bdfdd formdata.c: Fixed compilation warning
formdata.c:390: warning: cast from pointer to integer of different size

Introduced in commit ca5f9341ef this happens because a char*, which is
32-bits wide in 32-bit land, is being cast to a curl_off_t which is
64-bits wide where 64-bit integers are supported by the compiler.

This doesn't happen in 64-bit land as a pointer is the same size as a
curl_off_t.

This fix doesn't address the fact that a 64-bit value cannot be used
for CURLFORM_CONTENTLEN when set in a form array and compiled on a
32-bit platforms, it does at least suppress the compilation warning.
2016-03-18 07:19:31 +00:00
Gisle Vanem
d816e8cf52 openssl: adapt to API breakage in ERR_remove_thread_state()
The OpenSSL API change that broke this is "Convert ERR_STATE to new
multi-threading API": openssl commit 8509dcc.

Closes #713
2016-03-17 10:42:33 +01:00
Daniel Stenberg
8d9d03a157 version: init moved to private name space, added protos
follow-up to 80015cdd52
2016-03-17 00:55:46 +01:00
Daniel Stenberg
5f5b626357 openssl: verbose: show matching SAN pattern
... to allow users to see which specfic wildcard that matched when such
is used.

Also minor logic cleanup to simplify the code, and I removed all tabs
from verbose strings.
2016-03-17 00:49:02 +01:00
Jay Satiro
80015cdd52 version: thread safety 2016-03-16 19:13:42 -04:00
Steve Holme
0e18b8b107 transfer: Removed redundant HTTP authentication include files
It would also seem that share.h is not required here either as there
are no references to the Curl_share structure or functions.
2016-03-16 07:13:16 +00:00
Steve Holme
cd869cf1c1 easy: Removed redundant HTTP authentication include files 2016-03-16 06:59:42 +00:00
Steve Holme
3ccc2621a1 curl_sasl: Minor code indent fixes 2016-03-15 06:47:13 +00:00
Daniel Stenberg
b51f04bf23 easy: add check to malloc() when running event-based
... to allow torture tests then too.
2016-03-14 15:37:03 +01:00
Daniel Stenberg
6a353b105a memdebug: skip logging the limit countdown, fflush when reached 2016-03-14 15:36:40 +01:00
Daniel Stenberg
3c6238b3eb curl_sasl.c: minor code indent fixes 2016-03-14 09:55:38 +01:00
Daniel Stenberg
c3aca6ed47 multi: simplified singlesocket
Since sh_getentry() now checks for invalid sockets itself and by
narrowing the scope of the remove_sock_from_hash variable.
2016-03-14 09:44:14 +01:00
Daniel Stenberg
8eaf884417 multi: introduce sh_getentry() for looking up sockets in the sockhash
Simplify the code by using a single entry that looks for a socket in the
socket hash. As indicated in #712, the code looked for CURL_SOCKET_BAD
at some point and that is ineffective/wrong and this makes it easier to
avoid that.
2016-03-14 09:18:01 +01:00
Jaime Fullaondo
c0717a7059 multi hash: ensure modulo performed on curl_socket_t
Closes #712
2016-03-14 08:16:52 +01:00
Steve Holme
5dc43b975b base64: Minor coding standard and style updates 2016-03-13 17:59:06 +00:00
Steve Holme
0e16de870f base64: Use 'CURLcode result' for curl result codes 2016-03-13 17:14:57 +00:00
Steve Holme
9eb158821f negotiate: Use 'CURLcode result' for curl result codes 2016-03-13 17:09:58 +00:00
Maksim Kuzevanov
d7e3942814 multi_runsingle: avoid loop in CURLM_STATE_WAITPROXYCONNECT
Closes #703
2016-03-13 12:41:17 +01:00
Steve Holme
e4a0a9ef18 digest: Use boolean based success code for Curl_sasl_digest_get_pair()
Rather than use a 0 and 1 integer base result code use a TRUE / FALSE
based success code.
2016-03-12 17:25:15 +00:00
Steve Holme
a7a653fd58 digest: Corrected some typos in comments 2016-03-12 13:20:03 +00:00
Steve Holme
f0fbd099b4 krb5: Corrected some typos in function descriptions 2016-03-12 11:59:52 +00:00
Steve Holme
dbb90e7e9f ntlm: Corrected some typos in function descriptions 2016-03-12 11:56:10 +00:00
Steve Holme
06ccaa0c68 url: Corrected indentation when calling idna_to_ascii_lz() 2016-03-11 07:46:09 +00:00
Steve Holme
58e4a06743 idn_win32: Use boolean based success codes
Rather than use 0 and 1 integer base result codes use a FALSE / TRUE
based success code.
2016-03-11 07:24:39 +00:00
Daniel Stenberg
b084173989 idn_win32.c: warning: Trailing whitespace 2016-03-10 23:32:45 +01:00
Steve Holme
28477fd67a idn_win32.c: Fixed compilation warning from commit 9e7fcd4291
warning C4267: 'function': conversion from 'size_t' to 'int',
               possible loss of data
2016-03-10 21:52:09 +00:00
Daniel Stenberg
863c5766dd ftp: remove a check for NULL(!)
... as it implies we need to check for that on all the other variable
references as well (as Coverity otherwise warns us for missing NULL
checks), and we're alredy making sure that the pointer is never NULL.
2016-03-10 13:52:22 +01:00
Daniel Stenberg
7f7fcd0d75 cookies: first n/v pair in Set-Cookie: is the cookie, then parameters
RFC 6265 section 4.1.1 spells out that the first name/value pair in the
header is the actual cookie name and content, while the following are
the parameters.

libcurl previously had a more liberal approach which causes significant
problems when introducing new cookie parameters, like the suggested new
cookie priority draft.

The previous logic read all n/v pairs from left-to-right and the first
name used that wassn't a known parameter name would be used as the
cookie name, thus accepting "Set-Cookie: Max-Age=2; person=daniel" to be
a cookie named 'person' while an RFC 6265 compliant parser should
consider that to be a cookie named 'Max-Age' with an (unknown) parameter
'person'.

Fixes #709
2016-03-10 11:26:12 +01:00
Daniel Stenberg
4d4ce84bb3 krb5: improved type handling to avoid clang compiler warnings 2016-03-10 10:40:10 +01:00
Daniel Stenberg
549b1a433a url.c: fix clang warning: no newline at end of file 2016-03-10 09:36:49 +01:00
Daniel Stenberg
77e1726719 curl_multi_wait: never return -1 in 'numfds'
Such a return value isn't documented but could still happen, and the
curl tool code checks for it. It would happen when the underlying
Curl_poll() function returns an error. Starting now we mask that error
as a user of curl_multi_wait() would have no way to handle it anyway.

Reported-by: Jay Satiro
Closes #707
2016-03-10 08:17:25 +01:00
Steve Holme
a5aec58726 imap/pop3/smtp: Fixed connections upgraded with TLS are not reused
Regression since commit 710f14edba.

Bug: https://github.com/curl/curl/issues/422
Reported-by: Justin Ehlert
2016-03-08 19:36:46 +00:00
Tim Rühsen
c140bd7891 cookie: do not refuse cookies for localhost
Closes #658
2016-03-08 15:27:43 +01:00
Daniel Stenberg
cb222bcfef ftp_done: clear tunnel_state when secondary socket closes
Introducing a function for closing the secondary connection to make this
bug less likely to happen again.

Reported-by: daboul
Closes #701
2016-03-08 15:00:53 +01:00
Gisle Vanem
a7ec58a89f openssl: use the correct OpenSSL/BoringSSL/LibreSSL in messages 2016-03-08 14:19:01 +01:00
Anders Bakken
46bf7ff78d pipeline: Sanity check pipeline pointer before accessing it.
I got a crash with this stack:

curl/lib/url.c:2873 (Curl_removeHandleFromPipeline)
curl/lib/url.c:2919 (Curl_getoff_all_pipelines)
curl/lib/multi.c:561 (curl_multi_remove_handle)
curl/lib/url.c:415 (Curl_close)
curl/lib/easy.c:859 (curl_easy_cleanup)

Closes #704
2016-03-08 00:25:53 +01:00
Jay Satiro
1e58922f1e mprintf: update trio project link 2016-03-06 22:57:47 -05:00
Viktor Szakats
6c7a5b9603 makefile.m32: add missing libs for static -winssl-ssh2 builds
Bug: https://github.com/curl/curl/pull/693
2016-03-05 21:50:12 -05:00
Jay Satiro
81bdd85318 mbedtls: fix user-specified SSL protocol version
Prior to this change when a single protocol CURL_SSLVERSION_ was
specified by the user that version was set only as the minimum version
but not as the maximum version as well.
2016-03-05 21:39:36 -05:00
Viktor Szakats
05401b9a3b makefile.m32: fix to allow -ssh2-winssl combination
In makefile.m32, option -ssh2 (libssh2) automatically implied -ssl
(OpenSSL) option, with no way to override it with -winssl. Since both
libssh2 and curl support using Windows's built-in SSL backend, modify
the logic to allow that combination.
2016-03-05 13:40:34 -05:00
Jay Satiro
20de9b4f09 cookie: Don't expire session cookies in remove_expired
Prior to this change cookies with an expiry date that failed parsing
and were converted to session cookies could be purged in remove_expired.

Bug: https://github.com/curl/curl/issues/697
Reported-by: Seth Mos
2016-03-05 13:35:17 -05:00
Daniel Stenberg
33a0a926c5 cookie: remove redundant check
... as it was already checked previously within the function.

Reported-by: Dmitry-Me
Closes #695
2016-03-03 21:16:06 +01:00
Anders Bakken
3c2ef2a610 url: if Curl_done is premature then pipeline not in use
Prevent a crash if 2 (or more) requests are made to the same host and
pipelining is enabled and the connection does not complete.

Bug: https://github.com/curl/curl/pull/690
2016-03-01 18:55:04 -05:00
Viktor Szakats
d678bd6f60 makefile.m32: allow to pass .dll/.exe-specific LDFLAGS
using envvars `CURL_LDFLAG_EXTRAS_DLL` and
`CURL_LDFLAG_EXTRAS_EXE` respectively. This
is useful f.e. to pass ASLR-related extra
options, that are required to make this
feature work when using the mingw toolchain.

Ref: https://github.com/curl/curl/pull/670#issuecomment-190863985

Closes https://github.com/curl/curl/pull/689
2016-03-01 17:46:16 -05:00
Daniel Stenberg
c2a809cd26 formpost: fix memory leaks in AddFormData error branches
Reported-by: Dmitry-Me
Fixes #688
2016-02-29 20:32:08 +01:00
Jay Satiro
ae7d6b7154 getinfo: Fix syntax error when mbedTLS
The assignment of the mbedTLS TLS session info in the parent commit was
incorrect. Change the assignment to a pointer to the session structure.
2016-02-28 16:05:38 -05:00
Jay Satiro
2e0a3b935c getinfo: Add support for mbedTLS TLS session info
.. and preprocessor check TLS session info is defined for all backends.
2016-02-27 19:01:00 -05:00
Daniel Stenberg
1e486db9c2 file: try reading from files with no size
Some systems have special files that report as 0 bytes big, but still
contain data that can be read (for example /proc/cpuinfo on
Linux). Starting now, a zero byte size is considered "unknown" size and
will be read as far as possible anyway.

Reported-by: Jesse Tan

Closes #681
2016-02-25 23:45:17 +01:00
Daniel Stenberg
46bf7996f4 Curl_read: check for activated HTTP/1 pipelining, not only requested
... as when pipelining is used, we read things into a unified buffer and
we don't do that with HTTP/2. This could then easily make programs that
set CURLMOPT_PIPELINING = CURLPIPE_HTTP1|CURLPIPE_MULTIPLEX to get data
intermixed or plain broken between HTTP/2 streams.

Reported-by: Anders Bakken
2016-02-24 14:20:57 +01:00