提交 93c9673e 编写于 作者: C chegar

6946825: com.sun.net.httpserver.HttpServer; Memory Leak on Non HTTP conform open socket

Reviewed-by: michaelm
上级 b51dd8fc
...@@ -451,6 +451,7 @@ class ServerImpl implements TimeSource { ...@@ -451,6 +451,7 @@ class ServerImpl implements TimeSource {
if (requestLine == null) { if (requestLine == null) {
/* connection closed */ /* connection closed */
connection.close(); connection.close();
allConnections.remove(connection);
return; return;
} }
int space = requestLine.indexOf (' '); int space = requestLine.indexOf (' ');
...@@ -592,6 +593,8 @@ class ServerImpl implements TimeSource { ...@@ -592,6 +593,8 @@ class ServerImpl implements TimeSource {
sendReply ( sendReply (
code, true, "<h1>"+code+Code.msg(code)+"</h1>"+message code, true, "<h1>"+code+Code.msg(code)+"</h1>"+message
); );
/* connection is already closed by sendReply, now remove it */
allConnections.remove(connection);
} }
void sendReply ( void sendReply (
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册