Skip to content

Commit

Permalink
Expose the check for an HttpChannel's async send ability.
Browse files Browse the repository at this point in the history
  • Loading branch information
tobias committed Apr 7, 2015
1 parent 9069579 commit 14b2df4
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 1 deletion.
Expand Up @@ -18,4 +18,5 @@

public interface HttpChannel extends Channel {
boolean sendStarted();
boolean asyncSendSupported();
}
Expand Up @@ -40,6 +40,11 @@ public ServletHttpChannel(final HttpServletRequest request,
this.asyncContext.setTimeout(0);
}

@Override
public boolean asyncSendSupported() {
return isAsync();
}

@Override
protected String getResponseCharset() {
return this.response.getCharacterEncoding();
Expand Down Expand Up @@ -87,7 +92,7 @@ static boolean isAsync() {
@Override
void enqueue(PendingSend pending) {
//be async in 9.x, sync in 8.x (due to https://issues.jboss.org/browse/WFLY-3715)
if (isAsync()) {
if (asyncSendSupported()) {
super.enqueue(pending); // async
} else {
send(pending); // sync
Expand Down
Expand Up @@ -29,6 +29,11 @@ public UndertowHttpChannel(final HttpServerExchange exchange,
this.exchange = exchange.setPersistent(true).dispatch();
}

@Override
public boolean asyncSendSupported() {
return true;
}

@Override
protected String getResponseCharset() {
// getResponseCharset claims to return ISO-8859-1 if a charset can't be found,
Expand Down

0 comments on commit 14b2df4

Please sign in to comment.