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 na...@apache.org on 2005/10/24 20:33:25 UTC
svn commit: r328124 -
/webservices/axis/trunk/c/src/transport/axis3/HTTPTransport.cpp
Author: nadiramra
Date: Mon Oct 24 11:33:22 2005
New Revision: 328124
URL: http://svn.apache.org/viewcvs?rev=328124&view=rev
Log:
AXISCPP-822 - OS/400 memory leaks and improvements in transport.
Modified:
webservices/axis/trunk/c/src/transport/axis3/HTTPTransport.cpp
Modified: webservices/axis/trunk/c/src/transport/axis3/HTTPTransport.cpp
URL: http://svn.apache.org/viewcvs/webservices/axis/trunk/c/src/transport/axis3/HTTPTransport.cpp?rev=328124&r1=328123&r2=328124&view=diff
==============================================================================
--- webservices/axis/trunk/c/src/transport/axis3/HTTPTransport.cpp (original)
+++ webservices/axis/trunk/c/src/transport/axis3/HTTPTransport.cpp Mon Oct 24 11:33:22 2005
@@ -288,9 +288,6 @@
// In preperation for sending the message, calculate the size of the message
// by using the string length method.
- // NB: This calculation may not necessarily be correct when dealing with SSL
- // messages as the length of the encoded message is not necessarily the
- // same as the length of the uncoded message.
char buff[24];
sprintf( buff, "%d", m_strBytesToSend.length ());
this->setTransportProperty ("Content-Length", buff);
@@ -302,7 +299,9 @@
#ifndef __OS400__
*m_pActiveChannel << this->getHTTPHeaders ();
*m_pActiveChannel << this->m_strBytesToSend.c_str ();
-#else
+#else
+ // Ebcdic (OS/400) systems need to convert the data to UTF-8. Note that free() is
+ // correctly used and should not be changed to delete().
const char *buf = this->getHTTPHeaders ();
utf8Buf = toUTF8((char *)buf, strlen(buf)+1);
*m_pActiveChannel << utf8Buf;
@@ -317,16 +316,22 @@
catch( HTTPTransportException & e)
{
if (utf8Buf) free(utf8Buf);
+ m_strBytesToSend = "";
+ m_strHeaderBytesToSend = "";
throw;
}
catch( AxisException & e)
{
if (utf8Buf) free(utf8Buf);
+ m_strBytesToSend = "";
+ m_strHeaderBytesToSend = "";
throw;
}
catch(...)
{
if (utf8Buf) free(utf8Buf);
+ m_strBytesToSend = "";
+ m_strHeaderBytesToSend = "";
throw;
}