Revision e394ef0f

b/trunk/.gitignore
105 105
svnignore[.-]*
106 106
lint.db
107 107
*.vs10x
108

  
109
*.vsp
110
*.ctl
111
*.psess
b/trunk/NetSparkle/NetSparkle.cs
555 555
                UpdateSystemProfileInformation(config);
556 556

  
557 557
                // check if update is required
558
                NetSparkleAppCastItem latestVersion = null;
558
                NetSparkleAppCastItem latestVersion =null;
559 559
                bUpdateRequired = IsUpdateRequired(config, out latestVersion);
560
                this.LatestVersion = latestVersion.Version??"";                
560
                if (latestVersion!=null)
561
                    this.LatestVersion = latestVersion.Version??"";                
561 562
                if (!bUpdateRequired)
562 563
                    goto WaitSection;
563 564

  
b/trunk/Pithos.Client.WPF/App.xaml.cs
43 43
using System.Collections.Generic;
44 44
using System.IO;
45 45
using System.Linq;
46
using System.Net;
46 47
using System.Reflection;
47 48
using System.Text;
48 49
using System.Threading;
......
86 87
                Settings.Default.UseDefaultProxy = true;
87 88
            }
88 89

  
90
            if (Settings.Default.IgnoreCertificateErrors)
91
                ServicePointManager.ServerCertificateValidationCallback = (sender, certificate, chain, errors) => true;
92

  
89 93

  
90 94
            InitializeComponent();            
91 95
        }       
b/trunk/Pithos.Client.WPF/Configuration/PithosSettings.cs
248 248
            }
249 249
        }
250 250

  
251
        public bool IgnoreCertificateErrors
252
        {
253
            get { return _settings.IgnoreCertificateErrors; }
254
            set
255
            {
256
                _settings.IgnoreCertificateErrors = value;
257

  
258
            }
259
        }
260

  
251 261
        private static void SetDebugLevel()
252 262
        {
253 263
            var loggerRepository = (Hierarchy) log4net.LogManager.GetRepository();
b/trunk/Pithos.Client.WPF/Preferences/PreferencesView.xaml
215 215
                        <CheckBox Content="Enable Debug Logging" Height="16" HorizontalAlignment="Left" Margin="5,10,5,5" Name="DebugLoggingEnabled" VerticalAlignment="Top"/>
216 216
                        <Button x:Name="OpenLogPath" Content="Open Log Path" HorizontalAlignment="Left" Margin="5" Style="{StaticResource ButtonStyle}" Width="Auto"/>
217 217
                        <Button x:Name="OpenLogConsole" Content="Open Log Console" HorizontalAlignment="Left" Margin="5" Style="{StaticResource ButtonStyle}" Width="Auto" Visibility="Collapsed"/>
218
                        <CheckBox Content="Ignore Certificate Errors" Height="16" HorizontalAlignment="Left" Margin="5,10,5,5" Name="IgnoreCertificateErrors" VerticalAlignment="Top"/>
218 219
                        </StackPanel>
219 220
                    </GroupBox>
220 221
                </WrapPanel>
b/trunk/Pithos.Client.WPF/Preferences/PreferencesViewModel.cs
46 46
using System.ComponentModel.Composition;
47 47
using System.Diagnostics;
48 48
using System.IO;
49
using System.Net;
49 50
using System.Reflection;
50 51
using System.Threading.Tasks;
51 52
using System.Windows;
......
333 334
            }
334 335

  
335 336
            NotifyOfPropertyChange(()=>Settings);
337

  
338
            if (IgnoreCertificateErrors)
339
                ServicePointManager.ServerCertificateValidationCallback= (sender,certificate,chain,errors)=> true;
340
            else
341
            {
342
                ServicePointManager.ServerCertificateValidationCallback = null;
343
            }
336 344
        }
