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 2004/09/28 13:12:03 UTC

cvs commit: ws-axis/c/src/transport/libwww LibWWWTransport.cpp LibWWWTransport.h

samisa      2004/09/28 04:12:03

  Modified:    c/src/transport/libwww LibWWWTransport.cpp LibWWWTransport.h
  Log:
  Fixed indentation
  
  Revision  Changes    Path
  1.11      +55 -48    ws-axis/c/src/transport/libwww/LibWWWTransport.cpp
  
  Index: LibWWWTransport.cpp
  ===================================================================
  RCS file: /home/cvs/ws-axis/c/src/transport/libwww/LibWWWTransport.cpp,v
  retrieving revision 1.10
  retrieving revision 1.11
  diff -u -r1.10 -r1.11
  --- LibWWWTransport.cpp	28 Sep 2004 11:07:18 -0000	1.10
  +++ LibWWWTransport.cpp	28 Sep 2004 11:12:03 -0000	1.11
  @@ -23,7 +23,8 @@
   #include "WWWInit.h"
   
   // The object that acquires the lock to start event loop
  -LibWWWTransport* LibWWWTransport::m_spLockingObject = NULL;
  +LibWWWTransport *
  +    LibWWWTransport::m_spLockingObject = NULL;
   
   int
   terminate_handler (HTRequest * request, HTResponse * response,
  @@ -32,12 +33,12 @@
       if (status == HT_LOADED)
       {
   	//HTChunk *chunk = (HTChunk *) HTRequest_context (request);
  -        //HTPrint("In Handler %s\n", HTChunk_data(chunk) );
  -    if (HTNet_isEmpty ())
  -    {
  -	HTEventList_stopLoop ();
  -        LibWWWTransport::m_spLockingObject = NULL;
  -    }
  +	//HTPrint("In Handler %s\n", HTChunk_data(chunk) );
  +	if (HTNet_isEmpty ())
  +	{
  +	    HTEventList_stopLoop ();
  +	    LibWWWTransport::m_spLockingObject = NULL;
  +	}
   
       }
   #ifdef HT_EXT_CONTINUE
  @@ -53,8 +54,10 @@
   {
       if (source && destination && request)
       {
  -	HTChunk *chunk = NULL;
  -	HTStream *target = HTStreamToChunk (request, &chunk, 0);
  +	HTChunk *
  +	    chunk = NULL;
  +	HTStream *
  +	    target = HTStreamToChunk (request, &chunk, 0);
   	HTRequest_setOutputStream (request, target);
   	if (HTPostAnchor (source, destination, request) == YES)
   	    return chunk;
  @@ -108,7 +111,8 @@
   }
   
   AXIS_TRANSPORT_STATUS
  -LibWWWTransport::sendBytes (const char *pcSendBuffer, const void *pBufferid)
  +    LibWWWTransport::sendBytes (const char *pcSendBuffer,
  +				const void *pBufferid)
   {
       //Samisa: Why do I have to go through the buffers of Serializer?
       //If I am the transport, I would like the serializer 
  @@ -154,7 +158,7 @@
   }
   
   AXIS_TRANSPORT_STATUS
  -LibWWWTransport::getBytes (char *pcBuffer, int *piRetSize)
  +    LibWWWTransport::getBytes (char *pcBuffer, int *piRetSize)
   {
       if (m_iBytesLeft > 0)
       {
  @@ -307,8 +311,7 @@
   
   }
   
  -AXIS_PROTOCOL_TYPE
  -LibWWWTransport::getProtocol ()
  +AXIS_PROTOCOL_TYPE LibWWWTransport::getProtocol ()
   {
       return APTHTTP;		//HTTP
   }
  @@ -319,8 +322,7 @@
       return 0;			//TODO:Should return POST
   }
   
  -AXIS_TRANSPORT_STATUS
  -LibWWWTransport::flushOutput ()
  +AXIS_TRANSPORT_STATUS LibWWWTransport::flushOutput ()
   {
   
   
  @@ -328,7 +330,7 @@
       //without using 100-continue
   
       //HTRequest_clear(m_pRequest);
  -    HTRequest_setFlush(m_pRequest, YES);
  +    HTRequest_setFlush (m_pRequest, YES);
       //HTRequest_setOutputFormat(m_pRequest, WWW_SOURCE);
       HTRequest_setOutputFormat (m_pRequest, HTAtom_for ("text/xml"));
       HTRequest_setMethod (m_pRequest, METHOD_EXT_0);
  @@ -343,28 +345,32 @@
   
       //m_pResult = HTLoadToChunk(m_pcEndpointUri, m_pRequest);
   
  -    HTStream *target = HTStreamToChunk (m_pRequest, &m_pResult, 0);
  +    HTStream *
  +	target = HTStreamToChunk (m_pRequest, &m_pResult, 0);
       HTRequest_setOutputStream (m_pRequest, target);
   
       HTRequest_setContext (m_pRequest, m_pResult);
   
  -    HTAnchor *anchor = HTAnchor_findAddress (m_pcEndpointUri);
  +    HTAnchor *
  +	anchor = HTAnchor_findAddress (m_pcEndpointUri);
       HTRequest_setAnchor (m_pRequest, anchor);
   
  -    BOOL status = HTLoadToStream (m_pcEndpointUri, target, m_pRequest);
  +    BOOL
  +	status = HTLoadToStream (m_pcEndpointUri, target, m_pRequest);
   
  -    if (LibWWWTransport::m_spLockingObject == NULL) 
  +    if (LibWWWTransport::m_spLockingObject == NULL)
       {
  -        LibWWWTransport::m_spLockingObject = this;
  +	LibWWWTransport::m_spLockingObject = this;
       }
  -    if (LibWWWTransport::m_spLockingObject == this) 
  +    if (LibWWWTransport::m_spLockingObject == this)
       {
  -        HTEventList_loop (m_pRequest);
  -    } 
  +	HTEventList_loop (m_pRequest);
  +    }
       //if (m_pcReceived)
  -//	free (m_pcReceived);
  +//      free (m_pcReceived);
   
  -    int count = 0;
  +    int
  +	count = 0;
       do
       {
   	if (m_pResult)
  @@ -381,29 +387,29 @@
   	else
   	    sleep (1);
       }
  -    while (count++ < 2 && (HTRequest_bodyRead(m_pRequest) == 0 ));
  +    while (count++ < 2 && (HTRequest_bodyRead (m_pRequest) == 0));
   
  -    if (count == 2 ) // possible deadlock
  -    {
  -        //stop loop
  -        if (HTNet_isEmpty ())
  -    {
  -        HTEventList_stopLoop ();
  -        LibWWWTransport::m_spLockingObject = NULL;
  -    }
  -        //start loop
  -        if (LibWWWTransport::m_spLockingObject == NULL)
  -    {
  -        LibWWWTransport::m_spLockingObject = this;
  -    }
  -    if (LibWWWTransport::m_spLockingObject == this)
  +    if (count == 2)		// possible deadlock
       {
  -        HTEventList_loop (m_pRequest);
  -    }
  +	//stop loop
  +	if (HTNet_isEmpty ())
  +	{
  +	    HTEventList_stopLoop ();
  +	    LibWWWTransport::m_spLockingObject = NULL;
  +	}
  +	//start loop
  +	if (LibWWWTransport::m_spLockingObject == NULL)
  +	{
  +	    LibWWWTransport::m_spLockingObject = this;
  +	}
  +	if (LibWWWTransport::m_spLockingObject == this)
  +	{
  +	    HTEventList_loop (m_pRequest);
  +	}
   
   
       }
  -    
  +
       if (m_pResult)
       {
   	m_pcReceived = HTChunk_data (m_pResult);
  @@ -419,8 +425,10 @@
       return TRANSPORT_FAILED;
   #else
   
  -    HTParentAnchor *src = NULL;
  -    HTAnchor *dst = NULL;
  +    HTParentAnchor *
  +	src = NULL;
  +    HTAnchor *
  +	dst = NULL;
   
       dst = HTAnchor_findAddress (m_pcEndpointUri);
       src = HTTmpAnchor (NULL);
  @@ -507,7 +515,7 @@
   {
       STORAGE_CLASS_INFO void initializeLibrary (void)
       {
  -	if (g_bLibWWWinitialized)		//make sure the lib is initialized only once per client
  +	if (g_bLibWWWinitialized)	//make sure the lib is initialized only once per client
   	    return;
   #ifdef HT_EXT_CONTINUE
   	//Create a new non-premptive client
  @@ -557,4 +565,3 @@
       }
   }
   */
  -
  
  
  
  1.4       +34 -37    ws-axis/c/src/transport/libwww/LibWWWTransport.h
  
  Index: LibWWWTransport.h
  ===================================================================
  RCS file: /home/cvs/ws-axis/c/src/transport/libwww/LibWWWTransport.h,v
  retrieving revision 1.3
  retrieving revision 1.4
  diff -u -r1.3 -r1.4
  --- LibWWWTransport.h	28 Sep 2004 11:07:18 -0000	1.3
  +++ LibWWWTransport.h	28 Sep 2004 11:12:03 -0000	1.4
  @@ -41,20 +41,18 @@
    *
    */
   
  -AXIS_CPP_NAMESPACE_USE
  -
  -class LibWWWTransport : public SOAPTransport
  +AXIS_CPP_NAMESPACE_USE class LibWWWTransport:public SOAPTransport
   {
  -public:
  +  public:
       /**
        * Constructor.
        */
  -    LibWWWTransport();
  +    LibWWWTransport ();
   
       /**
        * Destructor.
        */
  -    ~LibWWWTransport();
  +    ~LibWWWTransport ();
   
       /**
        * Sends a buffer to the transport layer. A Caller may call this method
  @@ -90,8 +88,8 @@
        *       for each buffer for which this function returned the status
        *       code TRANSPORT_IN_PROGRESS.
        */
  -    AXIS_TRANSPORT_STATUS sendBytes(const char* pcSendBuffer, 
  -		const void* pBufferid);
  +    AXIS_TRANSPORT_STATUS sendBytes (const char *pcSendBuffer,
  +				     const void *pBufferid);
       /**
        * Gets a part of or full SOAP message. A Caller may call this method
        * multiple times to get parts of the SOAP message until the function
  @@ -123,7 +121,7 @@
        *                               data in the pcBuffer are not reliable and
        *                               should not be used.
        */
  -     AXIS_TRANSPORT_STATUS getBytes(char* pcBuffer, int* piRetSize);
  +    AXIS_TRANSPORT_STATUS getBytes (char *pcBuffer, int *piRetSize);
       /**
        * Opens a connection with the provided endpoint URI. The connection
        * type (protocol) is decided by the implementation and the protocol
  @@ -136,12 +134,12 @@
        * @return Returns AXIS_SUCCESS if connection established successfully.
        *         Else returns AXIS_FAIL
        */
  -     int openConnection();
  +    int openConnection ();
       /**
        * @brief Closes the connection established with OpenConnection.
        * @example AxisTransport.h
        */
  -     void closeConnection();
  +    void closeConnection ();
       /**
        * Registers the callback function which is used by transport layer to
        * inform the caller that a buffer given to be sent was sent and it can
  @@ -151,8 +149,8 @@
        * @param pFunct Function pointer to caller's function signature of
        *        this function is defined in Packet.h
        */
  -     void registerReleaseBufferCallback(
  -                    AXIS_ENGINE_CALLBACK_RELEASE_SEND_BUFFER pFunct);
  +    void registerReleaseBufferCallback
  +	(AXIS_ENGINE_CALLBACK_RELEASE_SEND_BUFFER pFunct);
       /**
        * Sets a predefined transport property to be included in the outgoing
        * message. This transport property is not persistent in the transport
  @@ -164,8 +162,8 @@
        *        for predefined transport property types.
        * @param pcValue Transport property value to be set.
        */
  -     void setTransportProperty(AXIS_TRANSPORT_INFORMATION_TYPE eType,
  -                    const char* pcValue);
  +    void setTransportProperty (AXIS_TRANSPORT_INFORMATION_TYPE eType,
  +			       const char *pcValue);
       /**
        * @brief Gets a predefined transport property in the arrived message
        *
  @@ -174,8 +172,7 @@
        * @return Value of the transport property if available. Returns null
        *         if unavailable.
        */
  -     const char* getTransportProperty(
  -                    AXIS_TRANSPORT_INFORMATION_TYPE eType);
  +    const char *getTransportProperty (AXIS_TRANSPORT_INFORMATION_TYPE eType);
       /**
        * Sets any transport property to be included in the outgoing message.
        * This transport property is not persistent in the transport layer.
  @@ -185,7 +182,7 @@
        * @param pcKey Key for the transport property to be set.
        * @param pcValue Value for transport property to be set.
        */
  -     void setTransportProperty(const char* pcKey, const char* pcValue);
  +    void setTransportProperty (const char *pcKey, const char *pcValue);
       /**
        * @brief Gets any transport property in the arrived message
        *
  @@ -193,7 +190,7 @@
        * @return Value of the transport property if available. Returns null
        *         if unavailable.
        */
  -     const char* getTransportProperty(const char* pcKey);
  +    const char *getTransportProperty (const char *pcKey);
       /**
        * Sets a SOAP attachment to be sent with outgoing message. This
        * attachment is usually the base64 or hex encoded character buffer
  @@ -206,7 +203,7 @@
        * @param pcAttachment The attachment. This is usually a null terminated string
        *        encoded to base64 or hex binary.
        */
  -     void setAttachment(const char* pcAttachmentid, const char* pcAttachment);
  +    void setAttachment (const char *pcAttachmentid, const char *pcAttachment);
       /**
        * Gets an attachment arrived in the inbound message. Usually the SOAP message will
        * contain the information indicating that there is an attachment arrived at the
  @@ -222,7 +219,7 @@
        * @return The attachment if available. Returns null if the attachment
        *         corresponding to the pcAttachmentid is not found.
        */
  -     const char* getAttachment(const char* pcAttachmentid);
  +    const char *getAttachment (const char *pcAttachmentid);
       /**
        * Sets the the remote endpoint for tranport to connect to. This URI
        * depends on the the transport type. 
  @@ -236,7 +233,7 @@
        * @brief Sets the remote endpoint for tranport to connect to.
        * @param pcEndpointUri Endpoint URI to connect to.
        */
  -     void setEndpointUri(const char* pcEndpointUri);
  +    void setEndpointUri (const char *pcEndpointUri);
       /**
        * Sets the session id for the transport session. Actual usage of this
        * session id is depend on the implementation of the transport.
  @@ -244,7 +241,7 @@
        * @brief Sets the session id for the transport session.
        * @param pcSessionId The session id.
        */
  -     void setSessionId(const char* pcSessionId);
  +    void setSessionId (const char *pcSessionId);
       /**
        * Gets the session id of the transport session sent by the remote end if
        * any. 
  @@ -252,7 +249,7 @@
        * @brief  Sets the session id for the transport session.
        * @return Session id if available. Returns null otherwise.
        */
  -     const char* getSessionId();
  +    const char *getSessionId ();
       /**
        * Gets the service name of the web service to be invoked. How this
        * service name is found is upto the type of the transport layer. For
  @@ -263,7 +260,7 @@
        * @brief  Gets the service name of the web service to be invoked.
        * @return Service name if available and null otherwise.
        */
  -     const char* getServiceName();
  +    const char *getServiceName ();
       /**
        * Gets the protocol type of the transport library. The caller should
        * use this function to check the protocol of the transport layer and
  @@ -272,7 +269,7 @@
        * @brief Gets the protocol type of the transport library.
        * @return The type of the transport. See AXIS_PROTOCOL_TYPE in Packet.h
        */
  -     AXIS_PROTOCOL_TYPE getProtocol();
  +    AXIS_PROTOCOL_TYPE getProtocol ();
       /**
        * Gets the sub protocol. The usefulness of this method and the return
        * values depend on the particular implementation. For example HTTP
  @@ -282,14 +279,14 @@
        * @brief Gets the sub protocol. 
        * @return Type of the sub protocol (Ex: GET, POST, UNSUPPORTED for HTTP).
        */
  -     int getSubProtocol();
  +    int getSubProtocol ();
       /**
        * @brief Forces transport to send any remaining data of the outgoing message.
        * @return Transport status. Two return status are possible. They are,
        *         TRANSPORT_FAILED   - Sending data has failed.
        *         TRANSPORT_FINISHED - Sending finished and successful.
        */
  -     AXIS_TRANSPORT_STATUS flushOutput();
  +    AXIS_TRANSPORT_STATUS flushOutput ();
     /**
       * Set proxy server and port for transport.
       *
  @@ -303,16 +300,16 @@
       * @param pcProxyHost Host name of proxy server
       * @param uiProxyPort Port of proxy server
       */
  -     void setProxy(const char* pcProxyHost, unsigned int uiProxyPort); 
  +    void setProxy (const char *pcProxyHost, unsigned int uiProxyPort);
   
     /**
       * Set transport timeout.
       *
       * @param lSeconds Timeout in seconds
       */
  -     void setTimeout(const long lSeconds);
  +    void setTimeout (const long lSeconds);
   
  -protected:
  +  protected:
       //Handler that terminate the event loop and clean up
       //int terminate_handler (HTRequest * request, HTResponse * response,
       //                           void * param, int status);
  @@ -321,18 +318,18 @@
       //Request object
       HTRequest * m_pRequest;
       //Chunk to hold the result
  -    HTChunk * m_pResult;
  +    HTChunk *m_pResult;
       //data to be posted
  -    char* m_pcData;
  +    char *m_pcData;
       //proxy
  -    char* m_pcProxy;
  +    char *m_pcProxy;
       //getting bytes
       int m_iBytesLeft;
  -    char* m_pcReceived;
  +    char *m_pcReceived;
   
  -public:
  +  public:
       // The object that acquires the lock to start event loop
  -    static LibWWWTransport* m_spLockingObject;
  +    static LibWWWTransport *m_spLockingObject;
   
   };