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

3834 Commits

Author SHA1 Message Date
Daniel Stenberg
ba6f20a244 Bug report #1823487 (http://curl.haxx.se/bug/view.cgi?id=1823487) pointed
out that SFTP requests didn't use persistent connections. Neither did SCP
ones.  I gave the SSH code a good beating and now both SCP and SFTP should
use persistent connections fine. I also did a bunch for indent changes as
well as a bug fix for the "keyboard interactive" auth.
2007-11-08 10:22:49 +00:00
Yang Tse
dee3844f13 MSVC versions prior to VS2005 do not complain about portable C functions 2007-11-07 18:18:42 +00:00
Daniel Stenberg
cbd1a77ec2 if () => if()
while () => while()
and some other minor re-indentings
2007-11-07 09:21:35 +00:00
Dan Fandrich
33f7ac06c3 Improved telnet support by drastically reducing the number of write
callbacks needed to pass a buffer to the user.  Instead one per byte it
is now as little as one per segment.
2007-11-07 05:52:03 +00:00
Gisle Vanem
66e4d391d3 Added prototype for _strtoi64(). 2007-11-06 16:20:54 +00:00
Gisle Vanem
caf880be18 Constified from arguments. 2007-11-06 16:20:04 +00:00
Daniel Stenberg
ad6e28073c removed space after if and while before the parenthesis for better source code
consistency
2007-11-05 09:45:09 +00:00
Daniel Stenberg
b9a7f4e502 Move connection-oriented variables from the SessionHandle struct to the
connectdata struct. This will in theory enable us to do persistent connections
with SCP+SFTP, but currently the state machine always (and wrongly) cleanup
everything in the 'done' action instead of in 'disconnect'. Also did a bunch
of indent fixes, if () => if() and a few other source cleanups like added
comments etc.
2007-11-05 09:30:45 +00:00
Daniel Stenberg
51009a40b4 make sure the code deals with failures on the DO_MORE state properly 2007-11-03 14:44:38 +00:00
Daniel Stenberg
2ec8f77f21 avoid setting up a transfer when the state machine failed previously 2007-11-02 23:34:00 +00:00
Daniel Stenberg
d34fe06fb0 minor re-indent 2007-11-01 21:43:56 +00:00
Gisle Vanem
c56c4a0a47 Add support for LDAP urls. Allthough the OpenWatcom
headers <winlap.h> and <winber.h> defines wrong calling convention.
2007-10-31 10:58:51 +00:00
Gisle Vanem
45064c5778 Added optional use of zlib (USE_ZLIB=1).
Use a response-file for the C-compiler.
2007-10-31 10:20:48 +00:00
Dan Fandrich
59b05ac383 Fixed an OOM problem with file: URLs
Moved Curl_file_connect into the protocol handler struct.
2007-10-30 23:00:40 +00:00
Dan Fandrich
0f77fe55b6 Reverted the const change--what was I thinking? 2007-10-29 20:57:03 +00:00
Dan Fandrich
68ee002ad0 Made some pointers const 2007-10-29 18:32:20 +00:00
Daniel Stenberg
e5f1499f62 let 7.17.1 be version-info 4:1:0 2007-10-29 10:19:07 +00:00
Gisle Vanem
848f40fd65 OpenWatcom cannot use wldap32.lib (wrong calling convention?).
Added generation of dummy ca-bundle.h. Sorted objects.
2007-10-28 12:02:20 +00:00
Dan Fandrich
d3ee83747c Fixed a valgrind uninitialized variable error. 2007-10-26 19:26:41 +00:00
Yang Tse
07dbfa25a0 typecast to prevent compiler warning 2007-10-26 01:12:33 +00:00
Daniel Stenberg
6a17cae4f6 Made libcurl built with NSS possible to ignore the peer verification.
Previously it would fail if the ca bundle wasn't present, even if the code
ignored the verification results.
2007-10-25 21:08:55 +00:00
Daniel Stenberg
4b96ac504c prevent compiler warnings about shadowing and one case of unused variable 2007-10-25 20:54:46 +00:00
Daniel Stenberg
ca67dcbc05 Don't assume there's a sessionhandle around when a connection is disconnected,
so do the data->reqdata.current_conn assignment when we know there is an easy
handle existing! Fixes the valgrind report on test 509.
2007-10-25 09:41:35 +00:00
Daniel Stenberg
9dbc2c827d fix the check 2007-10-25 09:34:16 +00:00
Daniel Stenberg
91e27ce755 Fixed a TFTP memory leak. Enabled test 2003 to verify this. 2007-10-25 07:47:38 +00:00
Daniel Stenberg
8997d258f7 Curl_ftp_disconnect() no longer relies on anything in the reqdata struct. That
was even mentioned to be bad in a comment! Should make test 2000 and 2001 work
fine.

