5 Star 0 Fork 15

src-openEuler/resteasy

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
该仓库未声明开源许可证文件(LICENSE),使用请关注具体项目描述及其代码上游依赖。
克隆/下载
resteasy-3.0.19-port-resteasy-netty-to-netty-3.10.6.patch 4.53 KB
一键复制 编辑 原始数据 按行查看 历史
baizg1107 提交于 2020-10-28 15:56 . Package init
diff -Nru Resteasy-3.0.19.Final/jaxrs/pom.xml Resteasy-3.0.19.Final.netty3/jaxrs/pom.xml
--- Resteasy-3.0.19.Final/jaxrs/pom.xml 2016-12-27 11:13:52.980803759 +0100
+++ Resteasy-3.0.19.Final.netty3/jaxrs/pom.xml 2016-12-27 11:15:46.080178186 +0100
@@ -39,7 +39,7 @@
<dep.cdi-api.version>1.2</dep.cdi-api.version>
<dep.jboss-ejb-api_3.1_spec.version>1.0.0.Final</dep.jboss-ejb-api_3.1_spec.version>
<dep.guice.version>4.0</dep.guice.version>
- <dep.netty.version>3.6.4.Final</dep.netty.version>
+ <dep.netty.version>3.10.6.Final</dep.netty.version>
<dep.netty4.version>4.0.7.Final</dep.netty4.version>
<dep.slf4j.version>1.7.5</dep.slf4j.version>
<dep.bc.version>1.52</dep.bc.version>
diff -Nru Resteasy-3.0.19.Final/jaxrs/server-adapters/resteasy-netty/src/main/java/org/jboss/resteasy/plugins/server/netty/NettyHttpResponse.java Resteasy-3.0.19.Final.netty3/jaxrs/server-adapters/resteasy-netty/src/main/java/org/jboss/resteasy/plugins/server/netty/NettyHttpResponse.java
--- Resteasy-3.0.19.Final/jaxrs/server-adapters/resteasy-netty/src/main/java/org/jboss/resteasy/plugins/server/netty/NettyHttpResponse.java 2016-08-02 16:26:27.000000000 +0200
+++ Resteasy-3.0.19.Final.netty3/jaxrs/server-adapters/resteasy-netty/src/main/java/org/jboss/resteasy/plugins/server/netty/NettyHttpResponse.java 2016-12-27 11:14:53.477794634 +0100
@@ -119,8 +119,9 @@
if (keepAlive)
{
// Add keep alive and content length if needed
- response.addHeader(Names.CONNECTION, Values.KEEP_ALIVE);
- response.addHeader(Names.CONTENT_LENGTH, 0);
+ response.headers()
+ .add(Names.CONNECTION, Values.KEEP_ALIVE)
+ .add(Names.CONTENT_LENGTH, 0);
}
channel.write(response);
committed = true;
diff -Nru Resteasy-3.0.19.Final/jaxrs/server-adapters/resteasy-netty/src/main/java/org/jboss/resteasy/plugins/server/netty/NettyUtil.java Resteasy-3.0.19.Final.netty3/jaxrs/server-adapters/resteasy-netty/src/main/java/org/jboss/resteasy/plugins/server/netty/NettyUtil.java
--- Resteasy-3.0.19.Final/jaxrs/server-adapters/resteasy-netty/src/main/java/org/jboss/resteasy/plugins/server/netty/NettyUtil.java 2016-08-02 16:26:27.000000000 +0200
+++ Resteasy-3.0.19.Final.netty3/jaxrs/server-adapters/resteasy-netty/src/main/java/org/jboss/resteasy/plugins/server/netty/NettyUtil.java 2016-12-27 11:03:35.816979009 +0100
@@ -98,7 +98,7 @@
{
Headers<String> requestHeaders = new Headers<String>();
- for (Map.Entry<String, String> header : request.getHeaders())
+ for (Map.Entry<String, String> header : request.headers())
{
requestHeaders.add(header.getKey(), header.getValue());
}
diff -Nru Resteasy-3.0.19.Final/jaxrs/server-adapters/resteasy-netty/src/main/java/org/jboss/resteasy/plugins/server/netty/RestEasyHttpResponseEncoder.java Resteasy-3.0.19.Final.netty3/jaxrs/server-adapters/resteasy-netty/src/main/java/org/jboss/resteasy/plugins/server/netty/RestEasyHttpResponseEncoder.java
--- Resteasy-3.0.19.Final/jaxrs/server-adapters/resteasy-netty/src/main/java/org/jboss/resteasy/plugins/server/netty/RestEasyHttpResponseEncoder.java 2016-08-02 16:26:27.000000000 +0200
+++ Resteasy-3.0.19.Final.netty3/jaxrs/server-adapters/resteasy-netty/src/main/java/org/jboss/resteasy/plugins/server/netty/RestEasyHttpResponseEncoder.java 2016-12-27 11:05:34.884907810 +0100
@@ -58,11 +58,11 @@
RuntimeDelegate.HeaderDelegate delegate = dispatcher.providerFactory.getHeaderDelegate(value.getClass());
if (delegate != null)
{
- response.addHeader(key, delegate.toString(value));
+ response.headers().add(key, delegate.toString(value));
}
else
{
- response.setHeader(key, value.toString());
+ response.headers().add(key, value.toString());
}
}
}
@@ -77,8 +77,9 @@
if (nettyResponse.isKeepAlive())
{
// Add content length and connection header if needed
- response.setHeader(Names.CONTENT_LENGTH, buffer.readableBytes());
- response.setHeader(Names.CONNECTION, Values.KEEP_ALIVE);
+ response.headers()
+ .set(Names.CONTENT_LENGTH, buffer.readableBytes())
+ .set(Names.CONNECTION, Values.KEEP_ALIVE);
}
return response;
}
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
1
https://gitee.com/src-openeuler/resteasy.git
git@gitee.com:src-openeuler/resteasy.git
src-openeuler
resteasy
resteasy
master

搜索帮助