summaryrefslogtreecommitdiff
path: root/java
diff options
context:
space:
mode:
authorBenoit Foucher <benoit@zeroc.com>2019-10-02 19:21:07 +0200
committerBenoit Foucher <benoit@zeroc.com>2019-10-02 19:21:07 +0200
commit8fb855336e8f2fdf319c56253fb063f57346e8ad (patch)
treed87f11865f60178470fe107df05c60a88d5e6ad3 /java
parentConditional compilation of TCP transport with Swift builds (diff)
downloadice-8fb855336e8f2fdf319c56253fb063f57346e8ad.tar.bz2
ice-8fb855336e8f2fdf319c56253fb063f57346e8ad.tar.xz
ice-8fb855336e8f2fdf319c56253fb063f57346e8ad.zip
The Ice connection will now print warnings for first invalid messages received by a client, fixes #565
Diffstat (limited to 'java')
-rw-r--r--java/src/Ice/src/main/java/com/zeroc/Ice/ConnectionI.java22
1 files changed, 12 insertions, 10 deletions
diff --git a/java/src/Ice/src/main/java/com/zeroc/Ice/ConnectionI.java b/java/src/Ice/src/main/java/com/zeroc/Ice/ConnectionI.java
index 5b3fd3292ce..55edfa597f5 100644
--- a/java/src/Ice/src/main/java/com/zeroc/Ice/ConnectionI.java
+++ b/java/src/Ice/src/main/java/com/zeroc/Ice/ConnectionI.java
@@ -1007,6 +1007,15 @@ public final class ConnectionI extends com.zeroc.IceInternal.EventHandler
_observer.receivedBytes(Protocol.headerSize);
}
+ //
+ // Connection is validated on first message. This is only used by
+ // setState() to check wether or not we can print a connection
+ // warning (a client might close the connection forcefully if the
+ // connection isn't validated, we don't want to print a warning
+ // in this case).
+ //
+ _validated = true;
+
int pos = _readStream.pos();
if(pos < Protocol.headerSize)
{
@@ -1045,6 +1054,7 @@ public final class ConnectionI extends com.zeroc.IceInternal.EventHandler
{
throw new IllegalMessageSizeException();
}
+
if(size > _messageSizeMax)
{
com.zeroc.IceInternal.Ex.throwMemoryLimitException(size, _messageSizeMax);
@@ -2195,6 +2205,8 @@ public final class ConnectionI extends com.zeroc.IceInternal.EventHandler
observerFinishRead(_readStream.getBuffer());
}
+ _validated = true;
+
assert (_readStream.pos() == Protocol.headerSize);
_readStream.pos(0);
byte[] m = _readStream.readBlob(4);
@@ -2225,8 +2237,6 @@ public final class ConnectionI extends com.zeroc.IceInternal.EventHandler
throw new IllegalMessageSizeException();
}
TraceUtil.traceRecv(_readStream, _logger, _traceLevels);
-
- _validated = true;
}
}
@@ -2521,14 +2531,6 @@ public final class ConnectionI extends com.zeroc.IceInternal.EventHandler
assert (info.stream.pos() == info.stream.size());
- //
- // Connection is validated on first message. This is only used by
- // setState() to check wether or not we can print a connection
- // warning (a client might close the connection forcefully if the
- // connection isn't validated).
- //
- _validated = true;
-
try
{
//