diff options
author | Marc Laukien <marc@zeroc.com> | 2003-03-23 01:05:24 +0000 |
---|---|---|
committer | Marc Laukien <marc@zeroc.com> | 2003-03-23 01:05:24 +0000 |
commit | 03c2097ec53c0e66f678834415c959beb250a754 (patch) | |
tree | ea0142fa0ae4324cfe565c83c43d4275f47c380f /java/src | |
parent | fix (diff) | |
download | ice-03c2097ec53c0e66f678834415c959beb250a754.tar.bz2 ice-03c2097ec53c0e66f678834415c959beb250a754.tar.xz ice-03c2097ec53c0e66f678834415c959beb250a754.zip |
incoming fix
Diffstat (limited to 'java/src')
-rw-r--r-- | java/src/IceInternal/BasicStream.java | 2 | ||||
-rw-r--r-- | java/src/IceInternal/IncomingBase.java | 60 |
2 files changed, 54 insertions, 8 deletions
diff --git a/java/src/IceInternal/BasicStream.java b/java/src/IceInternal/BasicStream.java index 0efca332c3d..f3de57ca0c9 100644 --- a/java/src/IceInternal/BasicStream.java +++ b/java/src/IceInternal/BasicStream.java @@ -895,8 +895,6 @@ public class BasicStream readStringSeq() { final int sz = readSize(); - // Don't use v.resize(sz) or v.reserve(sz) here, as it cannot be - // checked whether sz is a reasonable value String[] v = new String[sz]; for(int i = 0; i < sz; i++) { diff --git a/java/src/IceInternal/IncomingBase.java b/java/src/IceInternal/IncomingBase.java index c03e9dfc5e3..481cbd73d1f 100644 --- a/java/src/IceInternal/IncomingBase.java +++ b/java/src/IceInternal/IncomingBase.java @@ -22,11 +22,17 @@ public class IncomingBase _current = new Ice.Current(); _current.id = new Ice.Identity(); _current.adapter = adapter; + _cookie = new Ice.LocalObjectHolder(); + _response = response; + _compress = compress; + _is = new BasicStream(instance); + _os = new BasicStream(instance); + _connection = connection; } @@ -34,15 +40,31 @@ public class IncomingBase IncomingBase(IncomingBase in) // Adopts the argument. It must not be used afterwards. { _current = in._current; + in._current = null; + _servant = in._servant; + in._servant = null; + _locator = in._locator; + in._locator = null; + _cookie = in._cookie; + in._cookie = null; + _response = in._response; + in._response = false; + + _compress = in._compress; + in._compress = 0; + _is = in._is; in._is = null; + _os = in._os; in._os = null; + _connection = in._connection; + in._connection = null; } // @@ -52,16 +74,40 @@ public class IncomingBase public void reset(Instance instance, Connection connection, Ice.ObjectAdapter adapter, boolean response, byte compress) { - _current.adapter = adapter; - if(_current.ctx != null) - { - _current.ctx.clear(); - } + if(_current == null) + { + _current = new Ice.Current(); + _current.id = new Ice.Identity(); + _current.adapter = adapter; + } + else + { + assert(_current.id != null); + _current.adapter = adapter; + + if(_current.ctx != null) + { + _current.ctx.clear(); + } + } + _servant = null; + _locator = null; - _cookie.value = null; + + if(_cookie == null) + { + _cookie = new Ice.LocalObjectHolder(); + } + else + { + _cookie.value = null; + } + _response = response; + _compress = compress; + if(_is == null) { _is = new BasicStream(instance); @@ -70,6 +116,7 @@ public class IncomingBase { _is.reset(); } + if(_os == null) { _os = new BasicStream(instance); @@ -78,6 +125,7 @@ public class IncomingBase { _os.reset(); } + _connection = connection; } |