synchronized redirectors and using the port.

git-svn-id: https://svn.berlios.de/svnroot/repos/yacy/trunk@1122 6c8d7289-2bf4-0310-a012-ef5d649a1542
This commit is contained in:
allo 2005-11-23 07:37:15 +00:00
parent 85282b1d98
commit 787c368696
3 changed files with 29 additions and 14 deletions

View File

@ -35,9 +35,13 @@ New list:
<input type="submit" name="newlistbutton" value="create">
</td>
<td valign="top" align="right">
<input type="submit" name="activatelistbutton" value="Enable/disable this list"><br>
<!--<input type="submit" name="activatelistbutton" value="Enable/disable this list"><br>
<input type="submit" name="sharelistbutton" value="Share/don't share this list"><br>
<input type="submit" name="dellistbutton" value="Delete this list"><br>
<input type="submit" name="dellistbutton" value="Delete this list"><br>-->
<input type="checkbox" name="proxylist" value="on" />active<br />
<input type="checkbox" name="sharedlist" value="on" />shared<br />
<input type="submit" name="changebutton" value="Change"><br />
<input type="submit" name="dellistbutton" value="Delete this list"><br />
</td>
</tr>
</table>

View File

@ -128,13 +128,22 @@ public class Blacklist_p {
} catch (IOException e) {}
} else if (post.containsKey("activatelistbutton")) {
if( listManager.ListInListslist(BLACKLIST_ACTIVE, filename) ){
listManager.removeListFromListslist(BLACKLIST_ACTIVE, filename);
} else { // inactive list -> enable
listManager.addListToListslist(BLACKLIST_ACTIVE, filename);
}
listManager.reloadBlacklists();
} else if (post.containsKey("changebutton")) {
if (post.containsKey("proxylist")){
if( !(post.get("proxylist").equals("on")) && listManager.ListInListslist(BLACKLIST_ACTIVE, filename) ){
listManager.removeListFromListslist(BLACKLIST_ACTIVE, filename);
} else if ( post.get("proxylist").equals("on") && !(listManager.ListInListslist(BLACKLIST_ACTIVE, filename)) ) { // inactive list -> enable
listManager.addListToListslist(BLACKLIST_ACTIVE, filename);
}
}
if (post.containsKey("sharedlist")){
if( !(post.get("sharedlist").equals("on")) && listManager.ListInListslist(BLACKLIST_SHARED, filename) ){
listManager.removeListFromListslist(BLACKLIST_SHARED, filename);
} else if ( post.get("sharedlist").equals("on") && !(listManager.ListInListslist(BLACKLIST_SHARED, filename)) ) { // inSHARED list -> enable
listManager.addListToListslist(BLACKLIST_SHARED, filename);
}
}
listManager.reloadBlacklists();
} else if (post.containsKey("sharelistbutton")) {
if (listManager.ListInListslist(BLACKLIST_SHARED, filename)) {

View File

@ -355,16 +355,18 @@ public final class httpdProxyHandler extends httpdAbstractHandler implements htt
url = httpHeader.getRequestURL(conProp);
//redirector
if (redirectorEnabled){
redirectorWriter.println(url.toString());
redirectorWriter.flush();
synchronized(redirectorProcess){
redirectorWriter.println(url.toString());
redirectorWriter.flush();
}
String newUrl=redirectorReader.readLine();
url=new URL(newUrl);
conProp.setProperty(httpHeader.CONNECTION_PROP_HOST, url.getHost());
conProp.setProperty(httpHeader.CONNECTION_PROP_HOST, url.getHost()+":"+url.getPort());
conProp.setProperty(httpHeader.CONNECTION_PROP_PATH, url.getPath());
requestHeader.put(httpHeader.HOST, url.getHost());
requestHeader.put(httpHeader.HOST, url.getHost()+":"+url.getPort());
requestHeader.put(httpHeader.CONNECTION_PROP_PATH, url.getPath());
host=url.getHost();
port=url.getPort();//TODO:this does not work.
port=url.getPort();
path=url.getPath();
}
} catch (MalformedURLException e) {