update to netty 4.1.91, do not release bytebuf in content()/json() method
This commit is contained in:
parent
9435cc649b
commit
73a8c219c6
3 changed files with 11 additions and 22 deletions
|
@ -1,5 +1,5 @@
|
|||
group = org.xbib
|
||||
name = netty-http
|
||||
version = 4.1.90.0
|
||||
version = 4.1.91.0
|
||||
|
||||
org.gradle.warning.mode = ALL
|
||||
|
|
|
@ -2,7 +2,6 @@ package org.xbib.netty.http.client.api;
|
|||
|
||||
import io.netty.buffer.ByteBuf;
|
||||
import io.netty.buffer.ByteBufAllocator;
|
||||
import io.netty.buffer.ByteBufUtil;
|
||||
import io.netty.buffer.PooledByteBufAllocator;
|
||||
import io.netty.handler.codec.http.DefaultHttpHeaders;
|
||||
import io.netty.handler.codec.http.HttpHeaderNames;
|
||||
|
@ -588,22 +587,12 @@ public final class Request {
|
|||
}
|
||||
|
||||
public Builder text(String text) {
|
||||
ByteBuf byteBuf = ByteBufUtil.writeUtf8(allocator, text);
|
||||
try {
|
||||
content(byteBuf, HttpHeaderValues.TEXT_PLAIN);
|
||||
} finally {
|
||||
byteBuf.release();
|
||||
}
|
||||
content(text, HttpHeaderValues.TEXT_PLAIN);
|
||||
return this;
|
||||
}
|
||||
|
||||
public Builder json(String json) {
|
||||
ByteBuf byteBuf = ByteBufUtil.writeUtf8(allocator, json);
|
||||
try {
|
||||
content(byteBuf, HttpHeaderValues.APPLICATION_JSON);
|
||||
} finally {
|
||||
byteBuf.release();
|
||||
}
|
||||
content(json, HttpHeaderValues.APPLICATION_JSON);
|
||||
return this;
|
||||
}
|
||||
|
||||
|
@ -612,11 +601,6 @@ public final class Request {
|
|||
return this;
|
||||
}
|
||||
|
||||
public Builder content(ByteBuf byteBuf) {
|
||||
this.content = byteBuf;
|
||||
return this;
|
||||
}
|
||||
|
||||
public Builder content(CharSequence charSequence, CharSequence contentType) {
|
||||
content(charSequence.toString().getBytes(HttpUtil.getCharset(contentType, StandardCharsets.UTF_8)),
|
||||
AsciiString.of(contentType));
|
||||
|
@ -638,6 +622,11 @@ public final class Request {
|
|||
return this;
|
||||
}
|
||||
|
||||
public Builder content(ByteBuf byteBuf) {
|
||||
this.content = byteBuf;
|
||||
return this;
|
||||
}
|
||||
|
||||
public Builder setResponseListener(ResponseListener<HttpResponse> responseListener) {
|
||||
this.responseListener = responseListener;
|
||||
return this;
|
||||
|
|
|
@ -13,7 +13,7 @@ dependencyResolutionManagement {
|
|||
version('groovy', '4.0.11')
|
||||
version('spock', '2.4-M1-groovy-4.0')
|
||||
version('junit', '5.9.2')
|
||||
version('netty', '4.1.90.Final')
|
||||
version('netty', '4.1.91.Final')
|
||||
version('netty-tcnative', '2.0.59.Final')
|
||||
library('groovy-core', 'org.codehaus.groovy', 'groovy').versionRef('groovy')
|
||||
library('spock-core', 'org.spockframework', 'spock-core').versionRef('spock')
|
||||
|
@ -32,8 +32,8 @@ dependencyResolutionManagement {
|
|||
library('jackson', 'com.fasterxml.jackson.core', 'jackson-databind').version('2.12.7')
|
||||
library('javassist', 'org.javassist', 'javassist').version('3.29.1-GA')
|
||||
library('guice', 'org.xbib', 'guice').version('5.0.1.0')
|
||||
library('net', 'org.xbib', 'net').version('3.1.0')
|
||||
library('net-path', 'org.xbib', 'net-path').version('3.1.0')
|
||||
library('net', 'org.xbib', 'net').version('3.2.0')
|
||||
library('net-path', 'org.xbib', 'net-path').version('3.2.0')
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue