1
0
mirror of https://github.com/moparisthebest/curl synced 2024-11-06 01:25:33 -05:00
Commit Graph

172 Commits

Author SHA1 Message Date
Daniel Stenberg
686d90745b First curl_multi_socket() commit. Should primarily be considered as an internal
code rearrange to fit the future better.
2006-04-10 15:00:53 +00:00
Daniel Stenberg
4486d336a6 argh, forgot the check for a connection before we call Curl_done 2006-02-23 21:29:48 +00:00
Daniel Stenberg
6fdbb01194 Lots of work and analysis by "xbx___" in bug #1431750
(http://curl.haxx.se/bug/view.cgi?id=1431750) helped me identify and fix two
different but related bugs:

1) Removing an easy handle from a multi handle before the transfer is done
   could leave a connection in the connection cache for that handle that is
   in a state that isn't suitable for re-use. A subsequent re-use could then
   read from a NULL pointer and segfault.

2) When an easy handle was removed from the multi handle, there could be an
   outstanding c-ares DNS name resolve request. When the response arrived,
   it caused havoc since the connection struct it "belonged" to could've
   been freed already.

Now Curl_done() is called when an easy handle is removed from a multi handle
pre-maturely (that is, before the transfer was complteted). Curl_done() also
makes sure to cancel all (if any) outstanding c-ares requests.
2006-02-23 12:20:48 +00:00
Daniel Stenberg
87bcb6f377 Karl M added the CURLOPT_CONNECT_ONLY and CURLINFO_LASTSOCKET options that
an app can use to let libcurl only connect to a remote host and then extract
the socket from libcurl. libcurl will then not attempt to do any transfer at
all after the connect is done.
2006-02-11 22:35:16 +00:00
Daniel Stenberg
b7ffc6bb45 remove old printf() debug leftover 2005-03-08 22:21:59 +00:00
Daniel Stenberg
6a2e21ec8c FTP code turned into state machine. Not completely yet, but a good start.
The tag 'before_ftp_statemachine' was set just before this commit in case
of future need.
2005-02-09 13:06:40 +00:00
Daniel Stenberg
686d767053 if the DO operation returns failure, bail out and close down nicely to
prevent memory leakage
2005-01-30 22:54:06 +00:00
Daniel Stenberg
8dbaf534c8 Using the multi interface, and doing a requsted a re-used connection that
gets closed just after the request has been sent failed and did not re-issue
a request on a fresh reconnect like the easy interface did. Now it does!
(define CURL_MULTIEASY, run test case 160)
2005-01-29 22:31:06 +00:00
Daniel Stenberg
59b45a90cc multi interface: when a request is denied due to "Maximum redirects followed"
libcurl leaked the last Location: URL.
2005-01-29 12:01:20 +00:00
Daniel Stenberg
043d70fcdf Use plain structs and not typedef'ed ones in the hash and linked-list code. 2005-01-25 00:06:29 +00:00
Daniel Stenberg
e3fa7d021e Renamed easy.h and multi.h to easyif.h and multiif.h to make sure they don't
shadow our public headers with the former names.
2005-01-11 15:25:29 +00:00
Daniel Stenberg
29102befa6 Cyrill Osterwalder posted a detailed analysis about a bug that occurs when
using a custom Host: header and curl fails to send a request on a re-used
persistent connection and thus creates a new connection and resends it. It
then sent two Host: headers. Cyrill's analysis was posted here:
http://curl.haxx.se/mail/archive-2005-01/0022.html
2005-01-11 14:00:45 +00:00
Daniel Stenberg
065e466f1a Use Curl_easy_addmulti() to clear associations from easy handles to multi
handles. Include multi.h to get proto.
2005-01-10 11:42:20 +00:00
Daniel Stenberg
21bb852750 Pavel Orehov reported memory problems with the multi interface in bug report
#1098843. In short, a shared DNS cache was setup for a multi handle and when
the shared cache was deleted before the individual easy handles, the latter
cleanups caused read/writes to already freed memory.
2005-01-10 10:07:07 +00:00
Daniel Stenberg
92637303db fix the return code for curl_multi_add_handle() 2004-08-31 06:04:43 +00:00
Daniel Stenberg
6ed5feda2b First attempt at making the multi interface work when connecting to a host
that resolves to multiple IP addresses.
2004-06-29 11:20:07 +00:00
Daniel Stenberg
d70a335dce new Curl_done() proto 2004-05-17 08:07:07 +00:00
Daniel Stenberg
d7cb09bd18 better bailing out on memory failure 2004-05-17 08:04:42 +00:00
Daniel Stenberg
de279099e5 bail out nicely if strdup() returns NULL, removed trailing whitespace 2004-05-17 06:53:41 +00:00
Daniel Stenberg
1c69b15c7c return on memory alloc fail 2004-05-13 15:17:49 +00:00
Daniel Stenberg
d60c22572b Curl_done() and the protocol-specific conn->curl_done() functions now all
take a CURLcode as a second argument, that is non-zero when Curl_done()
is called after an error was returned from Curl_do() (or similar).
2004-05-12 12:06:39 +00:00
Daniel Stenberg
bbafb2eb27 curl_global_init_mem() allows the memory functions to be replaced.
memory.h is included everywhere for this.
2004-05-11 11:30:23 +00:00
Daniel Stenberg
648e82f05d Major hostip.c cleanup and split into multiple files and easier #ifdef
usage.
2004-04-26 07:20:11 +00:00
Daniel Stenberg
7ea837a18c adjusted to the new dns cache function to hide more hostip internals 2004-03-30 13:02:31 +00:00
Daniel Stenberg
6950aeafcc init the dns pointer to NULL for clarity 2004-03-30 08:14:37 +00:00
Daniel Stenberg
e545e33d5f Gisle Vanem's fixes to use CURL_SOCKET_BAD more instead of -1 for sockets. 2004-03-11 13:13:35 +00:00
Daniel Stenberg
7225b14002 curl_socket_t mistakes cleanup 2004-03-10 16:01:47 +00:00
Daniel Stenberg
ce5805a955 Use curl_socket_t instead of int for holding sockets. The typedefs and
defines are in setup.h.
2004-03-09 22:52:50 +00:00
Daniel Stenberg
465753c2de When following to a new URL, we must make sure to call Curl_done() first,
since the current connection must be taken care of properly before we move
on. Christopher R. Palmer reported a problem he found due to this mistake.
2004-03-04 16:13:33 +00:00
Daniel Stenberg
4816294f52 compiler warning fix, compare struct pointers of the same type 2004-02-05 09:37:04 +00:00
Daniel Stenberg
3a61c98b65 Peter Sylvester brought code that now allows a callback to modified the URL
even when the multi interface is used, and then libcurl will simulate a
"follow location" to that new URL. Test 509 was added to test this feature.
2004-01-12 15:26:32 +00:00
Daniel Stenberg
053f6c85ef updated year in the copyright string 2004-01-07 09:19:33 +00:00
Daniel Stenberg
1e98727c55 FTPS support added as RFC2228 and the murray-ftp-auth-ssl draft describe it 2003-11-24 07:15:37 +00:00
Daniel Stenberg
381c6c5d52 minor fix to not shadow a variable 2003-10-18 20:38:18 +00:00
Daniel Stenberg
8341e8e502 Clear the connection pointer after the async resolve has failed.
This cures the problem reported by Giuseppe Attardi on October 12, 2003.
2003-10-13 12:21:56 +00:00
Daniel Stenberg
343291ce37 Based on a patch provided by Siddhartha Prakash Jain. In Curl_resolv() when
my_getaddrinfo() has been called (and wait has been set to TRUE), we check
if the name already is resolved and if so don't return wait status to the
parent. This can happen with IP-only names.
2003-10-04 14:50:45 +00:00
Daniel Stenberg
8aa2894bfb failing to resolve a name using ares must Curl_disconnect() the handle
properly or risk getting into trouble!
2003-09-21 23:10:47 +00:00
Daniel Stenberg
0efcb57623 For easy handles within multi handles, we share the DNS cache always. 2003-09-11 22:14:29 +00:00
Daniel Stenberg
61629d2c86 made curl_multi_info_read() set 'msgs_in_queue' to 0 even when it returns
NULL!
2003-08-20 13:49:46 +00:00
Daniel Stenberg
b73612392d ares awareness/usage/support added. If configure --enable-ares is used, we
build libcurl to use ares for asynch name resolves.
2003-08-05 14:40:59 +00:00
Daniel Stenberg
938f1d1da7 Dan Winship's fix to make the new auth stuff such as NTLM to work with
the multi interface
2003-07-15 22:46:01 +00:00
Daniel Stenberg
308bc9d919 use CURLDEBUG instead of MALLOCDEBUG for preprocessor conditions 2003-06-26 11:22:12 +00:00
Daniel Stenberg
e727fb82f2 Marty Kuhrt's #include fixes for VMS 2003-06-13 06:48:04 +00:00
Daniel Stenberg
2f9cabc30b Peter Kovacs provided a patch that makes the CURLINFO_CONNECT_TIME work fine
when using the multi interface (too).
2003-04-29 18:03:30 +00:00
Daniel Stenberg
afffce80f0 Philippe Raoult needed this to build on FreeBSD 2003-03-13 21:41:02 +00:00
Daniel Stenberg
69ab4cd391 include <sys/socket.h> to compile the fd_set stuff properly on all systems 2003-02-14 09:03:03 +00:00
Daniel Stenberg
a7c72b7abf removed the local variables for emacs and vim, use the new sample.emacs
way for emacs, and vim users should provide a similar non-polluting style
2003-01-29 10:14:20 +00:00
Daniel Stenberg
f26a338a54 copyright year update in the source header 2003-01-16 21:08:12 +00:00
Daniel Stenberg
d64dd77993 fix the hash init to call the correct dns cleanup function 2002-11-28 15:48:54 +00:00
Daniel Stenberg
42acb00c81 moved the bools in the connectdata struct into the substruct named
ConnectBits where the other bools already are
2002-11-11 23:03:03 +00:00
Daniel Stenberg
203633d34d return call_multi when we follow a location 2002-10-18 15:27:49 +00:00
Daniel Stenberg
9b296e65bd Following locations properly, if told to do so. 2002-10-07 13:38:59 +00:00
Daniel Stenberg
35089a4289 properly disconnect failed connections 2002-09-23 12:44:45 +00:00
Daniel Stenberg
ba4e69bebc updated source code boilerplate/header 2002-09-03 11:52:59 +00:00
Daniel Stenberg
cb895ec335 Initial fix to make the multi interface return control while waiting for
the initial connect to "come through".

