Avoid IllegalStateException in case of abort concurrent to header
generation.
This commit is contained in:
parent
0e4a903764
commit
d92ac8062b
|
@ -23,6 +23,7 @@ import java.nio.ByteBuffer;
|
||||||
import org.eclipse.jetty.client.HttpClient;
|
import org.eclipse.jetty.client.HttpClient;
|
||||||
import org.eclipse.jetty.client.HttpContent;
|
import org.eclipse.jetty.client.HttpContent;
|
||||||
import org.eclipse.jetty.client.HttpExchange;
|
import org.eclipse.jetty.client.HttpExchange;
|
||||||
|
import org.eclipse.jetty.client.HttpRequestException;
|
||||||
import org.eclipse.jetty.client.HttpSender;
|
import org.eclipse.jetty.client.HttpSender;
|
||||||
import org.eclipse.jetty.client.api.ContentProvider;
|
import org.eclipse.jetty.client.api.ContentProvider;
|
||||||
import org.eclipse.jetty.client.api.Request;
|
import org.eclipse.jetty.client.api.Request;
|
||||||
|
@ -107,6 +108,12 @@ public class HttpSenderOverHTTP extends HttpSender
|
||||||
endPoint.write(new ByteBufferRecyclerCallback(callback, bufferPool, toRecycle), toWrite);
|
endPoint.write(new ByteBufferRecyclerCallback(callback, bufferPool, toRecycle), toWrite);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
case DONE:
|
||||||
|
{
|
||||||
|
// The headers have already been generated, perhaps by a concurrent abort.
|
||||||
|
callback.failed(new HttpRequestException("Could not generate headers", request));
|
||||||
|
return;
|
||||||
|
}
|
||||||
default:
|
default:
|
||||||
{
|
{
|
||||||
throw new IllegalStateException(result.toString());
|
throw new IllegalStateException(result.toString());
|
||||||
|
|
Loading…
Reference in New Issue