axis-java-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From sam...@apache.org
Subject cvs commit: ws-axis/c/src/transport/axis2 Axis2Transport.cpp
Date Tue, 09 Nov 2004 09:40:55 GMT
samisa      2004/11/09 01:40:55

  Modified:    c/src/engine/client Call.cpp
               c/src/transport/axis2 Axis2Transport.cpp
  Log:
  Changes to make use of a single transport object without creating a new one each time.
  Works with HTTP/1.1. Need to fix for HTTP/1.0
  
  Revision  Changes    Path
  1.69      +6 -3      ws-axis/c/src/engine/client/Call.cpp
  
  Index: Call.cpp
  ===================================================================
  RCS file: /home/cvs/ws-axis/c/src/engine/client/Call.cpp,v
  retrieving revision 1.68
  retrieving revision 1.69
  diff -u -r1.68 -r1.69
  --- Call.cpp	9 Nov 2004 02:45:55 -0000	1.68
  +++ Call.cpp	9 Nov 2004 09:40:55 -0000	1.69
  @@ -64,6 +64,8 @@
   
   Call::~Call ()
   {
  +	    SOAPTransportFactory::destroyTransportObject(m_pTransport);
  +		m_pTransport = NULL;
       if (m_bModuleInitialized)
           uninitialize_module();
       if (m_pcEndPointUri)
  @@ -291,7 +293,8 @@
   {
       try
       {
  -    m_pTransport = SOAPTransportFactory::getTransportObject(m_nTransportType);
  +        if (!m_pTransport) 
  +            m_pTransport = SOAPTransportFactory::getTransportObject(m_nTransportType);
   	if (!m_pTransport) return AXIS_FAIL;
   
       m_pTransport->setEndpointUri(m_pcEndPointUri);
  @@ -322,8 +325,8 @@
   {
   	if (m_pTransport) {
           m_pTransport->closeConnection();
  -	    SOAPTransportFactory::destroyTransportObject(m_pTransport);
  -		m_pTransport = NULL;
  +	//    SOAPTransportFactory::destroyTransportObject(m_pTransport);
  +	//	m_pTransport = NULL;
   	}
   }
   
  
  
  
  1.13      +22 -14    ws-axis/c/src/transport/axis2/Axis2Transport.cpp
  
  Index: Axis2Transport.cpp
  ===================================================================
  RCS file: /home/cvs/ws-axis/c/src/transport/axis2/Axis2Transport.cpp,v
  retrieving revision 1.12
  retrieving revision 1.13
  diff -u -r1.12 -r1.13
  --- Axis2Transport.cpp	8 Nov 2004 10:41:47 -0000	1.12
  +++ Axis2Transport.cpp	9 Nov 2004 09:40:55 -0000	1.13
  @@ -94,6 +94,7 @@
   	bUpdateURL = true;
       }
   
  +
       // If there is a new URI, then this flag will be set.  Depending on whether
       // GSKit is available, if the new URI is a secure connection, a secure
       // channel will be opened.  If GSKit is not available and the URL requires
  @@ -129,13 +130,16 @@
   	else
   	{
   	    // URI does not require a secure channel.  Delete the existing
  -	    // channel (as it may be secure) and create a new unsecure
  +	    // channel if it is secure and create a new unsecure
   	    // channel.
  -	    delete m_pChannel;
  -
  -	    m_pChannel = new Channel ();
  -	    m_pChannel->setURL (pcEndpointUri);
  -	    m_bChannelSecure = false;
  +            if (m_bChannelSecure)
  +            {
  +	        delete m_pChannel;
  +
  +                m_pChannel = new Channel ();
  +                m_pChannel->setURL (pcEndpointUri);
  +                m_bChannelSecure = false;
  +            }
   	}
       }
   }
  @@ -187,6 +191,7 @@
   {
       if (m_bURIChanged)
       {
  +        m_bURIChanged = false;
   	if (!m_pChannel->open ())
   	{
   	    int iStringLength = m_pChannel->GetLastError ().length () + 1;
  @@ -1087,14 +1092,17 @@
   
   	    iStartPosition = iPosition + 1;
   
  -	    m_vResponseHTTPHeaders.
  -		push_back (std::
  -			   make_pair (strHeaderLine.substr (0, iSeperator),
  -				      strHeaderLine.substr (iSeperator + 1,
  -							    strHeaderLine.
  -							    length () -
  -							    iSeperator - 1 -
  -							    1)));
  +            string key = strHeaderLine.substr (0, iSeperator);
  +            string value = strHeaderLine.substr (iSeperator + 1,
  +                                                            strHeaderLine.
  +                                                            length () -
  +                                                            iSeperator - 1 -
  +                                                            1);
  +	    m_vResponseHTTPHeaders.push_back (std::make_pair (key, value));
  +
  +            if (key == "Connection" && value == " close" ) // We need to close
the connection and open a new one
  +                m_bURIChanged = true;
  +                
   	}
   	while (iPosition != std::string::npos);
       }
  
  
  

Mime
View raw message