[Esbox-commits] r850 - trunk/common/org.maemo.esbox.ssh/src/org/maemo/esbox/internal/ssh

eswartz at garage.maemo.org eswartz at garage.maemo.org
Thu Oct 9 17:56:28 EEST 2008


Author: eswartz
Date: 2008-10-09 17:56:27 +0300 (Thu, 09 Oct 2008)
New Revision: 850

Modified:
   trunk/common/org.maemo.esbox.ssh/src/org/maemo/esbox/internal/ssh/BuggySB2QEMUStreamWrapperFactory.java
Log:
Fix issue where SB2 stream wrapper was holding all output until process termination.

Modified: trunk/common/org.maemo.esbox.ssh/src/org/maemo/esbox/internal/ssh/BuggySB2QEMUStreamWrapperFactory.java
===================================================================
--- trunk/common/org.maemo.esbox.ssh/src/org/maemo/esbox/internal/ssh/BuggySB2QEMUStreamWrapperFactory.java	2008-10-08 23:02:44 UTC (rev 849)
+++ trunk/common/org.maemo.esbox.ssh/src/org/maemo/esbox/internal/ssh/BuggySB2QEMUStreamWrapperFactory.java	2008-10-09 14:56:27 UTC (rev 850)
@@ -14,8 +14,7 @@
 import org.maemo.esbox.internal.api.core.machine.IStreamWrapper;
 import org.maemo.esbox.internal.api.core.machine.IStreamWrapperFactory;
 
-import java.io.IOException;
-import java.io.InputStream;
+import java.io.*;
 
 /**
  * @author eswartz
@@ -64,7 +63,7 @@
 		}
 		public InputStream getInputStream() {
 			
-			return new InputStream() {
+			return new FilterInputStream(out) {
 				byte[] lastTokens = new byte[weirdTokens.length];
 				int lastTokenIdxEnd = 0;
 				int lastTokenIdxSt = 0;
@@ -86,7 +85,7 @@
 							return ch;
 						}
 
-						ch = out.read();
+						ch = in.read();
 						
 						if (ch >= 0) {
 							if (weirdTokenIdx == 2 ||weirdTokenIdx == 3 || weirdTokenIdx == 5 || weirdTokenIdx == 6 
@@ -120,14 +119,14 @@
 		}
 		
 		public InputStream getErrorStream() {
-			return new InputStream() {
+			return new FilterInputStream(err) {
 
 				@Override
 				public int read() throws IOException {
 					if (hitWeirdToken)
 						return -1;
 					
-					return err.read();
+					return in.read();
 				}
 				
 			};



More information about the Esbox-commits mailing list