felix-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From gno...@apache.org
Subject svn commit: r883422 - /felix/trunk/karaf/client/src/main/java/org/apache/felix/karaf/client/Main.java
Date Mon, 23 Nov 2009 17:18:46 GMT
Author: gnodet
Date: Mon Nov 23 17:18:45 2009
New Revision: 883422

URL: http://svn.apache.org/viewvc?rev=883422&view=rev
Log:
FELIX-1888: The karaf client hangs if the authentication fails

Modified:
    felix/trunk/karaf/client/src/main/java/org/apache/felix/karaf/client/Main.java

Modified: felix/trunk/karaf/client/src/main/java/org/apache/felix/karaf/client/Main.java
URL: http://svn.apache.org/viewvc/felix/trunk/karaf/client/src/main/java/org/apache/felix/karaf/client/Main.java?rev=883422&r1=883421&r2=883422&view=diff
==============================================================================
--- felix/trunk/karaf/client/src/main/java/org/apache/felix/karaf/client/Main.java (original)
+++ felix/trunk/karaf/client/src/main/java/org/apache/felix/karaf/client/Main.java Mon Nov
23 17:18:45 2009
@@ -108,7 +108,9 @@
                     }
                 }
             } while (session == null);
-            session.authPassword(user, password);
+            if (!session.authPassword(user, password).await().isSuccess()) {
+                throw new Exception("Authentication failure");
+            }
             ClientChannel channel;
 			if (sb.length() > 0) {
  				channel = session.createChannel("exec");
@@ -124,7 +126,11 @@
             channel.open();
             channel.waitFor(ClientChannel.CLOSED, 0);
         } catch (Throwable t) {
-            t.printStackTrace();
+            if (level > 1) {
+                t.printStackTrace();
+            } else {
+                System.err.println(t.getMessage());
+            }
             System.exit(1);
         } finally {
             try {



Mime
View raw message