svnignore[.-]*
lint.db
*.vs10x
+
+*.vsp
+*.ctl
+*.psess
\ No newline at end of file
UpdateSystemProfileInformation(config);
// check if update is required
- NetSparkleAppCastItem latestVersion = null;
+ NetSparkleAppCastItem latestVersion =null;
bUpdateRequired = IsUpdateRequired(config, out latestVersion);
- this.LatestVersion = latestVersion.Version??"";
+ if (latestVersion!=null)
+ this.LatestVersion = latestVersion.Version??"";
if (!bUpdateRequired)
goto WaitSection;
using System.Collections.Generic;
using System.IO;
using System.Linq;
+using System.Net;
using System.Reflection;
using System.Text;
using System.Threading;
Settings.Default.UseDefaultProxy = true;
}
+ if (Settings.Default.IgnoreCertificateErrors)
+ ServicePointManager.ServerCertificateValidationCallback = (sender, certificate, chain, errors) => true;
+
InitializeComponent();
}
}
}
+ public bool IgnoreCertificateErrors
+ {
+ get { return _settings.IgnoreCertificateErrors; }
+ set
+ {
+ _settings.IgnoreCertificateErrors = value;
+
+ }
+ }
+
private static void SetDebugLevel()
{
var loggerRepository = (Hierarchy) log4net.LogManager.GetRepository();
<CheckBox Content="Enable Debug Logging" Height="16" HorizontalAlignment="Left" Margin="5,10,5,5" Name="DebugLoggingEnabled" VerticalAlignment="Top"/>
<Button x:Name="OpenLogPath" Content="Open Log Path" HorizontalAlignment="Left" Margin="5" Style="{StaticResource ButtonStyle}" Width="Auto"/>
<Button x:Name="OpenLogConsole" Content="Open Log Console" HorizontalAlignment="Left" Margin="5" Style="{StaticResource ButtonStyle}" Width="Auto" Visibility="Collapsed"/>
+ <CheckBox Content="Ignore Certificate Errors" Height="16" HorizontalAlignment="Left" Margin="5,10,5,5" Name="IgnoreCertificateErrors" VerticalAlignment="Top"/>
</StackPanel>
</GroupBox>
</WrapPanel>
using System.ComponentModel.Composition;
using System.Diagnostics;
using System.IO;
+using System.Net;
using System.Reflection;
using System.Threading.Tasks;
using System.Windows;
}
NotifyOfPropertyChange(()=>Settings);
+
+ if (IgnoreCertificateErrors)
+ ServicePointManager.ServerCertificateValidationCallback= (sender,certificate,chain,errors)=> true;
+ else
+ {
+ ServicePointManager.ServerCertificateValidationCallback = null;
+ }
}
/* public void ChangePithosFolder()
NotifyOfPropertyChange(()=>DebugLoggingEnabled);
}
}
+
+ public bool IgnoreCertificateErrors
+ {
+ get { return Settings.IgnoreCertificateErrors; }
+ set {
+ Settings.IgnoreCertificateErrors = value;
+ NotifyOfPropertyChange(() => IgnoreCertificateErrors);
+ }
+ }
#endregion
//------------------------------------------------------------------------------
// <auto-generated>
// This code was generated by a tool.
-// Runtime Version:4.0.30319.488
+// Runtime Version:4.0.30319.530
//
// Changes to this file may cause incorrect behavior and will be lost if
// the code is regenerated.
this["DebugLoggingEnabled"] = value;
}
}
+
+ [global::System.Configuration.UserScopedSettingAttribute()]
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
+ [global::System.Configuration.DefaultSettingValueAttribute("False")]
+ public bool IgnoreCertificateErrors {
+ get {
+ return ((bool)(this["IgnoreCertificateErrors"]));
+ }
+ set {
+ this["IgnoreCertificateErrors"] = value;
+ }
+ }
}
}
<Setting Name="DebugLoggingEnabled" Type="System.Boolean" Scope="User">
<Value Profile="(Default)">False</Value>
</Setting>
+ <Setting Name="IgnoreCertificateErrors" Type="System.Boolean" Scope="User">
+ <Value Profile="(Default)">False</Value>
+ </Setting>
</Settings>
</SettingsFile>
\ No newline at end of file
<setting name="DebugLoggingEnabled" serializeAs="String">
<value>False</value>
</setting>
+ <setting name="IgnoreCertificateErrors" serializeAs="String">
+ <value>False</value>
+ </setting>
</Pithos.Client.WPF.Properties.Settings>
</userSettings>
<startup>
public CloudAction(AccountInfo accountInfo, CloudActionType action, FileSystemInfo localFile, ObjectInfo cloudFile, FileState state, int blockSize, string algorithm)
: this(accountInfo,action)
{
+ if(blockSize<=0)
+ throw new ArgumentOutOfRangeException("blockSize");
+ Contract.EndContractBlock();
LocalFile = localFile.WithProperCapitalization();
CloudFile = cloudFile;
FileState = state;
{
var ex = t.Exception.InnerException;
var we = ex as WebException;
+
var response = we.Response as HttpWebResponse;
if (response!=null && response.StatusCode==HttpStatusCode.Conflict)
{
//In case of 409 the missing parts will be in the response content
using (var stream = response.GetResponseStream())
- using(var reader=stream.GetLoggedReader(Log))
+ using(var reader=stream.GetLoggedReader(Log,response.ContentLength))
{
//We used to have to cleanup the content before returning it because it contains
//error content after the list of hashes
}
}
- public static TextReader GetLoggedReader(this Stream stream,ILog log)
+ public static TextReader GetLoggedReader(this Stream stream, ILog log, long contentLength)
{
- TextReader reader = new StreamReader(stream);
+ var reader = new StreamReader(stream);
if (!log.IsDebugEnabled)
return reader;
using (reader)
{
- var body = reader.ReadToEnd();
+ var buffer=new char[contentLength];
+ var read=reader.Read(buffer, 0, (int)contentLength);
+ var body = new string(buffer,0,read); //reader.ReadToEnd();
log.DebugFormat("JSON response: {0}", body);
return new StringReader(body);
}