diff options
author | Benoit Foucher <benoit@zeroc.com> | 2019-10-02 19:21:07 +0200 |
---|---|---|
committer | Benoit Foucher <benoit@zeroc.com> | 2019-10-02 19:21:07 +0200 |
commit | 8fb855336e8f2fdf319c56253fb063f57346e8ad (patch) | |
tree | d87f11865f60178470fe107df05c60a88d5e6ad3 /csharp/src | |
parent | Conditional compilation of TCP transport with Swift builds (diff) | |
download | ice-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 'csharp/src')
-rw-r--r-- | csharp/src/Ice/ConnectionI.cs | 22 |
1 files changed, 12 insertions, 10 deletions
diff --git a/csharp/src/Ice/ConnectionI.cs b/csharp/src/Ice/ConnectionI.cs index 318fe77c562..81c4b9f6f98 100644 --- a/csharp/src/Ice/ConnectionI.cs +++ b/csharp/src/Ice/ConnectionI.cs @@ -1216,6 +1216,15 @@ namespace Ice _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) { @@ -1253,6 +1262,7 @@ namespace Ice { throw new IllegalMessageSizeException(); } + if(size > _messageSizeMax) { Ex.throwMemoryLimitException(size, _messageSizeMax); @@ -2256,6 +2266,8 @@ namespace Ice observerFinishRead(_readStream.getBuffer()); } + _validated = true; + Debug.Assert(_readStream.pos() == Protocol.headerSize); _readStream.pos(0); byte[] m = _readStream.readBlob(4); @@ -2287,8 +2299,6 @@ namespace Ice throw new IllegalMessageSizeException(); } TraceUtil.traceRecv(_readStream, _logger, _traceLevels); - - _validated = true; } } @@ -2579,14 +2589,6 @@ namespace Ice Debug.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 { // |