bug 715284 WebSocketChannel.cpp compiler warning r=jduell
authorPatrick McManus <mcmanus@ducksong.com>
Wed, 04 Jan 2012 18:19:15 -0500
changeset 85047 00a4148fad8255e1511cca233dd4e7ce32e53f9a
parent 85046 f6f8a1cd6702c23881c2c7025b52f017b2115007
child 85048 b48ad2fa617881de9c85bdcc5f25e95b29a464fb
push id805
push userakeybl@mozilla.com
push dateWed, 01 Feb 2012 18:17:35 +0000
treeherdermozilla-aurora@6fb3bf232436 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersjduell
bugs715284
milestone12.0a1
bug 715284 WebSocketChannel.cpp compiler warning r=jduell
netwerk/protocol/websocket/WebSocketChannel.cpp
--- a/netwerk/protocol/websocket/WebSocketChannel.cpp
+++ b/netwerk/protocol/websocket/WebSocketChannel.cpp
@@ -2368,17 +2368,18 @@ WebSocketChannel::SendMsgCommon(const ns
     return NS_ERROR_UNEXPECTED;
   }
 
   if (mStopped) {
     LOG(("WebSocketChannel:: Error: send when stopped\n"));
     return NS_ERROR_NOT_CONNECTED;
   }
 
-  if (aLength > mMaxMessageSize) {
+  NS_ABORT_IF_FALSE(mMaxMessageSize >= 0, "max message size negative");
+  if (aLength > static_cast<PRUint32>(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,
                      new OutboundMessage(aIsBinary ? kMsgTypeBinaryString