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

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