summaryrefslogtreecommitdiff
path: root/cpp/src
diff options
context:
space:
mode:
authorMarc Laukien <marc@zeroc.com>2001-09-09 03:52:35 +0000
committerMarc Laukien <marc@zeroc.com>2001-09-09 03:52:35 +0000
commit479148a990da6e9aaaffd1bf94b242168db6f422 (patch)
tree45bf87df3b36d2d70eede413b5e0188c154825de /cpp/src
parentfixes (diff)
downloadice-479148a990da6e9aaaffd1bf94b242168db6f422.tar.bz2
ice-479148a990da6e9aaaffd1bf94b242168db6f422.tar.xz
ice-479148a990da6e9aaaffd1bf94b242168db6f422.zip
fixes
Diffstat (limited to 'cpp/src')
-rw-r--r--cpp/src/Ice/ProxyFactory.cpp11
-rw-r--r--cpp/src/Ice/Reference.cpp13
-rw-r--r--cpp/src/Ice/Reference.h2
3 files changed, 16 insertions, 10 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
diff --git a/cpp/src/Ice/Reference.cpp b/cpp/src/Ice/Reference.cpp
index 349a5794bb1..8b6d86fe3ce 100644
--- a/cpp/src/Ice/Reference.cpp
+++ b/cpp/src/Ice/Reference.cpp
@@ -180,12 +180,16 @@ IceInternal::Reference::Reference(const InstancePtr& inst, const string& str) :
}
}
-IceInternal::Reference::Reference(Stream* s) :
+IceInternal::Reference::Reference(const string& ident, Stream* s) :
instance(s->instance()),
+ identity(ident),
mode(ModeTwoway),
secure(false)
{
- s->read(const_cast<string&>(identity));
+ //
+ // Don't read the identity here. Operations calling this
+ // constructor read the identity, and pass it as a parameter.
+ //
vector<EndpointPtr>::const_iterator p;
Ice::Int sz;
@@ -217,7 +221,10 @@ IceInternal::Reference::Reference(Stream* s) :
void
IceInternal::Reference::streamWrite(Stream* s) const
{
- s->write(identity);
+ //
+ // Don't write the identity here. Operations calling streamWrite
+ // write the identity.
+ //
vector<EndpointPtr>::const_iterator p;
diff --git a/cpp/src/Ice/Reference.h b/cpp/src/Ice/Reference.h
index 76c9a375546..0fbcd966063 100644
--- a/cpp/src/Ice/Reference.h
+++ b/cpp/src/Ice/Reference.h
@@ -37,7 +37,7 @@ public:
Reference(const InstancePtr&, const std::string&, Mode, bool,
const std::vector<EndpointPtr>&, const std::vector<EndpointPtr>&);
Reference(const InstancePtr&, const std::string&);
- Reference(Stream*);
+ Reference(const std::string&, Stream*);
//
// Marshal the reference