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

5096 Commits

Author SHA1 Message Date
Yang Tse
f737e94164 Curl_updateconninfo() error handling fix 2010-06-07 16:53:31 +02:00
Constantine Sapuntzakis
a0dd9df9ab OpenSSL: fix spurious SSL connection aborts
Was seeing spurious SSL connection aborts using libcurl and
OpenSSL. I tracked it down to uncleared error state on the
OpenSSL error stack - patch attached deals with that.

Rough idea of problem:

Code that uses libcurl calls some library that uses OpenSSL but
don't clear the OpenSSL error stack after an error.

ssluse.c calls SSL_read which eventually gets an EWOULDBLOCK from
the OS. Returns -1 to indicate an error

ssluse.c calls SSL_get_error. First thing, SSL_get_error calls
ERR_get_error to check the OpenSSL error stack, finds an old
error and returns SSL_ERROR_SSL instead of SSL_ERROR_WANT_READ or
SSL_ERROR_WANT_WRITE.

ssluse.c returns an error and aborts the connection

Solution:

Clear the openssl error stack before calling SSL_* operation if
we're going to call SSL_get_error afterwards.

Notes:

This is much more likely to happen with multi because it's easier
to intersperse other calls to the OpenSSL library in the same
thread.
2010-06-05 23:41:58 +02:00
Yang Tse
4724b9d966 replace socklen_t with curl_socklen_t 2010-06-05 15:08:26 +02:00
Frank Meier
8098d9417c getinfo: added *_PRIMARY_PORT, *_LOCAL_IP and *_LOCAL_PORT 2010-06-05 00:31:36 +02:00
Yang Tse
43d20d81a5 Enable OpenLDAP support for cygwin builds.
Enable OpenLDAP support for cygwin builds. This support was disabled back
in 2008 due to incompatibilities between OpenSSL and OpenLDAP headers.
cygwin's OpenSSL 0.9.8l and OpenLDAP 2.3.43 versions on cygwin 1.5.25
allow building an OpenLDAP enabled libcurl supporting back to Windows 95.

Remove non-functional CURL_LDAP_HYBRID code and references.
2010-06-04 15:14:31 +02:00
Kamil Dudka
bc0f3dd15e ftplistparser.c: oops, fix typo in the last commit 2010-06-02 23:55:45 +02:00
Kamil Dudka
475c19c42b ftplistparser.c: avoid some invalid dereferences 2010-06-02 23:50:38 +02:00
Kamil Dudka
c072bd4609 lib: eliminate some dead code 2010-06-02 23:50:38 +02:00
Daniel Stenberg
684830cb2a SSH: corrected the inability to respect the timeout
Jason McDonald posted bug report #3006786 when he found that the
SFTP code didn't timeout properly in several places in the code
even if a timeout was set properly.

Based on his suggested patch, I wrote a different implementation
that I think addressed the issue better and also uses the connect
timeout for the initial part of the SSH/SFTP done during the
"protocol connect" phase.

