Commit Graph

3518 Commits

Author SHA1 Message Date
Daniel Stenberg cea9695bcf Daniel Black filed bug #1704675 (http://curl.haxx.se/bug/view.cgi?id=1704675)
identifying a double-free problem in the SSL-dealing layer, telling GnuTLS to
free NULL credentials on closedown after a failure and a bad #ifdef for NSS
when closing down SSL.
2007-04-21 21:32:31 +00:00
Daniel Stenberg 92039629c7 Curl_ssl_close(): mark the connection as not using SSL anymore, to better
survive getting called twice
2007-04-21 21:24:53 +00:00
Gunter Knauf c8d3327e92 fixed ARFLAGS for CodeWarrior build. 2007-04-21 15:32:35 +00:00
Yang Tse 7f33aae067 initialize pending_ms to zero to avoid compiler warning:
'pending_ms' may be used uninitialized in this function
2007-04-20 01:58:15 +00:00
Yang Tse 61022f3817 - Save one call to curlx_tvnow(), which calls gettimeofday(), in each of
Curl_socket_ready(), Curl_poll() and Curl_select() when these are called
  with a zero timeout or a timeout value indicating a blocking call should
  be performed.

  These unnecessary calls to gettimeofday() got introduced in 7.16.2 when
  fixing 'timeout would restart when signal caught while awaiting socket
  events' on 20 March 2007.

- Move some loop breaking logic from the while clause into the loop,
  avoiding compiler warning 'assignment within conditional expression'
2007-04-20 00:07:19 +00:00
Daniel Stenberg bf648fcfc3 keep lines < 80 columns 2007-04-19 20:20:48 +00:00
Yang Tse b0e909329e fix comment and line spacing 2007-04-19 20:16:28 +00:00
Daniel Stenberg c234b9d04b clarify the comment about libssh2_sftp_write's return type 2007-04-18 20:15:22 +00:00
Daniel Stenberg 7a86740afd - James Housley made SFTP uploads use libssh2's non-blocking API (if available) 2007-04-18 20:11:47 +00:00
Daniel Stenberg 8e719e3ef5 - Prevent the internal progress meter from updating more frequently than once
per second.
2007-04-18 20:02:41 +00:00
Gunter Knauf f30ae93a1f added ranlib when library is created with ar. 2007-04-16 20:54:56 +00:00
Daniel Stenberg 76627b322e - Robert Iakobashvil added curl_multi_socket_action() to libcurl, which is a
function that deprecates the curl_multi_socket() function. Using the new
  function the application tell libcurl what action that was found in the
  socket that it passes in. This gives a significant performance boost as it
  allows libcurl to avoid a call to poll()/select() for every call to
  curl_multi_socket*().
