提交 6bed96ed 编写于 作者: W weijun

6588160: jaas krb5 client leaks OS-level UDP sockets (all platforms)

Reviewed-by: jccollet, chegar
上级 17a9da6b
...@@ -274,27 +274,31 @@ public abstract class KrbKdcReq { ...@@ -274,27 +274,31 @@ public abstract class KrbKdcReq {
+ ",Attempt =" + i + ",Attempt =" + i
+ ", #bytes=" + obuf.length); + ", #bytes=" + obuf.length);
} }
/* try {
* Send the data to the kdc. /*
*/ * Send the data to the kdc.
*/
kdcClient.send(obuf); kdcClient.send(obuf);
/* /*
* And get a response. * And get a response.
*/ */
try { try {
ibuf = kdcClient.receive(); ibuf = kdcClient.receive();
break; break;
} catch (SocketTimeoutException se) { } catch (SocketTimeoutException se) {
if (DEBUG) { if (DEBUG) {
System.out.println ("SocketTimeOutException with " + System.out.println ("SocketTimeOutException with " +
"attempt: " + i); "attempt: " + i);
} }
if (i == DEFAULT_KDC_RETRY_LIMIT) { if (i == DEFAULT_KDC_RETRY_LIMIT) {
ibuf = null; ibuf = null;
throw se; throw se;
}
} }
} finally {
kdcClient.close();
} }
} }
} }
......
...@@ -93,4 +93,7 @@ public class UDPClient { ...@@ -93,4 +93,7 @@ public class UDPClient {
return data; return data;
} }
public void close() {
dgSocket.close();
}
} }
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册