337 345

  
338 346
     /*   public void ChangePithosFolder()
......
496 504
                NotifyOfPropertyChange(()=>DebugLoggingEnabled);
497 505
            }
498 506
        }
507

  
508
        public bool IgnoreCertificateErrors
509
        {
510
            get { return Settings.IgnoreCertificateErrors; }
511
            set {
512
                Settings.IgnoreCertificateErrors = value;
513
                NotifyOfPropertyChange(() => IgnoreCertificateErrors);
514
            }
515
        }
499 516
       
500 517
        #endregion
501 518

  
b/trunk/Pithos.Client.WPF/Properties/Settings.Designer.cs
1 1
//------------------------------------------------------------------------------
2 2
// <auto-generated>
3 3
//     This code was generated by a tool.
4
//     Runtime Version:4.0.30319.488
4
//     Runtime Version:4.0.30319.530
5 5
//
6 6
//     Changes to this file may cause incorrect behavior and will be lost if
7 7
//     the code is regenerated.
......
374 374
                this["DebugLoggingEnabled"] = value;
375 375
            }
376 376
        }
377
        
378
        [global::System.Configuration.UserScopedSettingAttribute()]
379
        [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
380
        [global::System.Configuration.DefaultSettingValueAttribute("False")]
381
        public bool IgnoreCertificateErrors {
382
            get {
383
                return ((bool)(this["IgnoreCertificateErrors"]));
384
            }
385
            set {
386
                this["IgnoreCertificateErrors"] = value;
387
            }
388
        }
377 389
    }
378 390
}
b/trunk/Pithos.Client.WPF/Properties/Settings.settings
95 95
    <Setting Name="DebugLoggingEnabled" Type="System.Boolean" Scope="User">
96 96
      <Value Profile="(Default)">False</Value>
97 97
    </Setting>
98
    <Setting Name="IgnoreCertificateErrors" Type="System.Boolean" Scope="User">
99
      <Value Profile="(Default)">False</Value>
100
    </Setting>
98 101
  </Settings>
99 102
</SettingsFile>
b/trunk/Pithos.Client.WPF/app.config
108 108
      <setting name="DebugLoggingEnabled" serializeAs="String">
109 109
        <value>False</value>
110 110
      </setting>
111
      <setting name="IgnoreCertificateErrors" serializeAs="String">
112
        <value>False</value>
113
      </setting>
111 114
    </Pithos.Client.WPF.Properties.Settings>
112 115
  </userSettings>
113 116
  <startup>
b/trunk/Pithos.Core/Agents/CloudTransferAction.cs
99 99
        public CloudAction(AccountInfo accountInfo, CloudActionType action, FileSystemInfo localFile, ObjectInfo cloudFile, FileState state, int blockSize, string algorithm)
100 100
            : this(accountInfo,action)
101 101
        {
102
            if(blockSize<=0)
103
                throw new ArgumentOutOfRangeException("blockSize");
104
            Contract.EndContractBlock();
102 105
            LocalFile = localFile.WithProperCapitalization();
103 106
            CloudFile = cloudFile;
104 107
            FileState = state;
b/trunk/Pithos.Network/CloudFilesClient.cs
1055 1055
                {
1056 1056
                    var ex = t.Exception.InnerException;
1057 1057
                    var we = ex as WebException;
1058
                    
1058 1059
                    var response = we.Response as HttpWebResponse;
1059 1060
                    if (response!=null && response.StatusCode==HttpStatusCode.Conflict)
1060 1061
                    {
1061 1062
                        //In case of 409 the missing parts will be in the response content                        
1062 1063
                        using (var stream = response.GetResponseStream())
1063
                        using(var reader=stream.GetLoggedReader(Log))
1064
                        using(var reader=stream.GetLoggedReader(Log,response.ContentLength))
1064 1065
                        {
1065 1066
                            //We used to have to cleanup the content before returning it because it contains
1066 1067
                            //error content after the list of hashes
b/trunk/Pithos.Network/WebExtensions.cs
36 36
            }
37 37
        }
38 38

  
39
        public static TextReader GetLoggedReader(this Stream stream,ILog log)
39
        public static TextReader GetLoggedReader(this Stream stream, ILog log, long contentLength)
40 40
        {
41
            TextReader reader = new StreamReader(stream);
41
            var reader = new StreamReader(stream);
42 42
            if (!log.IsDebugEnabled)
43 43
                return reader;
44 44
            
45 45
            using (reader)
46 46
            {
47
                var body = reader.ReadToEnd();
47
                var buffer=new char[contentLength];
48
                var read=reader.Read(buffer, 0, (int)contentLength);
49
                var body = new string(buffer,0,read); //reader.ReadToEnd();
48 50
                log.DebugFormat("JSON response: {0}", body);
49 51
                return new StringReader(body);
50 52
            }

Also available in: Unified diff