mirror of
https://github.com/2dust/v2rayN.git
synced 2026-11-17 09:55:00 +03:00
fix: keep the PAC listener running after a client reset (#10447)
* fix: keep the PAC listener running after a client reset * Update PacManager.cs * Update PacManager.cs --------- Co-authored-by: 2dust <31833384+2dust@users.noreply.github.com>
This commit is contained in:
@@ -64,6 +64,8 @@ public class PacManager
|
|||||||
try
|
try
|
||||||
{
|
{
|
||||||
while (!token.IsCancellationRequested)
|
while (!token.IsCancellationRequested)
|
||||||
|
{
|
||||||
|
try
|
||||||
{
|
{
|
||||||
using var client = await listener.AcceptTcpClientAsync(token).ConfigureAwait(false);
|
using var client = await listener.AcceptTcpClientAsync(token).ConfigureAwait(false);
|
||||||
await using var stream = client.GetStream();
|
await using var stream = client.GetStream();
|
||||||
@@ -71,6 +73,10 @@ public class PacManager
|
|||||||
await stream.WriteAsync(_writeContent, token).ConfigureAwait(false);
|
await stream.WriteAsync(_writeContent, token).ConfigureAwait(false);
|
||||||
await stream.FlushAsync(token).ConfigureAwait(false);
|
await stream.FlushAsync(token).ConfigureAwait(false);
|
||||||
}
|
}
|
||||||
|
catch
|
||||||
|
{
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
catch (OperationCanceledException) when (token.IsCancellationRequested)
|
catch (OperationCanceledException) when (token.IsCancellationRequested)
|
||||||
{
|
{
|
||||||
|
|||||||
Reference in New Issue
Block a user