Bug 711205: Limit websocket outbound msg size to PR_INT32_MAX. r=mcmanus

This commit is contained in:
Jason Duell 2011-12-20 00:20:12 -08:00
parent a1f113cf0d
commit 289afd9b5c

View File

@ -2373,6 +2373,11 @@ WebSocketChannel::SendMsgCommon(const nsACString *aMsg, bool aIsBinary,
return NS_ERROR_NOT_CONNECTED;
}
if (aLength > mMaxMessageSize) {
LOG(("WebSocketChannel:: Error: message too big\n"));
return NS_ERROR_FILE_TOO_BIG;
}
return mSocketThread->Dispatch(
aStream ? new OutboundEnqueuer(this, new OutboundMessage(aStream, aLength))
: new OutboundEnqueuer(this,