Commit Graph

5225 Commits

Author SHA1 Message Date
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
Tor Arntsen dcc061543a lib: Change some CRLF line endings to LF
An update had added a couple of lines with DOS line endings,
and some compilers will choke on that (e.g. the Tru64 compiler).
2010-05-16 22:34:02 +02:00
Kamil Dudka 2ffe834bff ftp wildcard: a new option CURLOPT_FNMATCH_DATA 2010-05-16 02:52:33 +02:00
Howard Chu 027ceb37a1 RMTP: the version code is now rtmp aware 2010-05-15 22:13:17 +02:00
Howard Chu 510836f80b RTMP: fix wrong #ifdef 2010-05-15 22:02:44 +02:00
Pavel Raiskup e4af5d6efc ftp wildcard: fix int32_t and size/group mixups 2010-05-15 21:58:50 +02:00
Daniel Stenberg 77cfeadfa6 OpenSSL: multi interface handshake could hang
John-Mark Bell filed bug #3000052 that identified a problem (with
an associated patch) with the OpenSSL handshake state machine
when the multi interface is used:

Performing an https request using a curl multi handle and using
select or epoll to wait for events results in a hang. It appears
that the cause is the fix for bug #2958179, which makes
ossl_connect_common unconditionally return from the step 2 loop
when fetching from a multi handle.

When ossl_connect_step2 has completed, it updates
connssl->connecting_state to ssl_connect_3. ossl_connect_common
will then return to the caller, as a multi handle is in
use. Eventually, the client code will call curl_multi_fdset to
obtain an updated fdset to select or epoll on. For https
requests, curl_multi_fdset will cause https_getsock to be called.
https_getsock will only return a socket handle if the
connecting_state is ssl_connect_2_reading or
ssl_connect_2_writing.  Therefore, the client will never obtain a
valid fdset, and thus not drive the multi handle, resulting in a
hang.

