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: Bastiaan Jacques
Subject: [Gnash-commit] [SCM] Gnash branch, master, updated. release_0_8_9_final-1718-ga9961b2
Date: Fri, 09 Aug 2013 19:04:39 +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  a9961b2a24bbdc1b6fb8d1e043d8fa6285f892a3 (commit)
      from  bd54d3e2af2898a1b018322cfd5c9e628b837432 (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=a9961b2a24bbdc1b6fb8d1e043d8fa6285f892a3


commit a9961b2a24bbdc1b6fb8d1e043d8fa6285f892a3
Author: Bastiaan Jacques <address@hidden>
Date:   Fri Aug 9 20:53:52 2013 +0200

    Trivial cleanups.

diff --git a/libbase/Socket.cpp b/libbase/Socket.cpp
index 543a4ff..39bc7fc 100644
--- a/libbase/Socket.cpp
+++ b/libbase/Socket.cpp
@@ -141,41 +141,35 @@ Socket::connect(const std::string& hostname, 
boost::uint16_t port)
     }
 
     // This is used for ::connect()
-    struct sockaddr *saddr = 0;
 
-    int code = 0;
-    struct addrinfo req, *ans;
-    std::memset(&req, 0, sizeof(struct addrinfo));
+    addrinfo req = addrinfo(), *ans = 0;
+    
     req.ai_family = AF_UNSPEC;  // Allow IPv4 or IPv6
     req.ai_socktype = SOCK_STREAM;
 
     std::string portNo = boost::lexical_cast<std::string>(port);
-    code = getaddrinfo(hostname.c_str(), portNo.c_str(), &req, &ans);
+    int code = getaddrinfo(hostname.c_str(), portNo.c_str(), &req, &ans);
     if (code != 0) {
-        log_error(_("getaddrinfo() failed with code: #%d - %s\n"),
+        log_error(_("getaddrinfo() failed with code: #%d - %s"),
                  code, gai_strerror(code));
         return false;
     }
 
     // display all the IP numbers
-    struct addrinfo *ot = ans;
-    while (ot) {
-        char clienthost   [NI_MAXHOST];
-        std::memset(&clienthost, 0, NI_MAXHOST);
-        getnameinfo(ot->ai_addr, ot->ai_addrlen,
-                    clienthost, sizeof(clienthost),
-                    NULL, 0,
-                    NI_NUMERICHOST);
-        
-        if (ot->ai_family == AF_INET6) {
-            log_debug("%s has IPV6 address of: %s", hostname, clienthost);
-        } else if (ot->ai_family == AF_INET) {
-            log_debug("%s has IPV4 address of: %s", hostname, clienthost);
-        } else {
-            log_error("%s has no IP address!", hostname);
+    if (LogFile::getDefaultInstance().getVerbosity() != 0) {
+        for(struct addrinfo* ot = ans; ot; ot = ot->ai_next) {
+
+            char clienthost [INET6_ADDRSTRLEN] = {};
+            code = getnameinfo(ot->ai_addr, ot->ai_addrlen,
+                               clienthost, sizeof(clienthost),
+                               NULL, 0, NI_NUMERICHOST);
+
+            if (code != 0) {
+                log_error(_("getnameinfo() failed: %1%"), gai_strerror(code));
+            } else {
+                log_debug("%s has address of: %s", hostname, clienthost);
+            }
         }
-        
-        ot = ot->ai_next;
     }
 
     // Multiple IPV$ and IPV6 numbers may be returned, so we try them all if
@@ -194,9 +188,6 @@ Socket::connect(const std::string& hostname, 
boost::uint16_t port)
         }
     }
 
-    saddr = it->ai_addr;
-    const int addrlen = it->ai_addrlen;
-
 #ifndef _WIN32
     // Set non-blocking.
     const int flag = ::fcntl(_socket, F_GETFL, 0);
@@ -204,7 +195,7 @@ Socket::connect(const std::string& hostname, 
boost::uint16_t port)
 #endif
 
     // Attempt connection
-    int ret = ::connect(_socket, saddr, addrlen);
+    int ret = ::connect(_socket, it->ai_addr, it->ai_addrlen);
     freeaddrinfo(ans);          // free the response data
     if (ret < 0) {
         const int err = errno;
diff --git a/libbase/jemalloc_gnash.c b/libbase/jemalloc_gnash.c
index 78d4587..d2ef11d 100644
--- a/libbase/jemalloc_gnash.c
+++ b/libbase/jemalloc_gnash.c
@@ -48,14 +48,9 @@ struct mallinfo {
 struct mallinfo
 mallinfo(void)
 {
-    struct mallinfo mi;
-    size_t len;
+    struct mallinfo mi = {};
 
-    /* clear all fields */
-    mi.arena = mi.ordblks = mi.smblks = mi.hblks = mi.hblkhd = mi.usmblks =
-        mi.fsmblks = mi.uordblks = mi.fordblks = mi.keepcost = 0;
-
-    len = sizeof(mi.arena);
+    size_t len = sizeof(mi.arena);
     mallctl("stats.mapped", &mi.arena, &len, NULL, 0);
     len = sizeof(mi.uordblks);
     mallctl("stats.allocated", &mi.uordblks, &len, NULL, 0);

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

Summary of changes:
 libbase/Socket.cpp       |   45 ++++++++++++++++++---------------------------
 libbase/jemalloc_gnash.c |    9 ++-------
 2 files changed, 20 insertions(+), 34 deletions(-)


hooks/post-receive
-- 
Gnash



reply via email to

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