@@ -111,7 +111,6 @@ WebSocketFrame.prototype.addData = function(bufferList, fragmentationType) {
111111 if ( bufferList . length >= 4 ) {
112112 bufferList . joinInto ( this . maskBytes , 0 , 0 , 4 ) ;
113113 bufferList . advance ( 4 ) ;
114- this . maskPos = 0 ;
115114 this . parseState = WAITING_FOR_PAYLOAD ;
116115 }
117116 }
@@ -137,7 +136,7 @@ WebSocketFrame.prototype.addData = function(bufferList, fragmentationType) {
137136 this . binaryPayload = bufferList . take ( this . length ) ;
138137 bufferList . advance ( this . length ) ;
139138 if ( this . mask ) {
140- this . maskPos = xor ( this . binaryPayload , this . maskBytes , 0 ) ;
139+ xor ( this . binaryPayload , this . maskBytes , 0 ) ;
141140 }
142141
143142 if ( this . opcode === 0x08 ) { // WebSocketOpcode.CONNECTION_CLOSE
@@ -259,14 +258,13 @@ WebSocketFrame.prototype.toBuffer = function(nullMask) {
259258 maskKey = 0x00000000 ;
260259 }
261260 ctio . wuint32 ( maskKey , 'big' , this . maskBytes , 0 ) ;
262- this . maskPos = 0 ;
263261
264262 // write the mask key
265263 this . maskBytes . copy ( output , outputPos ) ;
266264 outputPos += 4 ;
267265
268266 data . copy ( output , outputPos ) ;
269- this . maskPos = xor ( output . slice ( outputPos ) , this . maskBytes , this . maskPos ) ;
267+ xor ( output . slice ( outputPos ) , this . maskBytes , 0 ) ;
270268 }
271269 else {
272270 data . copy ( output , outputPos ) ;
0 commit comments