# HG changeset patch # User Carl Byington # Date 1406839559 25200 # Node ID d835e842d1586460e9f5459fdd0f81f909652898 # Parent 5c17707d94b0e7cc432b920fc758594761b9418e still hangs during connection diff -r 5c17707d94b0 -r d835e842d158 src/ch/ethz/ssh2/log/Logger.java --- a/src/ch/ethz/ssh2/log/Logger.java Thu Jul 31 13:06:55 2014 -0700 +++ b/src/ch/ethz/ssh2/log/Logger.java Thu Jul 31 13:45:59 2014 -0700 @@ -5,26 +5,17 @@ package ch.ethz.ssh2.log; -import java.util.logging.Level; +import android.util.Log; -/** - * Logger delegating to JRE logging. By default, this is disabled and only - * used during development. - * - * @author Christian Plattner - * @version $Id: Logger.java 49 2013-08-01 12:28:42Z cleondris@gmail.com $ - */ public class Logger { - private java.util.logging.Logger delegate; - - public static boolean enabled = false; + private static final String TAG = "ConnectBot.ssh"; + public static boolean enabled = true; public static Logger getLogger(Class x) { - return new Logger(x); + return new Logger(); } - public Logger(Class x) { - this.delegate = java.util.logging.Logger.getLogger(x.getName()); + public Logger() { } public final boolean isEnabled() { @@ -32,29 +23,26 @@ } public boolean isDebugEnabled() { - return enabled && delegate.isLoggable(Level.FINER); + return enabled; } public void debug(String message) { - if (enabled) - delegate.fine(message); + if (enabled) Log.d(TAG, message); } public boolean isInfoEnabled() { - return enabled && delegate.isLoggable(Level.FINE); + return enabled; } public void info(String message) { - if (enabled) - delegate.info(message); + if (enabled) Log.i(TAG, message); } public boolean isWarningEnabled() { - return enabled && delegate.isLoggable(Level.WARNING); + return enabled; } public void warning(String message) { - if (enabled) - delegate.warning(message); + if (enabled) Log.w(TAG, message); } } \ No newline at end of file diff -r 5c17707d94b0 -r d835e842d158 src/ch/ethz/ssh2/transport/ClientKexManager.java --- a/src/ch/ethz/ssh2/transport/ClientKexManager.java Thu Jul 31 13:06:55 2014 -0700 +++ b/src/ch/ethz/ssh2/transport/ClientKexManager.java Thu Jul 31 13:45:59 2014 -0700 @@ -88,7 +88,7 @@ public synchronized void handleMessage(byte[] msg) throws IOException { PacketKexInit kip; - + if (msg == null) { synchronized (accessLock) { connectionClosed = true; @@ -96,6 +96,8 @@ return; } } + + log.debug(String.format("client kex manager, packet type %d", msg[0])); if ((kxs == null) && (msg[0] != Packets.SSH_MSG_KEXINIT)) { throw new PacketTypeException(msg[0]); diff -r 5c17707d94b0 -r d835e842d158 src/ch/ethz/ssh2/transport/TransportManager.java --- a/src/ch/ethz/ssh2/transport/TransportManager.java Thu Jul 31 13:06:55 2014 -0700 +++ b/src/ch/ethz/ssh2/transport/TransportManager.java Thu Jul 31 13:45:59 2014 -0700 @@ -436,6 +436,7 @@ final byte[] packet = new byte[length]; System.arraycopy(buffer, 0, packet, 0, length); final int type = packet[0] & 0xff; + log.debug(String.format("transport manager receive loop type %d", type)); switch (type) { case Packets.SSH_MSG_IGNORE: