fix: trackerServer connection param check

dev
tanyawen 2019-12-29 09:30:26 +08:00
parent 31ad07bae8
commit 94d4fab52a
1 changed files with 6 additions and 0 deletions

View File

@ -48,6 +48,9 @@ public class TrackerServer {
return this.inetSockAddr; return this.inetSockAddr;
} }
public void close(Connection connection) throws IOException { public void close(Connection connection) throws IOException {
if (connection == null) {
return;
}
//if connection enabled get from connection pool //if connection enabled get from connection pool
if (ClientGlobal.g_connection_pool_enabled) { if (ClientGlobal.g_connection_pool_enabled) {
ConnectionPool.closeConnection(connection); ConnectionPool.closeConnection(connection);
@ -62,6 +65,9 @@ public class TrackerServer {
* @throws IOException * @throws IOException
*/ */
public void releaseConnection(Connection connection) throws IOException { public void releaseConnection(Connection connection) throws IOException {
if (connection == null) {
return;
}
if (ClientGlobal.g_connection_pool_enabled) { if (ClientGlobal.g_connection_pool_enabled) {
ConnectionPool.releaseConnection(connection); ConnectionPool.releaseConnection(connection);
} else { } else {