Commit 64ac64e7 authored by Kamil Dudka's avatar Kamil Dudka
Browse files

eliminate a race condition in Curl_resolv_timeout()

parent e7e37a24
Loading
Loading
Loading
Loading
+3 −0
Original line number Original line Diff line number Diff line
@@ -6,6 +6,9 @@


                                  Changelog
                                  Changelog


Kamil Dudka (4 Apr 2010)
- Eliminated a race condition in Curl_resolv_timeout().

Daniel Stenberg (1 Apr 2010)
Daniel Stenberg (1 Apr 2010)
- Matt Wixson found and fixed a bug in the SCP/SFTP area where the code
- Matt Wixson found and fixed a bug in the SCP/SFTP area where the code
  treated a 0 return code from libssh2 to be the same as EAGAIN while in
  treated a 0 return code from libssh2 to be the same as EAGAIN while in
+3 −2
Original line number Original line Diff line number Diff line
@@ -628,6 +628,9 @@ int Curl_resolv_timeout(struct connectdata *conn,
clean_up:
clean_up:


  if (timeout > 0) {
  if (timeout > 0) {
    if(!prev_alarm)
      /* deactivate a possibly active alarm before uninstalling the handler */
      alarm(0);


#ifdef HAVE_SIGACTION
#ifdef HAVE_SIGACTION
    if(keep_copysig) {
    if(keep_copysig) {
@@ -664,8 +667,6 @@ clean_up:
      else
      else
        alarm((unsigned int)alarm_set);
        alarm((unsigned int)alarm_set);
    }
    }
    else
      alarm(0); /* just shut it off */
  }
  }
#endif /* USE_ALARM_TIMEOUT */
#endif /* USE_ALARM_TIMEOUT */