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 sa...@apache.org on 2005/03/03 15:55:11 UTC

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

samisa      2005/03/03 06:55:11

  Modified:    c/src/transport/axis3 HTTPTransport.cpp IChannel.hpp
  Log:
  Added proxy support.
  AXISCPP-428
  
  Revision  Changes    Path
  1.18      +21 -5     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.17
  retrieving revision 1.18
  diff -u -r1.17 -r1.18
  --- HTTPTransport.cpp	2 Mar 2005 10:58:47 -0000	1.17
  +++ HTTPTransport.cpp	3 Mar 2005 14:55:11 -0000	1.18
  @@ -292,11 +292,23 @@
       char			buff[8];
   
       m_strHeaderBytesToSend = m_strHTTPMethod + " ";
  -    m_strHeaderBytesToSend += std::string (url.getResource ()) + " ";
  +    if (m_bUseProxy)
  +        m_strHeaderBytesToSend += std::string (url.getURL ()) + " ";
  +    else
  +		m_strHeaderBytesToSend += std::string (url.getResource ()) + " ";
       m_strHeaderBytesToSend += m_strHTTPProtocol + "\r\n";
  -    m_strHeaderBytesToSend += std::string ("Host: ") + url.getHostName ();
   
  -    sprintf (buff, "%u", uiPort);
  +	if (m_bUseProxy)
  +        m_strHeaderBytesToSend += std::string ("Host: ") + m_strProxyHost;
  +    else
  +		m_strHeaderBytesToSend += std::string ("Host: ") + url.getHostName ();
  +
  +    	
  +    if (m_bUseProxy)
  +        uiPort = m_uiProxyPort;
  +       
  +
  +	sprintf (buff, "%u", uiPort);
   
       m_strHeaderBytesToSend += ":";
       m_strHeaderBytesToSend += buff;
  @@ -994,7 +1006,8 @@
    */
   void HTTPTransport::setProxy( const char *pcProxyHost, unsigned int uiProxyPort)
   {
  -    m_strProxyHost = pcProxyHost;
  +    m_pActiveChannel->setProxy(pcProxyHost,uiProxyPort);
  +	m_strProxyHost = pcProxyHost;
       m_uiProxyPort = uiProxyPort;
       m_bUseProxy = true;
   }
  @@ -1160,6 +1173,10 @@
   				m_bReopenConnection = true;
   			}
   
  +            // We need to close the connection and open a new one if we have 'Proxy-Connection: close'
  +            if (key == "Proxy-Connection" && value == " close")
  +                m_bReopenConnection = true;
  +
   	    // For both HTTP/1.0 and HTTP/1.1,
   	    // We need to keep the connection if we have 'Connection: Keep-Alive'
   			if( key == "Connection" && value == " Keep-Alive")
  @@ -1500,4 +1517,3 @@
   
   	return NULL;
   }
  -
  
  
  
  1.6       +1 -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.5
  retrieving revision 1.6
  diff -u -r1.5 -r1.6
  --- IChannel.hpp	24 Feb 2005 17:02:11 -0000	1.5
  +++ IChannel.hpp	3 Mar 2005 14:55:11 -0000	1.6
  @@ -35,6 +35,7 @@
       virtual void				setSocket( unsigned int uiNewSocket)=0;
   	virtual bool				setTransportProperty( AXIS_TRANSPORT_INFORMATION_TYPE type, const char* value)=0;
   	virtual const char *		getTransportProperty( AXIS_TRANSPORT_INFORMATION_TYPE type)=0;
  +	virtual void                setProxy(const char *pcProxyHost,unsigned int uiProxyPort) = 0;
   };
   
   #endif