summaryrefslogtreecommitdiff
path: root/js
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 /js
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 'js')
-rw-r--r--js/src/Ice/ConnectionI.js21
1 files changed, 12 insertions, 9 deletions
diff --git a/js/src/Ice/ConnectionI.js b/js/src/Ice/ConnectionI.js
index 26721eed259..15347c08b67 100644
--- a/js/src/Ice/ConnectionI.js
+++ b/js/src/Ice/ConnectionI.js
@@ -748,6 +748,15 @@ class ConnectionI
Debug.assert(this._readStream.buffer.remaining === 0);
this._readHeader = false;
+ //
+ // 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).
+ //
+ this._validated = true;
+
const pos = this._readStream.pos;
if(pos < Protocol.headerSize)
{
@@ -781,6 +790,7 @@ class ConnectionI
{
throw new Ice.IllegalMessageSizeException();
}
+
if(size > this._messageSizeMax)
{
ExUtil.throwMemoryLimitException(size, this._messageSizeMax);
@@ -1550,6 +1560,8 @@ class ConnectionI
return false;
}
+ this._validated = true;
+
Debug.assert(this._readStream.pos === Protocol.headerSize);
this._readStream.pos = 0;
const m = this._readStream.readBlob(4);
@@ -1576,7 +1588,6 @@ class ConnectionI
throw new Ice.IllegalMessageSizeException();
}
TraceUtil.traceRecv(this._readStream, this._logger, this._traceLevels);
- this._validated = true;
}
}
@@ -1756,14 +1767,6 @@ class ConnectionI
this._readStream.pos = 0;
this._readHeader = true;
- //
- // 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).
- //
- this._validated = true;
-
Debug.assert(info.stream.pos === info.stream.size);
try