Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions README.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -115,6 +115,13 @@ Do NOT use it.
|1000
|700

.2+|dnsjava.nio.register_shutdown_hook
3+|Register Shutdown Hook for automatic termination of NIO.
If disabled, the nio selector thread will not automatically clean up on JVM termination.
|Boolean
|True
|False

.2+|dnsjava.harden_unknown_additional
3+|Harden against unknown records in the authority section and additional section.
If disabled, such records are copied from the upstream and presented to the client together with the answer.
Expand Down
6 changes: 5 additions & 1 deletion src/main/java/org/xbill/DNS/NioClient.java
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,8 @@
* <dl>
* <dt>dnsjava.nio.selector_timeout
* <dd>Set selector timeout in milliseconds. Default/Max 1000, Min 1.
* <dt>dnsjava.nio.register_shutdown_hook
* <dd>Register Shutdown Hook termination of NIO. Default True.
* </dl>
*
* @since 3.4
Expand Down Expand Up @@ -60,7 +62,9 @@ static Selector selector() throws IOException {
selectorThread.start();
closeThread = new Thread(() -> close(true));
closeThread.setName("dnsjava NIO shutdown hook");
Runtime.getRuntime().addShutdownHook(closeThread);
if (Boolean.parseBoolean(System.getProperty("dnsjava.nio.register_shutdown_hook", "true"))) {
Runtime.getRuntime().addShutdownHook(closeThread);
}
}
}
}
Expand Down