diff options
author | Benoit Foucher <benoit@zeroc.com> | 2014-09-24 12:35:38 +0200 |
---|---|---|
committer | Benoit Foucher <benoit@zeroc.com> | 2014-09-24 12:35:38 +0200 |
commit | c74b14cc8d247109c8a877e4c9b948a9d9143d61 (patch) | |
tree | 87ad62ab9e03e960f6081fd55ec1483774e95a88 /java/src | |
parent | bug fix in IceGrid admin client (diff) | |
download | ice-c74b14cc8d247109c8a877e4c9b948a9d9143d61.tar.bz2 ice-c74b14cc8d247109c8a877e4c9b948a9d9143d61.tar.xz ice-c74b14cc8d247109c8a877e4c9b948a9d9143d61.zip |
Fixed ICE-5535, WSS hang and other minor issues
- ICE-5535: added support for parsing TCP/SSL/WS/WSS endpoints even if the transport isn't supported
- WSS implementation could hang under Java/C# if the SSL transport read too much data
- The opaque endpoint un-marshalling code in Java/C# could raise an EncapsulationException where it should have raised an UnarmshalOutOfBoundsException if the marshalled endpoint was invalid.
- Cleaned up JavaScript run methods for tests
- Few other minor fixes
Diffstat (limited to 'java/src')
-rw-r--r-- | java/src/IceInternal/EndpointFactoryManager.java | 1 | ||||
-rw-r--r-- | java/src/IceInternal/TcpEndpointI.java | 23 | ||||
-rw-r--r-- | java/src/IceInternal/WSEndpoint.java | 4 | ||||
-rw-r--r-- | java/src/IceInternal/WSTransceiver.java | 2 | ||||
-rw-r--r-- | java/src/IceSSL/EndpointI.java | 21 |
5 files changed, 9 insertions, 42 deletions
diff --git a/java/src/IceInternal/EndpointFactoryManager.java b/java/src/IceInternal/EndpointFactoryManager.java index 64fd927c771..a0b2b1511d2 100644 --- a/java/src/IceInternal/EndpointFactoryManager.java +++ b/java/src/IceInternal/EndpointFactoryManager.java @@ -132,6 +132,7 @@ public final class EndpointFactoryManager ue.streamWrite(bs); Buffer buf = bs.getBuffer(); buf.b.position(0); + buf.b.limit(buf.size()); bs.readShort(); // type bs.startReadEncaps(); EndpointI e = factory.read(bs); diff --git a/java/src/IceInternal/TcpEndpointI.java b/java/src/IceInternal/TcpEndpointI.java index 4f8fa51c9ac..3e35321ecc2 100644 --- a/java/src/IceInternal/TcpEndpointI.java +++ b/java/src/IceInternal/TcpEndpointI.java @@ -22,7 +22,7 @@ final class TcpEndpointI extends IPEndpointI public TcpEndpointI(ProtocolInstance instance) { super(instance); - _timeout = -2; + _timeout = _instance.defaultTimeout(); _compress = false; } @@ -252,23 +252,8 @@ final class TcpEndpointI extends IPEndpointI public void fillEndpointInfo(Ice.IPEndpointInfo info) { super.fillEndpointInfo(info); - if(info instanceof Ice.TCPEndpointInfo) - { - Ice.TCPEndpointInfo tcpInfo = (Ice.TCPEndpointInfo)info; - tcpInfo.timeout = _timeout; - tcpInfo.compress = _compress; - } - } - - @Override - public void initWithOptions(java.util.ArrayList<String> args, boolean oaEndpoint) - { - super.initWithOptions(args, oaEndpoint); - - if(_timeout == -2) - { - _timeout = _instance.defaultTimeout(); - } + info.timeout = _timeout; + info.compress = _compress; } @Override @@ -300,7 +285,7 @@ final class TcpEndpointI extends IPEndpointI if(_timeout < 1) { throw new Ice.EndpointParseException("invalid timeout value `" + argument + - "' in endpoint " + endpoint); + "' in endpoint " + endpoint); } } catch(NumberFormatException ex) diff --git a/java/src/IceInternal/WSEndpoint.java b/java/src/IceInternal/WSEndpoint.java index 14f64906f42..f8f248beb00 100644 --- a/java/src/IceInternal/WSEndpoint.java +++ b/java/src/IceInternal/WSEndpoint.java @@ -35,7 +35,6 @@ final class WSEndpoint extends IceInternal.EndpointI { _instance = instance; _delegate = (IPEndpointI)del; - _resource = s.readString(); } @@ -62,9 +61,6 @@ final class WSEndpoint extends IceInternal.EndpointI return WSEndpoint.this.secure(); } }; - - info.timeout = _delegate.timeout(); - info.compress = _delegate.compress(); _delegate.fillEndpointInfo(info); info.resource = _resource; return info; diff --git a/java/src/IceInternal/WSTransceiver.java b/java/src/IceInternal/WSTransceiver.java index 8cf6b96813e..93b7f18b78c 100644 --- a/java/src/IceInternal/WSTransceiver.java +++ b/java/src/IceInternal/WSTransceiver.java @@ -427,7 +427,7 @@ final class WSTransceiver implements Transceiver } while(postRead(buf)); - moreData.value = _readBufferPos < _readBuffer.b.position(); + moreData.value |= _readBufferPos < _readBuffer.b.position(); s = !buf.b.hasRemaining() ? SocketOperation.None : SocketOperation.Read; diff --git a/java/src/IceSSL/EndpointI.java b/java/src/IceSSL/EndpointI.java index cce1479e1ff..6fe9416d166 100644 --- a/java/src/IceSSL/EndpointI.java +++ b/java/src/IceSSL/EndpointI.java @@ -24,7 +24,7 @@ final class EndpointI extends IceInternal.IPEndpointI { super(instance); _instance = instance; - _timeout = -2; + _timeout = instance.defaultTimeout(); _compress = false; } @@ -256,23 +256,8 @@ final class EndpointI extends IceInternal.IPEndpointI public void fillEndpointInfo(Ice.IPEndpointInfo info) { super.fillEndpointInfo(info); - if(info instanceof IceSSL.EndpointInfo) - { - IceSSL.EndpointInfo sslInfo = (IceSSL.EndpointInfo)info; - sslInfo.timeout = _timeout; - sslInfo.compress = _compress; - } - } - - @Override - public void initWithOptions(java.util.ArrayList<String> args, boolean oaEndpoint) - { - super.initWithOptions(args, oaEndpoint); - - if(_timeout == -2) - { - _timeout = _instance.defaultTimeout(); - } + info.timeout = _timeout; + info.compress = _compress; } @Override |