diff --git a/ext/typhoeus/typhoeus_multi.c b/ext/typhoeus/typhoeus_multi.c index e73adcd4..2cb27dcb 100644 --- a/ext/typhoeus/typhoeus_multi.c +++ b/ext/typhoeus/typhoeus_multi.c @@ -75,6 +75,11 @@ static void multi_read_info(VALUE self, CURLM *multi_handle) { // this next bit is a horrible hack. For some reason my tests against a local server on my laptop // fail intermittently and return this result number. However, it will succeed if you try it a few // more times. Also noteworthy is that this doens't happen when hitting an external server. WTF?! + + // Sandofsky says: + // This is caused by OS X first attempting to resolve using IPV6. + // Hack solution: connect to yourself with 127.0.0.1, not localhost + // http://curl.haxx.se/mail/tracker-2009-09/0018.html if (result == 7) { VALUE max_retries = rb_funcall(easy, rb_intern("max_retries?"), 0); if (max_retries != Qtrue) { diff --git a/lib/typhoeus/easy.rb b/lib/typhoeus/easy.rb index 7ac56d4b..3a4f31e3 100644 --- a/lib/typhoeus/easy.rb +++ b/lib/typhoeus/easy.rb @@ -185,6 +185,7 @@ def max_retries? end def reset + @retries = 0 @response_code = 0 @response_header = "" @response_body = ""