Kaydet (Commit) fe56dfd8 authored tarafından Noel Grandin's avatar Noel Grandin Kaydeden (comit) Thorsten Behrens

tdf#93410 - NPE while connecting to LibreOffice via Java UNO API

The below commit fixes this as bug as a side-effect:

fix use of TCP_NODELAY for localhost URP connections

we implemented this logic in the C++ URP code a while back, but the Java
code was not correctly updated.

Reviewed-on: https://gerrit.libreoffice.org/17427Reviewed-by: 's avatarNoel Grandin <noelgrandin@gmail.com>
Tested-by: 's avatarNoel Grandin <noelgrandin@gmail.com>
(cherry picked from commit 9ffdcc76)

Change-Id: I377d7150f1adb69d6f86d9b4f3406163aaf85aea
Reviewed-on: https://gerrit.libreoffice.org/17708Reviewed-by: 's avatarThorsten Behrens <Thorsten.Behrens@CIB.de>
Tested-by: 's avatarThorsten Behrens <Thorsten.Behrens@CIB.de>
üst 77cf7b77
......@@ -152,9 +152,12 @@ public final class socketAcceptor implements XAcceptor {
}
// we enable tcpNoDelay for loopback connections because
// it can make a significant speed difference on linux boxes.
if (tcpNoDelay != null || ((InetSocketAddress)socket.getRemoteSocketAddress()).getAddress().isLoopbackAddress()) {
if (tcpNoDelay != null) {
socket.setTcpNoDelay(tcpNoDelay.booleanValue());
}
else if (((InetSocketAddress)socket.getRemoteSocketAddress()).getAddress().isLoopbackAddress()) {
socket.setTcpNoDelay(true);
}
return new SocketConnection(acceptingDescription, socket);
}
catch(IOException e) {
......
......@@ -146,8 +146,10 @@ public final class socketConnector implements XConnector {
try {
// we enable tcpNoDelay for loopback connections because
// it can make a significant speed difference on linux boxes.
if (desc.getTcpNoDelay() != null || isLoopbackAddress)
if (desc.getTcpNoDelay() != null)
socket.setTcpNoDelay(desc.getTcpNoDelay().booleanValue());
else if (isLoopbackAddress)
socket.setTcpNoDelay(true);
con = new SocketConnection(connectionDescription, socket);
} catch (IOException e) {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment