protected function _recursiveScan($url, $referer = null)
    {
        $response = $this->_singleScan($url, $referer);

        if (!$response) {
            return;
        }

        //Returns, if the maximum scanning depth has been reached
        if ($this->getConfig('maxDepth') && ++$this->currentDepth >= $this->getConfig('maxDepth')) {
            return;
        }

        //Returns, if the response is not ok
        if (!$response->isOk()) {
            $this->dispatchEvent('LinkScanner.responseNotOk', [$url]);

            return;
        }

        //Continues scanning for the links found
        foreach ((new BodyParser($response->getBody(), $url))->extractLinks() as $link) {
            if (!$this->canBeScanned($link)) {
                continue;
            }
            $this->dispatchEvent('LinkScanner.foundLinkToBeScanned', [$link]);

            //Single scan for external links, recursive scan for internal links
            call_user_func_array([$this, is_external_url($link, $this->hostname) ? '_singleScan' : __METHOD__], [$link, $url]);
        }
    }