Skip to content

Commit a184de6

Browse files
Merge branch 'stable'
2 parents 7b7def9 + c8b98b5 commit a184de6

File tree

2 files changed

+21
-7
lines changed

2 files changed

+21
-7
lines changed

projects/client/RabbitMQ.Client/src/client/impl/AutorecoveringConnection.cs

Lines changed: 19 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -64,6 +64,8 @@ public class AutorecoveringConnection : IConnection, IRecoverable
6464
public readonly object m_recordedEntitiesLock = new object();
6565
protected readonly TaskFactory recoveryTaskFactory = new TaskFactory();
6666
protected readonly object recoveryLockTarget = new object();
67+
// used to block connection recovery attempts after Close() is unvoked
68+
protected bool manuallyClosed = false;
6769
protected bool performingRecovery = false;
6870

6971
protected List<AutorecoveringModel> m_models = new List<AutorecoveringModel>();
@@ -332,18 +334,21 @@ public void BeginAutomaticRecovery()
332334

333335
recoveryTaskFactory.StartNew(() =>
334336
{
335-
try
337+
if(!self.manuallyClosed)
336338
{
339+
try
340+
{
337341
#if NETFX_CORE
338342
System.Threading.Tasks.Task.Delay(m_factory.NetworkRecoveryInterval).Wait();
339343
#else
340344
Thread.Sleep(m_factory.NetworkRecoveryInterval);
341345
#endif
342-
self.PerformAutomaticRecovery();
343-
}
344-
finally
345-
{
346-
performingRecovery = false;
346+
self.PerformAutomaticRecovery();
347+
}
348+
finally
349+
{
350+
performingRecovery = false;
351+
}
347352
}
348353
});
349354
}
@@ -608,48 +613,56 @@ protected void Init(string hostname)
608613
///<summary>API-side invocation of connection abort.</summary>
609614
public void Abort()
610615
{
616+
this.manuallyClosed = true;
611617
m_delegate.Abort();
612618
}
613619

614620
///<summary>API-side invocation of connection abort.</summary>
615621
public void Abort(ushort reasonCode, string reasonText)
616622
{
623+
this.manuallyClosed = true;
617624
m_delegate.Abort(reasonCode, reasonText);
618625
}
619626

620627
///<summary>API-side invocation of connection abort with timeout.</summary>
621628
public void Abort(int timeout)
622629
{
630+
this.manuallyClosed = true;
623631
m_delegate.Abort(timeout);
624632
}
625633

626634
///<summary>API-side invocation of connection abort with timeout.</summary>
627635
public void Abort(ushort reasonCode, string reasonText, int timeout)
628636
{
637+
this.manuallyClosed = true;
629638
m_delegate.Abort(reasonCode, reasonText, timeout);
630639
}
631640

632641
///<summary>API-side invocation of connection.close.</summary>
633642
public void Close()
634643
{
644+
this.manuallyClosed = true;
635645
m_delegate.Close();
636646
}
637647

638648
///<summary>API-side invocation of connection.close.</summary>
639649
public void Close(ushort reasonCode, string reasonText)
640650
{
651+
this.manuallyClosed = true;
641652
m_delegate.Close(reasonCode, reasonText);
642653
}
643654

644655
///<summary>API-side invocation of connection.close with timeout.</summary>
645656
public void Close(int timeout)
646657
{
658+
this.manuallyClosed = true;
647659
m_delegate.Close(timeout);
648660
}
649661

650662
///<summary>API-side invocation of connection.close with timeout.</summary>
651663
public void Close(ushort reasonCode, string reasonText, int timeout)
652664
{
665+
this.manuallyClosed = true;
653666
m_delegate.Close(reasonCode, reasonText, timeout);
654667
}
655668

projects/client/Unit.WinRT/RabbitMQ.Client.Unit.WinRT.csproj

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,8 @@
4747
</PropertyGroup>
4848
<Target Name="ImportSSL" Condition="$(SSLAvail)">
4949
<!-- import cacert into certmgr -->
50-
<Exec Command="certmgr -add -c Trust $(SSLCertsDir)/testca/cacert.cer" />
50+
<!-- <Exec Command="certmgr -c -add -s $(SSLCertsDir)\testca\cacert.cer -r localMachine Root" /> -->
51+
<Exec Command="certutil -addstore Root $(SSLCertsDir)\testca\cacert.cer" />
5152
</Target>
5253
<!-- Decide whether we need to set TEMP under mono -->
5354
<PropertyGroup>

0 commit comments

Comments
 (0)