Commit 91aeebed authored by Yang Tse's avatar Yang Tse
Browse files

Regression fix:

select/poll calls will only be retried upon EINTR failures as
it previously was in lib/select.c revision 1.29

In this way Curl_socket_ready() and Curl_poll() will again fail
on any select/poll errors different than EINTR.
parent b16ea66c
Loading
Loading
Loading
Loading
+4 −0
Original line number Original line Diff line number Diff line
@@ -6,6 +6,10 @@


                                  Changelog
                                  Changelog


Yang Tse (6 Mar 2008)
- Fix regression on Curl_socket_ready() and Curl_poll() so that these will
  again fail on select/poll errors different than EINTR.

Daniel Fandrich (5 Mar 2008)
Daniel Fandrich (5 Mar 2008)
- Fixed the test harness so it will write out zero-length data files.
- Fixed the test harness so it will write out zero-length data files.


+1 −0
Original line number Original line Diff line number Diff line
@@ -34,6 +34,7 @@ This release includes the following bugfixes:
 o crash when connection cache size is 1 and Curl_do() failed
 o crash when connection cache size is 1 and Curl_do() failed
 o GnuTLS-built libcurl can now be forced to prefer SSLv3
 o GnuTLS-built libcurl can now be forced to prefer SSLv3
 o crash when doing Negotiate again on a re-used connection
 o crash when doing Negotiate again on a re-used connection
 o select/poll regression


This release includes the following known bugs:
This release includes the following known bugs:


+8 −8
Original line number Original line Diff line number Diff line
@@ -5,7 +5,7 @@
 *                            | (__| |_| |  _ <| |___
 *                            | (__| |_| |  _ <| |___
 *                             \___|\___/|_| \_\_____|
 *                             \___|\___/|_| \_\_____|
 *
 *
 * Copyright (C) 1998 - 2007, Daniel Stenberg, <daniel@haxx.se>, et al.
 * Copyright (C) 1998 - 2008, Daniel Stenberg, <daniel@haxx.se>, et al.
 *
 *
 * This software is licensed as described in the file COPYING, which
 * This software is licensed as described in the file COPYING, which
 * you should have received as part of this distribution. The terms
 * you should have received as part of this distribution. The terms
@@ -68,9 +68,9 @@
#define elapsed_ms  (int)curlx_tvdiff(curlx_tvnow(), initial_tv)
#define elapsed_ms  (int)curlx_tvdiff(curlx_tvnow(), initial_tv)


#ifdef CURL_ACKNOWLEDGE_EINTR
#ifdef CURL_ACKNOWLEDGE_EINTR
#define error_is_EINTR  (error == EINTR)
#define error_not_EINTR (1)
#else
#else
#define error_is_EINTR  (0)
#define error_not_EINTR (error != EINTR)
#endif
#endif


/*
/*
@@ -129,7 +129,7 @@ static int wait_ms(int timeout_ms)
    if(r != -1)
    if(r != -1)
      break;
      break;
    error = SOCKERRNO;
    error = SOCKERRNO;
    if((error == EINVAL) || error_is_EINTR)
    if(error && error_not_EINTR)
      break;
      break;
    pending_ms = timeout_ms - elapsed_ms;
    pending_ms = timeout_ms - elapsed_ms;
    if(pending_ms <= 0)
    if(pending_ms <= 0)
@@ -219,7 +219,7 @@ int Curl_socket_ready(curl_socket_t readfd, curl_socket_t writefd,
    if(r != -1)
    if(r != -1)
      break;
      break;
    error = SOCKERRNO;
    error = SOCKERRNO;
    if((error == EINVAL) || error_is_EINTR)
    if(error && error_not_EINTR)
      break;
      break;
    if(timeout_ms > 0) {
    if(timeout_ms > 0) {
      pending_ms = timeout_ms - elapsed_ms;
      pending_ms = timeout_ms - elapsed_ms;
@@ -288,7 +288,7 @@ int Curl_socket_ready(curl_socket_t readfd, curl_socket_t writefd,
    if(r != -1)
    if(r != -1)
      break;
      break;
    error = SOCKERRNO;
    error = SOCKERRNO;
    if((error == EINVAL) || (error == EBADF) || error_is_EINTR)
    if(error && error_not_EINTR)
      break;
      break;
    if(timeout_ms > 0) {
    if(timeout_ms > 0) {
      pending_ms = timeout_ms - elapsed_ms;
      pending_ms = timeout_ms - elapsed_ms;
@@ -389,7 +389,7 @@ int Curl_poll(struct pollfd ufds[], unsigned int nfds, int timeout_ms)
    if(r != -1)
    if(r != -1)
      break;
      break;
    error = SOCKERRNO;
    error = SOCKERRNO;
    if((error == EINVAL) || error_is_EINTR)
    if(error && error_not_EINTR)
      break;
      break;
    if(timeout_ms > 0) {
    if(timeout_ms > 0) {
      pending_ms = timeout_ms - elapsed_ms;
      pending_ms = timeout_ms - elapsed_ms;
@@ -438,7 +438,7 @@ int Curl_poll(struct pollfd ufds[], unsigned int nfds, int timeout_ms)
    if(r != -1)
    if(r != -1)
      break;
      break;
    error = SOCKERRNO;
    error = SOCKERRNO;
    if((error == EINVAL) || (error == EBADF) || error_is_EINTR)
    if(error && error_not_EINTR)
      break;
      break;
    if(timeout_ms > 0) {
    if(timeout_ms > 0) {
      pending_ms = timeout_ms - elapsed_ms;
      pending_ms = timeout_ms - elapsed_ms;