Updated HttpClient code to Jetty 9.1 after merge.
This commit is contained in:
parent
a4c63caf26
commit
b246d70103
|
@ -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)
|
||||
{
|
||||
|
|
|
@ -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 ?
|
||||
|
|
|
@ -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
|
||||
|
|
Loading…
Reference in New Issue