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 da...@apache.org on 2004/09/09 14:19:43 UTC

cvs commit: ws-axis/c/src/transport/axis HttpTransport.cpp HttpTransport.hpp

damitha     2004/09/09 05:19:43

  Modified:    c/src/transport/axis HttpTransport.cpp HttpTransport.hpp
  Log:
  The code cannot handle 100 HTTP request Code
  According to HTTP 1.1 specification you may get 100
  code which means that
  server is still not ready to give OK request and you
  need to continue
  This patch is sent by Valentine.
  Thanks Valentine
  
  Revision  Changes    Path
  1.45      +33 -11    ws-axis/c/src/transport/axis/HttpTransport.cpp
  
  Index: HttpTransport.cpp
  ===================================================================
  RCS file: /home/cvs/ws-axis/c/src/transport/axis/HttpTransport.cpp,v
  retrieving revision 1.44
  retrieving revision 1.45
  diff -u -r1.44 -r1.45
  --- HttpTransport.cpp	8 Sep 2004 13:25:21 -0000	1.44
  +++ HttpTransport.cpp	9 Sep 2004 12:19:43 -0000	1.45
  @@ -49,7 +49,7 @@
   #ifdef WIN32
   #pragma warning (disable : 4101)
   #endif
  -
  +#include <iostream>
   #include "Platform.hpp"
   #include "HttpTransport.hpp"
   #include <iostream>
  @@ -69,6 +69,7 @@
       m_IsHttpHeader = 0;
       m_HttpBindDone = false;
       m_Secure = (secure == 0 ? false : true);
  +    m_mustReadAgainHTTP = false;
   
       if (SECURE == secure)
       {
  @@ -93,6 +94,7 @@
       m_strUrl = strUrl;
       m_IsHttpHeader = 0;
       m_HttpBindDone = false;
  +    m_mustReadAgainHTTP = false;
   
       if (secure)
       {
  @@ -131,6 +133,7 @@
       try
       {
   	m_bStatus = true;
  +        m_mustReadAgainHTTP = false;
   	std::string host = m_Url.GetHostName();
           unsigned int port = m_Url.GetPort();
           if(m_bUseProxy)
  @@ -212,14 +215,14 @@
       std::string tmpPacket;	/* use temporary, need to workout for this */
       try
       {
  -    if (!m_bStatus)
  -    {
  -	/* We have the payload; this is due to Fault request made in */
  -	/* earlier call to this method */
  -	*pPayLoad = m_PayLoad.c_str ();
  +        if (!m_bStatus)
  +        {
  +	    /* We have the payload; this is due to Fault request made in */
  +	    /* earlier call to this method */
  +	    *pPayLoad = m_PayLoad.c_str ();
   	
  -	return *this;
  -    }
  +	    return *this;
  +        }
           /* Http header is processed and validated. We now receive the payload */
           /* from the channel */
           if (m_IsHttpHeader == 1)
  @@ -302,11 +305,26 @@
                */
               {
                   /* printf("while,m_IsHttpHeader == 1\n"); */
  -                *pPayLoad = tmpPacket.c_str ();
  +                //*pPayLoad = tmpPacket.c_str ();
  +                m_PayLoad = tmpPacket;
  +                *pPayLoad = m_PayLoad.c_str();
                   break;
  +            //}
  +            //if (m_bStatus)
  +            //HTTPValidate (tmpPacket);	/* Validate the header */
  +            } 
  +            else 
  +            {
  +                HTTPValidate (tmpPacket);       /* Validate the header */
  +                // HTTP found HTTP 100 code which means we need to try again
  +                if(m_mustReadAgainHTTP) 
  +                {
  +                    m_mustReadAgainHTTP = false;
  +                    m_IsHttpHeader=0;
  +                    m_sHeader="";
  +                    continue;
  +                }
               }
  -            if (m_bStatus)
  -            HTTPValidate (tmpPacket);	/* Validate the header */
               int j = strlen (tmpPacket.c_str ());
               if (j == 0)
               break;
  @@ -689,6 +707,10 @@
   	/* Status code is 2xx; so valid packet. hence go ahead and extract
   	 * the payload. 
   	 */
  +        if (nHttpStatus == 1) 
  +        {
  +            m_mustReadAgainHTTP = true;
  +        }
   	if (nHttpStatus == 2)
   	{
   	    GetPayLoad (m_sHeader, offset);
  
  
  
  1.11      +3 -0      ws-axis/c/src/transport/axis/HttpTransport.hpp
  
  Index: HttpTransport.hpp
  ===================================================================
  RCS file: /home/cvs/ws-axis/c/src/transport/axis/HttpTransport.hpp,v
  retrieving revision 1.10
  retrieving revision 1.11
  diff -u -r1.10 -r1.11
  --- HttpTransport.hpp	6 Aug 2004 14:44:40 -0000	1.10
  +++ HttpTransport.hpp	9 Sep 2004 12:19:43 -0000	1.11
  @@ -181,6 +181,9 @@
       */
       long m_lTimeoutSeconds;
   
  +    /** Keep track of 100 HTTP code*/
  +    bool m_mustReadAgainHTTP;
  +
   };
   
   #endif