This should work fine for connect and for FTP-PASV connects. Needs massive
testing.
2002-08-12 09:43:20 +00:00
Daniel Stenberg
108cb14d1f Make SessionHandle keep record if it is used with the multi interface or
the easy interface, it CANNOT be used by a mixture.
2002-08-05 17:04:39 +00:00
Daniel Stenberg
b47b053e54 Gustaf Hui fixed curl_multi_remove_handle() to prevent a potential crash 2002-06-05 21:29:20 +00:00
Daniel Stenberg
775645f29b Gustaf Hui provided new code that changes how curl_multi_info_read()
messages are stored, so that they don't have to be kept around for the multi
 handle's entire life time. He also made it return failure codes properly
 which it didn't do before.

 I made the messages only get stored per easy-handle so that they can be
 independently killed easier without ruining the "master list". It makes
 the info_read() function slightly less beautiful as it has to scan for
 messages to return, but it makes removing individual handles a lot easier
 and less error prone.
2002-05-28 14:45:50 +00:00
Daniel Stenberg
0b898b5a8a fixed return code 2002-05-03 12:40:37 +00:00
Daniel Stenberg
2db0744a7b return CURLM_CALL_MULTI_PERFORM in one more case, and check return code
from malloc()
2002-05-02 22:12:14 +00:00
Daniel Stenberg
2de0028349 make sure the dns cache pointers in the easy handles are NULLed 2002-05-02 18:07:38 +00:00
Daniel Stenberg
969a25d1b2 implemented curl_multi_info_read() which I had forgotten before! 2002-04-27 22:21:51 +00:00
Daniel Stenberg
67b0f9aacd no longer include "multi.h", it comes with the regular curl/curl.h now 2002-03-20 10:54:17 +00:00
Daniel Stenberg
974f314f57 copyright string (year) update 2002-03-19 07:54:55 +00:00
Sterling Hughes
8d7f402efb Make cach'ing work with threads now, there are now three cases:
- Use a global dns cache (via setting the tentatively named,
    CURLOPT_DNS_USE_GLOBAL_CACHE option to true)
    - Use a per-handle dns cache, by default
    - Use a pooled dns cache when in the "multi" interface
2002-01-07 20:52:32 +00:00
Daniel Stenberg
8b6314ccfb merged the multi-dev branch back into MAIN again 2002-01-03 15:01:22 +00:00
Daniel Stenberg
e66cdacb93 minor changes 2001-12-13 07:16:27 +00:00
Daniel Stenberg
d52c0b6f05 more comments 2001-12-04 07:47:21 +00:00
Daniel Stenberg
a32cd520bd more more more MORE 2001-11-28 16:00:18 +00:00
Daniel Stenberg
b93a60daf9 the perform "state machine" is more explained now 2001-11-28 15:46:25 +00:00
Daniel Stenberg
e2844f5e04 mods 2001-11-28 15:25:01 +00:00
Daniel Stenberg
15a56b42d6 used in the new multi interface, not yet actually part of libcurl but
added to CVS to make them available to others
2001-11-28 11:09:18 +00:00