*) Bugfix for heise newsletter Problem

See: http://www.yacy-forum.de/viewtopic.php?p=7836#7836

git-svn-id: https://svn.berlios.de/svnroot/repos/yacy/trunk@559 6c8d7289-2bf4-0310-a012-ef5d649a1542
pull/1/head
theli 20 years ago
parent 4335bfe822
commit 7d8af6b41a

@ -421,7 +421,7 @@ public final class httpc {
// creating a socket address
InetSocketAddress address = new InetSocketAddress(hostip, port);
// trying to establis a connection to the address
// trying to establish a connection to the address
this.socket.connect(address,timeout);
// registering the socket

@ -459,7 +459,6 @@ public final class httpdProxyHandler extends httpdAbstractHandler implements htt
if (httpVer.equals("HTTP/0.9") || httpVer.equals("HTTP/1.0")) {
conProp.setProperty(httpd.CONNECTION_PROP_PERSISTENT,"close");
} else {
res.responseHeader.put(httpHeader.TRANSFER_ENCODING, "chunked");
chunkedOut = new httpChunkedOutputStream(respond);
}
res.responseHeader.remove(httpHeader.CONTENT_LENGTH);
@ -518,13 +517,17 @@ public final class httpdProxyHandler extends httpdAbstractHandler implements htt
String[] resStatus = res.status.split(" ");
// sending the respond header back to the client
if (chunkedOut != null) {
res.responseHeader.put(httpHeader.TRANSFER_ENCODING, "chunked");
}
httpd.sendRespondHeader(
conProp,
respond,
httpVer,
Integer.parseInt((resStatus.length > 0) ? resStatus[0]:"503"),
(resStatus.length > 1) ? resStatus[1] : null,
res.responseHeader);
res.responseHeader);
String storeError;
if ((storeError = cacheEntry.shallStoreCacheForProxy()) == null) {
@ -678,6 +681,9 @@ public final class httpdProxyHandler extends httpdAbstractHandler implements htt
// we respond on the request by using the cache, the cache is fresh
try {
// remove hop by hop headers
this.removeHopByHopHeaders(cachedResponseHeader);
// replace date field in old header by actual date, this is according to RFC
cachedResponseHeader.put(httpHeader.DATE, httpc.dateString(httpc.nowDate()));
@ -770,7 +776,14 @@ public final class httpdProxyHandler extends httpdAbstractHandler implements htt
// special headers inserted by squid
headers.remove(httpHeader.X_CACHE);
headers.remove(httpHeader.X_CACHE_LOOKUP);
headers.remove(httpHeader.X_CACHE_LOOKUP);
// remove transfer encoding header
headers.remove(httpHeader.TRANSFER_ENCODING);
//removing yacy status headers
headers.remove(httpHeader.X_YACY_KEEP_ALIVE_REQUEST_COUNT);
headers.remove(httpHeader.X_YACY_ORIGINAL_REQUEST_LINE);
}
private void forceConnectionClose() {

Loading…
Cancel
Save