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

@@ 328-343 (lines=16) @@
325
	 * @return void
326
	 */
327
	protected function onRead() {
328
		if (!$this->policyReqNotFound) {
329
			$d = $this->drainIfMatch("<policy-file-request/>\x00");
330
			if ($d === null) { // partially match
331
				return;
332
			}
333
			if ($d) {
334
				if (($FP = \PHPDaemon\Servers\FlashPolicy\Pool::getInstance($this->pool->config->fpsname->value, false)) && $FP->policyData) {
335
					$this->write($FP->policyData . "\x00");
336
				}
337
				$this->finish();
338
				return;
339
			}
340
			else {
341
				$this->policyReqNotFound = true;
342
			}
343
		}
344
		start:
345
		if ($this->finished) {
346
			return;