rpms/vnc/F-9 vnc-viewerIPv6.patch, NONE, 1.1 Makefile.am, 1.3, 1.4 vnc.spec, 1.191, 1.192 vnc-210617.patch, 1.1, NONE vnc-noxkb.patch, 1.1, NONE

Adam Tkac (atkac) fedora-extras-commits at redhat.com
Fri Jul 4 09:05:30 UTC 2008


Author: atkac

Update of /cvs/pkgs/rpms/vnc/F-9
In directory cvs-int.fedora.redhat.com:/tmp/cvs-serv25135

Modified Files:
	Makefile.am vnc.spec 
Added Files:
	vnc-viewerIPv6.patch 
Removed Files:
	vnc-210617.patch vnc-noxkb.patch 
Log Message:
- enabled XKEYBOARD extension (#450033)
- improved IPv6 support in viewer (#438422)


vnc-viewerIPv6.patch:

--- NEW FILE vnc-viewerIPv6.patch ---
diff -up vnc-4_1_2-unixsrc/common/network/Makefile.am.ipv6 vnc-4_1_2-unixsrc/common/network/Makefile.am
--- vnc-4_1_2-unixsrc/common/network/Makefile.am.ipv6	2008-06-02 10:22:17.000000000 +0200
+++ vnc-4_1_2-unixsrc/common/network/Makefile.am	2008-06-02 10:52:56.000000000 +0200
@@ -1,5 +1,7 @@
 noinst_LTLIBRARIES = libnetwork.la
 
+libnetwork_la_CPPFLAGS = -DHAVE_GETADDRINFO
+
 libnetwork_la_SOURCES = \
 	Socket.h \
 	TcpSocket.cxx \
diff -up vnc-4_1_2-unixsrc/common/network/TcpSocket.cxx.ipv6 vnc-4_1_2-unixsrc/common/network/TcpSocket.cxx
--- vnc-4_1_2-unixsrc/common/network/TcpSocket.cxx.ipv6	2008-06-02 10:22:17.000000000 +0200
+++ vnc-4_1_2-unixsrc/common/network/TcpSocket.cxx	2008-06-02 10:49:04.000000000 +0200
@@ -109,50 +109,99 @@ TcpSocket::TcpSocket(int sock, bool clos
 TcpSocket::TcpSocket(const char *host, int port)
   : closeFd(true)
 {
-  int sock;
+#define CAST_ADDR(x) (*((struct x *)&addr))
+  int sock, err, family, result = -1;
+  size_t addrlen;
+  struct sockaddr_storage addr;
+#ifdef HAVE_GETADDRINFO
+  struct addrinfo *ai, *current, hints;
+#endif
 
   // - Create a socket
   initSockets();
-  if ((sock = socket(AF_INET, SOCK_STREAM, 0)) < 0)
-    throw SocketException("unable to create socket", errorNumber);
 
-#ifndef WIN32
-  // - By default, close the socket on exec()
-  fcntl(sock, F_SETFD, FD_CLOEXEC);
-#endif
+#ifdef HAVE_GETADDRINFO
+  memset(&hints, 0, sizeof(struct addrinfo));
+  hints.ai_family = AF_UNSPEC;
+  hints.ai_socktype = SOCK_STREAM;
+  hints.ai_canonname = NULL;
+  hints.ai_addr = NULL;
+  hints.ai_next = NULL;
+
+  if ((result = getaddrinfo(host, NULL, &hints, &ai)) != 0) {
+    throw Exception("unable to resolve host by name: %s",
+		    gai_strerror(result));
+  }
+
+  for (current = ai; current != NULL; current = current->ai_next) {
+    family = current->ai_family;
+    if (family != AF_INET && family != AF_INET6)
+      continue;
+
+    addrlen = current->ai_addrlen;
+    memcpy(&addr, current->ai_addr, addrlen);
+
+    if (family == AF_INET)
+      CAST_ADDR(sockaddr_in).sin_port = htons(port);
+    else
+      CAST_ADDR(sockaddr_in6).sin6_port = htons(port);
 
-  // - Connect it to something
+#else
+    family = AF_INET;
+    addrlen = sizeof(struct sockaddr_in);
 
-  // Try processing the host as an IP address
-  struct sockaddr_in addr;
-  memset(&addr, 0, sizeof(addr));
-  addr.sin_family = AF_INET;
-  addr.sin_addr.s_addr = inet_addr(host);
-  addr.sin_port = htons(port);
-  if ((int)addr.sin_addr.s_addr == -1) {
-    // Host was not an IP address - try resolving as DNS name
-    struct hostent *hostinfo;
-    hostinfo = gethostbyname(host);
-    if (hostinfo && hostinfo->h_addr) {
-      addr.sin_addr.s_addr = ((struct in_addr *)hostinfo->h_addr)->s_addr;
-    } else {
-      int e = errorNumber;
-      closesocket(sock);
-      throw SocketException("unable to resolve host by name", e);
+    // Try processing the host as an IP address
+    memset(&addr, 0, addrlen);
+    CAST_ADDR(sockaddr_in).sin_family = AF_INET;
+    CAST_ADDR(sockaddr_in).sin_addr.s_addr = inet_addr(host);
+    CAST_ADDR(sockaddr_in).sin_port = htons(port);
+    if ((int)CAST_ADDR(sockaddr_in).sin_addr.s_addr == -1) {
+      // Host was not an IP address - try resolving as DNS name
+      struct hostent *hostinfo;
+      hostinfo = gethostbyname(host);
+      if (hostinfo && hostinfo->h_addr) {
+	CAST_ADDR(sockaddr_in).sin_addr.s_addr =
+	  ((struct in_addr *)hostinfo->h_addr)->s_addr;
+      } else {
+	err = errorNumber;
+	throw SocketException("unable to resolve host by name", err);
+      }
+    }
+#endif
+    sock = socket (family, SOCK_STREAM, 0);
+    if (sock == -1) {
+      err = errorNumber;
+#ifdef HAVE_GETADDRINFO
+      freeaddrinfo(ai);
+#endif
+      throw SocketException("unable to create socket", err);
     }
-  }
 
-  // Attempt to connect to the remote host
-  for (;;) {
-    if (connect(sock, (struct sockaddr *)&addr, sizeof(addr)) != 0) {
-      int e = errorNumber;
-      if (e == EINTR)
-        continue;
+    // Attempt to connect to the remote host
+    while ((result = connect(sock, (struct sockaddr *)&addr, addrlen)) == -1) {
+      err = errorNumber;
+      if (err == EINTR)
+	continue;
       closesocket(sock);
-      throw SocketException("unable to connect to host", e);
-    } else break;
+      break;
+    }
+#ifdef HAVE_GETADDRINFO
+    if (result == 0)
+      break;
+    else
+      continue;
   }
 
+  freeaddrinfo(ai);
+#endif
+  if (result == -1)
+    throw SocketException("unable connect to socket", err);
+
+#ifndef WIN32
+  // - By default, close the socket on exec()
+  fcntl(sock, F_SETFD, FD_CLOEXEC);
+#endif
+
   // Disable Nagle's algorithm, to reduce latency
   enableNagles(sock, false);
 
diff -up vnc-4_1_2-unixsrc/common/rdr/Exception.cxx.ipv6 vnc-4_1_2-unixsrc/common/rdr/Exception.cxx
--- vnc-4_1_2-unixsrc/common/rdr/Exception.cxx.ipv6	2008-06-02 10:23:35.000000000 +0200
+++ vnc-4_1_2-unixsrc/common/rdr/Exception.cxx	2008-06-02 10:28:51.000000000 +0200
@@ -22,8 +22,23 @@
 #include <winsock2.h>
 #endif
 
+#include <stdarg.h>
+
 using namespace rdr;
 
+Exception::Exception(const char *format, ...) {
+  va_list ap;
+  int result;
+
+  va_start(ap, format);
+  result = vsnprintf(str_, len, format, ap);
+  va_end(ap);
+
+  /* XXX - ensure that string ends correctly */
+  if (result > len)
+    str_[len - 1] = '\0';
+}
+
 SystemException::SystemException(const char* s, int err_)
   : Exception(s), err(err_)
 {
diff -up vnc-4_1_2-unixsrc/common/rdr/Exception.h.ipv6 vnc-4_1_2-unixsrc/common/rdr/Exception.h
--- vnc-4_1_2-unixsrc/common/rdr/Exception.h.ipv6	2008-06-02 10:23:05.000000000 +0200
+++ vnc-4_1_2-unixsrc/common/rdr/Exception.h	2008-06-02 10:28:41.000000000 +0200
@@ -27,13 +27,7 @@ namespace rdr {
   struct Exception {
     enum { len = 256 };
     char str_[len];
-    Exception(const char* s=0) {
-      str_[0] = 0;
-      if (s)
-        strncat(str_, s, len-1);
-      else
-        strcat(str_, "Exception");
-    }
+    Exception(const char *format, ...);
     virtual const char* str() const { return str_; }
   };
 


Index: Makefile.am
===================================================================
RCS file: /cvs/pkgs/rpms/vnc/F-9/Makefile.am,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -r1.3 -r1.4
--- Makefile.am	9 Apr 2008 09:56:29 -0000	1.3
+++ Makefile.am	4 Jul 2008 09:04:45 -0000	1.4
@@ -28,6 +28,8 @@
 Xvnc_LDADD = $(XVNC_LIBS) libvnccommon.la $(RFB_LIBS) \
 	$(XSERVER_LIBS) $(XSERVER_SYS_LIBS) -lX11
 
+Xvnc_LDFLAGS = $(LD_EXPORT_SYMBOLS_FLAG)
+
 libvnc_la_LTLIBRARIES = libvnc.la
 libvnc_ladir = $(moduledir)/extensions
 


Index: vnc.spec
===================================================================
RCS file: /cvs/pkgs/rpms/vnc/F-9/vnc.spec,v
retrieving revision 1.191
retrieving revision 1.192
diff -u -r1.191 -r1.192
--- vnc.spec	25 Apr 2008 10:46:43 -0000	1.191
+++ vnc.spec	4 Jul 2008 09:04:45 -0000	1.192
@@ -3,7 +3,7 @@
 Summary:   A remote display system
 Name:      vnc
 Version:   4.1.2
-Release:   30%{?dist}
+Release:   31%{?dist}
 URL:       http://www.realvnc.com
 Source0:   http://www.realvnc.com/dist/vnc-%{vnc_version}-unixsrc.tar.gz
 Source1:   Makefile.am
@@ -25,7 +25,6 @@
 Patch16:   vnc-64bit.patch
 Patch17:   vnc-select.patch
 Patch21:   vnc-newfbsize.patch
-Patch23:   vnc-210617.patch
 Patch24:   vnc-102434.patch
 Patch25:   vnc-config.patch
 Patch28:   vnc-render.patch
@@ -39,7 +38,6 @@
 Patch41:   vnc-privates.patch
 Patch42:   vnc-mieq.patch
 Patch43:   vnc-allocate.patch
-Patch44:   vnc-noxkb.patch
 Patch45:   vnc-paint.patch
 Patch46:   vnc-selections.patch
 Patch48:   vnc-manminor.patch
@@ -47,6 +45,7 @@
 Patch50:   vnc-scrollbars.patch
 Patch51:   vnc-bounds.patch
 Patch52:   vnc-includes.patch
+Patch53:   vnc-viewerIPv6.patch
 License:   GPLv2
 Group:     User Interface/Desktops
 BuildRoot: %{_tmppath}/%{name}-%{version}-root
@@ -62,7 +61,7 @@
 BuildRequires: libXt-devel, libXv-devel, pixman-devel
 BuildRequires: libselinux-devel
 BuildRequires: xorg-x11-server-source
-BuildRequires: mesa-libGL-devel >= 6.5.2, mesa-source >= 6.5.2, libdrm-devel
+BuildRequires: mesa-libGL-devel >= 6.5.2, libdrm-devel
 
 Requires: gtk2 >= 2.6
 Requires: coreutils
@@ -115,7 +114,6 @@
 %patch16 -p1 -b .64bit
 %patch17 -p1 -b .select
 %patch21 -p1 -b .newfbsize
-%patch23 -p1 -b .ipv6
 %patch24 -p1 -b .102434
 %patch25 -p1 -b .config
 %patch28 -p1 -b .render
@@ -136,7 +134,6 @@
 popd
 %patch42 -p1 -b .mieq
 %patch43 -p1 -b .alloc
-%patch44 -p1 -b .noxkb
 %patch45 -p1 -b .paint
 %patch46 -p1 -b .selections
 %patch48 -p1 -b .minor
@@ -144,6 +141,7 @@
 %patch50 -p1 -b .scrollbars
 %patch51 -p1 -b .bounds
 %patch52 -p1 -b .includes
+%patch53 -p1 -b .ipv6
 
 %build
 export CFLAGS="$CFLAGS $RPM_OPT_FLAGS"
@@ -184,8 +182,7 @@
 	--disable-dri \
         --enable-glx \
 	--disable-config-dbus \
-	--disable-config-hal \
-        --with-mesa-source=%{_datadir}/mesa/source
+	--disable-config-hal
 
 make %{?_smp_mflags}
 popd
@@ -334,6 +331,10 @@
 %{_libdir}/librfb.so.*
 
 %changelog
+* Mon Jun 30 2008 Adam Tkac <atkac redhat com> 4.1.2-31
+- enabled XKEYBOARD extension (#450033)
+- improved IPv6 support in viewer (#438422)
+
 * Fri Apr 25 2008 Adam Tkac <atkac redhat com> 4.1.2-30
 - rebuild against new mesa to fix GLX under anaconda (#443635)
 


--- vnc-210617.patch DELETED ---


--- vnc-noxkb.patch DELETED ---




More information about the fedora-extras-commits mailing list