Move Instrumentation from TlsSettings into UserSettings (TlsSettings will go away).

This commit is contained in:
Martin Baulig 2015-08-05 02:42:58 +02:00
Родитель ff7a6513b7
Коммит 1c50c2a2d0
6 изменённых файлов: 20 добавлений и 33 удалений

Просмотреть файл

@ -18,7 +18,7 @@
<DebugType>full</DebugType>
<Optimize>false</Optimize>
<OutputPath>bin\Debug</OutputPath>
<DefineConstants>DEBUG;PCL</DefineConstants>
<DefineConstants>DEBUG;PCL;INSTRUMENTATION</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
<ConsolePause>false</ConsolePause>

Просмотреть файл

@ -91,6 +91,15 @@ namespace Mono.Security.NewTls
hasSignatureParameters = true;
}
}
#if INSTRUMENTATION
public Instrumentation Instrumentation {
get; set;
}
#endif
}
}

Просмотреть файл

@ -115,7 +115,7 @@ namespace Mono.Security.NewTls.TestProvider
settings = GetSettings (userSettings);
if (instrumentation != null)
((TlsSettings)settings).Instrumentation = instrumentation;
((TlsSettings)settings).UserSettings.Instrumentation = instrumentation;
monoSslStream = await Start (ctx, stream, settings, cancellationToken);
return monoSslStream;

Просмотреть файл

@ -191,22 +191,6 @@ namespace Mono.Security.NewTls
PrivateKey = null;
Certificate = null;
}
#if INSTRUMENTATION
public bool HasInstrumentation {
get { return TlsSettings != null && TlsSettings.Instrumentation != null; }
}
public Instrumentation Instrumentation {
get {
if (!HasInstrumentation)
throw new InvalidOperationException ();
return TlsSettings.Instrumentation;
}
}
#endif
}
}

Просмотреть файл

@ -104,13 +104,15 @@ namespace Mono.Security.NewTls
this.eventSink = eventSink;
#if INSTRUMENTATION
if (configuration.HasInstrumentation) {
if (configuration.Instrumentation.HasSignatureInstrument)
signatureProvider = configuration.Instrumentation.SignatureInstrument;
if (configuration.Instrumentation.HasSettingsInstrument)
settingsProvider = configuration.Instrumentation.SettingsInstrument;
handshakeInstruments = configuration.Instrumentation.HandshakeInstruments;
instrumentationEventSink = configuration.Instrumentation.EventSink;
var userSettings = configuration.TlsSettings != null ? configuration.TlsSettings.UserSettings : null;
var instrumentation = userSettings != null ? userSettings.Instrumentation : null;
if (instrumentation != null) {
if (instrumentation.HasSignatureInstrument)
signatureProvider = instrumentation.SignatureInstrument;
if (instrumentation.HasSettingsInstrument)
settingsProvider = instrumentation.SettingsInstrument;
handshakeInstruments = instrumentation.HandshakeInstruments;
instrumentationEventSink = instrumentation.EventSink;
}
#endif

Просмотреть файл

@ -42,14 +42,6 @@ namespace Mono.Security.NewTls
}
#endregion
#if INSTRUMENTATION
public Instrumentation Instrumentation {
get; set;
}
#endif
}
}