| @@ 230-237 (lines=8) @@ | ||
| 227 | $this->onUdpPacket($this->read($this->getInputLength())); |
|
| 228 | return; |
|
| 229 | } |
|
| 230 | if ($this->state === self::STATE_ROOT) { |
|
| 231 | if (false === ($hdr = $this->readExact(2))) { |
|
| 232 | return; // not enough data |
|
| 233 | } |
|
| 234 | $this->pctSize = Binary::bytes2int($hdr); |
|
| 235 | $this->setWatermark($this->pctSize); |
|
| 236 | $this->state = self::STATE_PACKET; |
|
| 237 | } |
|
| 238 | if ($this->state === self::STATE_PACKET) { |
|
| 239 | if (false === ($pct = $this->readExact($this->pctSize))) { |
|
| 240 | return; // not enough data |
|
| @@ 238-246 (lines=9) @@ | ||
| 235 | $this->setWatermark($this->pctSize); |
|
| 236 | $this->state = self::STATE_PACKET; |
|
| 237 | } |
|
| 238 | if ($this->state === self::STATE_PACKET) { |
|
| 239 | if (false === ($pct = $this->readExact($this->pctSize))) { |
|
| 240 | return; // not enough data |
|
| 241 | } |
|
| 242 | $this->state = self::STATE_ROOT; |
|
| 243 | $this->setWatermark(2); |
|
| 244 | $this->onUdpPacket($pct); |
|
| 245 | return; |
|
| 246 | } |
|
| 247 | goto start; |
|
| 248 | } |
|
| 249 | ||