fixed race in HttpReceiverOverHTTPTest

This commit is contained in:
Greg Wilkins 2014-07-02 15:08:06 +10:00
parent 839485797b
commit 228600caf5
2 changed files with 9 additions and 1 deletions

View File

@ -301,6 +301,9 @@ public abstract class HttpReceiver
if (decoder != null)
{
buffer = decoder.decode(buffer);
// TODO If the decoder consumes all the content, should we return here?
if (LOG.isDebugEnabled())
LOG.debug("Response content decoded ({}) {}{}{}", decoder, response, System.lineSeparator(), BufferUtil.toDetailString(buffer));
}

View File

@ -42,6 +42,7 @@ import org.eclipse.jetty.http.HttpHeader;
import org.eclipse.jetty.http.HttpVersion;
import org.eclipse.jetty.io.ByteArrayEndPoint;
import org.eclipse.jetty.toolchain.test.TestTracker;
import org.eclipse.jetty.util.BufferUtil;
import org.junit.After;
import org.junit.Assert;
import org.junit.Before;
@ -230,7 +231,11 @@ public class HttpReceiverOverHTTPTest
@Override
public void onContent(Response response, ByteBuffer content)
{
boolean hadRemaining=content.hasRemaining();
super.onContent(response, content);
// TODO gzip decoding can pass on empty chunks. Currently ignoring them here, but could be done at the decoder???
if (hadRemaining) // Ignore empty chunks
latch.countDown();
}
};