You are viewing a plain text version of this content. The canonical link for it is here.
Posted to java-dev@axis.apache.org by sa...@apache.org on 2004/10/05 10:16:51 UTC
cvs commit: ws-axis/c/src/transport/axis2 Channel.cpp
samisa 2004/10/05 01:16:51
Modified: c/src/transport/axis Channel.cpp
c/src/transport/axis2 Channel.cpp
Log:
Eliminated the possibility of calling closeChannel twise to resolve
AXISCPP-185.
Revision Changes Path
1.23 +5 -5 ws-axis/c/src/transport/axis/Channel.cpp
Index: Channel.cpp
===================================================================
RCS file: /home/cvs/ws-axis/c/src/transport/axis/Channel.cpp,v
retrieving revision 1.22
retrieving revision 1.23
diff -u -r1.22 -r1.23
--- Channel.cpp 20 Aug 2004 09:41:51 -0000 1.22
+++ Channel.cpp 5 Oct 2004 08:16:51 -0000 1.23
@@ -358,9 +358,10 @@
void
Channel::CloseChannel ()
{
+ if (INVALID_SOCKET == m_Sock) // Check if socket already closed : AXISCPP-185
+ return;
#ifdef WIN32
- if (INVALID_SOCKET != m_Sock)
- closesocket (m_Sock);
+ closesocket (m_Sock);
/* Check for any possible error conditions from WSACleanup() and report
* them before exiting, as this information might indicate a network
@@ -369,10 +370,9 @@
WSACleanup ();
#else
- if (INVALID_SOCKET != m_Sock)
- close (m_Sock);
-
+ close (m_Sock);
#endif
+ m_Sock = INVALID_SOCKET; // fix for AXISCPP-185
}
/*
1.2 +5 -4 ws-axis/c/src/transport/axis2/Channel.cpp
Index: Channel.cpp
===================================================================
RCS file: /home/cvs/ws-axis/c/src/transport/axis2/Channel.cpp,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -r1.1 -r1.2
--- Channel.cpp 21 Sep 2004 03:52:24 -0000 1.1
+++ Channel.cpp 5 Oct 2004 08:16:51 -0000 1.2
@@ -357,9 +357,10 @@
void
Channel::closeChannel ()
{
+ if (INVALID_SOCKET == m_Sock) // Check if socket already closed : AXISCPP-185
+ return;
#ifdef WIN32
- if (INVALID_SOCKET != m_Sock)
- closesocket (m_Sock);
+ closesocket (m_Sock);
/* Check for any possible error conditions from WSACleanup() and report
* them before exiting, as this information might indicate a network
@@ -368,10 +369,10 @@
WSACleanup ();
#else
- if (INVALID_SOCKET != m_Sock)
- ::close (m_Sock);
+ ::close (m_Sock);
#endif
+ m_Sock = INVALID_SOCKET; // fix for AXISCPP-185
}
/*