commit e25f23014a4571eb169b860ef5ee4f72f9162e4c from: marcus date: Thu Apr 1 22:11:09 2004 UTC loop when getting negotiations, so we do not hang. commit - a4f0ea1e32c3d6c79216bbe0da757f0e3b63a43a commit + e25f23014a4571eb169b860ef5ee4f72f9162e4c blob - 1ebf58ac911b33af919e82a15ea0a55faeb24ac9 blob + 7222e126ca1f381267a76f5adaa32794da301484 --- de/mud/telnet/TelnetWrapper.java +++ de/mud/telnet/TelnetWrapper.java @@ -1,7 +1,7 @@ /* * This file is part of "The Java Telnet Application". * - * (c) Matthias L. Jugel, Marcus Meißner 1996-2002. All Rights Reserved. + * (c) Matthias L. Jugel, Marcus Meißner 1996-2004. All Rights Reserved. * * Please visit http://javatelnet.org/ for updates and contact. * @@ -129,10 +129,14 @@ public class TelnetWrapper extends Wrapper { * @return the amount of bytes read */ public int read(byte[] b) throws IOException { - int n = handler.negotiate(b); + /* process all already read bytes */ + int n; - if (n > 0) - return n; + do { + n = handler.negotiate(b); + if (n>0) + return n; + } while (n==0); while (n <= 0) { do {