You are viewing a plain text version of this content. The canonical link for it is here.
Posted to axis-cvs@ws.apache.org by pr...@apache.org on 2005/01/25 12:41:33 UTC

cvs commit: ws-axis/c/src/transport/axis3 ChannelFactory.cpp HTTPTransport.cpp

prestonf    2005/01/25 03:41:32

  Modified:    c/src/transport/axis3 ChannelFactory.cpp HTTPTransport.cpp
  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.7       +45 -36    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.6
  retrieving revision 1.7
  diff -u -r1.6 -r1.7
  --- ChannelFactory.cpp	25 Jan 2005 11:21:51 -0000	1.6
  +++ ChannelFactory.cpp	25 Jan 2005 11:41:32 -0000	1.7
  @@ -82,63 +82,72 @@
   		iLibCount = 1;
   	}
   
  -    sLibHandler = PLATFORM_LOADLIB( pcLibraryName);
  -
  -    if( !sLibHandler)
  -    {
  -        throw HTTPTransportException( SERVER_TRANSPORT_LOADING_CHANNEL_FAILED);
  -    }
  -	else
  +// Additional code added to block reloading of DLL if name has not changed.
  +	if( m_pLibName[iLibCount] == NULL ||
  +		strcmp( pcLibraryName, m_pLibName[iLibCount]) != 0)
   	{
  -        CREATE_OBJECT3 sCreate = (CREATE_OBJECT3) PLATFORM_GETPROCADDR( sLibHandler, CREATE_FUNCTION3);
  -        DELETE_OBJECT3 sDelete = (DELETE_OBJECT3) PLATFORM_GETPROCADDR( sLibHandler, DELETE_FUNCTION3);
  +		sLibHandler = PLATFORM_LOADLIB( pcLibraryName);
   
  -        if (!sCreate || !sDelete)
  -        {
  -		    PLATFORM_UNLOADLIB( sLibHandler);
  +		if( !sLibHandler)
  +		{
  +			throw HTTPTransportException( SERVER_TRANSPORT_LOADING_CHANNEL_FAILED);
  +		}
  +		else
  +		{
  +			CREATE_OBJECT3 sCreate = (CREATE_OBJECT3) PLATFORM_GETPROCADDR( sLibHandler, CREATE_FUNCTION3);
  +			DELETE_OBJECT3 sDelete = (DELETE_OBJECT3) PLATFORM_GETPROCADDR( sLibHandler, DELETE_FUNCTION3);
  +
  +			if (!sCreate || !sDelete)
  +			{
  +				PLATFORM_UNLOADLIB( sLibHandler);
   
  -            char * pszErrorInfo = new char[ strlen( pcLibraryName) + 1];
  +				char * pszErrorInfo = new char[ strlen( pcLibraryName) + 1];
   
  -            strcpy( pszErrorInfo, pcLibraryName);
  +				strcpy( pszErrorInfo, pcLibraryName);
   
  -            throw HTTPTransportException( SERVER_TRANSPORT_LOADING_CHANNEL_FAILED, pszErrorInfo);
  -        }
  +				throw HTTPTransportException( SERVER_TRANSPORT_LOADING_CHANNEL_FAILED, pszErrorInfo);
  +			}
   
   #ifdef ENABLE_AXISTRACE
   // Load function to do lib level inits
  -		void (*initializeLibrary) (AxisTraceEntrypoints&);
  -		initializeLibrary = (void (*)(AxisTraceEntrypoints&))PLATFORM_GETPROCADDR(sLibHandler, "initializeLibrary");
  +			void (*initializeLibrary) (AxisTraceEntrypoints&);
  +			initializeLibrary = (void (*)(AxisTraceEntrypoints&))PLATFORM_GETPROCADDR(sLibHandler, "initializeLibrary");
   
  -		AxisTraceEntrypoints ep;
  -		AxisTrace::getTraceEntrypoints( ep);
  +			AxisTraceEntrypoints ep;
  +			AxisTrace::getTraceEntrypoints( ep);
   
  -		if( initializeLibrary)
  -		{
  -			(*initializeLibrary) ( ep);
  -		}
  +			if( initializeLibrary)
  +			{
  +				(*initializeLibrary) ( ep);
  +			}
   #endif
   
   // 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];
  -		}
  +			if( m_pLibName[iLibCount] != NULL)
  +			{
  +				delete m_pLibName[iLibCount];
  +			}
   
  -		m_pLibName[iLibCount] = new char[ strlen( pcLibraryName) + 1];
  +			m_pLibName[iLibCount] = new char[ strlen( pcLibraryName) + 1];
   
  -		strcpy( m_pLibName[iLibCount], pcLibraryName);
  +			strcpy( m_pLibName[iLibCount], pcLibraryName);
   
  -		UnLoadChannelLibrary( eChannelType, m_pChannel[iLibCount]);
  +			UnLoadChannelLibrary( eChannelType, m_pChannel[iLibCount]);
   
  -		m_LibHandler[iLibCount] = sLibHandler;
  +			m_LibHandler[iLibCount] = sLibHandler;
   
  -		if( sCreate)
  -		{
  -			sCreate( &pChannel);
  +			if( sCreate)
  +			{
  +				sCreate( &pChannel);
   
  -			m_pChannel[iLibCount] = pChannel;
  +				m_pChannel[iLibCount] = pChannel;
  +			}
   		}
  +	}
  +	else
  +	{
  +		pChannel = m_pChannel[iLibCount];
   	}
   
   	return pChannel;
  
  
  
  1.9       +4 -0      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.8
  retrieving revision 1.9
  diff -u -r1.8 -r1.9
  --- HTTPTransport.cpp	25 Jan 2005 11:21:51 -0000	1.8
  +++ HTTPTransport.cpp	25 Jan 2005 11:41:32 -0000	1.9
  @@ -127,6 +127,8 @@
   		{
   			if( m_pSecureChannel != NULL)
   			{
  +				m_pNormalChannel->close();
  +
   				m_pActiveChannel = m_pSecureChannel;
   
   				m_pActiveChannel->setURL( pcEndpointUri);
  @@ -148,6 +150,8 @@
   			{
   				if( m_pNormalChannel != NULL)
   				{
  +					m_pSecureChannel->close();
  +
   					m_pActiveChannel = m_pNormalChannel;
   					m_pActiveChannel->setURL( pcEndpointUri);
   					m_bChannelSecure = false;