gnash-commit
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Gnash-commit] [SCM] Gnash branch, master, updated. release_0_8_9_final-


From: Rob Savoye
Subject: [Gnash-commit] [SCM] Gnash branch, master, updated. release_0_8_9_final-1491-g3f35eb7
Date: Sun, 06 May 2012 00:57:14 +0000

This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "Gnash".

The branch, master has been updated
       via  3f35eb769777c30161f6737f81fd51b322441f2e (commit)
      from  829c21078ca77bb981a1bc2ccdf9c7609721b2b8 (commit)

Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.

- Log -----------------------------------------------------------------
http://git.savannah.gnu.org/cgit//commit/?id=3f35eb769777c30161f6737f81fd51b322441f2e


commit 3f35eb769777c30161f6737f81fd51b322441f2e
Author: Rob Savoye <address@hidden>
Date:   Sat May 5 18:56:40 2012 -0600

    Work for localhost regardless of hos the hosts file is setup.

diff --git a/libbase/Socket.cpp b/libbase/Socket.cpp
index a2c2445..5fc6160 100644
--- a/libbase/Socket.cpp
+++ b/libbase/Socket.cpp
@@ -156,10 +156,33 @@ Socket::connect(const std::string& hostname, 
boost::uint16_t port)
     req.ai_family = AF_UNSPEC;  // Allow IPv4 or IPv6
     req.ai_socktype = SOCK_STREAM;
 
-    if ((code = getaddrinfo(hostname.c_str(), 0, &req, &ans)) != 0) {
+    // getaddrinfo() is sensitive to how localhost is defined in
+    // /etc/hosts. Whatever hostname is, needs to match the entry in
+    // the hosts file. Localhost is usually only used for debug and
+    // and testing, all other hostnames aere fully qualified. Anyway,
+    // this causes our XMLSocketTester test case to fail since not
+    // all build slaves have the same entry for localhost in their
+    // hosts file.
+    code = getaddrinfo(hostname.c_str(), 0, &req, &ans);
+    if (code != 0) {
         log_error(_("getaddrinfo() failed with code: #%d - %s\n"),
                   code, gai_strerror(code));
-        return false;
+        if (code == EAI_NONAME) {
+            std::string localhost;
+            if (hostname == "localhost") {
+                localhost = "localhost.localdomain";
+            } else if (hostname == "localhost.localdomain") {
+                localhost = "localhost";                
+            }
+            if ((code = getaddrinfo(localhost.c_str(), 0, &req, &ans)) != 0) {
+                log_error(_("getaddrinfo() failed again with code: #%d - 
%s\n"),
+                          code, gai_strerror(code));
+                return false;
+            }
+            log_error(_("getaddrinfo() needed to change localhost"));
+        } else {
+            return false;
+        }
     }
 
     // display all the IP numbers

-----------------------------------------------------------------------

Summary of changes:
 libbase/Socket.cpp |   27 +++++++++++++++++++++++++--
 1 files changed, 25 insertions(+), 2 deletions(-)


hooks/post-receive
-- 
Gnash



reply via email to

[Prev in Thread] Current Thread [Next in Thread]