Permalink
Browse files

Revert "[WebSocket] Frame concatenation"

This reverts commit 53354cd.
  • Loading branch information...
1 parent 53354cd commit d4ee8f9b1a0fee90a593d08053f69ff3f8489cef @cboden cboden committed Jun 7, 2012
View
4 src/Ratchet/WebSocket/Version/Hixie76/Frame.php
@@ -75,8 +75,4 @@ public function getPayload() {
return substr($this->_data, 1, strlen($this->_data) - 2);
}
-
- public function extractOverflow() {
- return '';
- }
}
View
24 src/Ratchet/WebSocket/Version/RFC6455/Frame.php
@@ -38,7 +38,7 @@ public function isCoalesced() {
return false;
}
- return $this->_bytes_rec >= $payload_length + $payload_start;
+ return $payload_length + $payload_start === $this->_bytes_rec;
}
/**
@@ -223,26 +223,4 @@ public function getPayload() {
return $payload;
}
-
- /**
- * Sometimes clients will concatinate more than one frame over the wire
- * This method will take the extra bytes off the end and return them
- * @todo Consider returning new Frame
- * @return string
- */
- public function extractOverflow() {
- if ($this->isCoalesced()) {
- $endPoint = $this->getPayloadLength();
- $endPoint += $this->getPayloadStartingByte();
-
- if ($this->_bytes_rec > $endPoint) {
- $overflow = substr($this->_data, $endPoint);
- $this->_data = substr($this->_data, 0, $endPoint);
-
- return $overflow;
- }
- }
-
- return '';
- }
}
View
3 src/Ratchet/WebSocket/WsServer.php
@@ -122,10 +122,7 @@ public function onMessage(ConnectionInterface $from, $msg) {
// Control frames (ping, pong, close) can be sent in between a fragmented message
$from->WebSocket->message->addFrame($from->WebSocket->frame);
- $nextFrame = $from->WebSocket->version->newFrame();
- $nextFrame->addBuffer($from->WebSocket->frame->extractOverflow());
unset($from->WebSocket->frame);
- $from->WebSocket->frame = $nextFrame;
}
if ($from->WebSocket->message->isCoalesced()) {

0 comments on commit d4ee8f9

Please sign in to comment.