(http://curl.haxx.se/bug/view.cgi?id=3006786)
2010-06-02 23:33:51 +02:00
Yang Tse
3b24076c3b add missing new files to non-configure target build files 2010-06-02 15:09:39 +02:00
Yang Tse
077125e4a2 include libcurl standard internal headers 2010-06-02 14:13:02 +02:00
Yang Tse
d939e0f410 make setup.h first included file 2010-06-02 13:19:04 +02:00
Yang Tse
69d07feb14 fix spnego memory leak 2010-06-02 12:44:46 +02:00
Yang Tse
1c4538610b openldap header inclusions fix 2010-06-02 11:23:30 +02:00
Daniel Stenberg
2c72732ebf multi_socket: handles timer inaccuracy better for timeouts
Igor Novoseltsev reported a problem with the multi socket API and
using timeouts and timers. It boiled down to a problem with
libcurl's use of GetTickCount() interally to figure out the
current time, while Igor's own application code used another
function call.

It made his app call the socket API timeout function a bit
_before_ libcurl would consider the timeout to trigger, and that
could easily lead to timeouts or stalls in the app. It seems
GetTickCount() in general often has no better resolution than
16ms and switching to the alternative function
QueryPerformanceCounter has its share of problems:
http://www.virtualdub.org/blog/pivot/entry.php?id=106

We address this problem by simply having libcurl treat timers
that already has occured or will occur within 40ms subject for
treatment. I'm confident that there are other implementations and
operating systems with similarly in accurate timer functions so
it makes sense to have applied generically and I don't believe we
sacrifice much by adding a 40ms inaccuracy on these timeouts.
2010-06-01 23:20:16 +02:00
Yang Tse
89da532445 fix ldap related compilation issues 2010-06-01 17:25:03 +02:00
Yang Tse
b38189c7b4 fix compiler warning: enumerated type mixed with another type 2010-06-01 12:25:14 +02:00
Yang Tse
1bb04927f3 fix compiler warning: enumerated type mixed with another type 2010-05-31 19:55:22 +02:00
Patrick Monnerat
3fd01be648 smtp_authenticate: avoid compiler warnings 2010-05-31 17:37:00 +02:00
Yang Tse
0546d448ce fix compiler warning: enumerated type mixed with another type 2010-05-31 17:22:43 +02:00
Yang Tse
b4fa27ae4b fix compiler warning: enumerated type mixed with another type 2010-05-31 17:11:51 +02:00
Yang Tse
a9483b1f4a fix compiler warning: enumerated type mixed with another type 2010-05-31 16:36:05 +02:00
Yang Tse
40f8aaedb7 fix compiler warning: external declaration in primary source file 2010-05-31 16:24:01 +02:00
Yang Tse
374f48675b update year in copyright notice 2010-05-31 13:51:29 +02:00
Kamil Dudka
20ae9d4f71 strtoofft: rename CURL_LLONG_MIN -> CURL_OFF_T_MIN
... and CURL_LLONG_MAX -> CURL_OFF_T_MAX
2010-05-29 21:28:16 +02:00
Kamil Dudka
35955179c6 CURL_LLONG_MAX: avoid constant overflow
... when (CURL_SIZEOF_CURL_OFF_T == 4)
2010-05-29 21:23:18 +02:00
Howard Chu
b1c1b9bb76 LDAPS: list availability depending on SSL's presence 2010-05-28 12:23:28 +02:00
Howard Chu
123f80ae54 LDAP: make it build without SSL if no such support is available
of course it also goes for the case where SSL is explicitly
disabled
2010-05-28 12:22:35 +02:00
Kamil Dudka
233ec511db lib: eliminate 'statement not reached' warnings 2010-05-28 09:45:17 +02:00
Howard Chu
c03cbb38ad openldap: fix compiler warnings 2010-05-27 22:37:38 +02:00
Daniel Stenberg
63661d8e83 indent: some whitespace edits 2010-05-27 22:37:38 +02:00
Kamil Dudka
4a0493f789 wildcard.c: add missing include of "setup.h" 2010-05-27 20:56:01 +02:00
Pavel Raiskup
9190e2876e wildcard.c: add missing include of "curl_memory.h" 2010-05-27 18:41:29 +02:00
Tor Arntsen
b4f0e1291f setup_once: use enum type for 'bool' on non-C99 platforms
An enum will catch non-bool assignments to bool on platforms with
a strict compiler, e.g MIPSPro.

Signed-off-by: Kamil Dudka <kdudka@redhat.com>
2010-05-27 18:15:17 +02:00
Kamil Dudka
dd8568739c url.c: avoid implied cast to bool 2010-05-27 16:35:31 +02:00
Tor Arntsen
97b497a75f curl_fnmatch: remove use of register keyword
Using the 'register' keyword rarely improves anything with modern
compilers and architectures.
2010-05-27 16:34:57 +02:00
Julien Chaffraix
d3c813e726 RTMP: Fix compiler warnings 2010-05-26 00:41:45 +02:00
Julien Chaffraix
9e480973eb OOM fixes in http_negociate.c and lib/splay.c
Fix 2 OOM errors: a missing NULL-check in lib/http_negociate.c
and a potential NULL dereferencing in lib/splay.c
2010-05-26 00:40:26 +02:00
Howard Chu
2e056353b0 LDAP: properly implemented as a curl_handler
makes the LDAP code much cleaner, nicer and in general being a
better libcurl citizen. If a new enough OpenLDAP version is
detect, the new and shiny lib/openldap.c code is then used
instead of the old cruft

Code by Howard, minor cleanups by Daniel.
2010-05-25 00:44:42 +02:00
Tor Arntsen
606b933a4f curl_fnmatch: Use int not bool when function returns int
bool in curl internals is unsigned char and should not be used
to receive return value from functions returning int - this fails
when using IBM VisualAge and Tru64 compilers.
2010-05-21 23:42:55 +02:00
Daniel Stenberg
d17709da31 TFTP: send legal timeout value
Eric Mertens posted bug #3003705: when we made TFTP use the
correct timeout option when sent to the server (fixed May 18th
2010) it became obvious that libcurl used invalid timeout values
(300 by default while the RFC allows nothing above 255). While of
course it is obvious that as TFTP has worked thus far without
being able to set timeout at all, just removing the setting
wouldn't make any difference in behavior. I decided to still keep
it (but fix the problem) as it now actually allows for easier
(future) customization of the timeout.

(http://curl.haxx.se/bug/view.cgi?id=3003705)
2010-05-21 23:29:52 +02:00
Daniel Stenberg
0bb6deda72 TFTP: don't ack if wrong block num is received
If an unexpected block number was received, break out of the
switch loop.
2010-05-21 23:07:59 +02:00
Daniel Stenberg
0a29e2445c TFTP: block id wrap bug fix
In a normal expression, doing [unsigned short] + 1 will not wrap
at 16 bits so the comparisons and outputs were done wrong. I
added a macro do make sure it gets done right.

Douglas Kilpatrick filed bug report #3004787 about it:
http://curl.haxx.se/bug/view.cgi?id=3004787
2010-05-21 23:04:15 +02:00
Ben Greear
700335103e Fix build warnings.
Signed-off-by: Ben Greear <greearb@candelatech.com>
2010-05-20 23:16:46 +02:00
Ben Greear
368fd5d27b setopt: Fix setting of set.is_fwrite_set
Signed-off-by: Ben Greear <greearb@candelatech.com>
2010-05-20 23:15:34 +02:00
Tanguy Fautre
81239edb89 build: allow curl to build with Microsoft VC10
By undefing a bunch of E* defines that VC10 has started to define
but that we redefine internally to their WSA* alternatives when
building for Windows.
2010-05-20 22:40:48 +02:00
Tor Arntsen
5f53c9d94a lib: Fix AIX build failure 2010-05-19 22:09:35 +02:00
Dan Fandrich
04cfef24a1 Fixed some memory leaks in the POP3 torture tests 2010-05-19 12:18:06 -07:00
Dan Fandrich
1d26151d5f Fixed a memory leak in the SMTP torture tests 2010-05-18 14:44:19 -07:00
Daniel Stenberg
aabd27d9aa TFTP: send timeout option correctly
Eric Mertens posted bug report #3003005 pointing out that the
libcurl TFTP code was not sending the timeout option properly to
the server, and suggested a fix.

(http://curl.haxx.se/bug/view.cgi?id=3003005)
2010-05-18 23:14:00 +02:00