[gsoap] Try next interface on connect failure (backport)

Mattias Ellert ellert at fedoraproject.org
Mon Aug 25 10:06:04 UTC 2014


commit c734f080857fc147f83648c7b86ade7b585e1ba8
Author: Mattias Ellert <mattias.ellert at fysast.uu.se>
Date:   Mon Aug 25 10:25:07 2014 +0200

    Try next interface on connect failure (backport)

 gsoap-ai-next.patch |  119 +++++++++++++++++++++++++++++++++++++++++++++++++++
 gsoap.spec          |   10 +++-
 2 files changed, 127 insertions(+), 2 deletions(-)
---
diff --git a/gsoap-ai-next.patch b/gsoap-ai-next.patch
new file mode 100644
index 0000000..5791755
--- /dev/null
+++ b/gsoap-ai-next.patch
@@ -0,0 +1,119 @@
+diff -ur gsoap-2.8.17.orig/gsoap/samples/calc_vs2005/calc_vs2005/stdsoap2.cpp gsoap-2.8.17/gsoap/samples/calc_vs2005/calc_vs2005/stdsoap2.cpp
+--- gsoap-2.8.17.orig/gsoap/samples/calc_vs2005/calc_vs2005/stdsoap2.cpp	2013-12-18 20:58:36.000000000 +0100
++++ gsoap-2.8.17/gsoap/samples/calc_vs2005/calc_vs2005/stdsoap2.cpp	2014-08-25 09:52:17.739045215 +0200
+@@ -4089,6 +4089,13 @@
+     if (connect(sk, (struct sockaddr*)&soap->peer, sizeof(soap->peer)))
+ #endif
+     { err = soap_socket_errno(sk);
++#ifdef WITH_IPV6
++      if (err == SOAP_ECONNREFUSED && res->ai_next)
++      { soap->fclosesocket(soap, sk);
++	res = res->ai_next;
++	goto again;
++      }
++#endif
+ #ifndef WITH_LEAN
+       if (err == SOAP_EADDRINUSE)
+       { soap->fclosesocket(soap, sk);
+diff -ur gsoap-2.8.17.orig/gsoap/samples/calc_vs2005/calc_vs2005/stdsoap2.h gsoap-2.8.17/gsoap/samples/calc_vs2005/calc_vs2005/stdsoap2.h
+--- gsoap-2.8.17.orig/gsoap/samples/calc_vs2005/calc_vs2005/stdsoap2.h	2013-12-18 20:58:36.000000000 +0100
++++ gsoap-2.8.17/gsoap/samples/calc_vs2005/calc_vs2005/stdsoap2.h	2014-08-25 09:53:42.186056125 +0200
+@@ -972,11 +972,13 @@
+ # define SOAP_EWOULDBLOCK WSAEWOULDBLOCK
+ # define SOAP_EINPROGRESS WSAEINPROGRESS
+ # define SOAP_EADDRINUSE WSAEADDRINUSE
++# define SOAP_ECONNREFUSED WSAECONNREFUSED
+ #else
+ # define SOAP_ERANGE ERANGE
+ # define SOAP_EINTR EINTR
+ # define SOAP_EAGAIN EAGAIN
+ # define SOAP_EADDRINUSE EADDRINUSE
++# define SOAP_ECONNREFUSED ECONNREFUSED
+ # ifdef SYMBIAN
+ #  define SOAP_EWOULDBLOCK 9898
+ #  define SOAP_EINPROGRESS 9899
+diff -ur gsoap-2.8.17.orig/gsoap/stdsoap2.c gsoap-2.8.17/gsoap/stdsoap2.c
+--- gsoap-2.8.17.orig/gsoap/stdsoap2.c	2013-12-18 20:58:38.000000000 +0100
++++ gsoap-2.8.17/gsoap/stdsoap2.c	2014-08-25 09:52:17.739045215 +0200
+@@ -4089,6 +4089,13 @@
+     if (connect(sk, (struct sockaddr*)&soap->peer, sizeof(soap->peer)))
+ #endif
+     { err = soap_socket_errno(sk);
++#ifdef WITH_IPV6
++      if (err == SOAP_ECONNREFUSED && res->ai_next)
++      { soap->fclosesocket(soap, sk);
++	res = res->ai_next;
++	goto again;
++      }
++#endif
+ #ifndef WITH_LEAN
+       if (err == SOAP_EADDRINUSE)
+       { soap->fclosesocket(soap, sk);
+diff -ur gsoap-2.8.17.orig/gsoap/stdsoap2.cpp gsoap-2.8.17/gsoap/stdsoap2.cpp
+--- gsoap-2.8.17.orig/gsoap/stdsoap2.cpp	2013-12-18 20:58:38.000000000 +0100
++++ gsoap-2.8.17/gsoap/stdsoap2.cpp	2014-08-25 09:52:17.739045215 +0200
+@@ -4089,6 +4089,13 @@
+     if (connect(sk, (struct sockaddr*)&soap->peer, sizeof(soap->peer)))
+ #endif
+     { err = soap_socket_errno(sk);
++#ifdef WITH_IPV6
++      if (err == SOAP_ECONNREFUSED && res->ai_next)
++      { soap->fclosesocket(soap, sk);
++	res = res->ai_next;
++	goto again;
++      }
++#endif
+ #ifndef WITH_LEAN
+       if (err == SOAP_EADDRINUSE)
+       { soap->fclosesocket(soap, sk);
+diff -ur gsoap-2.8.17.orig/gsoap/stdsoap2.h gsoap-2.8.17/gsoap/stdsoap2.h
+--- gsoap-2.8.17.orig/gsoap/stdsoap2.h	2013-12-18 20:58:38.000000000 +0100
++++ gsoap-2.8.17/gsoap/stdsoap2.h	2014-08-25 09:53:42.186056125 +0200
+@@ -972,11 +972,13 @@
+ # define SOAP_EWOULDBLOCK WSAEWOULDBLOCK
+ # define SOAP_EINPROGRESS WSAEINPROGRESS
+ # define SOAP_EADDRINUSE WSAEADDRINUSE
++# define SOAP_ECONNREFUSED WSAECONNREFUSED
+ #else
+ # define SOAP_ERANGE ERANGE
+ # define SOAP_EINTR EINTR
+ # define SOAP_EAGAIN EAGAIN
+ # define SOAP_EADDRINUSE EADDRINUSE
++# define SOAP_ECONNREFUSED ECONNREFUSED
+ # ifdef SYMBIAN
+ #  define SOAP_EWOULDBLOCK 9898
+ #  define SOAP_EINPROGRESS 9899
+diff -ur gsoap-2.8.17.orig/gsoap/VisualStudio2005/wsdl2h/wsdl2h/stdsoap2.cpp gsoap-2.8.17/gsoap/VisualStudio2005/wsdl2h/wsdl2h/stdsoap2.cpp
+--- gsoap-2.8.17.orig/gsoap/VisualStudio2005/wsdl2h/wsdl2h/stdsoap2.cpp	2013-12-18 20:58:38.000000000 +0100
++++ gsoap-2.8.17/gsoap/VisualStudio2005/wsdl2h/wsdl2h/stdsoap2.cpp	2014-08-25 09:52:17.739045215 +0200
+@@ -4089,6 +4089,13 @@
+     if (connect(sk, (struct sockaddr*)&soap->peer, sizeof(soap->peer)))
+ #endif
+     { err = soap_socket_errno(sk);
++#ifdef WITH_IPV6
++      if (err == SOAP_ECONNREFUSED && res->ai_next)
++      { soap->fclosesocket(soap, sk);
++	res = res->ai_next;
++	goto again;
++      }
++#endif
+ #ifndef WITH_LEAN
+       if (err == SOAP_EADDRINUSE)
+       { soap->fclosesocket(soap, sk);
+diff -ur gsoap-2.8.17.orig/gsoap/VisualStudio2005/wsdl2h/wsdl2h/stdsoap2.h gsoap-2.8.17/gsoap/VisualStudio2005/wsdl2h/wsdl2h/stdsoap2.h
+--- gsoap-2.8.17.orig/gsoap/VisualStudio2005/wsdl2h/wsdl2h/stdsoap2.h	2013-12-18 20:58:38.000000000 +0100
++++ gsoap-2.8.17/gsoap/VisualStudio2005/wsdl2h/wsdl2h/stdsoap2.h	2014-08-25 09:53:42.186056125 +0200
+@@ -972,11 +972,13 @@
+ # define SOAP_EWOULDBLOCK WSAEWOULDBLOCK
+ # define SOAP_EINPROGRESS WSAEINPROGRESS
+ # define SOAP_EADDRINUSE WSAEADDRINUSE
++# define SOAP_ECONNREFUSED WSAECONNREFUSED
+ #else
+ # define SOAP_ERANGE ERANGE
+ # define SOAP_EINTR EINTR
+ # define SOAP_EAGAIN EAGAIN
+ # define SOAP_EADDRINUSE EADDRINUSE
++# define SOAP_ECONNREFUSED ECONNREFUSED
+ # ifdef SYMBIAN
+ #  define SOAP_EWOULDBLOCK 9898
+ #  define SOAP_EINPROGRESS 9899
diff --git a/gsoap.spec b/gsoap.spec
index 0870d9e..fc7afb2 100644
--- a/gsoap.spec
+++ b/gsoap.spec
@@ -1,7 +1,7 @@
 Summary: Generator Tools for Coding SOAP/XML Web Services in C and C++
 Name: gsoap
 Version: 2.8.17
-Release: 3%{?dist}
+Release: 4%{?dist}
 # Bump the soversion when the new version is not backward compatiple
 %global soversion 5
 
@@ -30,12 +30,14 @@ Patch0: %{name}-libtool.patch
 Patch1: %{name}-private-lm.patch
 # https://sourceforge.net/p/gsoap2/patches/110/
 Patch2: %{name}-pad.patch
-# https://sourceforge.net/p/gsoap2/bugs/959/
+# https://sourceforge.net/p/gsoap2/bugs/966/
 Patch3: %{name}-ipv6.patch
 # https://sourceforge.net/p/gsoap2/patches/117/
 Patch4: %{name}-default-paths.patch
 # https://sourceforge.net/p/gsoap2/patches/118/
 Patch5: %{name}-cleanfiles.patch
+# https://sourceforge.net/p/gsoap2/bugs/959/
+Patch6: %{name}-ai-next.patch
 BuildRoot: %(mktemp -ud %{_tmppath}/%{name}-%{version}-%{release}-XXXXXX)
 
 BuildRequires: flex
@@ -82,6 +84,7 @@ gSOAP documentation in html
 %patch3 -p1
 %patch4 -p1
 %patch5 -p1
+%patch6 -p1
 
 # XML files non-executable
 find . -name "*.xml" -exec chmod a-x {} ';'
@@ -311,6 +314,9 @@ make check
 %postun -p /sbin/ldconfig
 
 %changelog
+* Mon Aug 25 2014 Mattias Ellert <mattias.ellert at fysast.uu.se> - 2.8.17-4
+- Try next interface on connect failure (backport)
+
 * Sat Aug 16 2014 Fedora Release Engineering <rel-eng at lists.fedoraproject.org> - 2.8.17-3
 - Rebuilt for https://fedoraproject.org/wiki/Fedora_21_22_Mass_Rebuild
 


More information about the scm-commits mailing list