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-1489-ga0a4969
Date: Sun, 29 Apr 2012 19:15:09 +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  a0a4969115fff484076c26c3fb1a078f26dda6e4 (commit)
       via  75bf7c021e52e9b6a960848c698e013c27f51b15 (commit)
       via  502b2b202e8ace25b680b6a159a286163ace4221 (commit)
       via  0c72d2d84b6fbb9aa4551c3d515368b03951de65 (commit)
       via  e2a526bcb3a00f42a30396b049e2dbbc3b13bc34 (commit)
       via  90121033d07af46b4da736cc6555015221de6b2f (commit)
       via  a4364ccb0e95f53fa4b8876e5addfc9de7cd5770 (commit)
       via  97e59e5507a6d9074a76f308ee87dd0623666885 (commit)
       via  7b006611af480df8fef737be098e743e009ec403 (commit)
       via  eabc5cc75a1b636f160e2b47ebceae2b4c70c8a6 (commit)
       via  f580600479b0e45d5e3b1027163b80180a196251 (commit)
       via  6a48f18ff58ba7d37c8bb8c1c632daac2c6c68d7 (commit)
       via  ff0c13dbc7d78eadc4b224115c87ec6d00a483b7 (commit)
       via  35a601a74a8e64757612e06c85d08df88b181727 (commit)
       via  eb38447ba426faf04fc5ddfadecd2afeef59917e (commit)
       via  5878bc9de3bde31df93bed94d25ff5c11a00edc8 (commit)
       via  acc9eb7a10169387a403d523ecf530e55479107a (commit)
       via  2cc1a63be5ba5681ac6c4777d9cbd9350beb980d (commit)
       via  f1467a702088abc3bbfacaffc2aa588f32261e65 (commit)
       via  5cc647f4f8fa683e0b9edae58973e6a9943f34c2 (commit)
       via  1fa1c4057e7911ae39e0637b8903b3bfce7a48c6 (commit)
       via  30e43ac2b2765451d778766bf6d8e407a491531c (commit)
       via  6d821004d8d1ef7f286bf1e4a50123000ee9caa4 (commit)
       via  cefc09e1088323d61d80fd1b0a8da17a92d6567c (commit)
       via  61d41972a8542f813641f65bebc92b7096344b5b (commit)
      from  941e9a6a32e7394c76ceeba84ad5eed03b0c98cd (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=a0a4969115fff484076c26c3fb1a078f26dda6e4


commit a0a4969115fff484076c26c3fb1a078f26dda6e4
Merge: 941e9a6 75bf7c0
Author: Rob Savoye <address@hidden>
Date:   Sun Apr 29 13:14:13 2012 -0600

    merge in IPV6 support from branch.

diff --cc cygnal/libnet/network.cpp
index 050aa0b,c4f8659..81c9804
--- a/cygnal/libnet/network.cpp
+++ b/cygnal/libnet/network.cpp
@@@ -562,29 -584,80 +584,79 @@@ Network::createClient(const string &hos
              return false;
          }
      }
 -#endif
  
