mirror of
https://github.com/2dust/v2rayN.git
synced 2026-11-01 18:15: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:
@@ -65,11 +65,17 @@ public class PacManager
|
||||
{
|
||||
while (!token.IsCancellationRequested)
|
||||
{
|
||||
using var client = await listener.AcceptTcpClientAsync(token).ConfigureAwait(false);
|
||||
await using var stream = client.GetStream();
|
||||
_ = await stream.ReadAsync(buffer, token).ConfigureAwait(false);
|
||||
await stream.WriteAsync(_writeContent, token).ConfigureAwait(false);
|
||||
await stream.FlushAsync(token).ConfigureAwait(false);
|
||||
try
|
||||
{
|
||||
using var client = await listener.AcceptTcpClientAsync(token).ConfigureAwait(false);
|
||||
await using var stream = client.GetStream();
|
||||
_ = await stream.ReadAsync(buffer, token).ConfigureAwait(false);
|
||||
await stream.WriteAsync(_writeContent, token).ConfigureAwait(false);
|
||||
await stream.FlushAsync(token).ConfigureAwait(false);
|
||||
}
|
||||
catch
|
||||
{
|
||||
}
|
||||
}
|
||||
}
|
||||
catch (OperationCanceledException) when (token.IsCancellationRequested)
|
||||
|
||||
Reference in New Issue
Block a user