Skip to content

Commit

Permalink
优化代码
Browse files Browse the repository at this point in the history
  • Loading branch information
smthing committed Jan 12, 2025
1 parent 16e8a56 commit df9c8ae
Showing 1 changed file with 4 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -180,7 +180,7 @@ public void handle(HttpRequest request, HttpResponse response, CompletableFuture
}
System.out.println("\033[1mWeb Info:\033[0m");
if (config.isEnabled()) {
HttpServer httpBootstrap = Feat.createHttpServer(options -> {
HttpServer httpServer = Feat.createHttpServer(options -> {
options.group(group)
.readBufferSize(config.getReadBufferSize())
.serverName("smart-servlet")
Expand All @@ -192,7 +192,7 @@ public void handle(HttpRequest request, HttpResponse response, CompletableFuture
options.proxyProtocolSupport();
}
});
httpBootstrap.httpHandler(httpServerHandler).listen(config.getHost(), config.getPort());
httpServer.httpHandler(httpServerHandler).listen(config.getHost(), config.getPort());
System.out.println("\tHTTP is enabled, " + config.getHost() + ":" + config.getPort());
} else {
System.out.println("\tHTTP is disabled.");
Expand Down Expand Up @@ -272,7 +272,7 @@ private void startSslServer(ContainerConfig config, AsynchronousChannelGroup gro
default:
throw new UnsupportedOperationException("无效证书类型");
}
HttpServer httpBootstrap = Feat.createHttpServer(options -> {
HttpServer httpServer = Feat.createHttpServer(options -> {
options.group(group)
.readBufferSize(config.getSslReadBufferSize())
.serverName("smart-servlet")
Expand All @@ -285,7 +285,7 @@ private void startSslServer(ContainerConfig config, AsynchronousChannelGroup gro
options.proxyProtocolSupport();
}
});
httpBootstrap.httpHandler(httpServerHandler).listen(config.getHost(), config.getSslPort());
httpServer.httpHandler(httpServerHandler).listen(config.getHost(), config.getSslPort());
}

@Override
Expand Down

0 comments on commit df9c8ae

Please sign in to comment.