Index: src/io/Utf8IOStream.java =================================================================== --- src/io/Utf8IOStream.java (revision 1393) +++ src/io/Utf8IOStream.java (working copy) @@ -110,22 +110,9 @@ public int read(byte buf[]) throws IOException { - int avail=inpStream.available(); - - if (avail==0) -//#if !ZLIB -//# //trying to fix phillips 9@9 -//# if (!Config.getInstance().istreamWaiting) avail=1; -//# else -//#endif - return 0; - - if (avail>buf.length) avail=buf.length; - - avail=inpStream.read(buf, 0, avail); - - bytesRecv+=avail; - return avail; + int recv = inpStream.read(buf, 0, buf.length); + bytesRecv += recv; + return recv; } Index: src/com/alsutton/jabber/JabberStream.java =================================================================== --- src/com/alsutton/jabber/JabberStream.java (revision 1393) +++ src/com/alsutton/jabber/JabberStream.java (working copy) @@ -183,19 +183,16 @@ XMLParser parser = new XMLParser( this ); byte cbuf[]=new byte[512]; + int length; while (true) { - int length=iostream.read(cbuf); - - if (length==0) { - try { Thread.sleep(100); } catch (Exception e) {}; - continue; - } + if ((length = iostream.read(cbuf)) == -1) + break; parser.parse(cbuf, length); } - //dispatcher.broadcastTerminatedConnection( null ); + dispatcher.broadcastTerminatedConnection(null); } catch( Exception e ) { System.out.println("Exception in parser:"); e.printStackTrace();