Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Commented out Keep alive code as it does not seem to work with Opera …

…and IE
  • Loading branch information...
commit 3bfcb195d997431888d04f33f31b040451ed3e8f 1 parent ea6383f
@pepite pepite authored
Showing with 24 additions and 21 deletions.
  1. +24 −21 src/play/modules/netty/PlayHandler.java
View
45 src/play/modules/netty/PlayHandler.java
@@ -236,15 +236,16 @@ public static void copyResponse(ChannelHandlerContext ctx, Request request, Resp
ctx.getChannel().write(nettyResponse);
ChannelFuture writeFuture = ctx.getChannel().write(new ChunkedNioFile(file));
// Decide whether to close the connection or not.
- boolean close =
- HttpHeaders.Values.CLOSE.equalsIgnoreCase(nettyRequest.getHeader(HttpHeaders.Names.CONNECTION)) ||
- nettyRequest.getProtocolVersion().equals(HttpVersion.HTTP_1_0) &&
- !HttpHeaders.Values.KEEP_ALIVE.equalsIgnoreCase(nettyRequest.getHeader(HttpHeaders.Names.CONNECTION));
-
- if (close) {
+ // Comment out for now as it does not seem to work with Opera and IE
+// boolean close =
+// HttpHeaders.Values.CLOSE.equalsIgnoreCase(nettyRequest.getHeader(HttpHeaders.Names.CONNECTION)) ||
+// nettyRequest.getProtocolVersion().equals(HttpVersion.HTTP_1_0) &&
+// !HttpHeaders.Values.KEEP_ALIVE.equalsIgnoreCase(nettyRequest.getHeader(HttpHeaders.Names.CONNECTION));
+//
+// if (close) {
// Close the connection when the whole content is written out.
writeFuture.addListener(ChannelFutureListener.CLOSE);
- }
+ //}
} catch (Exception e) {
@@ -254,16 +255,17 @@ public static void copyResponse(ChannelHandlerContext ctx, Request request, Resp
} else if (is != null) {
ctx.getChannel().write(nettyResponse);
ChannelFuture writeFuture = ctx.getChannel().write(new ChunkedStream(is));
+ // Comment out for now as it does not seem to work with Opera and IE
// Decide whether to close the connection or not.
- boolean close =
- HttpHeaders.Values.CLOSE.equalsIgnoreCase(nettyRequest.getHeader(HttpHeaders.Names.CONNECTION)) ||
- nettyRequest.getProtocolVersion().equals(HttpVersion.HTTP_1_0) &&
- !HttpHeaders.Values.KEEP_ALIVE.equalsIgnoreCase(nettyRequest.getHeader(HttpHeaders.Names.CONNECTION));
-
- if (close) {
+// boolean close =
+// HttpHeaders.Values.CLOSE.equalsIgnoreCase(nettyRequest.getHeader(HttpHeaders.Names.CONNECTION)) ||
+// nettyRequest.getProtocolVersion().equals(HttpVersion.HTTP_1_0) &&
+// !HttpHeaders.Values.KEEP_ALIVE.equalsIgnoreCase(nettyRequest.getHeader(HttpHeaders.Names.CONNECTION));
+//
+// if (close) {
// Close the connection when the whole content is written out.
writeFuture.addListener(ChannelFutureListener.CLOSE);
- }
+ // }
} else {
@@ -542,15 +544,16 @@ public static void serveStatic(RenderStatic renderStatic, ChannelHandlerContext
ctx.getChannel().write(nettyResponse);
ChannelFuture writeFuture = ctx.getChannel().write(new ChunkedNioFile(file.getRealFile()));
// Decide whether to close the connection or not.
- boolean close =
- HttpHeaders.Values.CLOSE.equalsIgnoreCase(nettyRequest.getHeader(HttpHeaders.Names.CONNECTION)) ||
- nettyRequest.getProtocolVersion().equals(HttpVersion.HTTP_1_0) &&
- !HttpHeaders.Values.KEEP_ALIVE.equalsIgnoreCase(nettyRequest.getHeader(HttpHeaders.Names.CONNECTION));
-
- if (close) {
+ // Decide whether to close the connection or not.
+// boolean close =
+// HttpHeaders.Values.CLOSE.equalsIgnoreCase(nettyRequest.getHeader(HttpHeaders.Names.CONNECTION)) ||
+// nettyRequest.getProtocolVersion().equals(HttpVersion.HTTP_1_0) &&
+// !HttpHeaders.Values.KEEP_ALIVE.equalsIgnoreCase(nettyRequest.getHeader(HttpHeaders.Names.CONNECTION));
+//
+// if (close) {
// Close the connection when the whole content is written out.
writeFuture.addListener(ChannelFutureListener.CLOSE);
- }
+ // }
}
}
Please sign in to comment.
Something went wrong with that request. Please try again.