Skip to content

Commit 70e47ca

Browse files
cmliuCopilot
andauthored
Potential fix for pull request finding
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
1 parent 741ef1b commit 70e47ca

1 file changed

Lines changed: 6 additions & 3 deletions

File tree

_worker.js

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -676,9 +676,12 @@ function 处理XHTTPUDP请求(首包, reader, request, 反代上下文, response
676676
log(`[XHTTP转发] 处理失败: ${err?.message || err}`);
677677
closeSocketQuietly(xhttpBridge);
678678
} finally {
679-
const 保持木马UDP反代下行 = !转发失败 && 首包.协议 === 'trojan' && 木马UDP上下文.反代地址 && 木马UDP上下文.反代Socket;
680-
if (!保持木马UDP反代下行) try { 木马UDP上下文.反代Socket?.close() } catch (e) { }
681-
try { reader.releaseLock() } catch (e) { }
679+
const 保持木马UDP反代下行 = !转发失败 && 首包.协议 === 'trojan' && 木马UDP上下文.反代地址 && 木马UDP上下文.反代Socket;
680+
if (!保持木马UDP反代下行) {
681+
try { 木马UDP上下文.反代Socket?.close() } catch (e) { }
682+
closeSocketQuietly(xhttpBridge);
683+
}
684+
try { reader.releaseLock() } catch (e) { }
682685
}
683686
},
684687
cancel() {

0 commit comments

Comments
 (0)