Skip to content

Commit

Permalink
synchronized redirectors and using the port.
Browse files Browse the repository at this point in the history
git-svn-id: https://svn.berlios.de/svnroot/repos/yacy/trunk@1122 6c8d7289-2bf4-0310-a012-ef5d649a1542
  • Loading branch information
allo committed Nov 23, 2005
1 parent 85282b1 commit 787c368
Show file tree
Hide file tree
Showing 3 changed files with 29 additions and 14 deletions.
8 changes: 6 additions & 2 deletions htroot/Blacklist_p.html
Expand Up @@ -35,9 +35,13 @@ <h2>Blacklist</h2>
<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>
Expand Down
23 changes: 16 additions & 7 deletions htroot/Blacklist_p.java
Expand Up @@ -128,13 +128,22 @@ public static serverObjects respond(httpHeader header, serverObjects post, serve
} 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)) {
Expand Down
12 changes: 7 additions & 5 deletions source/de/anomic/http/httpdProxyHandler.java
Expand Up @@ -355,16 +355,18 @@ public void doGet(Properties conProp, httpHeader requestHeader, OutputStream res
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) {
Expand Down

0 comments on commit 787c368

Please sign in to comment.