浏览代码

Don't handle payload if server returns masked data (#401)

Mykola Voronin 9 年之前
父节点
当前提交
383c787add
共有 1 个文件被更改,包括 1 次插入0 次删除
  1. 1 0
      SocketRocket/SRWebSocket.m

+ 1 - 0
SocketRocket/SRWebSocket.m

@@ -964,6 +964,7 @@ static const uint8_t SRPayloadLenMask   = 0x7F;
         
         
         if (header.masked) {
         if (header.masked) {
             [self _closeWithProtocolError:@"Client must receive unmasked data"];
             [self _closeWithProtocolError:@"Client must receive unmasked data"];
+            return;
         }
         }
         
         
         size_t extra_bytes_needed = header.masked ? sizeof(_currentReadMaskKey) : 0;
         size_t extra_bytes_needed = header.masked ? sizeof(_currentReadMaskKey) : 0;