summaryrefslogtreecommitdiff
path: root/cpp/src/Ice/ProxyFactory.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'cpp/src/Ice/ProxyFactory.cpp')
-rw-r--r--cpp/src/Ice/ProxyFactory.cpp11
1 files changed, 5 insertions, 6 deletions
diff --git a/cpp/src/Ice/ProxyFactory.cpp b/cpp/src/Ice/ProxyFactory.cpp
index eacfce7e27c..10cfc0dcba6 100644
--- a/cpp/src/Ice/ProxyFactory.cpp
+++ b/cpp/src/Ice/ProxyFactory.cpp
@@ -38,18 +38,16 @@ IceInternal::ProxyFactory::proxyToString(const ObjectPrx& proxy)
ObjectPrx
IceInternal::ProxyFactory::streamToProxy(Stream* s)
{
- Stream::Container::iterator i = s->i;
string identity;
s->read(identity);
- if (identity.length() == 0)
+ if (identity.length())
{
- return 0;
+ ReferencePtr reference = new Reference(identity, s);
+ return referenceToProxy(reference);
}
else
{
- s->i = i;
- ReferencePtr reference = new Reference(s);
- return referenceToProxy(reference);
+ return 0;
}
}
@@ -66,6 +64,7 @@ IceInternal::ProxyFactory::proxyToStream(const ObjectPrx& proxy, Stream* s)
{
if (proxy)
{
+ s->write(proxy->__reference()->identity);
proxy->__reference()->streamWrite(s);
}
else