6946825: com.sun.net.httpserver.HttpServer; Memory Leak on Non HTTP conform open socket
Reviewed-by: michaelm
--- a/jdk/src/share/classes/sun/net/httpserver/ServerImpl.java Thu May 06 13:42:52 2010 +0800
+++ b/jdk/src/share/classes/sun/net/httpserver/ServerImpl.java Thu May 06 17:17:09 2010 +0100
@@ -451,6 +451,7 @@
if (requestLine == null) {
/* connection closed */
connection.close();
+ allConnections.remove(connection);
return;
}
int space = requestLine.indexOf (' ');
@@ -592,6 +593,8 @@
sendReply (
code, true, "<h1>"+code+Code.msg(code)+"</h1>"+message
);
+ /* connection is already closed by sendReply, now remove it */
+ allConnections.remove(connection);
}
void sendReply (