Skip to content
Draft
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Added logging
  • Loading branch information
tkyc committed Jun 20, 2023
commit 3d0fee2027ea4d0a6c332a3b6f3eaaf11abd4433
4 changes: 4 additions & 0 deletions src/main/java/com/microsoft/sqlserver/jdbc/IOBuffer.java
Original file line number Diff line number Diff line change
Expand Up @@ -2895,6 +2895,10 @@ private Socket getConnectedSocket(InetSocketAddress addr, int timeoutInMilliSeco

if (null != localSocketAddress && !localSocketAddress.isEmpty()) {
selectedSocket.bind(new InetSocketAddress(InetAddress.getByName(localSocketAddress), 0));
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do we validate this user specified loicalSocketAddress as a valid IP somewhere before coming here ? If not would it be good to handle an exception thrown by InetSocketAddress/bind call and raise an error in that case ?


if (logger.isLoggable(Level.FINER)) {
logger.finer(this.toString() + " binding socket to: " + localSocketAddress);
}
}

if (!selectedSocket.isConnected()) {
Expand Down