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