From d8afe60e0778d2c317903d50e216d22749ba42b9 Mon Sep 17 00:00:00 2001 From: allo Date: Wed, 23 Nov 2005 14:05:25 +0000 Subject: [PATCH] Bugfix for last Bugfix ;-). host/port were set to originaladdress instead of the correct values for the new Url. git-svn-id: https://svn.berlios.de/svnroot/repos/yacy/trunk@1126 6c8d7289-2bf4-0310-a012-ef5d649a1542 --- source/de/anomic/http/httpdProxyHandler.java | 17 +++++++++-------- 1 file changed, 9 insertions(+), 8 deletions(-) diff --git a/source/de/anomic/http/httpdProxyHandler.java b/source/de/anomic/http/httpdProxyHandler.java index 4862d91bc..97f942172 100644 --- a/source/de/anomic/http/httpdProxyHandler.java +++ b/source/de/anomic/http/httpdProxyHandler.java @@ -334,14 +334,8 @@ public final class httpdProxyHandler extends httpdAbstractHandler implements htt 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); - } + int pos=0; + int port=0; URL url = null; try { @@ -366,6 +360,13 @@ public final class httpdProxyHandler extends httpdAbstractHandler implements htt httpd.sendRespondError(conProp,respond,4,501,null,errorMsg,e); return; } + + if ((pos = host.indexOf(":")) < 0) { + port = 80; + } else { + port = Integer.parseInt(host.substring(pos + 1)); + host = host.substring(0, pos); + } String ext; if ((pos = path.lastIndexOf('.')) < 0) {