diff options
Diffstat (limited to 'bundles/org.eclipse.team.cvs.core/src/org/eclipse/team/internal/ccvs/core/connection/PServerConnection.java')
-rw-r--r-- | bundles/org.eclipse.team.cvs.core/src/org/eclipse/team/internal/ccvs/core/connection/PServerConnection.java | 96 |
1 files changed, 48 insertions, 48 deletions
diff --git a/bundles/org.eclipse.team.cvs.core/src/org/eclipse/team/internal/ccvs/core/connection/PServerConnection.java b/bundles/org.eclipse.team.cvs.core/src/org/eclipse/team/internal/ccvs/core/connection/PServerConnection.java index 935069365..4d628c7a6 100644 --- a/bundles/org.eclipse.team.cvs.core/src/org/eclipse/team/internal/ccvs/core/connection/PServerConnection.java +++ b/bundles/org.eclipse.team.cvs.core/src/org/eclipse/team/internal/ccvs/core/connection/PServerConnection.java @@ -101,31 +101,31 @@ public class PServerConnection implements IServerConnection { InputStream is = null; OutputStream os = null; - - Proxy proxy = getProxy(); - if (proxy!=null) { - String host = cvsroot.getHost(); - int port = cvsroot.getPort(); - if (port == ICVSRepositoryLocation.USE_DEFAULT_PORT) { - port = DEFAULT_PORT; - } - try { - int timeout = CVSProviderPlugin.getPlugin().getTimeout() * 1000; - IJSchService service = CVSProviderPlugin.getPlugin().getJSchService(); - service.connect(proxy, host, port, timeout, monitor); - } catch( Exception ex) { - ex.printStackTrace(); - throw new IOException(ex.getMessage()); - } - is = proxy.getInputStream(); - os = proxy.getOutputStream(); - - } else { - fSocket = createSocket(monitor); - is = fSocket.getInputStream(); - os = fSocket.getOutputStream(); - } - + + Proxy proxy = getProxy(); + if (proxy!=null) { + String host = cvsroot.getHost(); + int port = cvsroot.getPort(); + if (port == ICVSRepositoryLocation.USE_DEFAULT_PORT) { + port = DEFAULT_PORT; + } + try { + int timeout = CVSProviderPlugin.getPlugin().getTimeout() * 1000; + IJSchService service = CVSProviderPlugin.getPlugin().getJSchService(); + service.connect(proxy, host, port, timeout, monitor); + } catch( Exception ex) { + ex.printStackTrace(); + throw new IOException(ex.getMessage()); + } + is = proxy.getInputStream(); + os = proxy.getOutputStream(); + + } else { + fSocket = createSocket(monitor); + is = fSocket.getInputStream(); + os = fSocket.getOutputStream(); + } + boolean connected = false; try { this.inputStream = new BufferedInputStream(new PollingInputStream(is, @@ -147,8 +147,8 @@ public class PServerConnection implements IServerConnection { Proxy proxy = service.getProxyForHost(cvsroot.getHost(), IProxyData.SOCKS_PROXY_TYPE); if (proxy == null) proxy = service.getProxyForHost(cvsroot.getHost(), IProxyData.HTTPS_PROXY_TYPE); - return proxy; - } + return proxy; + } @Override public InputStream getInputStream() { @@ -204,29 +204,29 @@ public class PServerConnection implements IServerConnection { String message = "";//$NON-NLS-1$ String separator = ""; //$NON-NLS-1$ - if(!CVSProviderPlugin.getPlugin().isUseProxy()) { - while (line.length() > 0 && line.charAt(0) == ERROR_CHAR) { - if (line.length() > 2) { - message += separator + line.substring(2); - separator = " "; //$NON-NLS-1$ - } - line = Connection.readLine(cvsroot, getInputStream()); - } - } else { - while (line.length() > 0) { - message += separator + line; - separator = "\n"; //$NON-NLS-1$ - line = Connection.readLine(cvsroot, getInputStream()); - } - } + if(!CVSProviderPlugin.getPlugin().isUseProxy()) { + while (line.length() > 0 && line.charAt(0) == ERROR_CHAR) { + if (line.length() > 2) { + message += separator + line.substring(2); + separator = " "; //$NON-NLS-1$ + } + line = Connection.readLine(cvsroot, getInputStream()); + } + } else { + while (line.length() > 0) { + message += separator + line; + separator = "\n"; //$NON-NLS-1$ + line = Connection.readLine(cvsroot, getInputStream()); + } + } // If the last line is the login failed (I HATE YOU) message, return authentication failure if (LOGIN_FAILED.equals(line)) { - if (message.length() == 0) { - throw new CVSAuthenticationException(CVSMessages.PServerConnection_loginRefused, CVSAuthenticationException.RETRY,cvsroot); - } else { - throw new CVSAuthenticationException(message, CVSAuthenticationException.RETRY,cvsroot); - } + if (message.length() == 0) { + throw new CVSAuthenticationException(CVSMessages.PServerConnection_loginRefused, CVSAuthenticationException.RETRY,cvsroot); + } else { + throw new CVSAuthenticationException(message, CVSAuthenticationException.RETRY,cvsroot); + } } // Remove leading "error 0" @@ -276,5 +276,5 @@ public class PServerConnection implements IServerConnection { private void throwInValidCharacter() throws CVSAuthenticationException { throw new CVSAuthenticationException(CVSMessages.PServerConnection_invalidChars, CVSAuthenticationException.RETRY, cvsroot); } - + } |