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 pr...@apache.org on 2005/01/25 12:21:51 UTC
cvs commit: ws-axis/c/src/transport/axis3 HTTPTransport.cpp ChannelFactory.cpp ChannelFactory.hpp IChannel.hpp
prestonf 2005/01/25 03:21:51
Modified: c/src/transport/axis3 HTTPTransport.cpp ChannelFactory.cpp
ChannelFactory.hpp IChannel.hpp
Log:
Hi All,
These are modifications needed for the draft of the new http transport implementation AXIS3 (see AXISCPP-361).
Regards,
Fred Preston.
Revision Changes Path
1.8 +8 -2 ws-axis/c/src/transport/axis3/HTTPTransport.cpp
Index: HTTPTransport.cpp
===================================================================
RCS file: /home/cvs/ws-axis/c/src/transport/axis3/HTTPTransport.cpp,v
retrieving revision 1.7
retrieving revision 1.8
diff -u -r1.7 -r1.8
--- HTTPTransport.cpp 21 Jan 2005 17:18:34 -0000 1.7
+++ HTTPTransport.cpp 25 Jan 2005 11:21:51 -0000 1.8
@@ -738,13 +738,13 @@
case CHANNEL_HTTP_DLL_NAME:
{
- m_pNormalChannel = m_pChannelFactory->LoadChannelLibrary( value);
+ m_pNormalChannel = m_pChannelFactory->LoadChannelLibrary( UnsecureChannel, value);
break;
}
case CHANNEL_HTTP_SSL_DLL_NAME:
{
- m_pSecureChannel = m_pChannelFactory->LoadChannelLibrary( value);
+ m_pSecureChannel = m_pChannelFactory->LoadChannelLibrary( SecureChannel, value);
break;
}
@@ -855,6 +855,12 @@
case SECURE_PROPERTIES:
{
pszPropValue = m_pActiveChannel->getTransportProperty( eType);
+ break;
+ }
+
+ case CHANNEL_HTTP_SSL_DLL_NAME:
+ case CHANNEL_HTTP_DLL_NAME:
+ {
break;
}
}
1.6 +47 -33 ws-axis/c/src/transport/axis3/ChannelFactory.cpp
Index: ChannelFactory.cpp
===================================================================
RCS file: /home/cvs/ws-axis/c/src/transport/axis3/ChannelFactory.cpp,v
retrieving revision 1.5
retrieving revision 1.6
diff -u -r1.5 -r1.6
--- ChannelFactory.cpp 20 Jan 2005 19:35:48 -0000 1.5
+++ ChannelFactory.cpp 25 Jan 2005 11:21:51 -0000 1.6
@@ -33,9 +33,7 @@
ChannelFactory::ChannelFactory()
{
- m_iLibCount = 0;
-
- for( int iCount = 0; iCount < ChannelFactory_MaxListSize; iCount++)
+ for( int iCount = 0; iCount < (int) MaxChannelCount; iCount++)
{
m_pLibName[iCount] = NULL;
m_LibHandler[iCount] = NULL;
@@ -45,7 +43,7 @@
ChannelFactory::~ChannelFactory()
{
- for( int iCount = 0; iCount < m_iLibCount; iCount++)
+ for( int iCount = 0; iCount < (int) MaxChannelCount; iCount++)
{
if( m_pChannel[iCount] != NULL)
{
@@ -73,10 +71,16 @@
}
}
-IChannel * ChannelFactory::LoadChannelLibrary( const char * pcLibraryName)
+IChannel * ChannelFactory::LoadChannelLibrary( g_ChannelType eChannelType, const char * pcLibraryName)
{
DLHandler sLibHandler;
IChannel * pChannel = NULL;
+ int iLibCount = 0;
+
+ if( eChannelType == SecureChannel)
+ {
+ iLibCount = 1;
+ }
sLibHandler = PLATFORM_LOADLIB( pcLibraryName);
@@ -101,58 +105,68 @@
}
#ifdef ENABLE_AXISTRACE
- // Load function to do lib level inits
- void (*initializeLibrary) (AxisTraceEntrypoints&);
- initializeLibrary = (void (*)(AxisTraceEntrypoints&))PLATFORM_GETPROCADDR(sLibHandler, "initializeLibrary");
-
- AxisTraceEntrypoints ep;
- AxisTrace::getTraceEntrypoints(ep);
- if (initializeLibrary)
- (*initializeLibrary)(ep);
+// Load function to do lib level inits
+ void (*initializeLibrary) (AxisTraceEntrypoints&);
+ initializeLibrary = (void (*)(AxisTraceEntrypoints&))PLATFORM_GETPROCADDR(sLibHandler, "initializeLibrary");
+
+ AxisTraceEntrypoints ep;
+ AxisTrace::getTraceEntrypoints( ep);
+
+ if( initializeLibrary)
+ {
+ (*initializeLibrary) ( ep);
+ }
#endif
- m_pLibName[m_iLibCount] = new char[ strlen( pcLibraryName) + 1];
+// Additional code added to that when the user wants to load a different
+// library from that which is already loaded, it will now allow the change.
+ if( m_pLibName[iLibCount] != NULL)
+ {
+ delete m_pLibName[iLibCount];
+ }
+
+ m_pLibName[iLibCount] = new char[ strlen( pcLibraryName) + 1];
+
+ strcpy( m_pLibName[iLibCount], pcLibraryName);
- strcpy( m_pLibName[m_iLibCount], pcLibraryName);
+ UnLoadChannelLibrary( eChannelType, m_pChannel[iLibCount]);
- m_LibHandler[m_iLibCount] = sLibHandler;
+ m_LibHandler[iLibCount] = sLibHandler;
if( sCreate)
{
sCreate( &pChannel);
- m_pChannel[m_iLibCount] = pChannel;
- }
-
- if( m_iLibCount < ChannelFactory_MaxListSize)
- {
- m_iLibCount++;
+ m_pChannel[iLibCount] = pChannel;
}
}
return pChannel;
}
-bool ChannelFactory::UnLoadChannelLibrary( IChannel * pIChannel)
+bool ChannelFactory::UnLoadChannelLibrary( g_ChannelType eChannelType, IChannel * pIChannel)
{
bool bSuccess = false;
+ int iLibCount = 0;
- for( int iCount = 0; iCount < m_iLibCount && !bSuccess; iCount++)
+ if( eChannelType == SecureChannel)
{
- if( m_pChannel[iCount] == pIChannel)
- {
- DELETE_OBJECT3 sDelete = (DELETE_OBJECT3) PLATFORM_GETPROCADDR( m_LibHandler[iCount], DELETE_FUNCTION3);
+ iLibCount = 1;
+ }
- sDelete( pIChannel);
+ if( m_pChannel[iLibCount] == pIChannel)
+ {
+ DELETE_OBJECT3 sDelete = (DELETE_OBJECT3) PLATFORM_GETPROCADDR( m_LibHandler[iLibCount], DELETE_FUNCTION3);
- m_pChannel[iCount] = 0;
+ sDelete( pIChannel);
- PLATFORM_UNLOADLIB( m_LibHandler[iCount]);
+ m_pChannel[iLibCount] = 0;
- m_LibHandler[iCount] = 0;
+ PLATFORM_UNLOADLIB( m_LibHandler[iLibCount]);
- bSuccess = true;
- }
+ m_LibHandler[iLibCount] = 0;
+
+ bSuccess = true;
}
return bSuccess;
1.5 +5 -7 ws-axis/c/src/transport/axis3/ChannelFactory.hpp
Index: ChannelFactory.hpp
===================================================================
RCS file: /home/cvs/ws-axis/c/src/transport/axis3/ChannelFactory.hpp,v
retrieving revision 1.4
retrieving revision 1.5
diff -u -r1.4 -r1.5
--- ChannelFactory.hpp 20 Jan 2005 19:35:47 -0000 1.4
+++ ChannelFactory.hpp 25 Jan 2005 11:21:51 -0000 1.5
@@ -30,7 +30,6 @@
#include <axis/GDefine.hpp>
#include "IChannel.hpp"
-#define ChannelFactory_MaxListSize 2
#define CREATE_FUNCTION3 "CreateInstance"
#define DELETE_FUNCTION3 "DestroyInstance"
@@ -42,14 +41,13 @@
public:
ChannelFactory();
virtual ~ChannelFactory();
- virtual IChannel * LoadChannelLibrary( const char * pcLibraryName);
- virtual bool UnLoadChannelLibrary( IChannel *);
+ virtual IChannel * LoadChannelLibrary( g_ChannelType eChannelType, const char * pcLibraryName);
+ virtual bool UnLoadChannelLibrary( g_ChannelType eChannelType, IChannel *);
private:
- int m_iLibCount;
- char * m_pLibName[ChannelFactory_MaxListSize];
- DLHandler m_LibHandler[ChannelFactory_MaxListSize];
- IChannel * m_pChannel[ChannelFactory_MaxListSize];
+ char * m_pLibName[(int) MaxChannelCount];
+ DLHandler m_LibHandler[(int) MaxChannelCount];
+ IChannel * m_pChannel[(int) MaxChannelCount];
};
AXIS_CPP_NAMESPACE_END
#endif
1.4 +7 -0 ws-axis/c/src/transport/axis3/IChannel.hpp
Index: IChannel.hpp
===================================================================
RCS file: /home/cvs/ws-axis/c/src/transport/axis3/IChannel.hpp,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -r1.3 -r1.4
--- IChannel.hpp 11 Jan 2005 11:43:48 -0000 1.3
+++ IChannel.hpp 25 Jan 2005 11:21:51 -0000 1.4
@@ -11,6 +11,13 @@
AXIS_CPP_NAMESPACE_USE
+enum g_ChannelType
+{
+ UnsecureChannel,
+ SecureChannel,
+ MaxChannelCount
+};
+
class IChannel
{
public: