Skip to content

Commit

Permalink
Backport b6ecca126846f9c53d554ff061cfe9b7b20a4d12
Browse files Browse the repository at this point in the history
  • Loading branch information
GoeLin committed May 2, 2024
1 parent 025969c commit 58490e3
Showing 1 changed file with 4 additions and 4 deletions.
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright (c) 2001, 2021, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2001, 2023, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
Expand Down Expand Up @@ -547,7 +547,7 @@ public SocketAddress receive(ByteBuffer dst) throws IOException {
n = receive(dst, connected);
}
}
if (n >= 0) {
if (n > 0 || (n == 0 && isOpen())) {
// sender address is in socket address buffer
sender = sourceSocketAddress();
}
Expand Down Expand Up @@ -668,7 +668,7 @@ private SocketAddress trustedBlockingReceive(ByteBuffer dst)
park(Net.POLLIN);
n = receive(dst, connected);
}
if (n >= 0) {
if (n > 0 || (n == 0 && isOpen())) {
// sender address is in socket address buffer
sender = sourceSocketAddress();
}
Expand Down Expand Up @@ -705,7 +705,7 @@ private SocketAddress trustedBlockingReceive(ByteBuffer dst, long nanos)
park(Net.POLLIN, remainingNanos);
n = receive(dst, connected);
}
if (n >= 0) {
if (n > 0 || (n == 0 && isOpen())) {
// sender address is in socket address buffer
sender = sourceSocketAddress();
}
Expand Down

0 comments on commit 58490e3

Please sign in to comment.