Minor cleanups

This commit is contained in:
Chris Boden 2012-05-21 13:16:33 -04:00
parent bf808d4c61
commit 0caa6e814b
3 changed files with 4 additions and 14 deletions

View File

@ -15,6 +15,8 @@ class MessageParser {
$from->WebSocket->frame->addBuffer($data);
if ($from->WebSocket->frame->isCoalesced()) {
if ($from->WebSocket->frame->getOpcode() > 2) {
// take action on the control frame
unset($from->WebSocket->frame);
return;

View File

@ -35,7 +35,6 @@ class Message implements MessageInterface {
/**
* {@inheritdoc}
* @todo Should I allow addFrame if the frame is not coalesced yet? I believe I'm assuming this class will only receive fully formed frame messages
* @todo Also, I should perhaps check the type...control frames (ping/pong/close) are not to be considered part of a message
*/
public function addFrame(FrameInterface $fragment) {

View File

@ -17,6 +17,7 @@ class WsServer implements MessageComponentInterface {
* Negotiates upgrading the HTTP connection to a WebSocket connection
* It contains useful configuration properties and methods
* @var HandshakeNegotiator
* @note May not expose this in the future, may do through facade methods
*/
public $handshaker;
@ -36,18 +37,6 @@ class WsServer implements MessageComponentInterface {
*/
protected $messager;
/**
* Re-entrant instances of protocol version classes
* @internal
*/
protected $_versions = array(
'HyBi10' => null
, 'Hixie76' => null
, 'RFC6455' => null
);
protected $_mask_payload = false;
/**
* For now, array_push accepted subprotocols to this array
* @deprecated
@ -177,6 +166,6 @@ class WsServer implements MessageComponentInterface {
}
}
return substr($string, 0, -1);
return mb_substr($string, 0, -1, 'ASCII');
}
}