From 67d96249b45b33acc03559dc27bddaa3b02426e6 Mon Sep 17 00:00:00 2001 From: karlchenofhell Date: Tue, 13 Feb 2007 21:17:43 +0000 Subject: [PATCH] - fix for last commit git-svn-id: https://svn.berlios.de/svnroot/repos/yacy/trunk@3366 6c8d7289-2bf4-0310-a012-ef5d649a1542 --- htroot/CrawlURLFetch_p.html | 39 ++++++++++++++++++------------- htroot/CrawlURLFetch_p.java | 46 +++++++++++++++++++++++-------------- 2 files changed, 52 insertions(+), 33 deletions(-) diff --git a/htroot/CrawlURLFetch_p.html b/htroot/CrawlURLFetch_p.html index 8548f2880..877153d5e 100644 --- a/htroot/CrawlURLFetch_p.html +++ b/htroot/CrawlURLFetch_p.html @@ -12,18 +12,22 @@

The newly added URLs will be crawled without any filter restricions except of the static stop-words. The Re-Crawl option isn't used and the sites won't be stored in the Proxy Cache. Text and media types will be indexed. - Since these URLs are explicitely requested from another peer, they won't be distributed for remote indexing. + Since these URLs will be requested explicitely from another peer, they won't be distributed for remote indexing.

:
- #(saved)#::
- Or select previously entered URL: #(/saved)# #(hostError)#:: Malformed URL#(/hostError)# + #(saved)#:: +
+
:
+
+ + #(/saved)#
#(peersKnown)#:: @@ -56,36 +60,39 @@
- - #(threadError)#:: - Error on stopping thread, it isn't alive anymore:: - Error on restarting thread, it isn't alive anymore#(/threadError)# - - #(runs)#:: + + + #(threadError)#:: + Error on stopping thread, it isn't alive anymore:: + Error on restarting thread, it isn't alive anymore#(/threadError)# + + #(runs)#:: +
Thread to fetch URLs is #(status)#running::stopped::paused#(/status)#
Total runs:
#[totalRuns]#
-
Last run duration:
#[lastRun]#
-
Last server response:
#[lastServerResponse]#
Total fetched URLs:
#[totalFetchedURLs]#
Total failed URLs:
#[totalFailedURLs]#
+
Last run duration:
#[lastRun]# ms
+
Last server response:
#[lastServerResponse]#
Last fetched URLs:
#[lastFetchedURLs]#
Failed URLs:
#[error]#
    #{error}# -
  • #[reason]#: #[url]#
  • #{/error}# +
  • #[reason]#: #[url]#
  • #{/error}#
#(status)# :: :: - #(/status)# + + #(/status)#
- #(/runs)#
+ #(/runs)# #%env/templates/footer.template%# \ No newline at end of file diff --git a/htroot/CrawlURLFetch_p.java b/htroot/CrawlURLFetch_p.java index 939d9a7fc..ec4c7ee5e 100644 --- a/htroot/CrawlURLFetch_p.java +++ b/htroot/CrawlURLFetch_p.java @@ -74,6 +74,7 @@ public class CrawlURLFetch_p { } } + if (fetcher != null) fetcher.interrupt(); fetcher = null; if (post.get("source", "").equals("peer") && post.get("peerhash", "").equals("random")) { @@ -93,6 +94,12 @@ public class CrawlURLFetch_p { prop.put("host", post.get("host", "")); prop.put("hostError", ERR_HOST_MALFORMED_URL); } + } else if (post.get("source", "").equals("savedURL")) { + try { + url = new URL(post.get("saved", "")); + } catch (MalformedURLException e) { + /* should never appear, except for invalid input, see above */ + } } else if (post.get("source", "").equals("peer")) { yacySeed ys = null; try { @@ -128,8 +135,9 @@ public class CrawlURLFetch_p { prop.put("threadError", ERR_THREAD_STOP); } } - else if (post.containsKey("restart") || post.containsKey("resume")) { + else if (post.containsKey("restart")) { if (fetcher != null) { + fetcher.interrupt(); if (fetcher.url == null) { fetcher = new URLFetcher( env, @@ -151,8 +159,9 @@ public class CrawlURLFetch_p { if (fetcher != null) { prop.put("runs", 1); - prop.put("runs_status", (fetcher.isAlive()) ? STAT_THREAD_ALIVE : - (fetcher.paused) ? STAT_THREAD_PAUSED : STAT_THREAD_STOPPED); + prop.put("runs_status", + ((fetcher.paused && fetcher.isAlive()) ? STAT_THREAD_PAUSED : + (fetcher.isAlive()) ? STAT_THREAD_ALIVE : STAT_THREAD_STOPPED)); prop.put("runs_totalRuns", URLFetcher.totalRuns); prop.put("runs_totalFetchedURLs", URLFetcher.totalFetchedURLs); prop.put("runs_totalFailedURLs", URLFetcher.totalFailed); @@ -180,7 +189,7 @@ public class CrawlURLFetch_p { if (savedURLs.size() == 0) return 0; prop.put("saved", 1); for (int i=0; i