Code Duplication    Length = 16-16 lines in 2 locations

PHPDaemon/Servers/HTTP/Connection.php 1 location

@@ 227-242 (lines=16) @@
224
	 * @return void
225
	 */
226
	protected function onRead() {
227
		if (!$this->policyReqNotFound) {
228
			$d = $this->drainIfMatch("<policy-file-request/>\x00");
229
			if ($d === null) { // partially match
230
				return;
231
			}
232
			if ($d) {
233
				if (($FP = \PHPDaemon\Servers\FlashPolicy\Pool::getInstance($this->pool->config->fpsname->value, false)) && $FP->policyData) {
234
					$this->write($FP->policyData . "\x00");
235
				}
236
				$this->finish();
237
				return;
238
			}
239
			else {
240
				$this->policyReqNotFound = true;
241
			}
242
		}
243
		start:
244
		if ($this->finished) {
245
			return;

PHPDaemon/Servers/WebSocket/Connection.php 1 location

@@ 343-358 (lines=16) @@
340
	 * @return void
341
	 */
342
	protected function onRead() {
343
		if (!$this->policyReqNotFound) {
344
			$d = $this->drainIfMatch("<policy-file-request/>\x00");
345
			if ($d === null) { // partially match
346
				return;
347
			}
348
			if ($d) {
349
				if (($FP = \PHPDaemon\Servers\FlashPolicy\Pool::getInstance($this->pool->config->fpsname->value, false)) && $FP->policyData) {
350
					$this->write($FP->policyData . "\x00");
351
				}
352
				$this->finish();
353
				return;
354
			}
355
			else {
356
				$this->policyReqNotFound = true;
357
			}
358
		}
359
		start:
360
		if ($this->finished) {
361
			return;