Commit 3f430f34 authored by justcoding121's avatar justcoding121

fix retry

parent 4debbe81
...@@ -32,9 +32,9 @@ namespace Titanium.Web.Proxy.Network ...@@ -32,9 +32,9 @@ namespace Titanium.Web.Proxy.Network
Exception exception = null; Exception exception = null;
var attempts = retries; var attempts = retries;
while (attempts >= 0)
while (true)
{ {
try try
{ {
//setup connection //setup connection
...@@ -49,15 +49,17 @@ namespace Titanium.Web.Proxy.Network ...@@ -49,15 +49,17 @@ namespace Titanium.Web.Proxy.Network
exception = ex; exception = ex;
} }
if(exception == null attempts--;
if (attempts < 0
|| exception == null
|| !(exception is T)) || !(exception is T))
{ {
break; break;
} }
exception = null; exception = null;
await disposeConnection(); await disposeConnection();
attempts--;
} }
return new RetryResult(currentConnection, exception, @continue); return new RetryResult(currentConnection, exception, @continue);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment