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/04/11 14:22:45 UTC
cvs commit: ws-axis/c/src/engine/client Stub.cpp
samisa 2005/04/11 05:22:45
Modified: c/src/engine/client Stub.cpp
Log:
Added NULL check to transport key within setTransportProperty method.
AXISCPP-601
Revision Changes Path
1.43 +38 -31 ws-axis/c/src/engine/client/Stub.cpp
Index: Stub.cpp
===================================================================
RCS file: /home/cvs/ws-axis/c/src/engine/client/Stub.cpp,v
retrieving revision 1.42
retrieving revision 1.43
diff -u -r1.42 -r1.43
--- Stub.cpp 23 Mar 2005 15:44:59 -0000 1.42
+++ Stub.cpp 11 Apr 2005 12:22:45 -0000 1.43
@@ -77,40 +77,47 @@
{
if (m_pTransport)
{
- if (strcmp (pcKey, "SOAPAction") == 0) //Samisa: Setting SOAPAction,
+ if(!pcKey)
+ {
+ m_pTransport=NULL; //this should be set to null. otherwise the previous setting can be still there.
+ return;// if the pcKey is set to null, the method returns
+ }
+
+ else if (strcmp (pcKey, "SOAPAction") == 0) //Samisa: Setting SOAPAction,
//may need to add '"' to value - AXISCPP-531
- {
+ {
// both "" missing
- if (pcValue
- && (pcValue[0] != '"'
+ if (pcValue
+ && (pcValue[0] != '"'
&& pcValue[strlen (pcValue) - 1] != '"'))
- {
- char *tempvalue = new char[strlen (pcValue) + 3];
- sprintf (tempvalue, "\"%s\"", pcValue);
- m_pTransport->setTransportProperty (pcKey, tempvalue);
- delete[]tempvalue;
- }
- else if (pcValue && (pcValue[0] != '"')) //starting '"' missing
- {
- char *tempvalue = new char[strlen (pcValue) + 2];
- sprintf (tempvalue, "\"%s", pcValue);
- m_pTransport->setTransportProperty (pcKey, tempvalue);
- delete[]tempvalue;
- }
- else if (pcValue && (pcValue[strlen (pcValue) - 1] != '"')) // ending '"' missing
- {
- char *tempvalue = new char[strlen (pcValue) + 3];
- sprintf (tempvalue, "\"%s\"", pcValue);
- m_pTransport->setTransportProperty (pcKey, tempvalue);
- delete[]tempvalue;
- }
- else // both "" present
- m_pTransport->setTransportProperty (pcKey, pcValue);
- }
- else
- {
- m_pTransport->setTransportProperty (pcKey, pcValue);
- }
+ {
+ char *tempvalue = new char[strlen (pcValue) + 3];
+ sprintf (tempvalue, "\"%s\"", pcValue);
+ m_pTransport->setTransportProperty (pcKey, tempvalue);
+ delete[]tempvalue;
+ }
+ else if (pcValue && (pcValue[0] != '"')) //starting '"' missing
+ {
+ char *tempvalue = new char[strlen (pcValue) + 2];
+ sprintf (tempvalue, "\"%s", pcValue);
+ m_pTransport->setTransportProperty (pcKey, tempvalue);
+ delete[]tempvalue;
+ }
+ else if (pcValue && (pcValue[strlen (pcValue) - 1] != '"')) // ending '"' missing
+ {
+ char *tempvalue = new char[strlen (pcValue) + 3];
+ sprintf (tempvalue, "\"%s\"", pcValue);
+ m_pTransport->setTransportProperty (pcKey, tempvalue);
+ delete[]tempvalue;
+ }
+ else // both "" present
+ m_pTransport->setTransportProperty (pcKey, pcValue);
+ }
+
+ else
+ {
+ m_pTransport->setTransportProperty (pcKey, pcValue);
+ }
}
}