Skip to content

Commit 1f3b3a0

Browse files
committed
update string buffer to string builder.
1 parent 2281214 commit 1f3b3a0

File tree

2 files changed

+7
-2
lines changed

2 files changed

+7
-2
lines changed

EasyRest/src/main/java/tech/dbgsoftware/easyrest/model/request/Request.java

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,8 @@ public Request(FullHttpRequest fullHttpRequest) {
5050
}
5151
}));
5252
}
53+
} catch (Exception e) {
54+
LogUtils.error("Ref count = " + fullHttpRequest.refCnt() + " " + e.getMessage());
5355
} finally {
5456
fullHttpRequest.release();
5557
}

EasyRest/src/main/java/tech/dbgsoftware/easyrest/network/NettyInit.java

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -243,15 +243,18 @@ private void registerUserHandlers(ChannelPipeline pipeline){
243243
userHandlers.forEach((name, handler) -> {
244244
Function<Map<String, Boolean>, ChannelHandler> handlerPredicate = newHandler -> {
245245
try {
246-
if (!newHandler.get(name)) {
246+
if (newHandler != null && handler != null && !newHandler.get(name)) {
247247
return handler.getClass().newInstance();
248248
}
249249
} catch (InstantiationException | IllegalAccessException e) {
250250
LOGGER.error(e.getMessage(), e);
251251
}
252252
return handler;
253253
};
254-
pipeline.addLast(workerEventLoopGroup, handlerPredicate.apply(isSharableMapping));
254+
ChannelHandler channelHandler = handlerPredicate.apply(isSharableMapping);
255+
if (channelHandler != null) {
256+
pipeline.addLast(workerEventLoopGroup, channelHandler);
257+
}
255258
});
256259
}
257260
}

0 commit comments

Comments
 (0)