Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

NettyAsyncHttpProvider issue during setting future.keepAlive() #8

Closed
wants to merge 3 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
6 changes: 3 additions & 3 deletions README
Expand Up @@ -19,7 +19,7 @@ and then define the dependency as:
<dependency>
<groupId>com.ning</groupId>
<artifactId>async-http-client</artifactId>
<version>1.6.2</version>
<version>1.6.3</version>
</dependency>

You can also download the artifact
Expand Down Expand Up @@ -97,7 +97,7 @@ You can also mix Future with AsyncHandler to only retrieve part of the asynchron

@Override
public STATE onHeadersReceived(HttpResponseHeaders h) throws Exception {
Headers headers = h.getHeaders();
FluentCaseInsensitiveStringsMap headers = h.getHeaders();
// The headers have been read
// If you don't want to read the body, or stop processing the response
return STATE.ABORT;
Expand All @@ -106,7 +106,7 @@ You can also mix Future with AsyncHandler to only retrieve part of the asynchron
@Override
public STATE onBodyPartReceived(HttpResponseBodyPart bodyPart) throws Exception {
builder.append(new String(bodyPart.getBodyPartBytes()));
return STATE.CONTINU
return STATE.CONTINUE;
}

@Override
Expand Down
Expand Up @@ -1009,7 +1009,7 @@ public void messageReceived(final ChannelHandlerContext ctx, MessageEvent e) thr
int statusCode = response.getStatus().getCode();

String ka = response.getHeader(HttpHeaders.Names.CONNECTION);
future.setKeepAlive(ka == null || ka.toLowerCase().equals("keep-alive"));
future.setKeepAlive(ka != null && ka.toLowerCase().equals("keep-alive"));

List<String> wwwAuth = getWwwAuth(response.getHeaders());
Realm realm = request.getRealm() != null ? request.getRealm() : config.getRealm();
Expand Down