fix(test/server): Fix force cleanup in DNS server tests by casting server properties before closing sockets
This commit is contained in:
parent
1185ea67d4
commit
0f8953fc1d
@ -1,5 +1,11 @@
|
|||||||
# Changelog
|
# Changelog
|
||||||
|
|
||||||
|
## 2025-05-28 - 7.4.1 - fix(test/server)
|
||||||
|
Fix force cleanup in DNS server tests by casting server properties before closing sockets
|
||||||
|
|
||||||
|
- Cast server to any to safely invoke close() on httpsServer and udpServer in test cleanup
|
||||||
|
- Ensures proper emergency cleanup of server sockets without direct access to private properties
|
||||||
|
|
||||||
## 2025-05-28 - 7.4.0 - feat(manual socket handling)
|
## 2025-05-28 - 7.4.0 - feat(manual socket handling)
|
||||||
Add comprehensive manual socket handling documentation for advanced DNS server use cases
|
Add comprehensive manual socket handling documentation for advanced DNS server use cases
|
||||||
|
|
||||||
|
@ -193,13 +193,13 @@ async function stopServer(server: smartdns.DnsServer | null | undefined) {
|
|||||||
try {
|
try {
|
||||||
// @ts-ignore - accessing private properties for emergency cleanup
|
// @ts-ignore - accessing private properties for emergency cleanup
|
||||||
if (server.httpsServer) {
|
if (server.httpsServer) {
|
||||||
server.httpsServer.close();
|
(server as any).httpsServer.close();
|
||||||
server.httpsServer = null;
|
(server as any).httpsServer = null;
|
||||||
}
|
}
|
||||||
// @ts-ignore - accessing private properties for emergency cleanup
|
// @ts-ignore - accessing private properties for emergency cleanup
|
||||||
if (server.udpServer) {
|
if (server.udpServer) {
|
||||||
server.udpServer.close();
|
(server as any).udpServer.close();
|
||||||
server.udpServer = null;
|
(server as any).udpServer = null;
|
||||||
}
|
}
|
||||||
} catch (forceError) {
|
} catch (forceError) {
|
||||||
console.log('Force cleanup error:', forceError.message || forceError);
|
console.log('Force cleanup error:', forceError.message || forceError);
|
||||||
|
@ -3,6 +3,6 @@
|
|||||||
*/
|
*/
|
||||||
export const commitinfo = {
|
export const commitinfo = {
|
||||||
name: '@push.rocks/smartdns',
|
name: '@push.rocks/smartdns',
|
||||||
version: '7.4.0',
|
version: '7.4.1',
|
||||||
description: 'A robust TypeScript library providing advanced DNS management and resolution capabilities including support for DNSSEC, custom DNS servers, and integration with various DNS providers.'
|
description: 'A robust TypeScript library providing advanced DNS management and resolution capabilities including support for DNSSEC, custom DNS servers, and integration with various DNS providers.'
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user