Issue #1569 - relaxing WebSocketPolicy.setMax*MessageSize checks

+ Allow setting of the max (binary|text) message size to -1 to
  have unconstrained message sizes.
+ Disconnect message size from buffer size in JSR356 Session calls
This commit is contained in:
Joakim Erdfelt 2017-05-31 13:06:36 -07:00
parent 8d21193931
commit 8ca70c691c
2 changed files with 2 additions and 7 deletions

View File

@ -328,7 +328,6 @@ public class JsrSession extends WebSocketSession implements javax.websocket.Sess
@Override
public void setMaxBinaryMessageBufferSize(int length)
{
getPolicy().setMaxBinaryMessageSize(length);
getPolicy().setMaxBinaryMessageBufferSize(length);
}
@ -342,7 +341,6 @@ public class JsrSession extends WebSocketSession implements javax.websocket.Sess
@Override
public void setMaxTextMessageBufferSize(int length)
{
getPolicy().setMaxTextMessageSize(length);
getPolicy().setMaxTextMessageBufferSize(length);
}

View File

@ -273,9 +273,6 @@ public class WebSocketPolicy
public void setInputBufferSize(int size)
{
assertGreaterThan("InputBufferSize",size,1);
assertLessThan("InputBufferSize",size,"MaxTextMessageBufferSize",maxTextMessageBufferSize);
assertLessThan("InputBufferSize",size,"MaxBinaryMessageBufferSize",maxBinaryMessageBufferSize);
this.inputBufferSize = size;
}
@ -304,7 +301,7 @@ public class WebSocketPolicy
*/
public void setMaxBinaryMessageSize(int size)
{
assertGreaterThan("MaxBinaryMessageSize",size,1);
assertGreaterThan("MaxBinaryMessageSize",size,-1);
this.maxBinaryMessageSize = size;
}
@ -334,7 +331,7 @@ public class WebSocketPolicy
*/
public void setMaxTextMessageSize(int size)
{
assertGreaterThan("MaxTextMessageSize",size,1);
assertGreaterThan("MaxTextMessageSize",size,-1);
this.maxTextMessageSize = size;
}