(http://curl.haxx.se/bug/view.cgi?id=3000052)
2010-05-14 22:35:08 +02:00
Daniel Stenberg 7764795c06 follow redirect: ignore response-body on redirect even if compressed
Sebastian V reported bug #3000056 identifying a problem with
redirect following. It showed that when curl followed redirects
it didn't properly ignore the response body of the 30X response
if that response was using compressed Content-Encoding!

(http://curl.haxx.se/bug/view.cgi?id=3000056)
2010-05-14 22:12:07 +02:00
Hoi-Ho Chan 83305cbf9f Remove support for BSD version of PolarSSL
"The BSD version of PolarSSL was made for migratory purposes only and is not
maintained. The GPL version of PolarSSL is actually the only actively
developed version, so I would be very reluctant to use the BSD version." /
Paul Bakker, PolarSSL hacker.

Signed-off-by: Hoi-Ho Chan <hoiho.chan@gmail.com>
2010-05-13 21:50:52 +02:00
Dan Fandrich 76255cfdc9 Added Polar SSL and RTMP files to the non-autoconf build files
I didn't bother with a few that have little hope of running the required
dependent libraries.
2010-05-12 19:05:58 -07:00
Dan Fandrich ad6bc4d82e Added the new ftp source files to the non-autoconf build files 2010-05-12 17:32:10 -07:00
Daniel Stenberg a799162bc7 style: minor whitespace change 2010-05-12 23:32:42 +02:00
Pavel Raiskup 0825cd80a6 FTP: WILDCARDMATCH/CHUNKING/FNMATCH added 2010-05-12 23:17:51 +02:00
Howard Chu 04cb15ae9d RTMP: initial support added, powered by librtmp
librtmp is found at http://rtmpdump.mplayerhq.hu/
2010-05-12 23:07:20 +02:00
Howard Chu bc8fc9803f sendrecv: make them two pairs of send/recv to properly deal with FTPS
FTP(S) use two connections that can be set to different recv and
send functions independently, so by introducing recv+send pairs
in the same manner we already have sockets/connections we can
work with FTPS fine.

This commit fixes the FTPS regression introduced in change d64bd82.
2010-05-11 22:48:38 +02:00
Kamil Dudka 3e759f4fb6 nss: make it possible to read ASCII and DER CRL 2010-05-11 14:39:08 +02:00
Kamil Dudka 2e8b21833a nss: add CRL to cache instead of read-only NSS db 2010-05-11 14:37:43 +02:00
Hacki d2621445f1 moved vars into conditional since seems that winsock implementation doesnt use them. 2010-05-08 05:38:42 +02:00
Daniel Stenberg adaf87530d multi interface: missed storing connection time
Dirk Manske reported a regression. When connecting with the multi
interface, there were situations where libcurl wouldn't store
connect time correctly as it used to (and is documented to) do.

Using his fine sample program we could repeat it, and I wrote up
test case 573 using that code. The problem does not easily show
itself using the local test suite though.

The fix, also as suggested by Dirk, is a bit on the ugly side as
it adds yet another call to Curl_verboseconnect() and setting the
TIMER_CONNECT time.  That situation is subject for some closer
inspection in the future.
2010-05-07 23:49:29 +02:00
Daniel Stenberg 8914857092 verboseconnect: so the verbose checking within the function
As the function is used more than once and libcurl can be built
without it, do the conditional check within the verboseconnect()
function itself.
2010-05-07 23:24:47 +02:00
Howard Chu d64bd82bdc sendrecv: split the I/O handling into private handler
Howard Chu brought the bulk work of this patch that properly
moves out the sending and recving of data to the parts of the
code that are properly responsible for the various ways of doing
so.

Daniel Stenberg assisted with polishing a few bits and fixed some
minor flaws in the original patch.

Another upside of this patch is that we now abuse CURLcodes less
with the "magic" -1 return codes and instead use CURLE_AGAIN more
consistently.
2010-05-07 15:05:34 +02:00
Hoi-Ho Chan 51427e1947 PolarSSL: initial support added
This is Hoi-Ho Chan's patch with some minor fixes by me. There
are some potential issues in this, but none worse than we can
sort out on the list and over time.
2010-05-05 22:30:46 +02:00
Ben Greear 38d2afcefb telnet: Allow programatic use of telnet.
The main change is to allow input from user-specified methods,
when they are specified with CURLOPT_READFUNCTION.
All calls to fflush(stdout) in telnet.c were removed, which makes
using 'curl telnet://foo.com' painful since prompts and other data
are not always returned to the user promptly.  Use
'curl --no-buffer telnet://foo.com' instead.  In general,
the user should have their CURLOPT_WRITEFUNCTION do a fflush
for interactive use.

Also fix assumption that reading from stdin never returns < 0.
Old code could crash in that case.

Call progress functions in telnet main loop.

Signed-off-by: Ben Greear <greearb@candelatech.com>
2010-04-29 08:55:11 +02:00
Daniel Stenberg 107146676e SSH: init and cleanup libssh2 in global_init/cleanup
The necessary libssh2 functions require libssh2 1.2.5 or later.
2010-04-26 00:36:25 +02:00
Kamil Dudka 82e9b78a38 nss: fix SSL handshake timeout underflow 2010-04-24 23:23:01 +02:00
Guenter Knauf 07f45946b5 encourage users to take latest lib dependencies. 2010-04-24 17:48:09 +02:00
Daniel Stenberg 7fb7f24131 socks5: please static code analyzer
Make sure we don't call memcpy() if the argument is NULL even
though we also passed a zero length then, as the clang analyzer
whined and we want to limit warnings (even false positives) when
they're this easy to fix.

The change of (char) to (unsigned char) will fix long user names
and passwords on systems that have the char type signed by
default.
2010-04-24 12:40:00 +02:00
Daniel Stenberg 5b40c11c2f gzip: Value stored to 'data' is never read 2010-04-24 12:37:11 +02:00
Yang Tse 81512cc02b hmac.c related compilation adjustment 2010-04-20 21:35:31 +02:00
Yang Tse 32236dad5e hmac.c related compilation adjustment 2010-04-20 21:23:53 +02:00
monnerat b30ce34d84 Add compilation directives for hmac in Watcom,riscos and vc6 platform-specific makefiles. 2010-04-20 19:23:48 +02:00
Ruslan Gazizov 2164b6b463 replaced wsock32.lib usage with ws2_32.lib in MSVC makefiles 2010-04-20 16:30:10 +02:00
monnerat 7af5e3c39e Merge branch 'master' of github.com:bagder/curl 2010-04-19 17:37:51 +02:00
monnerat 42930155ab Remove null-effect leftover code. 2010-04-19 17:30:20 +02:00
Daniel Stenberg a5b7e3205d Curl_HMAC_MD5: fix the array init to not warn with picky compilers 2010-04-19 16:19:36 +02:00
monnerat dfce37da23 Fix GnuTLS compilation problem in md5.c 2010-04-19 14:09:45 +02:00
monnerat 14bfcb96f5 Fix compilation problem: declare Curl_HMAC_MD5 as extern in include file. 2010-04-19 12:44:17 +02:00
monnerat 87fbcb4494 Merge branch 'master' of github.com:bagder/curl 2010-04-19 11:17:46 +02:00
monnerat 4bfe07640c Implement SMTP authentication 2010-04-19 11:16:30 +02:00
Daniel Stenberg b7848e4a72 parsedate: Value stored to 'found' is never read 2010-04-17 18:57:39 +02:00
Daniel Stenberg 99ec359b4d check_gzip_header: Value stored to 'data' is never read 2010-04-17 18:55:52 +02:00
Daniel Stenberg dfad8a6dad dprintf_formatf: Value stored to 'left' is never read 2010-04-16 23:50:39 +02:00
Daniel Stenberg d841ab82b8 curl_version: remove superfluous assignments 2010-04-16 23:49:03 +02:00
Daniel Stenberg d6be52d80e FTP PORT: Value stored to 'rc' is never read 2010-04-16 23:45:05 +02:00
Daniel Stenberg c0111460b0 Curl_setup_transfer: no longer returns anything
This function could only return CURLE_OK and by changing it to
a void instead, we can simplify code all over.
2010-04-16 23:43:04 +02:00
Daniel Stenberg 93981bb9b5 PASV response: Value stored to 'rc' is never read 2010-04-16 23:28:20 +02:00
Daniel Stenberg 8f136288c5 Curl_perform: Value stored to 'res2' is never read 2010-04-16 23:27:35 +02:00
Daniel Stenberg 9799dbebd6 sftp range: remove unnecessary check for NULL pointer 2010-04-16 23:20:50 +02:00
Daniel Stenberg b025ac16a6 ftp_range: remove unnecessary check for NULL pointer 2010-04-16 23:20:07 +02:00
Daniel Stenberg 5d43c75c66 file_range: remove unnecessary check for NULL pointer 2010-04-16 23:18:43 +02:00
Daniel Stenberg 15fa5dcfe6 SOCKS4: Value stored to 'rc' is never read 2010-04-16 23:03:55 +02:00
Daniel Stenberg 516dfd1705 FTP PASV: Value stored to 'rc' is never read 2010-04-16 23:02:15 +02:00
Daniel Stenberg 743bd81e64 ftp_range: Value stored to 'totalsize' is never read
Simplified the code by removing a local variable completely.
2010-04-16 23:00:21 +02:00
Daniel Stenberg 520cee3fb7 SOCKS5: when name resolves fail return immediately
This makes the code flow more obvious and reacts on the return
code properly, even if the code acted the same way before.
2010-04-16 22:58:04 +02:00
Daniel Stenberg fa7341143a POP3: when USER command fails, don't even try PASS 2010-04-16 22:56:13 +02:00
Daniel Stenberg 313a5b05c2 tftp_rx: Value stored to 'sbytes' is never read 2010-04-16 22:55:07 +02:00
Daniel Stenberg 01fc53e027 file_range: Value stored to 'totalsize' is never read 2010-04-16 22:52:49 +02:00
Jerome Vouillon c2888604d7 GnuTLS: make the connection phase non-blocking
When multi interface is used, the SSL handshake is no longer
blocking when GnuTLS is used.
2010-04-16 22:43:01 +02:00
Daniel Stenberg 6632d957e7 krb5_auth: fix my previous change to compile 2010-04-16 20:22:46 +02:00
Daniel Stenberg 2056ca9fea SSL_RECV: EOF is not an error here
The recent overhaul of the SSL recv function made this treat a
zero returned from gnutls_record_recv() as an error, and this
caused our HTTPS test cases to fail. We leave it to upper layer
code to detect if an EOF is a problem or not.
2010-04-16 15:29:25 +02:00
Daniel Stenberg f3d4b17a9c resolvers: no more using AI_CANONNAME
No resolver anymore needs to use AI_CANONNAME and do reverse
lookups.  We should work hard to avoid having code that relies on
it.
2010-04-16 15:03:52 +02:00
Daniel Stenberg 5bd38b70dd KRB5: use given host name instead of reverse lookup'ed name
This code would previously use dns_entry->addr->ai_canonname
instead of the given host name, which caused us grief and
problems since not all our resolver options do the reverse lookup
and I would also guess that it caused problems with KRB5/GSS with
virtual name-based hosts. Now the host name from the URL is used.
2010-04-16 15:02:08 +02:00
Dan Fandrich 44f1bef668 Remove redundant conditional 2010-04-15 10:51:03 -07:00
Daniel Stenberg 68aae7f579 Curl_ipv4_resolve_r: only set AI_CANONNAME when needed
As reported in bug report #2987196, the code for ipv6 already did
the setting of this bit correctly so we copied that logic into
the Curl_ipv4_resolve_r() function as well. KRB code is the only
code we know that might need the cannonical name so only resolve
it for such requests!
2010-04-15 13:04:01 +02:00
Daniel Stenberg 5a814f6f2c ignore files generated by 'maketgz' 2010-04-14 17:12:34 +02:00
Yang Tse 6432fafa1a fix compiler warning: variable might be clobbered by longjmp or vfork 2010-04-13 16:34:13 +02:00
Guenter Knauf 32edba1999 added a cast to silent compiler warning with 64bit systems. 2010-04-12 16:47:48 +02:00
Daniel Stenberg f9db721c1c update the section on timeouts
The section that describes how to work with timeouts was
misleading and could easily trick users to use the wrong API.
2010-04-12 11:09:55 +02:00
Daniel Stenberg cf9145973b update URL and cut out wrong info on ipv6
c-ares has had its own URL for a while and we should point
people to that. It also works with IPv6 since a long time.
2010-04-12 11:09:08 +02:00
Daniel Stenberg 02892e4fd8 FTP quote commands prefixed with '*' now can fail without aborting
Prefixing the FTP quote commands with an asterisk really only
worked for the postquote actions. This is now fixed and test case
227 has been extended to verify.
2010-04-09 16:54:52 +02:00
Kamil Dudka 10977f57de qssl: reflect recent code changes in SSL interface
Reported by Guenter Knauf.
2010-04-07 10:47:19 +02:00
Kamil Dudka ef1ac363ee nss: handle client certificate related errors 2010-04-06 13:42:11 +02:00
Ben Greear e6858e267b ssl: Fix build when SSL isn't enabled
Signed-off-by: Ben Greear <greearb@candelatech.com>
2010-04-06 01:44:28 +02:00
Kamil Dudka ff8711135e refactorize interface of Curl_ssl_recv/Curl_ssl_send 2010-04-04 23:37:18 +02:00
Kamil Dudka 7425db3fab simplify code of Curl_resolv_timeout() 2010-04-04 23:35:21 +02:00
Kamil Dudka 64ac64e783 eliminate a race condition in Curl_resolv_timeout() 2010-04-04 23:34:24 +02:00
Ben Greear e7e37a246a fixed compiler warnings 2010-04-02 21:02:35 +02:00
Daniel Stenberg 49f3160d69 fix SFTP download hang
Matt Wixson found and fixed a bug in the SCP/SFTP area where the
code treated a 0 return code from libssh2 to be the same as
EAGAIN while in reality it isn't. The problem caused a hang in
SFTP transfers from a MessageWay server.
2010-04-01 22:39:15 +02:00
Daniel Stenberg 1d265692b7 removed README.cmake due to the improved situation 2010-03-31 23:05:16 +02:00
Guenter Knauf 7b913444ec fix compiler warning with a cast. 2010-03-31 02:09:49 +02:00
Guenter Knauf 909fdc07bf make folks use latest available dependent libraries. 2010-03-31 01:10:09 +02:00
Daniel Stenberg d1837ad90a use (s)size_t for string lengths to fix compiler warns 2010-03-29 16:30:35 +02:00
Ben Greear 7e22d6332b Fix compile warnings in ssh.c
strlen() returns size_t, but ssh libraries are wanting 'unsigned int'.  Add
explicit casts and use _ex versions of the ssh library calls.

Signed-off-by: Ben Greear <greearb@candelatech.com>
2010-03-29 16:09:09 +02:00
Ben Greear 3ec7543007 fix smtp compile warning
Use ssize_t instead of int for the Curl_smtp_escape_eob nread
argument.

Signed-off-by: Ben Greear <greearb@candelatech.com>
2010-03-29 16:03:38 +02:00
Ben Greear 69ccc9f861 pop3: Get message listing if no mailbox in URL
If you pass a URL to pop3 that does not contain a message ID as
part of the URL, it will currently ask for 'INBOX' which just
causes the pop3 server to return an error.

The change makes libcurl treat en empty message ID as a request
for LIST (list of pop3 message IDs).  User's code could then
parse this and download individual messages as desired.
2010-03-28 23:49:00 +02:00
Ben Greear 0eda142e90 allow user+password in the URL for all protocols
Ben Greear brought a patch that from now on allows all protocols
to specify name and user within the URL, in the same manner HTTP
and FTP have been allowed to in the past - although far from all
of the libcurl supported protocols actually have that feature in
their URL definition spec.
2010-03-27 23:00:51 +01:00
Ben Greear 7de44e0a42 Make rate-limitation logic smoother
This gives a smoother rate limitation performance by using
sub-second pauses and also taking the buffer sizes into
account.
2010-03-26 23:33:02 +01:00
Daniel Stenberg 05de2cf180 remove all .cvsignore files 2010-03-25 23:22:03 +01:00
Daniel Stenberg 93e6b1cb7c PROT_CLOSEACTION should not include TFTP
TFTP is not a protocol that uses close actions so it should
not be set in that bitmask!
2010-03-25 19:56:50 +01:00
Daniel Stenberg 675330b8df use CURL_SIZEOF_LONG instead of SIZEOF_LONG
That's the symbol we have or generate in include/curl/curlbuild.h
2010-03-25 11:39:13 +01:00
Bill Hoffman 481c61d060 Merge branch 'master' of github.com:bagder/curl 2010-03-24 14:19:50 -04:00
Bob Richmond 05632d5db9 fix: timeout after last data chunk was handled
Bob Richmond: There's an annoying situation where libcurl will
read new HTTP response data from a socket, then check if it's a
timeout if one is set. If the last packet received constitutes
the end of the response body, libcurl still treats it as a
timeout condition and reports a message like:

"Operation timed out after 3000 milliseconds with 876 out of 876
bytes received"

It should only a timeout if the timer lapsed and we DIDN'T
receive the end of the response body yet.
2010-03-24 17:02:17 +01:00
Daniel Stenberg c245a8f92e avoid compiler warning without USE_ALARM_TIMEOUT 2010-03-24 17:00:20 +01:00
Bill Hoffman d42f9329dc Fix curl CMake build.
This commit fixes the cmake build of curl, and cleans up the
cmake code a little.  It removes some commented out code and
some trailing whitespace.  To get curl to build the binary
tree include/curl directory needed to be added to the include
path. Also, SIZEOF_SHORT needed to be added.  A check for the
lack of defines of SIZEOF_* for warnless.c was added.
2010-03-24 10:57:54 -04:00
Chris Conroy 1ac168e576 Fix RTSP GET_PARAMETER empty and non-empty operation.
Test coverage included. Thanks to Massimo Callegari for the bug report
2010-03-24 13:21:14 +01:00
Daniel Stenberg be28825b2d restore executable bits on some files 2010-03-24 11:07:35 +01:00
Daniel Stenberg 2309b4e330 remove the CVSish $Id$ lines 2010-03-24 11:02:54 +01:00
Daniel Stenberg 3f96b7827b update to current state 2010-03-24 10:44:25 +01:00
Daniel Stenberg 4b351d018e mark connection as connected
Kenny To filed the bug report #2963679 with patch to fix a
problem he experienced with doing multi interface HTTP POST over
a proxy using PROXYTUNNEL. He found a case where it would connect
fine but bits.tcpconnect was not set correct so libcurl didn't
work properly.

(http://curl.haxx.se/bug/view.cgi?id=2963679)
2010-03-23 23:30:39 +01:00
Daniel Stenberg 7fd32ce73d chunked-encoding with Content-Length: header problem
Akos Pasztory filed debian bug report #572276
http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=572276
mentioning a problem with a resource that returns chunked-encoded
_and_ with a Content-Length and libcurl failed to properly ignore
the latter information.
2010-03-23 15:26:45 +01:00
Daniel Stenberg 2a94293efd delayed easy handle kill caused double Curl_close() call
Hauke Duden provided an example program that made the multi
interface crash.  His example simply used the multi interface and
did first one FTP transfer and after completion it used a second
easy handle and did another FTP transfer on the same FTP server.

This triggered a bug in the "delayed easy handle kill" system
that curl uses: when an FTP connection is left alive it must keep
an easy handle around internally - only for the purpose of having
an easy handle when it later disconnects it. The code assumed
that when the easy handle was removed and an internal reference
was made, that version could be killed later on when a new easy
handle came using the same connection. This was wrong as Hauke's
example showed that the removed handle wasn't killed for real
until later. This caused a double close attempt => segfault.
2010-03-23 13:18:30 +01:00
Thomas Lopatic 6657f12fff fix the alarm()-based DNS timeout
Looking at the code of Curl_resolv_timeout() in hostip.c, I think
that in case of a timeout, the signal handler for SIGALRM never
gets removed. I think that in my case it gets executed at some
point later on when execution has long left Curl_resolv_timeout()
or even the cURL library.

The code that is jumped to with siglongjmp() simply sets the
error message to "name lookup timed out" and then returns with
CURLRESOLV_ERROR. I guess that instead of simply returning
without cleaning up, the code should have a goto that jumps to
the spot right after the call to Curl_resolv().
2010-03-22 21:57:48 +01:00
douglas steinwand abcea311e3 Fix insufficient initialization in Curl_clone_ssl_config()
which could have caused a double free when reusing curl handle.
2010-03-22 09:25:03 +01:00
Ben Greear ad76d58e7f Fix tftp return codes and tsize upload handling
Error codes were not properly returned to the main curl code (and on to apps
using libcurl).

tftp was crapping out when tsize == 0 on upload, but I see no reason to fail
to upload just because the remote file is zero-length.  Ignore tsize option on
upload.
2010-03-21 23:24:36 +01:00
Daniel Stenberg 930742776a more files to ignore 2010-03-21 00:21:34 +01:00
Daniel Stenberg b40acd8009 provide an initial set of .gitignore files 2010-03-20 23:35:45 +01:00
Kamil Dudka 19ca0c0fbe - Improved Curl_read() to not ignore the error returned from Curl_ssl_recv(). 2010-03-19 15:43:11 +00:00
Daniel Stenberg 6728334edb fix warning about conversions between curl_off_t and long 2010-03-18 21:52:31 +00:00
Yang Tse 749fd2f9e9 another shot at the ftp_init() icc 9.1 optimizer issue 2010-03-18 17:37:00 +00:00
Daniel Stenberg 733f794cb8 - Constantine Sapuntzakis brought a patch:
The problem mentioned on Dec 10 2009
  (http://curl.haxx.se/bug/view.cgi?id=2905220) was only partially fixed.
  Partially because an easy handle can be associated with many connections in
  the cache (e.g. if there is a redirect during the lifetime of the easy
  handle).  The previous patch only cleaned up the first one. The new fix now
  removes the easy handle from all connections, not just the first one.
2010-03-15 22:40:42 +00:00
Yang Tse 52cd332b95 fix compiler warning 2010-03-11 18:53:42 +00:00
Dan Fandrich c7e647b88a Allow compilation even when OpenSSL has been configured without MD4 support. 2010-03-11 06:57:33 +00:00
Daniel Stenberg e262aaae2b - Ben Greear brought a patch that fixed the rate limiting logic for TFTP when
the easy interface was used.
2010-03-06 18:42:06 +00:00
Daniel Stenberg a0c3edcc37 indent fix by Ben Greear, I removed some braces for single-line conditional
expressions
2010-03-06 18:39:45 +00:00
Yang Tse f4551a9678 Constantine Sapuntzakis detected and fixed a double free in builds done
with threaded resolver enabled (Windows default configuration) that would
get triggered when a curl handle is closed while doing DNS resolution.
2010-03-05 03:15:19 +00:00
Daniel Stenberg 9b2cce236f - Based on patch provided by Jacob Moshenko, the transfer logic now properly
makes sure that when using sub-second timeouts, there's no final bad 1000ms
  wait. Previously, a sub-second timeout would often make the elapsed time end
  up the time rounded up to the nearest second (e.g. 1s for 200ms timeout)
2010-03-02 21:20:22 +00:00
Daniel Stenberg 6bf071df7e - Andrei Benea filed bug report #2956698 and pointed out that the
CURLOPT_CERTINFO feature leaked memory due to a missing OpenSSL function
  call. He provided the patch to fix it too.

  http://curl.haxx.se/bug/view.cgi?id=2956698
2010-03-02 13:41:18 +00:00
Daniel Stenberg 13ac29382f - Made the pingpong timeout code properly deal with the response timeout AND
the global timeout if set. Also, as was reported in the bug report #2956437
  by Ryan Chan, the time stamp to use as basis for the per command timeout was
  not set properly in the DONE phase for FTP (and not for SMTP) so I fixed
  that just now. This was a regression compared to 7.19.7 due to the
  conversion of FTP code over to the generic pingpong concepts.

  http://curl.haxx.se/bug/view.cgi?id=2956437
2010-03-02 13:26:23 +00:00
Daniel Stenberg 8719398d05 remove assignment never used 2010-03-02 13:05:02 +00:00
Daniel Stenberg 53aa6b21fe - Ben Greear provided an update for TFTP that fixes upload. 2010-03-01 22:14:47 +00:00
Daniel Stenberg 496002ea1c - Wesley Miaw reported bug #2958179 which identified a case of looping during
OpenSSL based SSL handshaking even though the multi interface was used and
  there was no good reason for it.

  http://curl.haxx.se/bug/view.cgi?id=2958179
2010-03-01 21:59:07 +00:00
Daniel Stenberg 03a57308b9 - Pat Ray in bug #2958474 pointed out an off-by-one case when receiving a
chunked-encoding trailer.

  http://curl.haxx.se/bug/view.cgi?id=2958474
2010-02-26 22:55:30 +00:00
Dan Fandrich 507d58435a Fixed a couple of out of memory leaks and a segfault in the IMAP code. 2010-02-26 21:24:44 +00:00
Yang Tse cef95aadeb Added SIZEOF_INT and SIZEOF_SHORT definitions for non-configure systems 2010-02-26 18:32:46 +00:00
Yang Tse bcd1c7c2e9 fix compiler warning 2010-02-26 16:42:33 +00:00
Yang Tse 87428e07ca fix compiler warning 2010-02-26 01:47:21 +00:00
Yang Tse 01fb0d8497 fix compiler warning 2010-02-25 08:09:05 +00:00
Dan Fandrich cce81a7f45 Fixed a couple of out of memory leaks and a segfault in the SMTP code. 2010-02-25 08:07:06 +00:00
Yang Tse 5695c4db86 fix compiler warning 2010-02-24 00:03:06 +00:00
Yang Tse 4186b5b41f fix compiler warning 2010-02-23 16:07:54 +00:00
Yang Tse 5b778a7ca4 fix socket data type and logging format in debug tracking socket functions 2010-02-22 23:28:56 +00:00
Yang Tse 439f62bfa8 convert Curl_ultous() and Curl_ultouc() functions to curlx_ultous() and
curlx_ultouc(), exposing them through curlx.h to allow proper code reuse
later in our test harness.
2010-02-22 18:56:29 +00:00
Patrick Monnerat e1625ba727 _ Adjusted RFC821 HELO fallback and enabled test804 2010-02-22 13:57:57 +00:00
Patrick Monnerat 338553eda3 - Proper handling of STARTTLS on SMTP, taking CURLUSESSL_TRY into account.
- SMTP falls back to RFC821 HELO when EHLO fails (and SSL is not required).
- Use of true local host name (i.e.: via gethostname()) when available, as default argument to SMTP HELO/EHLO.
- Test case 804 for HELO fallback.
2010-02-22 12:41:02 +00:00
Yang Tse 2abcd132f8 add header inclusion 2010-02-22 03:41:02 +00:00
Yang Tse dc9f0a9758 fix compiler warning 2010-02-22 02:37:13 +00:00
Yang Tse 10affed097 fix compiler warning 2010-02-21 19:59:09 +00:00
Daniel Stenberg a4a60afabb - Fixed the SMTP compliance by making sure RCPT TO addresses are specified
properly in angle brackets. Recipients provided with CURLOPT_MAIL_RCPT now
  get angle bracket wrapping automatically by libcurl unless the recipient
  starts with an angle bracket as then the app is assumed to deal with that
  properly on its own.
2010-02-20 22:29:59 +00:00
Daniel Stenberg a434cb43e8 - I made the SMTP code expect a 250 response back from the server after the
full DATA has been sent, and I modified the test SMTP server to also send
  that response. As usual, the DONE operation that is made after a completed
  transfer is still not doable in a non-blocking way so this waiting for 250
  is unfortunately made blockingly.
2010-02-20 21:56:48 +00:00
Daniel Stenberg 846b926a3f corected a comment and wrapped a few longish lines 2010-02-20 21:41:25 +00:00
Yang Tse f0d3930346 fix compiler warning 2010-02-20 19:51:02 +00:00
Yang Tse a6fb6b70c7 fix compiler warning 2010-02-20 11:58:26 +00:00
Yang Tse 2179ef9fa9 fix compiler warning 2010-02-20 01:15:10 +00:00
Yang Tse 048438345a fix compiler warning 2010-02-19 18:02:38 +00:00
Daniel Stenberg 23bab783d4 use curl standard indentation and line lengths 2010-02-17 12:13:55 +00:00
Yang Tse 46b112bcd4 replaced tabs with spaces 2010-02-16 13:32:45 +00:00
Yang Tse 4b43d18c4a fix compiler warning: conversion from "long" to "size_t" may lose sign 2010-02-15 16:18:52 +00:00
Yang Tse a07bc79117 removed trailing whitespace 2010-02-14 19:40:18 +00:00
Gunter Knauf 68b73bcfba used allways #ifdef / #ifndef;
moved gethostbyname_thread() to #else case to avoid 'not used' compiler warning.
2010-02-13 18:39:47 +00:00
Gunter Knauf ac04add596 replaced tabs by spaces, removed trailing tabs/spaces. 2010-02-13 18:29:59 +00:00
Daniel Stenberg 975814368a - Jack Zhang reported a problem with SMTP: we wrongly used multiple addresses
in the same RCPT TO line, when they should be sent in separate single
  commands. I updated test case 802 to verify this.

- I also fixed a bad use of my_setopt_str() of CURLOPT_MAIL_RCPT in the curl
  tool which made it try to output it as string for the --libcurl feature
  which could lead to crashes.
2010-02-12 22:23:46 +00:00
Patrick Monnerat 4258e943a1 _ Make it compilable again on OS400.
_ Upgrade OS400 EBCDIC wrappers for new options.
_ Upgrade ILE/RPG bindings to current state.
2010-02-11 18:49:06 +00:00
Daniel Stenberg 06ae8ca5a6 - When downloading compressed content over HTTP and the app as asked libcurl
to automatically uncompress it with the CURLOPT_ENCODING option, libcurl
  could wrongly provide the callback with more data than what the maximum
  documented amount. An application could thus get tricked into badness if the
  maximum limit was trusted to be enforced by libcurl itself (as it is
  documented).

  This is further detailed and explained in the libcurl security advisory
  20100209 at

    http://curl.haxx.se/docs/adv_20100209.html
2010-02-09 09:35:48 +00:00
Daniel Stenberg d33da42334 set VERSIONINFO accordingly for the 7.20.0 release 2010-02-09 09:35:07 +00:00
Yang Tse 71593dfe57 OOM handling fix 2010-02-06 17:30:06 +00:00
Yang Tse 0f4a91afde OOM handling fix 2010-02-06 13:21:45 +00:00
Yang Tse 12d01bc5f7 - avoid OpenSSL 0.9.8 ENGINE_by_id memory leak
- cleanup parenthesis usage in return statements
2010-02-05 09:33:36 +00:00
Yang Tse bc7615ae2d - attempt to workaround icc 9.1 optimizer issue 2010-02-05 09:32:11 +00:00
Yang Tse 7aef172a34 fix printf-style format strings 2010-02-04 19:44:31 +00:00
Yang Tse 15efa262bb Fix compiler warning: unused variable 2010-02-04 10:08:39 +00:00
Dan Fandrich 680434f313 Changed the Watcom makefiles to make them easier to keep in sync with
Makefile.inc since that can't be included directly.
2010-02-03 23:07:11 +00:00
Yang Tse b77d0db59e Fix OOM handling 2010-02-03 13:28:47 +00:00
Yang Tse 381a4d6efe Fix portability issue related with unaligned memory access 2010-02-03 06:49:27 +00:00
Yang Tse f6d288a397 Fix compiler warnings: conversion from 'const int ' to 'unsigned char ', possible loss of data 2010-02-03 06:44:18 +00:00
Yang Tse d1717e7c90 Fix compiler warning: conditional expression is constant 2010-02-02 16:25:07 +00:00
Yang Tse e569ff959f Fix compiler warning: local variable may be used without having been initialized. 2010-02-02 16:23:42 +00:00
Yang Tse 839b61c32a Fix compiler warnings: conversion from 'const int ' to 'unsigned char ', possible loss of data 2010-02-02 16:23:01 +00:00
Yang Tse 46de140aca Fix compiler warning: variable was set but never used
Simplify preprocessor symbol checking
2010-02-02 09:15:52 +00:00
Daniel Stenberg 17a2c32ca9 Julien Chaffraix pointed out a comment mistake, and I re-indented the code
slightly while editing
2010-02-02 08:48:58 +00:00
Yang Tse 35e220606d Conroy's fix to make the code match with the RTP documentation regarding
writing out the whole header. The docs say it writes the whole header,
but the code (before this patch) did not write out the leading $.
2010-02-01 22:13:55 +00:00
Daniel Stenberg 55f1e787f3 We introduce a loop in lib/multi.c around all calls to multi_runsingle() and
simply check for CURLM_CALL_MULTI_PERFORM internally. This has the added
benefit that this goes in line with my long-term wishes to get rid of the
CURLM_CALL_MULTI_PERFORM all together from the public API.
2010-02-01 21:42:44 +00:00
Yang Tse 715e3a806f Make Curl_pop3_write() additionally truncate trailing POP3_EOB from received
string buffer, otherwise Curl_client_write() call with zero size would write
to the end of string buffer including matched POP3_EOB.
2010-01-30 05:22:30 +00:00