398467 Servlet 3.1 Non Blocking IO

prevent fillInterest from HTTP after upgrade
This commit is contained in:
Greg Wilkins 2013-07-12 13:01:46 +10:00
parent ce37be598c
commit 3add75f135
3 changed files with 8 additions and 2 deletions

View File

@ -545,7 +545,7 @@ public abstract class AbstractConnection implements Connection
@Override
public String toString()
{
return String.format("AC.ExReadCB@%x", AbstractConnection.this.hashCode());
return String.format("AC.ReadCB@%x{%s}", AbstractConnection.this.hashCode(),AbstractConnection.this);
}
};
}

View File

@ -25,6 +25,8 @@ import java.util.concurrent.atomic.AtomicBoolean;
import java.util.concurrent.atomic.AtomicReference;
import org.eclipse.jetty.util.Callback;
import org.eclipse.jetty.util.log.Log;
import org.eclipse.jetty.util.log.Logger;
/* ------------------------------------------------------------ */
@ -35,6 +37,7 @@ import org.eclipse.jetty.util.Callback;
*/
public abstract class FillInterest
{
private final static Logger LOG = Log.getLogger(FillInterest.class);
private final AtomicReference<Callback> _interested = new AtomicReference<>(null);
/* ------------------------------------------------------------ */
@ -56,7 +59,10 @@ public abstract class FillInterest
throw new IllegalArgumentException();
if (!_interested.compareAndSet(null,callback))
{
LOG.warn("Read pending for "+_interested.get()+" pervented "+callback);
throw new ReadPendingException();
}
try
{
if (needsFill())

View File

@ -237,7 +237,7 @@ public class HttpConnection extends AbstractConnection implements Runnable, Http
finally
{
setCurrentConnection(null);
if (!suspended && getEndPoint().isOpen())
if (!suspended && getEndPoint().isOpen() && getEndPoint().getConnection()==this)
{
fillInterested();
}