2007-04-16 16:34:08 +00:00
Yang Tse b039d883e5 proper fix for compiler warning 2007-04-13 08:45:07 +00:00
Yang Tse b3401ddbad Take in account that it can be built with compiler debug info and
without the curl memory debugging leak detection code enabled.
2007-04-13 08:22:56 +00:00
Yang Tse 038fe54e21 fix compiler warning 2007-04-13 07:57:31 +00:00
Daniel Stenberg c38c339480 Song Ma found a memory leak in the if2ip code if you pass in an interface
name longer than the name field of the ifreq struct (typically 6 bytes), as
then it wouldn't close the used dummy socket.
2007-04-12 20:09:19 +00:00
Dan Fandrich 70cce4cddd Work around an out of memory situation in Curl_ftp_done instead of
returning an error code, to allow connections to be torn down
cleanly since this function can be called AFTER an OOM situation
has already been reached.
2007-04-12 01:26:02 +00:00
Yang Tse 84c5e846b3 convenience SIG_ATOMIC_T macro definition 2007-04-11 11:02:13 +00:00
Dan Fandrich 47f044265e Fixed some out of memory handling issues. 2007-04-11 00:25:41 +00:00
Dan Fandrich d46d995766 Fixed some out of memory handling issues. 2007-04-10 22:52:50 +00:00
Daniel Stenberg 5daa6b9367 Ravi Pratap provided fixes for HTTP pipelining 2007-04-10 20:46:40 +00:00
Yang Tse 5be7b543d8 Update NTLM flag and description 2007-04-10 02:17:06 +00:00
Dan Fandrich 910ee13b20 Fixed an out of memory handling issue. 2007-04-10 00:38:41 +00:00
Yang Tse be5ade5c7a VC8+ (VS2005+) has C99 variadic macro support 2007-04-09 17:46:01 +00:00
Yang Tse 0e05a6329a fix out of memory handling issue 2007-04-08 22:49:38 +00:00
Daniel Stenberg c518c52aba Nick Zitzmann did ssh.c cleanups 2007-04-08 22:44:21 +00:00
Yang Tse a11374d994 fix out of memory handling issue 2007-04-07 17:25:19 +00:00
Yang Tse d9e89e170f fix out of memory handling issue 2007-04-07 04:51:35 +00:00
Yang Tse 47594be5c0 fix compiler warning 2007-04-07 00:38:46 +00:00
Yang Tse 0d635a1119 fix out of memory handling issue 2007-04-06 20:53:15 +00:00
Dan Fandrich e9ffa9a3b8 Fixed a few memory leaks in OOM conditions.
Made libssh2 logging more verbose when debugging is enabled.
2007-04-06 06:32:05 +00:00
Yang Tse c895dc8a19 runtests -t discovered this out of memory handling issues 2007-04-05 11:09:46 +00:00
Dan Fandrich c321b9f704 Fixes some more out of memory handling bugs. 2007-04-04 23:41:35 +00:00
Dan Fandrich 7e74349b86 Fixed file handle leak in OOM condition. 2007-04-04 22:49:12 +00:00
Yang Tse 8fe9376d54 move WinSock definitions of EBADF, EINTR, EINVAL and EAFNOSUPPORT to setup_once.h 2007-04-04 06:06:36 +00:00
Dan Fandrich 7d48d851a2 Fixed a memory leak and improper shutdown on SFTP post-quote command failure. 2007-04-04 00:46:16 +00:00
Daniel Stenberg 990b15e402 Rob Jones fixed better #ifdef'ing for a bunch of #include lines. 2007-04-03 20:54:37 +00:00
Yang Tse 584f3639e3 update copyright year 2007-04-03 18:25:18 +00:00
Yang Tse f1b4f5e2ae fix MSDOS symbol check 2007-04-03 15:35:19 +00:00
Yang Tse bcf0af9ddb recover code simplification lost with last commit 2007-04-03 13:26:05 +00:00
Gisle Vanem c420113795 DOS targets do have setmode(). 2007-04-03 10:18:38 +00:00
Daniel Stenberg 20d33ad7e5 Nick Zitzmann made CURLOPT_POSTQUOTE work for SFTP as well. 2007-04-02 21:24:05 +00:00
Yang Tse e4d4ee8db5 fix compiler warning 2007-04-02 03:38:18 +00:00
Yang Tse 8a7d58378b fix compiler warning 2007-04-02 02:13:26 +00:00
Daniel Stenberg 6c6e4710b5 Robert Iakobashvili made curl_multi_remove_handle() a lot faster when many
easy handles are added to a multi handle, by avoiding the looping over all
the handles to find which one to remove.
2007-04-01 08:24:23 +00:00
Daniel Stenberg 5e7164f87a Matt Kraai provided a patch that makes curl build on QNX 6 fine again. Mostly
by letting configure check for setmode and ifdef on HAVE_SETMODE. NOTE: non-
configure platforms that havve setmode() needs their hard-coded config.h files
fixed. I fixed the src/config-win32.h.
2007-04-01 07:51:30 +00:00
Daniel Stenberg c1f117700a Pointless to check for non-NULL pointers that already have been dereferenced
and they have to be non-NULL long before this check.
CID 22 in the coverity.com scan
2007-03-31 21:10:05 +00:00
Daniel Stenberg 7ea90c46eb avoid dereferencing a NULL pointer by setting a default word to lookup in case
it is missing
CID 5 in the coverity.com scan
2007-03-31 21:06:40 +00:00
Daniel Stenberg 4d9e24d1e4 Better deal with NULL pointers.
CID 3 and 4 from the coverity.com scan.
2007-03-31 21:01:18 +00:00
Daniel Stenberg d27813c2dd *** empty log message *** 2007-03-31 20:46:47 +00:00
Daniel Stenberg 371a25eee9 When curl_easy_duphandle() fails because it can't get or make a connection
cache, we must make sure not to derefence the NULL pointer...
CID 6 coverity.com scan
2007-03-31 11:28:03 +00:00
Daniel Stenberg e535a71c71 The info types cannot be checked for explicity by ANDing the types since they
have not been properly defined to allow this! Instead of changing the defines
and break the ABI/API, I opted to modify the code to check for exact type
matches.
CID 10 coverity.com scan
2007-03-31 11:12:28 +00:00
Daniel Stenberg b9e5fecf5f Check for a NULL easy->easy_conn in multi_getsock() since it can in fact
happen when curl_multi_remove_handle() is called.
CID 13. coverity.com scan
2007-03-31 10:56:07 +00:00
Daniel Stenberg 3af08472ad Removed check for ftpcode being NULL, as later it is derefenced unconditionally
anyway and we can just as well rely on it being valid.
CID 12, coverity.com scan
2007-03-31 10:39:54 +00:00
Daniel Stenberg 75db459f0a Pointer "conn" dereferenced before NULL check. found by coverity.com scan 2007-03-30 20:54:32 +00:00
Daniel Stenberg 74e54c5a49 Pointer "cur_pos" dereferenced before NULL check, found by coverity.com scan.
Removed the NULL check since the pointer must be valid already.
2007-03-30 20:52:42 +00:00
Daniel Stenberg 3dcc7202d5 dead code removed, found by the coverity.com scan 2007-03-30 19:59:15 +00:00
Dan Fandrich ffb11ad5c6 Don't tear down the ftp connection if the maximum filesize was exceeded
and added tests 290 and 291 to check.
2007-03-30 01:13:47 +00:00
Dan Fandrich 7763bb9172 Send an EOF message before closing a channel, as recommended by RFC4254.
Enable libssh2 tracing when ssh debugging is turned on.
2007-03-29 19:17:18 +00:00
Yang Tse a1e5c621c0 fix compiler warning 2007-03-29 12:29:32 +00:00
Yang Tse 3d5a8515a6 fix error introduced in last commit 2007-03-29 00:11:55 +00:00
Yang Tse bfa0f8c6c2 fix compiler warning 2007-03-28 19:05:43 +00:00
Yang Tse 869d192ffc Improve detection of socket events which allow a further recv() call
to complete with no delay and actually find out what happened with
the socket. As well as detection of socket send()able condition.

