You are viewing a plain text version of this content. The canonical link for it is here.
Posted to java-dev@axis.apache.org by sa...@apache.org on 2005/06/20 10:23:55 UTC
cvs commit: ws-axis/c/src/soap HeaderBlock.cpp
samisa 2005/06/20 01:23:55
Modified: c/src/soap HeaderBlock.cpp
Log:
Fixed the problem of allowing duplicate attibutes in createStdAttribute()
AXISCPP-452
Revision Changes Path
1.65 +18 -0 ws-axis/c/src/soap/HeaderBlock.cpp
Index: HeaderBlock.cpp
===================================================================
RCS file: /home/cvs/ws-axis/c/src/soap/HeaderBlock.cpp,v
retrieving revision 1.64
retrieving revision 1.65
diff -u -r1.64 -r1.65
--- HeaderBlock.cpp 9 Jun 2005 05:05:54 -0000 1.64
+++ HeaderBlock.cpp 20 Jun 2005 08:23:54 -0000 1.65
@@ -691,6 +691,24 @@
if (blnStatus)
{
+ // Samisa: AXISCPP-452 - got to check for duplicate attributes
+ list<Attribute*>::iterator itAttr = m_attributes.begin();
+ while (itAttr != m_attributes.end())
+ {
+ Attribute* pCurrentAttribute = *itAttr;
+ if (!strcmp(pCurrentAttribute->getLocalName(),pAttribute->getLocalName() ) &&
+ !strcmp(pCurrentAttribute->getPrefix(), pAttribute->getPrefix() ) )
+ {
+ // we have the attribute set already, so only change the value
+ pCurrentAttribute->setValue( pAttribute->getValue() );
+ delete pAttribute;
+ return pCurrentAttribute; // return the currently set attributes pointer
+ // job done
+ }
+ itAttr++;
+ }
+
+ // we do not have the attribute set already, hence add it
m_attributes.push_back(pAttribute);
return pAttribute;
}