[Fix] Unmask it

This commit is contained in:
sta 2017-01-06 17:57:11 +09:00
parent 6effadef75
commit a0bfa1f52d

View File

@ -1473,13 +1473,26 @@ namespace WebSocketSharp
private bool processPingFrame (WebSocketFrame frame)
{
var data = frame.PayloadData.ApplicationData;
if (!send (Fin.Final, Opcode.Pong, data, false))
var pong = WebSocketFrame.CreatePongFrame (data, _client);
lock (_forState) {
if (_readyState != WebSocketState.Open) {
_logger.Error ("The state of the connection has been changed.");
return false;
}
if (!sendBytes (pong.ToArray ()))
return false;
}
_logger.Trace ("A pong has been sent to respond to this ping.");
if (_emitOnPing)
if (_emitOnPing) {
if (_client)
pong.Unmask ();
enqueueToMessageEventQueue (new MessageEventArgs (frame));
}
return true;
}