Commit 4c663ba9 authored by Daniel Stenberg's avatar Daniel Stenberg
Browse files

When transferring 500 downloads in parallel with a c-ares enabled build only

to find that it crashed miserably, and this was due to some select()isms left
in the code. This was due to API restrictions in c-ares 1.3.x, but with the
upcoming c-ares 1.4.0 this is no longer the case so now libcurl runs much
better with c-ares and the multi interface with > 1024 file descriptors in
use.
parent 713c9f86
Loading
Loading
Loading
Loading
+10 −0
Original line number Original line Diff line number Diff line
@@ -10,6 +10,16 @@ Daniel S (31 May 2007)
- Feng Tu made (lib)curl support "upload" resuming work for file:// URLs.
- Feng Tu made (lib)curl support "upload" resuming work for file:// URLs.


Daniel S (30 May 2007)
Daniel S (30 May 2007)
- I modified the 10-at-a-time.c example to transfer 500 downloads in parallel
  with a c-ares enabled build only to find that it crashed miserably, and this
  was due to some select()isms left in the code. This was due to API
  restrictions in c-ares 1.3.x, but with the upcoming c-ares 1.4.0 this is no
  longer the case so now libcurl runs much better with c-ares and the multi
  interface with > 1024 file descriptors in use.

  Extra note: starting now we require c-ares 1.4.0 for asynchronous name
  resolves.

- Added CURLMOPT_MAXCONNECTS which is a curl_multi_setopt() option for setting
- Added CURLMOPT_MAXCONNECTS which is a curl_multi_setopt() option for setting
  the maximum size of the connection cache maximum size of the multi handle.
  the maximum size of the connection cache maximum size of the multi handle.


+1 −0
Original line number Original line Diff line number Diff line
@@ -19,6 +19,7 @@ This release includes the following changes:
 o SFTP now supports quote commands before a transfer
 o SFTP now supports quote commands before a transfer
 o CURLMOPT_MAXCONNECTS added to curl_multi_setopt()
 o CURLMOPT_MAXCONNECTS added to curl_multi_setopt()
 o upload resume works for file:// URLs
 o upload resume works for file:// URLs
 o asynchronous name resolves now require c-ares 1.4.0 or later


This release includes the following bugfixes:
This release includes the following bugfixes:


+7 −6
Original line number Original line Diff line number Diff line
@@ -2050,10 +2050,10 @@ fi
dnl set variable for use in automakefile(s)
dnl set variable for use in automakefile(s)
AM_CONDITIONAL(USE_MANUAL, test x"$USE_MANUAL" = x1)
AM_CONDITIONAL(USE_MANUAL, test x"$USE_MANUAL" = x1)


AC_MSG_CHECKING([whether to enable ares])
AC_MSG_CHECKING([whether to enable c-ares])
AC_ARG_ENABLE(ares,
AC_ARG_ENABLE(ares,
AC_HELP_STRING([--enable-ares=PATH],[Enable ares for name lookups])
AC_HELP_STRING([--enable-ares=PATH],[Enable c-ares for name lookups])
AC_HELP_STRING([--disable-ares],[Disable ares for name lookups]),
AC_HELP_STRING([--disable-ares],[Disable c-ares for name lookups]),
[ case "$enableval" in
[ case "$enableval" in
  no)
  no)
       AC_MSG_RESULT(no)
       AC_MSG_RESULT(no)
@@ -2061,10 +2061,10 @@ AC_HELP_STRING([--disable-ares],[Disable ares for name lookups]),
  *)   AC_MSG_RESULT(yes)
  *)   AC_MSG_RESULT(yes)


       if test "x$IPV6_ENABLED" = "x1"; then
       if test "x$IPV6_ENABLED" = "x1"; then
         AC_MSG_NOTICE([ares may not work properly with ipv6])
         AC_MSG_NOTICE([c-ares may not work properly with ipv6])
       fi
       fi


       AC_DEFINE(USE_ARES, 1, [Define if you want to enable ares support])
       AC_DEFINE(USE_ARES, 1, [Define if you want to enable c-ares support])
       dnl substitute HAVE_ARES for curl-config and similar
       dnl substitute HAVE_ARES for curl-config and similar
       HAVE_ARES="1"
       HAVE_ARES="1"
       AC_SUBST(HAVE_ARES)
       AC_SUBST(HAVE_ARES)
@@ -2109,7 +2109,8 @@ void curl_domalloc() { }
int main(void)
int main(void)
{
{
  ares_channel channel;
  ares_channel channel;
  ares_cancel(channel);
  ares_cancel(channel); /* added in 1.2.0 */
  ares_process_fd(channel, 0, 0); /* added in 1.4.0 */
  return 0;
  return 0;
}
}
],
],
+1 −2
Original line number Original line Diff line number Diff line
@@ -12,8 +12,7 @@ c-ares:
  http://daniel.haxx.se/projects/c-ares/
  http://daniel.haxx.se/projects/c-ares/


NOTE
NOTE
  The latest libcurl version requires c-ares 1.3.2 or later to work
  The latest libcurl version requires c-ares 1.4.0 or later.
  flawlessly.


  Once upon the time libcurl built fine with the "original" ares. That is no
  Once upon the time libcurl built fine with the "original" ares. That is no
  longer true. You need to use c-ares.
  longer true. You need to use c-ares.
+5 −2
Original line number Original line Diff line number Diff line
@@ -420,11 +420,14 @@ CURLcode curl_easy_perform(CURL *easy)
    timeout.tv_sec = 1;
    timeout.tv_sec = 1;
    timeout.tv_usec = 0;
    timeout.tv_usec = 0;


    /* get file descriptors from the transfers */
    /* Old deprecated style: get file descriptors from the transfers */
    curl_multi_fdset(multi, &fdread, &fdwrite, &fdexcep, &maxfd);
    curl_multi_fdset(multi, &fdread, &fdwrite, &fdexcep, &maxfd);

    rc = Curl_select(maxfd+1, &fdread, &fdwrite, &fdexcep, &timeout);
    rc = Curl_select(maxfd+1, &fdread, &fdwrite, &fdexcep, &timeout);


    /* The way is to extract the sockets and wait for them without using
       select. This whole alternative version should probably rather use the
       curl_multi_socket() approach. */

    if(rc == -1)
    if(rc == -1)
      /* select error */
      /* select error */
      break;
      break;
Loading