This also allows removal of a Cygwin specific block of code.
2007-03-28 18:59:42 +00:00
Gisle Vanem 60bc103a78 djgpp uses gcc which has varadic macros. 2007-03-28 04:48:11 +00:00
Gisle Vanem 8a0a7ce3a8 Fix compiler warning. 2007-03-28 04:44:14 +00:00
Gisle Vanem 25c064c888 Simplified code around 'tld_errmsg' a bit. 2007-03-28 04:23:33 +00:00
Gunter Knauf 45b2577974 added variadic macro stuff. 2007-03-27 19:27:43 +00:00
Yang Tse d58c7a8bdd Update message 2007-03-27 18:16:35 +00:00
Yang Tse eed47311f8 New Internal wrapper function Curl_select() around select (2), it
uses poll() when a fine poll() is available, so now libcurl can be
built without select() support at all if a fine poll() is available.
2007-03-27 18:15:26 +00:00
Yang Tse 59eaae42b8 don't retry select() call upon unrecoverable error EBADF 2007-03-27 15:22:49 +00:00
Yang Tse 4294cac701 Platforms that lack autotools support should define HAVE_VARIADIC_MACROS_C99
and/or HAVE_VARIADIC_MACROS_GCC for specific compiler versions that support
variadic macros with C99 style and/or old gcc style in their specific config.h
file.