Also, freedirs() now take a ftp_conn struct pointer which saves some extra
unnecessary variable assignments.
2007-10-24 21:14:11 +00:00
Daniel Stenberg
a3f958aaaa added clarifying comment 2007-10-24 21:09:59 +00:00
Yang Tse
08c5e2a194 Windows build targets have socklen_t definition in ws2tcpip.h but some
versions of ws2tcpip.h do not have the definition. It seems that when
the socklen_t definition is missing from ws2tcpip.h the definition for
INET_ADDRSTRLEN is also missing, and that when one definition is present
the other one also is available.
2007-10-24 14:39:07 +00:00
Daniel Stenberg
949ff9715a Bug report #1812190 (http://curl.haxx.se/bug/view.cgi?id=1812190) points out
that libcurl tried to re-use connections a bit too much when using non-SSL
protocols tunneled over a HTTP proxy.
2007-10-23 21:00:51 +00:00
Yang Tse
b9a305983f File is not a protocol that can deal with "persistancy" 2007-10-23 15:16:46 +00:00
Yang Tse
e550df675a Fix compiler warning: subscript has type `char' 2007-10-23 10:14:24 +00:00
Daniel Stenberg
5b358603bd Michal Marek forwarded the bug report
https://bugzilla.novell.com/show_bug.cgi?id=332917 about a HTTP redirect to
FTP that caused memory havoc. His work together with my efforts created two
fixes:

#1 - FTP::file was moved to struct ftp_conn, because is has to be dealt with
     at connection cleanup, at which time the struct HandleData could be
     used by another connection.
     Also, the unused char *urlpath member is removed from struct FTP.

#2 - provide a Curl_reset_reqproto() function that frees
     data->reqdata.proto.* on connection setup if needed (that is if the
     SessionHandle was used by a different connection).
2007-10-22 15:05:35 +00:00
Daniel Stenberg
1056dc9a26 Bug report #1815530 (http://curl.haxx.se/bug/view.cgi?id=1815530) points out
that specifying a proxy with a trailing slash didn't work (unless it also
contained a port number).
2007-10-22 09:25:45 +00:00
Yang Tse
7fe89c5d29 We use this ZERO_NULL to avoid picky compiler warnings,
when assigning a NULL pointer to a function pointer var.
2007-10-20 15:47:16 +00:00
Yang Tse
5c8fc7dce9 Fix compiler warning: conversion from "int" to "unsigned short" may lose significant bits 2007-10-20 15:11:51 +00:00
Patrick Monnerat
8f5909b664 Allow CURLOPT_COPYPOSTFIELDS with explicit data size = 0 2007-10-18 10:54:49 +00:00
Dan Fandrich
bef2e7f2ff Avoid a NULL pointer dereference in an OOM condition. 2007-10-18 01:04:57 +00:00
Yang Tse
0164f0cf81 Fix overflow detection, take four. Avoiding zero size malloc. 2007-10-17 19:29:06 +00:00
Yang Tse
e7387f7557 Fix overflow detection, thanks to Patrick Monnerat detecting test
failure condition: http://curl.haxx.se/mail/lib-2007-10/0152.html
2007-10-17 18:06:32 +00:00
Yang Tse
92433e596b We use this ZERO_NULL to avoid picky compiler warnings,
when assigning a NULL pointer to a function pointer var.
2007-10-17 16:58:32 +00:00
Yang Tse
949073d448 Fix compiler warning: signed and unsigned type in conditional expression 2007-10-17 00:44:48 +00:00
Yang Tse
85877dae9a Fix compiler warning: comparison between signed and unsigned 2007-10-17 00:10:00 +00:00
Yang Tse
c6ef31955a ANSI C compliant overflow check 2007-10-16 23:32:02 +00:00
Dan Fandrich
65ba6e3337 Fixed compiler warning re: unused variable `bigsize' 2007-10-16 18:09:57 +00:00
Patrick Monnerat
a005243908 Fix dynamic CURLOPT_POSTFIELDS bug: back to static.
CURLOPT_COPYPOSTFIELDS option added for dynamic.
Fix some OS400 features.
2007-10-15 18:32:01 +00:00
Dan Fandrich
001a2d9b67 Fix LDAP compile error when LDAP is not available.
Fixed a typo in the LDAP configure code and made sure NULL is defined
in a test programs that need it.
2007-10-15 16:24:46 +00:00
Dan Fandrich
61ffcd7815 Made a few more functions static with the protocol handler table in place. 2007-10-13 00:47:53 +00:00
Daniel Stenberg
a9f47b9364 another Curl_handler fix, the #ifdefs got a bit mixed up... 2007-10-12 20:53:43 +00:00
Dan Fandrich
7831c1ae44 Fixed a few compile errors and warnings. 2007-10-12 18:49:14 +00:00
Patrick Monnerat
07b6e7363d Added per-protocol callback static tables, replacing callback ptr storage
in the connectdata structure by a single handler table ptr.
2007-10-12 13:36:37 +00:00
Yang Tse
43e8f00861 lber.h needs to be included since ldap.h might not include it 2007-10-09 23:51:55 +00:00
Gunter Knauf
0cc9122093 added check for MSVC6 standard PSDK and bail out since insufficient for LDAP support with current code. 2007-10-09 23:25:58 +00:00
Gunter Knauf
50b3545ada fix socklen_t for MSVC6 & 7. 2007-10-09 22:10:17 +00:00
Gunter Knauf
baac8065cf added two more module dependencies for LDAPS. 2007-10-09 20:15:27 +00:00
Daniel Stenberg
08fd1829e0 Known bug #47, which confused libcurl if doing NTLM auth over a proxy with
a response that was larger than 16KB is now improved slightly so that now
the restriction at 16KB is for the headers only and it should be a rare
situation where the response-headers exceed 16KB. Thus, I consider #47 fixed
and the header limitation is now known as known bug #48.
2007-10-07 08:28:03 +00:00
Daniel Stenberg
4449bd9b4d Michael Wallner made the CULROPT_COOKIELIST option support a new magic
string: "FLUSH". Using that will cause libcurl to flush its cookies to the
CURLOPT_COOKIEJAR file.
2007-10-05 14:37:33 +00:00
Daniel Stenberg
67d94514b0 Kim Rinnewitz reported that --local-port didn't work with TFTP transfers.
This happened because the tftp code always uncondionally did a bind()
without caring if one already had been done and then it failed. I wrote a
test case (1009) to verify this, but it is a bit error-prone since it will
have to pick a fixed local port number and since the tests are run on so
many different hosts in different situations I add it in disabled state.
2007-10-04 10:01:41 +00:00
Yang Tse
a11c8a6ea0 Cleanup no longer used macros 2007-10-03 16:58:10 +00:00
Yang Tse
2858935187 Fix compiler warning: local variable may be used without having been initialized 2007-10-03 16:26:56 +00:00
Yang Tse
3f3a38f9c6 Fix issue related with the use of ares_timeout() result. 2007-10-03 13:19:34 +00:00
Daniel Stenberg
4bf28cb904 exported symbols must use lowercase "curl_", and I also fixed two compiler
warnings, one C99 thing and the bad pointer sent to the callback
2007-10-03 08:58:40 +00:00
Daniel Stenberg
ce1cfcb7a6 Alexey Pesternikov introduced CURLOPT_OPENSOCKETFUNCTION and
CURLOPT_OPENSOCKETDATA to set a callback that allows an application to replace
the socket() call used by libcurl. It basically allows the app to change
address, protocol or whatever of the socket. (I also did some whitespace
indent/cleanups in lib/url.c which kind of hides some of these changes, sorry
for mixing those in.)
2007-10-03 08:45:00 +00:00
Daniel Stenberg
ce81cd21d3 I renamed the CURLE_SSL_PEER_CERTIFICATE error code to
CURLE_PEER_FAILED_VERIFICATION (standard CURL_NO_OLDIES style), and made this
return code get used by the previous SSH MD5 fingerprint check in case it
fails.
2007-10-03 08:07:50 +00:00
Daniel Stenberg
51c6a5d43b Based on a patch brought by Johnny Luong, libcurl now offers
CURLOPT_SSH_HOST_PUBLIC_KEY_MD5 and the curl tool --hostpubmd5. They both make
the SCP or SFTP connection verify the remote host's md5 checksum of the public
key before doing a connect, to reduce the risk of a man-in-the-middle attack.
2007-10-03 08:00:42 +00:00
Yang Tse
08b9f73219 Fix memory leak under low memory conditions. 2007-10-02 19:19:47 +00:00
Yang Tse
048bfeaaef Fix compiler warning 2007-10-02 15:26:30 +00:00
Yang Tse
a137109a0c <winber.h> needed for Windows LDAP client 32 API support 2007-10-02 14:48:38 +00:00
Yang Tse
17c01d21a9 Linking with wldap32.lib needed for Windows LDAP client 32 API support 2007-10-02 14:26:04 +00:00
Daniel Stenberg
119364741e known bug #46: chunked-encoded CONNECT responses from a http proxy now works.
Added test case 1008 to verify. Note that #47 is still there.
2007-10-02 10:21:36 +00:00
Daniel Stenberg
ec08e2f9f2 Alex Fishman reported a curl_easy_escape() problem that was made the
function do wrong on all input bytes that are >= 0x80 (decimal 128) due to a
signed / unsigned mistake in the code. I fixed it and added test case 543 to
verify.
2007-09-30 22:40:24 +00:00
Daniel Stenberg
f58ba5ab1c Immanuel Gregoire fixed a problem with persistent transfers over SFTP - the
previous proto struct was kept.
2007-09-29 21:34:34 +00:00
Daniel Stenberg
2c105af910 Adapted the c-ares code to the API change c-ares 1.5.0 brings in the
notifier callback(s).
2007-09-28 21:48:28 +00:00
Daniel Stenberg
bb667c8ac6 rename variable to prevent shadow warning 2007-09-28 21:45:05 +00:00
Dan Fandrich
8388366849 Renamed a variable to avoid shadowing a global declarations. 2007-09-28 18:47:59 +00:00
Dan Fandrich
0819c3a8cf Don't strdup an empty string 2007-09-27 18:39:10 +00:00
Dan Fandrich
ad05b22de3 Renamed a few variables to avoid shadowing global declarations. 2007-09-27 18:12:03 +00:00
Daniel Stenberg
a4d6611d26 a name resolve that times out is still a failed name resolve 2007-09-27 12:05:39 +00:00
Dan Fandrich
0bd2d54814 Renamed a few variables to avoid shadowing global declarations. 2007-09-27 02:45:58 +00:00
Dan Fandrich
16b95fc773 Enabled a few more gcc warnings with --enable-debug. Renamed a few
variables to avoid shadowing global declarations.
2007-09-27 01:45:22 +00:00
Yang Tse
9c5cd6c413 Fix compiler warning: the address of 'env' will always evaluate as 'true' 2007-09-27 00:58:41 +00:00
Daniel Stenberg
fd4cf78f36 Philip Langdale provided the new CURLOPT_POST301 option for
curl_easy_setopt() that alters how libcurl functions when following
redirects. It makes libcurl obey the RFC2616 when a 301 response is received
after a non-GET request is made. Default libcurl behaviour is to change
method to GET in the subsequent request (like it does for response code 302
- because that's what many/most browsers do), but with this CURLOPT_POST301
option enabled it will do what the spec says and do the next request using
the same method again. I.e keep POST after 301.

The curl tool got this option as --post301

Test case 1011 and 1012 were added to verify.
2007-09-26 12:44:59 +00:00
Daniel Stenberg
a6315359d7 Max Katsev reported that when doing a libcurl FTP request with
CURLOPT_NOBODY enabled but not CURLOPT_HEADER, libcurl wouldn't do TYPE
before it does SIZE which makes it less useful. I walked over the code and
made it do this properly, and added test case 542 to verify it.
2007-09-26 12:00:01 +00:00
Dan Fandrich
966130132f Make glibc define the prototype for strcasestr 2007-09-25 17:33:56 +00:00
Dan Fandrich
bdfeaa0f95 #ifdef out a few more functions when SSL is disabled. 2007-09-25 06:45:05 +00:00
Dan Fandrich
c478200766 Use a native strcasestr() if found. 2007-09-25 06:43:58 +00:00
Daniel Stenberg
775f86cb5a Immanuel Gregoire fixed KNOWN_BUGS #44: --ftp-method nocwd did not handle
URLs ending with a slash properly (it should list the contents of that
directory). Test case 351 brought back and also test 1010 was added.
2007-09-24 21:47:35 +00:00
Daniel Stenberg
015d5869d7 Mark Davies fixed Negotiate authentication over proxy, and also introduced
the --proxy-negotiate command line option to allow a user to explicitly
select it.
2007-09-21 11:05:31 +00:00
Daniel Stenberg
8c3f40ee32 Rob Crittenden provided an NSS update with the following highlights:
o It looks for the NSS database first in the environment variable SSL_DIR,
  then in /etc/pki/nssdb, then it initializes with no database if neither of
  those exist.

o If the NSS PKCS#11 libnspsem.so driver is available then PEM files may be
  loaded, including the ca-bundle. If it is not available then only
  certificates already in the NSS database are used.

o Tries to detect whether a file or nickname is being passed in so the right
  thing is done

o Added a bit of code to make the output more like the OpenSSL module,
  including displaying the certificate information when connecting in
  verbose mode

o Improved handling of certificate errors (expired, untrusted, etc)

The libnsspem.so PKCS#11 module is currently only available in Fedora
8/rawhide. Work will be done soon to upstream it. The NSS module will work
with or without it, all that changes is the source of the certificates and
keys.
2007-09-18 22:21:54 +00:00
Daniel Stenberg
45fd6685bd Immanuel pointed out that public key SSH auth failed if no public/private
key was specified and there was no HOME environment variable, and then it
didn't continue to try the other auth methods. Now it will instead try to
get the files id_dsa.pub and id_dsa from the current directory if none of
the two conditions were met.
2007-09-18 21:14:28 +00:00
Gunter Knauf
7ac7c119be added a define for Win32 to detect already defined ssize_t. 2007-09-18 18:18:34 +00:00
Daniel Stenberg
e04151ed76 Michal Marek made libcurl automatically append ";type=<a|i>" when using HTTP
proxies for FTP urls.
2007-09-15 21:14:12 +00:00
Gunter Knauf
b41e65a8e3 fixed ldap support for winldap. 2007-09-15 20:03:03 +00:00
Gunter Knauf
be8c219ec2 fixed VC6 makefiles for new ldap linkage. 2007-09-15 20:02:22 +00:00
Daniel Stenberg
1ce732e9d6 - I noticed while writing test 541 that the FTP code wrongly did a CWD on the
second transfer as it didn't store and remember the "" path from the
  previous transfer so it would instead CWD to the entry path as stored. This
  worked, but did a superfluous command. Thus, test case 541 now also verifies
  this fix.
2007-09-11 22:21:39 +00:00
Daniel Stenberg
cc618e761c - Bug report #1792649 (http://curl.haxx.se/bug/view.cgi?id=1792649) pointed
out a problem with doing an empty upload over FTP on a re-used connection.
  I added test case 541 to reproduce it and to verify the fix.
2007-09-11 22:21:12 +00:00
Dan Fandrich
7350f9851a TFTP now reports the "not defined" TFTP error code 0 as an error,
not success.
2007-09-07 20:35:37 +00:00
Dan Fandrich
8147c3659d Minix doesn't support getsockopt on UDP sockets or send/recv on TCP
sockets.
2007-09-05 22:01:57 +00:00
Daniel Stenberg
73e91ce20c Curl_GetFTPResponse() now checks and properly deals with the fact that the
underlying ftp_readresp() function has a separate "cache" where there might
in fact be leftover data...
2007-09-05 21:41:07 +00:00
Dan Fandrich
3fa60164af Renamed the CURLE_FTP_SSL_FAILED error code to CURLE_USE_SSL_FAILED.
Renamed the curl_ftpssl enum to curl_usessl and its enumerated constants,
creating macros for backward compatibility.
2007-08-31 19:36:32 +00:00
Dan Fandrich
ac6e0501c6 Made some of the error strings returned by the *strerror functions more
generic, and more consistent with each other.
2007-08-31 17:56:06 +00:00