added timeout setting to scanner interface

git-svn-id: https://svn.berlios.de/svnroot/repos/yacy/trunk@7723 6c8d7289-2bf4-0310-a012-ef5d649a1542
pull/1/head
orbiter 14 years ago
parent f0d5ddfa92
commit d326f1486a

@ -46,7 +46,7 @@
<input type="text" name="scanhosts" value="#[scanhosts]#" size="60" maxlength="400" /><br/><br/>
<input type="radio" name="source" id="sourcenet" value="intranet"#(intranet.checked)#:: checked="checked"#(/intranet.checked)# />Full Intranet Scan: #[intranethosts]#<br/>
<input type="checkbox" name="bigrange" />bigrange
timeout: <input type="text" name="timeout" value ="100" size="4"/> ms, <input type="checkbox" name="bigrange" />bigrange
#(intranetHint)#::<div class="info">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Do not use intranet scan results, you are not in an intranet environment!</div>#(/intranetHint)#
</dd>
<dt>Scan Cache</dt>

@ -61,6 +61,9 @@ public class CrawlStartScanner_p {
prop.put("hosts", "");
prop.put("intranet.checked", sb.isIntranetMode() ? 1 : 0);
int timeout = sb.isIntranetMode() ? 200 : 3000;
timeout = post == null ? timeout : post.getInt("timeout", timeout);
// make a scanhosts entry
String hosts = post == null ? "" : post.get("scanhosts", "");
Set<InetAddress> ips = Domains.myIntranetIPs();
@ -108,7 +111,7 @@ public class CrawlStartScanner_p {
if (p >= 0) host = host.substring(0, p);
ia.add(Domains.dnsResolve(host));
}
final Scanner scanner = new Scanner(ia, CONCURRENT_RUNNER, sb.isIntranetMode() ? 100 : 3000);
final Scanner scanner = new Scanner(ia, CONCURRENT_RUNNER, timeout);
if (post.get("scanftp", "").equals("on")) scanner.addFTP(bigrange);
if (post.get("scanhttp", "").equals("on")) scanner.addHTTP(bigrange);
if (post.get("scanhttps", "").equals("on")) scanner.addHTTPS(bigrange);
@ -123,7 +126,7 @@ public class CrawlStartScanner_p {
}
if (post.containsKey("scan") && "intranet".equals(post.get("source", ""))) {
final Scanner scanner = new Scanner(Domains.myIntranetIPs(), CONCURRENT_RUNNER, sb.isIntranetMode() ? 100 : 3000);
final Scanner scanner = new Scanner(Domains.myIntranetIPs(), CONCURRENT_RUNNER, timeout);
if ("on".equals(post.get("scanftp", ""))) scanner.addFTP(bigrange);
if ("on".equals(post.get("scanhttp", ""))) scanner.addHTTP(bigrange);
if ("on".equals(post.get("scanhttps", ""))) scanner.addHTTPS(bigrange);

Loading…
Cancel
Save