|
|
@ -322,7 +322,7 @@ public final class httpdProxyHandler extends httpdAbstractHandler implements htt
|
|
|
|
|
|
|
|
|
|
|
|
try {
|
|
|
|
try {
|
|
|
|
// remembering the starting time of the request
|
|
|
|
// remembering the starting time of the request
|
|
|
|
Date requestDate = new Date(); // remember the time...
|
|
|
|
final Date requestDate = new Date(); // remember the time...
|
|
|
|
this.connectionProperties.put(httpHeader.CONNECTION_PROP_REQUEST_START,new Long(requestDate.getTime()));
|
|
|
|
this.connectionProperties.put(httpHeader.CONNECTION_PROP_REQUEST_START,new Long(requestDate.getTime()));
|
|
|
|
if (yacyTrigger) de.anomic.yacy.yacyCore.triggerOnlineAction();
|
|
|
|
if (yacyTrigger) de.anomic.yacy.yacyCore.triggerOnlineAction();
|
|
|
|
switchboard.proxyLastAccess = System.currentTimeMillis();
|
|
|
|
switchboard.proxyLastAccess = System.currentTimeMillis();
|
|
|
@ -330,6 +330,19 @@ public final class httpdProxyHandler extends httpdAbstractHandler implements htt
|
|
|
|
// using an ByteCount OutputStream to count the send bytes (needed for the logfile)
|
|
|
|
// using an ByteCount OutputStream to count the send bytes (needed for the logfile)
|
|
|
|
respond = new httpdByteCountOutputStream(respond,conProp.getProperty(httpHeader.CONNECTION_PROP_REQUESTLINE).length() + 2);
|
|
|
|
respond = new httpdByteCountOutputStream(respond,conProp.getProperty(httpHeader.CONNECTION_PROP_REQUESTLINE).length() + 2);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
String host = conProp.getProperty(httpHeader.CONNECTION_PROP_HOST);
|
|
|
|
|
|
|
|
final String path = conProp.getProperty(httpHeader.CONNECTION_PROP_PATH); // always starts with leading '/'
|
|
|
|
|
|
|
|
final String args = conProp.getProperty(httpHeader.CONNECTION_PROP_ARGS); // may be null if no args were given
|
|
|
|
|
|
|
|
final String ip = conProp.getProperty(httpHeader.CONNECTION_PROP_CLIENTIP); // the ip from the connecting peer
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
int port, pos;
|
|
|
|
|
|
|
|
if ((pos = host.indexOf(":")) < 0) {
|
|
|
|
|
|
|
|
port = 80;
|
|
|
|
|
|
|
|
} else {
|
|
|
|
|
|
|
|
port = Integer.parseInt(host.substring(pos + 1));
|
|
|
|
|
|
|
|
host = host.substring(0, pos);
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
URL url = null;
|
|
|
|
URL url = null;
|
|
|
|
try {
|
|
|
|
try {
|
|
|
|
url = httpHeader.getRequestURL(conProp);
|
|
|
|
url = httpHeader.getRequestURL(conProp);
|
|
|
@ -354,19 +367,6 @@ public final class httpdProxyHandler extends httpdAbstractHandler implements htt
|
|
|
|
return;
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
String host = conProp.getProperty(httpHeader.CONNECTION_PROP_HOST);
|
|
|
|
|
|
|
|
String path = conProp.getProperty(httpHeader.CONNECTION_PROP_PATH); // always starts with leading '/'
|
|
|
|
|
|
|
|
String args = conProp.getProperty(httpHeader.CONNECTION_PROP_ARGS); // may be null if no args were given
|
|
|
|
|
|
|
|
String ip = conProp.getProperty(httpHeader.CONNECTION_PROP_CLIENTIP); // the ip from the connecting peer
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
int port, pos;
|
|
|
|
|
|
|
|
if ((pos = host.indexOf(":")) < 0) {
|
|
|
|
|
|
|
|
port = 80;
|
|
|
|
|
|
|
|
} else {
|
|
|
|
|
|
|
|
port = Integer.parseInt(host.substring(pos + 1));
|
|
|
|
|
|
|
|
host = host.substring(0, pos);
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
String ext;
|
|
|
|
String ext;
|
|
|
|
if ((pos = path.lastIndexOf('.')) < 0) {
|
|
|
|
if ((pos = path.lastIndexOf('.')) < 0) {
|
|
|
|
ext = "";
|
|
|
|
ext = "";
|
|
|
@ -374,7 +374,6 @@ public final class httpdProxyHandler extends httpdAbstractHandler implements htt
|
|
|
|
ext = path.substring(pos + 1).toLowerCase();
|
|
|
|
ext = path.substring(pos + 1).toLowerCase();
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// check the blacklist
|
|
|
|
// check the blacklist
|
|
|
|
// blacklist idea inspired by [AS]:
|
|
|
|
// blacklist idea inspired by [AS]:
|
|
|
|
// respond a 404 for all AGIS ("all you get is shit") servers
|
|
|
|
// respond a 404 for all AGIS ("all you get is shit") servers
|
|
|
|