# # # patch "ChangeLog" # from [0ce26645827dda40be63fc03c01234d20fd22b24] # to [32a3e4ff36dcb1441bae18c1335758885f9ed5d5] # # patch "netxx/resolve_getaddrinfo.cxx" # from [5cbbb8c8debda2da26c6dc4792516e8094621502] # to [23c2b01157fa9d39368e934cfdac20360a26115e] # ============================================================ --- ChangeLog 0ce26645827dda40be63fc03c01234d20fd22b24 +++ ChangeLog 32a3e4ff36dcb1441bae18c1335758885f9ed5d5 @@ -1,3 +1,10 @@ +2006-04-11 Richard Levitte + + * netxx/resolve_getaddrinfo.cxx (resolve_hostname): monotone might + be compiled on a computer that has AI_ADDRCONFIG and run on one + that doesn't understand that flag. If the error EAI_BADFLAGS is + returned, try again without AI_ADDRCONFIG. + 2006-04-10 Richard Levitte * contrib/usher.cc: Changed all reference to "monotone" to the new ============================================================ --- netxx/resolve_getaddrinfo.cxx 5cbbb8c8debda2da26c6dc4792516e8094621502 +++ netxx/resolve_getaddrinfo.cxx 23c2b01157fa9d39368e934cfdac20360a26115e @@ -82,6 +82,17 @@ flags.ai_socktype = SOCK_STREAM; int gai_error = getaddrinfo(hostname, 0, &flags, &info); + + // Because we might compile on a computer that has AI_ADDRCONFIG and + // run on one that doesn't, we need to check for EAI_BADFLAGS, and + // try again without AI_ADDRCONFIG in that case. +#ifdef AI_ADDRCONFIG + if (gai_error == EAI_BADFLAGS) { + flags.ai_flags &= ~AI_ADDRCONFIG; + gai_error = getaddrinfo(hostname, 0, &flags, &info); + } +#endif + if (gai_error != 0) { std::string error("name resolution failure for "); error += hostname; error += ": "; error += gai_strerror(gai_error);