Browse Source

remove headerLimiter (#6835)

* update smart-servlet to 0.1.3-SNAPSHOT

* update aio-enhance to 1.0.3-SNAPSHOT

* smart-servlet bugfix

* bugfix

* update smart-socket to 1.5.6-SNAPSHOT

* remove file

* update aio-enhance to 1.0.4-SNAPSHOT

* 优化代码

* 优化代码

* update smart-socket to 1.5.6

* config threadNum

* update smart-socket to 1.5.7-SNAPSHOT

* 优化代码

* update smart-socket to 1.5.10-SNAPSHOT

* 优化代码

* 优化代码

* 优化代码

* 异常aio-enhance

* 优化代码

* 优化代码

* 优化代码

* remove aio-pro

* remove headerLimiter
三刀 3 years ago
parent
commit
2fd58c9b53

+ 1 - 17
frameworks/Java/smart-socket/src/main/java/org/smartboot/http/Bootstrap.java

@@ -16,10 +16,6 @@ import org.smartboot.http.server.HttpRequest;
 import org.smartboot.http.server.HttpResponse;
 import org.smartboot.http.server.HttpServerHandler;
 import org.smartboot.http.server.handler.HttpRouteHandler;
-import org.smartboot.http.server.impl.Request;
-import org.smartboot.socket.StateMachineEnum;
-import org.smartboot.socket.extension.processor.AbstractMessageProcessor;
-import org.smartboot.socket.transport.AioSession;
 
 import javax.sql.DataSource;
 import java.io.IOException;
@@ -55,22 +51,10 @@ public class Bootstrap {
         HttpBootstrap bootstrap = new HttpBootstrap();
         bootstrap.configuration()
                 .threadNum(cpuNum)
-                .headerLimiter(0)
                 .readBufferSize(1024 * 4)
                 .writeBufferSize(1024 * 4)
                 .readMemoryPool(16384 * 1024 * 4)
-                .writeMemoryPool(10 * 1024 * 1024 * cpuNum, cpuNum)
-                .messageProcessor(processor -> new AbstractMessageProcessor<>() {
-                    @Override
-                    public void process0(AioSession session, Request msg) {
-                        processor.process(session, msg);
-                    }
-
-                    @Override
-                    public void stateEvent0(AioSession session, StateMachineEnum stateMachineEnum, Throwable throwable) {
-                        processor.stateEvent(session, stateMachineEnum, throwable);
-                    }
-                });
+                .writeMemoryPool(10 * 1024 * 1024 * cpuNum, cpuNum);
         bootstrap.httpHandler(routeHandle).setPort(8080).start();
     }
 

+ 1 - 13
frameworks/Java/smart-socket/src/main/java/org/smartboot/servlet/Bootstrap.java

@@ -42,22 +42,10 @@ public class Bootstrap {
         bootstrap.configuration()
                 .threadNum(cpuNum)
                 .bannerEnabled(false)
-                .headerLimiter(0)
                 .readBufferSize(1024 * 4)
                 .writeBufferSize(1024 * 4)
                 .readMemoryPool(16384 * 1024 * 4)
-                .writeMemoryPool(10 * 1024 * 1024 * cpuNum, cpuNum)
-                .messageProcessor(processor -> new AbstractMessageProcessor<>() {
-                    @Override
-                    public void process0(AioSession session, Request msg) {
-                        processor.process(session, msg);
-                    }
-
-                    @Override
-                    public void stateEvent0(AioSession session, StateMachineEnum stateMachineEnum, Throwable throwable) {
-                        processor.stateEvent(session, stateMachineEnum, throwable);
-                    }
-                });
+                .writeMemoryPool(10 * 1024 * 1024 * cpuNum, cpuNum);
         bootstrap.setPort(8080)
                 .httpHandler(new HttpServerHandler() {
                     @Override