summaryrefslogtreecommitdiff
path: root/java-compat
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-compat
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-compat')
-rw-r--r--java-compat/src/Ice/src/main/java/Ice/ConnectionI.java22
1 files changed, 12 insertions, 10 deletions
diff --git a/java-compat/src/Ice/src/main/java/Ice/ConnectionI.java b/java-compat/src/Ice/src/main/java/Ice/ConnectionI.java
index 85d7b141361..bd4879c1ed9 100644
--- a/java-compat/src/Ice/src/main/java/Ice/ConnectionI.java
+++ b/java-compat/src/Ice/src/main/java/Ice/ConnectionI.java
@@ -1138,6 +1138,16 @@ public final class ConnectionI extends IceInternal.EventHandler
{
throw new Ice.IllegalMessageSizeException();
}
+
+ //
+ // 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;
+
if(size > _messageSizeMax)
{
IceInternal.Ex.throwMemoryLimitException(size, _messageSizeMax);
@@ -2283,6 +2293,8 @@ public final class ConnectionI extends IceInternal.EventHandler
observerFinishRead(_readStream.getBuffer());
}
+ _validated = true;
+
assert (_readStream.pos() == IceInternal.Protocol.headerSize);
_readStream.pos(0);
byte[] m = _readStream.readBlob(4);
@@ -2313,8 +2325,6 @@ public final class ConnectionI extends IceInternal.EventHandler
throw new IllegalMessageSizeException();
}
IceInternal.TraceUtil.traceRecv(_readStream, _logger, _traceLevels);
-
- _validated = true;
}
}
@@ -2613,14 +2623,6 @@ public final class ConnectionI extends 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
{
//