Upgrade to Netty 4.1

Issue: SPR-14143
This commit is contained in:
Juergen Hoeller 2016-04-11 12:20:13 +02:00
parent 4407bd794d
commit 21e4ac1aa2
3 changed files with 12 additions and 10 deletions

View File

@ -63,9 +63,9 @@ configure(allprojects) { project ->
ext.jsonpathVersion = "2.2.0" ext.jsonpathVersion = "2.2.0"
ext.jtaVersion = "1.2" ext.jtaVersion = "1.2"
ext.junitVersion = "4.12" ext.junitVersion = "4.12"
ext.nettyVersion = "4.0.36.Final" ext.nettyVersion = "4.1.0.CR7"
ext.okhttp3Version = "3.2.0"
ext.okhttpVersion = "2.7.5" ext.okhttpVersion = "2.7.5"
ext.okhttp3Version = "3.2.0"
ext.openjpaVersion = "2.4.1" ext.openjpaVersion = "2.4.1"
ext.poiVersion = "3.14" ext.poiVersion = "3.14"
ext.protobufVersion = "2.6.1" ext.protobufVersion = "2.6.1"

View File

@ -1,5 +1,5 @@
/* /*
* Copyright 2002-2015 the original author or authors. * Copyright 2002-2016 the original author or authors.
* *
* Licensed under the Apache License, Version 2.0 (the "License"); * Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License. * you may not use this file except in compliance with the License.
@ -42,8 +42,8 @@ import org.springframework.util.concurrent.ListenableFuture;
import org.springframework.util.concurrent.SettableListenableFuture; import org.springframework.util.concurrent.SettableListenableFuture;
/** /**
* {@link org.springframework.http.client.ClientHttpRequest} implementation that uses * {@link org.springframework.http.client.ClientHttpRequest} implementation
* Netty 4 to execute requests. * that uses Netty 4 to execute requests.
* *
* <p>Created via the {@link Netty4ClientHttpRequestFactory}. * <p>Created via the {@link Netty4ClientHttpRequestFactory}.
* *
@ -148,8 +148,8 @@ class Netty4ClientHttpRequest extends AbstractAsyncClientHttpRequest implements
FullHttpRequest nettyRequest = new DefaultFullHttpRequest(HttpVersion.HTTP_1_1, FullHttpRequest nettyRequest = new DefaultFullHttpRequest(HttpVersion.HTTP_1_1,
nettyMethod, this.uri.toString(), this.body.buffer()); nettyMethod, this.uri.toString(), this.body.buffer());
nettyRequest.headers().set(HttpHeaders.HOST, uri.getHost()); nettyRequest.headers().set(HttpHeaders.HOST, this.uri.getHost());
nettyRequest.headers().set(HttpHeaders.CONNECTION, io.netty.handler.codec.http.HttpHeaders.Values.CLOSE); nettyRequest.headers().set(HttpHeaders.CONNECTION, "close");
for (Map.Entry<String, List<String>> entry : headers.entrySet()) { for (Map.Entry<String, List<String>> entry : headers.entrySet()) {
nettyRequest.headers().add(entry.getKey(), entry.getValue()); nettyRequest.headers().add(entry.getKey(), entry.getValue());

View File

@ -1,5 +1,5 @@
/* /*
* Copyright 2002-2014 the original author or authors. * Copyright 2002-2016 the original author or authors.
* *
* Licensed under the Apache License, Version 2.0 (the "License"); * Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License. * you may not use this file except in compliance with the License.
@ -28,8 +28,8 @@ import org.springframework.http.HttpHeaders;
import org.springframework.util.Assert; import org.springframework.util.Assert;
/** /**
* {@link org.springframework.http.client.ClientHttpResponse} implementation that uses * {@link org.springframework.http.client.ClientHttpResponse} implementation
* Netty 4 to execute requests. * that uses Netty 4 to parse responses.
* *
* @author Arjen Poutsma * @author Arjen Poutsma
* @since 4.1.2 * @since 4.1.2
@ -56,11 +56,13 @@ class Netty4ClientHttpResponse extends AbstractClientHttpResponse {
@Override @Override
@SuppressWarnings("deprecation")
public int getRawStatusCode() throws IOException { public int getRawStatusCode() throws IOException {
return this.nettyResponse.getStatus().code(); return this.nettyResponse.getStatus().code();
} }
@Override @Override
@SuppressWarnings("deprecation")
public String getStatusText() throws IOException { public String getStatusText() throws IOException {
return this.nettyResponse.getStatus().reasonPhrase(); return this.nettyResponse.getStatus().reasonPhrase();
} }