File tree Expand file tree Collapse file tree 3 files changed +16
-2
lines changed
projects/client/RabbitMQ.Client/src/client Expand file tree Collapse file tree 3 files changed +16
-2
lines changed Original file line number Diff line number Diff line change @@ -75,14 +75,18 @@ public class ProtocolVersionMismatchException: System.Net.ProtocolViolationExcep
75
75
///<summary>The peer's AMQP specification minor version.</summary>
76
76
public int ServerMinor { get { return m_serverMinor ; } }
77
77
78
+ private static String positiveOrUnknown ( int version ) {
79
+ return version >= 0 ? version . ToString ( ) : "unknown" ;
80
+ }
81
+
78
82
///<summary>Fills the new instance's properties with the values passed in.</summary>
79
83
public ProtocolVersionMismatchException ( int clientMajor ,
80
84
int clientMinor ,
81
85
int serverMajor ,
82
86
int serverMinor )
83
87
: base ( "AMQP server protocol negotiation failure: server version " +
84
- serverMajor + "-" + serverMinor +
85
- ", client version " + clientMajor + "-" + clientMinor )
88
+ positiveOrUnknown ( serverMajor ) + "-" + positiveOrUnknown ( serverMinor ) +
89
+ ", client version " + positiveOrUnknown ( clientMajor ) + "-" + positiveOrUnknown ( clientMinor ) )
86
90
{
87
91
m_clientMajor = clientMajor ;
88
92
m_clientMinor = clientMinor ;
Original file line number Diff line number Diff line change @@ -977,6 +977,12 @@ public void Open(bool insist)
977
977
978
978
ConnectionStartDetails connectionStart = ( ConnectionStartDetails )
979
979
connectionStartCell . Value ;
980
+
981
+ if ( connectionStart == null ) {
982
+ throw new ProtocolVersionMismatchException ( Protocol . MajorVersion ,
983
+ Protocol . MinorVersion ,
984
+ - 1 , - 1 ) ;
985
+ }
980
986
981
987
ServerProperties = connectionStart . m_serverProperties ;
982
988
Original file line number Diff line number Diff line change @@ -482,6 +482,10 @@ public void FinishClose()
482
482
{
483
483
m_session . Close ( m_closeReason ) ;
484
484
}
485
+ if ( m_connectionStartCell != null )
486
+ {
487
+ m_connectionStartCell . Value = null ;
488
+ }
485
489
}
486
490
487
491
///////////////////////////////////////////////////////////////////////////
You can’t perform that action at this time.
0 commit comments