summaryrefslogtreecommitdiff
path: root/jurt
diff options
context:
space:
mode:
authorNoel Grandin <noel@peralex.com>2015-07-30 15:38:41 +0200
committerThorsten Behrens <Thorsten.Behrens@CIB.de>2015-08-18 15:09:22 +0000
commitfe56dfd8261f311f78c375a54a09adb81489c854 (patch)
tree65512ec6412a9dd243363b224ca38fd5f9c0a50c /jurt
parent77cf7b7758dde33dac8e2e2edf0fbffd98af60e3 (diff)
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/17427 Reviewed-by: Noel Grandin <noelgrandin@gmail.com> Tested-by: Noel Grandin <noelgrandin@gmail.com> (cherry picked from commit 9ffdcc76858bc01150727345de4dfd0ef40ed8c0) Change-Id: I377d7150f1adb69d6f86d9b4f3406163aaf85aea Reviewed-on: https://gerrit.libreoffice.org/17708 Reviewed-by: Thorsten Behrens <Thorsten.Behrens@CIB.de> Tested-by: Thorsten Behrens <Thorsten.Behrens@CIB.de>
Diffstat (limited to 'jurt')
-rw-r--r--jurt/com/sun/star/lib/connections/socket/socketAcceptor.java5
-rw-r--r--jurt/com/sun/star/lib/connections/socket/socketConnector.java4
2 files changed, 7 insertions, 2 deletions
diff --git a/jurt/com/sun/star/lib/connections/socket/socketAcceptor.java b/jurt/com/sun/star/lib/connections/socket/socketAcceptor.java
index 022f89142c75..da33625e498d 100644
--- a/jurt/com/sun/star/lib/connections/socket/socketAcceptor.java
+++ b/jurt/com/sun/star/lib/connections/socket/socketAcceptor.java
@@ -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) {
diff --git a/jurt/com/sun/star/lib/connections/socket/socketConnector.java b/jurt/com/sun/star/lib/connections/socket/socketConnector.java
index fc44639a5feb..c169b59a6aeb 100644
--- a/jurt/com/sun/star/lib/connections/socket/socketConnector.java
+++ b/jurt/com/sun/star/lib/connections/socket/socketConnector.java
@@ -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) {