Updated HttpClient code to Jetty 9.1 after merge.

This commit is contained in:
Simone Bordet 2013-07-12 22:34:47 +02:00
parent a4c63caf26
commit b246d70103
3 changed files with 8 additions and 5 deletions

View File

@ -29,6 +29,7 @@ import org.eclipse.jetty.http.HttpHeaderValue;
import org.eclipse.jetty.util.BufferUtil;
import org.eclipse.jetty.util.Callback;
import org.eclipse.jetty.util.IteratingCallback;
import org.eclipse.jetty.util.IteratingNestedCallback;
import org.eclipse.jetty.util.log.Log;
import org.eclipse.jetty.util.log.Logger;
@ -564,7 +565,7 @@ public abstract class HttpSender implements AsyncContentProvider.Listener
anyToFailure(failure);
}
private class Delegate extends IteratingCallback
private class Delegate extends IteratingNestedCallback
{
private Delegate(Callback callback)
{

View File

@ -33,6 +33,7 @@ import org.eclipse.jetty.http.HttpVersion;
import org.eclipse.jetty.io.ByteBufferPool;
import org.eclipse.jetty.io.EndPoint;
import org.eclipse.jetty.io.EofException;
import org.eclipse.jetty.util.BufferUtil;
public class HttpReceiverOverHTTP extends HttpReceiver implements HttpParser.ResponseHandler<ByteBuffer>
{
@ -108,7 +109,8 @@ public class HttpReceiverOverHTTP extends HttpReceiver implements HttpParser.Res
private void shutdown()
{
// Shutting down the parser may invoke messageComplete() or earlyEOF()
parser.shutdownInput();
parser.atEOF();
parser.parseNext(BufferUtil.EMPTY_BUFFER);
if (!onResponseFailure(new EOFException()))
{
// TODO: just shutdown here, or full close ?

View File

@ -86,7 +86,7 @@ public class HttpClientContinueTest extends AbstractHttpClientServerTest
.scheme(scheme)
.header(HttpHeader.EXPECT, HttpHeaderValue.CONTINUE.asString())
.content(new BytesContentProvider(contents))
.timeout(555, TimeUnit.SECONDS)
.timeout(5, TimeUnit.SECONDS)
.send();
Assert.assertNotNull(response);
@ -133,7 +133,7 @@ public class HttpClientContinueTest extends AbstractHttpClientServerTest
return -1;
}
})
.timeout(555, TimeUnit.SECONDS)
.timeout(5, TimeUnit.SECONDS)
.send();
Assert.assertNotNull(response);
@ -590,7 +590,7 @@ public class HttpClientContinueTest extends AbstractHttpClientServerTest
}
});
Assert.assertTrue(latch.await(555, TimeUnit.SECONDS));
Assert.assertTrue(latch.await(5, TimeUnit.SECONDS));
}
@Test