You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@dubbo.apache.org by me...@apache.org on 2020/07/08 03:39:46 UTC
[dubbo] branch master updated: fix bug: Rest Protocol can't work
when use Tomcat as WebContainer (#6402)
This is an automated email from the ASF dual-hosted git repository.
mercyblitz pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/dubbo.git
The following commit(s) were added to refs/heads/master by this push:
new 44345d5 fix bug: Rest Protocol can't work when use Tomcat as WebContainer (#6402)
44345d5 is described below
commit 44345d5d6a49a7996641129bdbbf812c8263411b
Author: 星尘 <yi...@126.com>
AuthorDate: Wed Jul 8 11:39:30 2020 +0800
fix bug: Rest Protocol can't work when use Tomcat as WebContainer (#6402)
Co-authored-by: 01376420 <1qaz!QAZ>
---
.../java/org/apache/dubbo/remoting/http/tomcat/TomcatHttpServer.java | 3 +--
1 file changed, 1 insertion(+), 2 deletions(-)
diff --git a/dubbo-remoting/dubbo-remoting-http/src/main/java/org/apache/dubbo/remoting/http/tomcat/TomcatHttpServer.java b/dubbo-remoting/dubbo-remoting-http/src/main/java/org/apache/dubbo/remoting/http/tomcat/TomcatHttpServer.java
index 167653a..954259b 100755
--- a/dubbo-remoting/dubbo-remoting-http/src/main/java/org/apache/dubbo/remoting/http/tomcat/TomcatHttpServer.java
+++ b/dubbo-remoting/dubbo-remoting-http/src/main/java/org/apache/dubbo/remoting/http/tomcat/TomcatHttpServer.java
@@ -51,14 +51,13 @@ public class TomcatHttpServer extends AbstractHttpServer {
String baseDir = new File(System.getProperty("java.io.tmpdir")).getAbsolutePath();
tomcat = new Tomcat();
- Connector connector = new Connector("org.apache.coyote.http11.Http11NioProtocol");
+ Connector connector = tomcat.getConnector();
connector.setPort(url.getPort());
connector.setProperty("maxThreads", String.valueOf(url.getParameter(THREADS_KEY, DEFAULT_THREADS)));
connector.setProperty("maxConnections", String.valueOf(url.getParameter(ACCEPTS_KEY, -1)));
connector.setProperty("URIEncoding", "UTF-8");
connector.setProperty("connectionTimeout", "60000");
connector.setProperty("maxKeepAliveRequests", "-1");
- tomcat.setConnector(connector);
tomcat.setBaseDir(baseDir);
tomcat.setPort(url.getPort());