axis-c-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Petr Cvachoucek <cvachou...@unicontrols.cz>
Subject Axis C++ 1.6beta
Date Thu, 30 Mar 2006 12:20:27 GMT
Hi again,

I did some more investigations and seems successfully solved memory 
leaks. In general the source code generated by wsdl2ws tool needs to be 
extended and copy constructors and assignment operators must be added, 
and destructors must do cleanup. If someone is interested, I can send 
what is required to do.

When testing the client and server (both axis c++ - generated by 
wsdl2ws, using apache2 on server side), I encountered other serious 
problems. The client crashes sometimes, I tried to find the reason and 
found bugs in the axis HTTP transport library. Client crashes sometimes 
when the server response is in chunked format (but not every time).

The method HTTPTransport::getBytes() doesn't work in all cases, here is 
the part I needed to change to make it work correctly:

(original position in HTTPTransport.cpp, line 767)

case eSOAPMessageIsChunked:
{
   if (m_GetBytesState == eSOAPMessageIsChunked)
   {
     if( m_iBytesLeft == 0)
     {
       getNextDataPacket( "No data available for next chunk size.");
     }
     m_iContentLength = getChunkSize();

     while( m_iContentLength + strlen(ASCII_S_CRLF) > m_iBytesLeft)
     {
       getNextDataPacket( "No data available for next chunk.");
     }
     if( m_iBytesLeft >= m_iContentLength + strlen(ASCII_S_CRLF))
     {
       nextChunk = m_strReceived.substr(
         m_iContentLength + strlen(ASCII_S_CRLF));

       m_strReceived = m_strReceived.substr( 0, m_iContentLength);
       m_iBytesLeft = m_iContentLength;

       if( peekChunkLength( nextChunk) == 0)
       {
         m_GetBytesState = eWaitingForHTTPHeader;
       }
     }
     else
     {
       nextChunk = "";
     }

     if( m_bMimeTrue)
     {
       processRootMimeBody();
       m_iBytesLeft = m_strReceived.length();
     }

     break;
   }
}

Also the method HTTPTransport::copyDataToParserBuffer() needs modification:

(original position in HTTPTransport.cpp, line 1722)


bool HTTPTransport::copyDataToParserBuffer(char * pcBuffer, int * 
piSize, int iBytesToCopy)
{
   bool bTransportInProgress = false;
   if( iBytesToCopy > 0)
   {
     int iToCopy = (*piSize < iBytesToCopy) ? *piSize : iBytesToCopy;
     strncpy( pcBuffer, m_strReceived.c_str(), iToCopy);
     m_iBytesLeft -= iToCopy;
     *piSize = iToCopy;

     if( m_iBytesLeft > 0)
     {
       m_strReceived = m_strReceived.substr( iToCopy);
     }
     else
     {
       m_strReceived = "";
     }
     bTransportInProgress = true;
   }
   else
   {
     *piSize = 0;
   }

   return bTransportInProgress;
}


The original behavior was pretty unstable, there were passed invalid 
data to xerces parser and then the xerces throws an exception. But seems 
it is not handled correctly in axis soap engine, because the axis engine 
   crashes.

I'll continue testing and let you know if I find some more bugs. Btw, 
does anybody know why it isn't possible to download previous releases of 
axis c++ ? (only 1.6beta is on http://www.apache.org/dist/ws/axis-c/).
The 1.6beta is still pretty unstable in my opinion, why there is no 
earlier stable version available for download?????

Petr

Mime
View raw message