summaryrefslogtreecommitdiff
path: root/cpp/src
diff options
context:
space:
mode:
authorDwayne Boone <dwayne@zeroc.com>2009-05-08 13:48:51 -0230
committerDwayne Boone <dwayne@zeroc.com>2009-05-08 13:48:51 -0230
commitcdc0f62f4fe737454bbb96031695415c4f9be406 (patch)
treeec007ba67d4f0e579becf7c7709137a619b5de8d /cpp/src
parentBug 3966 - deadlock in LocatorInfo (diff)
downloadice-cdc0f62f4fe737454bbb96031695415c4f9be406.tar.bz2
ice-cdc0f62f4fe737454bbb96031695415c4f9be406.tar.xz
ice-cdc0f62f4fe737454bbb96031695415c4f9be406.zip
Bug 3409 - add sequence checking to ruby/python
Diffstat (limited to 'cpp/src')
-rw-r--r--cpp/src/Ice/LocatorInfo.cpp13
-rw-r--r--cpp/src/Ice/StreamI.cpp30
-rw-r--r--cpp/src/Ice/StreamI.h6
-rw-r--r--cpp/src/Slice/PythonUtil.cpp12
-rw-r--r--cpp/src/Slice/RubyUtil.cpp12
5 files changed, 70 insertions, 3 deletions
diff --git a/cpp/src/Ice/LocatorInfo.cpp b/cpp/src/Ice/LocatorInfo.cpp
index 4cd06442f3b..7d866d3da2e 100644
--- a/cpp/src/Ice/LocatorInfo.cpp
+++ b/cpp/src/Ice/LocatorInfo.cpp
@@ -581,7 +581,18 @@ IceInternal::LocatorInfo::getLocatorRegistry()
//
// Do not make locator calls from within sync.
//
- LocatorRegistryPrx locatorRegistry = locator->getRegistry();
+ LocatorRegistryPrx locatorRegistry;
+ try
+ {
+ locatorRegistry = locator->getRegistry();
+ }
+ catch(const Ice::Exception&)
+ {
+ IceUtil::Monitor<IceUtil::Mutex>::Lock sync(*this);
+ notifyAll();
+
+ throw;
+ }
{
IceUtil::Monitor<IceUtil::Mutex>::Lock sync(*this);
diff --git a/cpp/src/Ice/StreamI.cpp b/cpp/src/Ice/StreamI.cpp
index c347c653f5a..0fe3b566473 100644
--- a/cpp/src/Ice/StreamI.cpp
+++ b/cpp/src/Ice/StreamI.cpp
@@ -322,6 +322,36 @@ Ice::InputStreamI::skipSlice()
}
void
+Ice::InputStreamI::startSeq(int numElements, int minSize)
+{
+ _is->startSeq(numElements, minSize);
+}
+
+void
+Ice::InputStreamI::checkSeq()
+{
+ _is->checkSeq();
+}
+
+void
+Ice::InputStreamI::checkFixedSeq(int numElements, int minSize)
+{
+ _is->checkFixedSeq(numElements, minSize);
+}
+
+void
+Ice::InputStreamI::endSeq(int sz)
+{
+ _is->endSeq(sz);
+}
+
+void
+Ice::InputStreamI::endElement()
+{
+ _is->endElement();
+}
+
+void
Ice::InputStreamI::readPendingObjects()
{
_is->readPendingObjects();
diff --git a/cpp/src/Ice/StreamI.h b/cpp/src/Ice/StreamI.h
index 4f5aba6b70f..39dd8dda0bf 100644
--- a/cpp/src/Ice/StreamI.h
+++ b/cpp/src/Ice/StreamI.h
@@ -83,6 +83,12 @@ public:
virtual void skipEncapsulation();
virtual void endEncapsulation();
+ virtual void startSeq(int, int);
+ virtual void checkSeq();
+ virtual void checkFixedSeq(int, int);
+ virtual void endSeq(int);
+ virtual void endElement();
+
virtual void readPendingObjects();
virtual void rewind();
diff --git a/cpp/src/Slice/PythonUtil.cpp b/cpp/src/Slice/PythonUtil.cpp
index 08a1366c68a..67fdd424431 100644
--- a/cpp/src/Slice/PythonUtil.cpp
+++ b/cpp/src/Slice/PythonUtil.cpp
@@ -1235,11 +1235,21 @@ Slice::Python::CodeVisitor::visitSequence(const SequencePtr& p)
}
else
{
+ TypePtr type = p->type();
_out << nl << "_M_" << getAbsolute(p, "_t_") << " = IcePy.defineSequence('" << scoped << "', ";
writeMetaData(metaData);
_out << ", ";
writeType(p->type());
- _out << ")";
+ _out << ", ";
+ if(type->isVariableLength())
+ {
+ _out << "True";
+ }
+ else
+ {
+ _out << "False";
+ }
+ _out << ", " << type->minWireSize() << ")";
}
_out.dec();
}
diff --git a/cpp/src/Slice/RubyUtil.cpp b/cpp/src/Slice/RubyUtil.cpp
index abbb02ddd0f..3efd92320ff 100644
--- a/cpp/src/Slice/RubyUtil.cpp
+++ b/cpp/src/Slice/RubyUtil.cpp
@@ -1106,11 +1106,21 @@ Slice::Ruby::CodeVisitor::visitSequence(const SequencePtr& p)
//
string name = fixIdent(p->name(), IdentToUpper);
string scoped = p->scoped();
+ TypePtr type = p->type();
_out << sp << nl << "if not defined?(" << getAbsolute(p, IdentToUpper, "T_") << ')';
_out.inc();
_out << nl << "T_" << name << " = ::Ice::__defineSequence('" << scoped << "', ";
writeType(p->type());
- _out << ")";
+ _out << ", ";
+ if(type->isVariableLength())
+ {
+ _out << "true";
+ }
+ else
+ {
+ _out << "false";
+ }
+ _out << ", " << type->minWireSize() << ")";
_out.dec();
_out << nl << "end"; // if not defined?()
}