*) Displaying an proxy error page instead of a white page if the server has closed

the connection before yacy was able to receive the http response line
   See: http://www.yacy-forum.de/viewtopic.php?p=8866#8866
        http://www.yacy-forum.de/viewtopic.php?t=704

git-svn-id: https://svn.berlios.de/svnroot/repos/yacy/trunk@630 6c8d7289-2bf4-0310-a012-ef5d649a1542
pull/1/head
theli 19 years ago
parent cc493ef8c1
commit 3df5c7a6cf

@ -478,9 +478,17 @@ public final class httpdProxyHandler extends httpdAbstractHandler implements htt
// send request
res = remote.GET(remotePath, requestHeader);
conProp.put(httpd.CONNECTION_PROP_CLIENT_REQUEST_HEADER,requestHeader);
long contentLength = res.responseHeader.contentLength();
// request has been placed and result has been returned. work off response
String[] resStatus = res.status.split(" ");
// determine if it's an internal error of the httpc
if (res.responseHeader.size() == 0) {
throw new Exception((resStatus.length > 1) ? resStatus[1] : "Internal httpc error");
}
// if the content length is not set we have to use chunked transfer encoding
long contentLength = res.responseHeader.contentLength();
if (contentLength < 0) {
// according to http://www.w3.org/Protocols/rfc2616/rfc2616-sec10.html
// a 204,304 message must not contain a message body.
@ -546,9 +554,6 @@ public final class httpdProxyHandler extends httpdAbstractHandler implements htt
// remove hop by hop headers
this.removeHopByHopHeaders(res.responseHeader);
// request has been placed and result has been returned. work off response
String[] resStatus = res.status.split(" ");
// sending the respond header back to the client
if (chunkedOut != null) {
res.responseHeader.put(httpHeader.TRANSFER_ENCODING, "chunked");

Loading…
Cancel
Save