If previous definitions are not done, even when aplicable, and --disable-verbose
is used, the fallback (void) method will be used to define infof, avoiding the
inclusion of unwanted strings in the resulting library/executable.
2007-03-27 04:17:26 +00:00
Yang Tse fba4cd0e62 Internal function Curl_select() renamed to Curl_socket_ready() 2007-03-26 23:23:46 +00:00
Gunter Knauf 8272abef28 changed link lib order to make nlmconv happy. 2007-03-26 17:01:35 +00:00
Gunter Knauf 5fbc93c3eb added CVS Id tag. 2007-03-26 01:54:06 +00:00
Gunter Knauf 8851df41c5 fixed build to use compiler-default lib extension. 2007-03-26 01:50:44 +00:00
Daniel Stenberg 6c56b5301f - Daniel Johnson fixed multi code to traverse the easy handle list properly.
A left-over bug from the February 21 fix.
2007-03-25 08:16:16 +00:00
Yang Tse fa0780bb91 fix compiler warning 2007-03-25 03:20:17 +00:00
Yang Tse f08ac86834 fix compiler warning 2007-03-25 02:30:58 +00:00
Yang Tse d6eca89229 fix compiler warning 2007-03-25 01:59:52 +00:00
Dan Fandrich 2bd1d7e996 Fixed a couple of compile problems. 2007-03-24 17:23:01 +00:00
Dan Fandrich 0dd1219668 Fixed a memory leak when specifying a proxy with a file: URL and added
test case 288 to verify it.
2007-03-24 02:15:20 +00:00
Daniel Stenberg 3d528e1b15 add missing state name for the debug state switch output 2007-03-23 22:25:04 +00:00
Daniel Stenberg f9a339a225 fix debug message 2007-03-23 22:24:33 +00:00
Dan Fandrich 0043e87014 Added --pubkey option to curl and made --key also work for SCP/SFTP,
plus made --pass work on an SSH private key as well.
2007-03-23 17:59:40 +00:00
Yang Tse 0f634a0c89 fix yet another leftover in previous commit 2007-03-23 12:13:08 +00:00
Yang Tse 047cd1a533 fix leftover in previous commit 2007-03-23 12:09:16 +00:00
Yang Tse f9eb61e90a fix compiler warning: empty body in an if/else-statement 2007-03-23 12:01:19 +00:00
Yang Tse 34afb0b257 Change spelling, ONE_TERRABYTE -> ONE_TERABYTE
Shave off a couple of function calls in the part of
Curl_pgrsUpdate() which is always executed when called.

Fix a couple of comments.
2007-03-23 04:23:53 +00:00
Dan Fandrich 6bb9bd8b69 Don't shut down sftp in an error if it was never started. 2007-03-23 00:03:34 +00:00
Dan Fandrich 3229a80c9f Fixed unused variable compiler warning. 2007-03-22 17:58:01 +00:00
Dan Fandrich 5eba84eed3 Use C99-style variadic macros when available. 2007-03-22 17:18:41 +00:00
Yang Tse 4fb483012c Add a couple of local macros to improve code readability.
For completeness sake, wait_ms() might also get interrupted when
experimental CURL_ACKNOWLEDGE_EINTR is defined.
2007-03-22 15:32:28 +00:00
Yang Tse 90ce18019c reverted back to previous version => http://curl.haxx.se/mail/lib-2007-03/0258.html 2007-03-21 13:09:39 +00:00
Yang Tse fe10cb2ef5 avoid the use of variadic macros for greater portability 2007-03-21 08:17:13 +00:00
Yang Tse 842be6c52f fix compiler warning: implicit conversion from "long" to "int" 2007-03-21 07:29:03 +00:00
Yang Tse e4b754f64e Fixed: When a signal was caught awaiting for an event using Curl_select()
or Curl_poll() with a non-zero timeout both functions would restart the
specified timeout. This could even lead to the extreme case that if a
signal arrived with a frecuency lower to the specified timeout neither
function would ever exit.

Added experimental symbol definition check CURL_ACKNOWLEDGE_EINTR in
Curl_select() and Curl_poll(). When compiled with CURL_ACKNOWLEDGE_EINTR
defined both functions will return as soon as a signal is caught. Use it
at your own risk, all calls to these functions in the library should be
revisited and checked before fully supporting this feature.
2007-03-20 20:00:40 +00:00
Gisle Vanem 34ed4642ec Remove unneeded 'HAVE_*' defines. 2007-03-20 16:30:14 +00:00
Yang Tse 072a8b2955 Bryan Henderson fixed the progress function so that it can get called
more frequently allowing same calling frecuency for the client progress
callback, while keeping the once a second frecuency for speed calculations
and internal display of the transfer progress.
2007-03-19 12:02:33 +00:00
Yang Tse da2b75a026 Fix compiler warning/error: ISO C90 forbids mixed declarations and code 2007-03-18 17:29:24 +00:00
Yang Tse 0e2d3b7b6c Code refactoring, extracting a new function wait_ms() from Curl_select and
Curl_poll() which is called whenever not a single valid file descriptor is
passed to these functions.

Improve readibility using a poll() macro to replace WSApoll().
2007-03-18 04:51:40 +00:00