1
0
mirror of https://github.com/moparisthebest/curl synced 2024-11-08 02:25:06 -05:00
Go to file
Daniel Stenberg 8da56e12c6 multi_socket: re-use of same socket without notifying app
When a hostname resolves to multiple IP addresses and the first one
tried doesn't work, the socket for the second attempt may get dropped on
the floor, causing the request to eventually time out. The issue is that
when using kqueue (as on mac and bsd platforms) instead of select, the
kernel removes the first fd from kqueue when it is closed (in trynextip,
connect.c:503). Trynextip() then goes on to open a new socket, which
gets assigned the same number as the one it just closed. Later in
multi.c, socket_cb is not called because the fd is already in
multi->sockhash, so the new socket is never added to kqueue.

The correct fix is to ensure that socket_cb is called to remove the fd
when trynextip() closes the socket, and again to re-add it after
singleipsocket(). I'm not sure how to cleanly do that, but the attached
patch works around the problem in an admittedly kludgy way by delaying
the close to ensure that the newly-opened socket gets a different fd.

Daniel's added comment: I didn't spot a way to easily do a nicer fix so
I've proceeded with Ben's patch.

Bug: http://curl.haxx.se/bug/view.cgi?id=3017819
Patch by: Ben Darnell
2010-06-24 23:22:24 +02:00
CMake CMake fixes for Linux. 2010-03-24 14:07:18 -04:00
docs THANKS: added contributors from the 7.21.0 release 2010-06-16 14:26:14 +02:00
include version: start working on the 7.21.1-dev version 2010-06-16 14:26:43 +02:00
lib multi_socket: re-use of same socket without notifying app 2010-06-24 23:22:24 +02:00
m4 configure: spell --disable-threaded-resolver correctly 2010-06-17 15:10:08 +02:00
packages ILE/RPG binding updated to current curl.h definitions. 2010-06-09 17:19:58 +02:00
perl remove the CVSish $Id$ lines 2010-03-24 11:02:54 +01:00
src fix compiler warning: enumerated type mixed with another type 2010-06-01 12:25:14 +02:00
tests test575: do not fail with threaded DNS resolver 2010-06-17 17:07:15 +02:00
.gitattributes Add .gitattributes files to turn off CRLF translation for some files 2010-03-24 23:48:35 -04:00
.gitignore ignore: CHANGES.dist gets generated by maketgz 2010-06-21 22:42:11 +02:00
acinclude.m4 remove the CVSish $Id$ lines 2010-03-24 11:02:54 +01:00
Android.mk Copy the license file so it's seen by the Android build system 2010-05-12 15:23:28 -07:00
buildconf findtool: file name as a full path requires a slash 2010-05-09 23:16:37 +02:00
buildconf.bat modified to use the git file, not cvs 2010-04-11 11:35:33 +02:00
CHANGES CHANGES: move all contents from CHANGES to CHANGES.0 2010-06-21 22:27:39 +02:00
CHANGES.0 CHANGES: move all contents from CHANGES to CHANGES.0 2010-06-21 22:27:39 +02:00
CMakeLists.txt Enable OpenLDAP support for cygwin builds. 2010-06-04 15:14:31 +02:00
configure.ac Enable OpenLDAP support for cygwin builds. 2010-06-04 15:14:31 +02:00
COPYING update the generic copyright year range to include 2010 2010-03-02 13:47:58 +00:00
CTestConfig.cmake ENH: move dashboard location 2009-07-15 19:40:46 +00:00
curl-config.in remove the CVSish $Id$ lines 2010-03-24 11:02:54 +01:00
curl-style.el remove the CVSish $Id$ lines 2010-03-24 11:02:54 +01:00
GIT-INFO s/CVS/git 2010-03-22 00:41:34 +01:00
install-sh removed trailing whitespace 2010-02-14 19:40:18 +00:00
libcurl.pc.in remove the CVSish $Id$ lines 2010-03-24 11:02:54 +01:00
log2changes.pl log2changes: correct command line, fix tag usage, change Version output 2010-06-21 22:21:25 +02:00
MacOSX-Framework removed trailing whitespace 2010-02-14 19:40:18 +00:00
Makefile.am remove the CVSish $Id$ lines 2010-03-24 11:02:54 +01:00
Makefile.dist replaced wsock32.lib usage with ws2_32.lib in MSVC makefiles 2010-04-20 16:30:10 +02:00
maketgz maketgz: produce CHANGES automatically with the 1000 most recent commits 2010-06-21 22:42:36 +02:00
missing renamed generated config.h to curl_config.h in order to avoid clashes when libcurl is used with other projects which also have a config.h. 2009-07-14 13:25:14 +00:00
mkinstalldirs remove the CVSish $Id$ lines 2010-03-24 11:02:54 +01:00
README various changes of CVS to git 2010-03-22 00:34:09 +01:00
RELEASE-NOTES release: start on 7.21.1, bump contributor count 2010-06-16 14:29:16 +02:00
sample.emacs remove the CVSish $Id$ lines 2010-03-24 11:02:54 +01:00
TODO-RELEASE scrapped all left-over TODOs 2010-03-24 11:20:34 +01:00
vc6curl.dsw Renamed vc6 workspace and project files to avoid filename clash when used for conversion to later VS versions. 2009-05-08 17:51:44 +00:00

                                  _   _ ____  _
                              ___| | | |  _ \| |
                             / __| | | | |_) | |
                            | (__| |_| |  _ <| |___
                             \___|\___/|_| \_\_____|

README

  Curl is a command line tool for transferring data specified with URL
  syntax. Find out how to use curl by reading the curl.1 man page or the
  MANUAL document. Find out how to install Curl by reading the INSTALL
  document.

  libcurl is the library curl is using to do its job. It is readily
  available to be used by your software. Read the libcurl.3 man page to
  learn how!

  You find answers to the most frequent questions we get in the FAQ document.

  Study the COPYING file for distribution terms and similar. If you distribute
  curl binaries or other binaries that involve libcurl, you might enjoy the
  LICENSE-MIXING document.

CONTACT

  If you have problems, questions, ideas or suggestions, please contact us
  by posting to a suitable mailing list. See http://curl.haxx.se/mail/

  All contributors to the project are listed in the THANKS document.

WEB SITE

  Visit the curl web site for the latest news and downloads:

        http://curl.haxx.se/

GIT

  To download the very latest source off the GIT server do this:

    git clone git://github.com/bagder/curl.git

  (you'll get a directory named curl created, filled with the source code)

NOTICE

  Curl contains pieces of source code that is Copyright (c) 1998, 1999
  Kungliga Tekniska Högskolan. This notice is included here to comply with the
  distribution terms.