-     const struct hostent *hent = ::gethostbyname(hostname.c_str());
-     if (hent > static_cast< const struct hostent *>(0)) {
-         ::memcpy(&sock_in.sin_addr, hent->h_addr, hent->h_length);
-     }
-     sock_in.sin_family = AF_INET;
-     sock_in.sin_port = ntohs(static_cast<short>(port));
- 
- #if 0
-     char ascip[INET_ADDRSTRLEN];
-     inet_ntop(sock_in.sin_family, &sock_in.sin_addr.s_addr, ascip, 
INET_ADDRSTRLEN);
-     log_debug(_("The IP address for this client socket is %s"), ascip);
- #endif
- 
-     proto = ::getprotobyname("TCP");
- 
-     _sockfd = ::socket(PF_INET, SOCK_STREAM, proto->p_proto);
-     if (_sockfd < 0) {
-         log_error(_("unable to create socket: %s"), strerror(errno));
-         _sockfd = -1;
+     int code = 0;
+     struct addrinfo req, *ans;
+     std::memset(&req, 0, sizeof(struct addrinfo));
+     req.ai_family = AF_UNSPEC;  // Allow IPv4 or IPv6
+     req.ai_socktype = SOCK_STREAM;
+     
+     if ((code = getaddrinfo(hostname.c_str(), 0, &req, &ans)) != 0) {
+         log_error(_("getaddrinfo() failed with code: #%d - %s\n"),
+                   code, gai_strerror(code));
          return false;
      }
+     
+     // display all the IP numbers
+     struct addrinfo *ot = ans;
+     while (ot) {
+         // // We only want the SOCK_STREAM type
+         // if (ot->ai_socktype == SOCK_DGRAM) {
+         //     // log_debug("SockType is SOCK_DGRAM");
+         //     ot = ot->ai_next;
+         //     continue;
+         // }
+         char clienthost   [NI_MAXHOST];
+         std::memset(&clienthost, 0, NI_MAXHOST);
+         char clientservice[NI_MAXSERV];
+         std::memset(&clientservice, 0, NI_MAXSERV);
+         getnameinfo(ot->ai_addr, ot->ai_addrlen,
+                     clienthost, sizeof(clienthost),
+                     clientservice, sizeof(clientservice),
+                     NI_NUMERICHOST);
+         
+         boost::shared_ptr<char> straddr = getIPString(ot);
+         
+         if (ot->ai_family == AF_INET6) {
+             log_debug("%s has IPV6 address of: %s", hostname, straddr.get());
+         } else if (ot->ai_family == AF_INET) {
+             log_debug("%s has IPV4 address of: %s", hostname, straddr.get());
+         } else {
+             log_error("%s has no IP address!", hostname);
+         }
+         
+         ot = ot->ai_next;
+     }
  
+     // Multiple IPV$ and IPV6 numbers may be returned, so we try them all if
+     // required
+     struct addrinfo *it = ans;
+     while (it) {
+         _sockfd = ::socket(it->ai_family, it->ai_socktype, it->ai_protocol);
+         if (_sockfd < 0) {
+             const int err = errno;
+             log_error(_("Socket creation failed: %s"), std::strerror(err));
+             _sockfd = 0;
+             // Try the next IP number
+             it = it->ai_next;
+         } else {
+             break;
+         }
+     }
+     
+     // cache the data we need later
+     struct sockaddr_in6 *addr6 = reinterpret_cast<struct sockaddr_in6 
*>(it->ai_addr);
+     // When NULL is passed to getaddrinfo(), the port isn't set in
+     // the returned data, so we do it here.
+     addr6->sin6_port = htons(port);
+     // This is used for ::connect()
+     struct sockaddr *saddr = it->ai_addr;
+ 
+     const int addrlen = it->ai_addrlen;
+     boost::shared_ptr<char> straddr = getIPString(it);
+ 
+     freeaddrinfo(ans);          // free the response data
+     
      retries = 2;
      while (retries-- > 0) {
          // We use select to wait for the read file descriptor to be

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

Summary of changes:
 configure.ac                                     |    5 +
 cygnal/cygnal.cpp                                |   63 ++++--
 cygnal/libnet/network.cpp                        |  262 +++++++++++++++-------
 cygnal/libnet/network.h                          |    7 +
 cygnal/testsuite/libnet.all/generate_amfbins.cpp |   22 +-
 cygnal/testsuite/libnet.all/test_diskstream.cpp  |    4 +-
 cygnal/testsuite/libnet.all/test_http.cpp        |  242 ++++++++++----------
 cygnal/testsuite/libnet.all/test_rtmp.cpp        |   90 ++++----
 libbase/Socket.cpp                               |  159 +++++++++++--
 libbase/Socket.h                                 |   10 +-
 libbase/URL.cpp                                  |   29 ++-
 testsuite/libbase.all/URLTest.cpp                |   18 ++
 testsuite/misc-ming.all/XMLSocketTest.as         |    6 +-
 testsuite/misc-ming.all/XMLSocketTester.sh       |    2 +-
 14 files changed, 590 insertions(+), 329 deletions(-)


hooks/post-receive
-- 
Gnash



reply via email to

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