X-Git-Url: http://git.linex4red.de/pub/Android/ownCloud.git/blobdiff_plain/435b31ba4f3597cc7a43270cd4a54fb0180956c1..7f75f13f0c47b5cc4f5fe6a743a6fb8a9281fef7:/src/eu/alefzero/owncloud/authenticator/EasySSLSocketFactory.java diff --git a/src/eu/alefzero/owncloud/authenticator/EasySSLSocketFactory.java b/src/eu/alefzero/owncloud/authenticator/EasySSLSocketFactory.java index 3c2eac7a..f1de8f5f 100644 --- a/src/eu/alefzero/owncloud/authenticator/EasySSLSocketFactory.java +++ b/src/eu/alefzero/owncloud/authenticator/EasySSLSocketFactory.java @@ -154,23 +154,17 @@ public class EasySSLSocketFactory implements ProtocolSocketFactory { * terminates and throws an {@link ConnectTimeoutException} *

* - * @param host - * the host name/IP - * @param port - * the port on the host - * @param clientHost - * the local host name/IP to bind the socket to - * @param clientPort - * the port on the local machine - * @param params - * {@link HttpConnectionParams Http connection parameters} + * @param host the host name/IP + * @param port the port on the host + * @param clientHost the local host name/IP to bind the socket to + * @param clientPort the port on the local machine + * @param params {@link HttpConnectionParams Http connection parameters} * * @return Socket a new socket * - * @throws IOException - * if an I/O error occurs while creating the socket - * @throws UnknownHostException - * if the IP address of the host cannot be determined + * @throws IOException if an I/O error occurs while creating the socket + * @throws UnknownHostException if the IP address of the host cannot be + * determined */ public Socket createSocket(final String host, final int port, final InetAddress localAddress, final int localPort, @@ -182,13 +176,16 @@ public class EasySSLSocketFactory implements ProtocolSocketFactory { int timeout = params.getConnectionTimeout(); SocketFactory socketfactory = getSSLContext().getSocketFactory(); if (timeout == 0) { - return socketfactory.createSocket(host, port, localAddress, + Socket socket = socketfactory.createSocket(host, port, localAddress, localPort); + socket.setSoTimeout(params.getSoTimeout()); + return socket; } else { Socket socket = socketfactory.createSocket(); SocketAddress localaddr = new InetSocketAddress(localAddress, localPort); SocketAddress remoteaddr = new InetSocketAddress(host, port); + socket.setSoTimeout(params.getSoTimeout()); socket.bind(localaddr); socket.connect(remoteaddr, timeout); return socket;