Avoid IllegalStateException in case of abort concurrent to header

generation.
This commit is contained in:
Simone Bordet 2014-05-11 11:21:11 +02:00
parent 0e4a903764
commit d92ac8062b
1 changed files with 7 additions and 0 deletions

View File

@ -23,6 +23,7 @@ import java.nio.ByteBuffer;
import org.eclipse.jetty.client.HttpClient;
import org.eclipse.jetty.client.HttpContent;
import org.eclipse.jetty.client.HttpExchange;
import org.eclipse.jetty.client.HttpRequestException;
import org.eclipse.jetty.client.HttpSender;
import org.eclipse.jetty.client.api.ContentProvider;
import org.eclipse.jetty.client.api.Request;
@ -107,6 +108,12 @@ public class HttpSenderOverHTTP extends HttpSender
endPoint.write(new ByteBufferRecyclerCallback(callback, bufferPool, toRecycle), toWrite);
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:
{
throw new IllegalStateException(result.toString());