Browse Source

Merge remote-tracking branch 'upstream/master'

tags/2.5.7
kimw 10 years ago
parent
commit
99fe540e53
9 changed files with 50 additions and 8 deletions
  1. +9
    -0
      CHANGES
  2. +3
    -2
      shadowsocks-csharp/Controller/Logging.cs
  3. +3
    -2
      shadowsocks-csharp/Controller/Service/AvailabilityStatistics.cs
  4. +2
    -1
      shadowsocks-csharp/Controller/Service/PolipoRunner.cs
  5. +2
    -1
      shadowsocks-csharp/Encryption/PolarSSL.cs
  6. +2
    -1
      shadowsocks-csharp/Encryption/Sodium.cs
  7. +19
    -0
      shadowsocks-csharp/Util/Util.cs
  8. +8
    -0
      shadowsocks-csharp/View/ConfigForm.cs
  9. +2
    -1
      shadowsocks-csharp/View/LogForm.cs

+ 9
- 0
CHANGES View File

@@ -1,3 +1,12 @@
2.5.6 2015-08-19
- Add portable mode
- Support server reorder

2.5.5 2015-08-17
- Fix crash when enabling Availability Statistics and some servers can not be resolved
- Allow multiple instances
- Other fixes

2.5.4 2015-08-16 2.5.4 2015-08-16
- Hide Privoxy icon - Hide Privoxy icon




+ 3
- 2
shadowsocks-csharp/Controller/Logging.cs View File

@@ -1,4 +1,5 @@
using System;
using Shadowsocks.Util;
using System;
using System.Collections.Generic; using System.Collections.Generic;
using System.IO; using System.IO;
using System.Net.Sockets; using System.Net.Sockets;
@@ -14,7 +15,7 @@ namespace Shadowsocks.Controller
{ {
try try
{ {
string temppath = Path.GetTempPath();
string temppath = Utils.GetTempPath();
LogFile = Path.Combine(temppath, "shadowsocks.log"); LogFile = Path.Combine(temppath, "shadowsocks.log");
FileStream fs = new FileStream(LogFile, FileMode.Append); FileStream fs = new FileStream(LogFile, FileMode.Append);
StreamWriterWithTimestamp sw = new StreamWriterWithTimestamp(fs); StreamWriterWithTimestamp sw = new StreamWriterWithTimestamp(fs);


+ 3
- 2
shadowsocks-csharp/Controller/Service/AvailabilityStatistics.cs View File

@@ -6,7 +6,8 @@ using System.Net.NetworkInformation;
using System.Threading; using System.Threading;
using Shadowsocks.Model; using Shadowsocks.Model;
using System.Reflection; using System.Reflection;

using Shadowsocks.Util;
namespace Shadowsocks.Controller namespace Shadowsocks.Controller
{ {
class AvailabilityStatistics class AvailabilityStatistics
@@ -25,7 +26,7 @@ namespace Shadowsocks.Controller
//static constructor to initialize every public static fields before refereced //static constructor to initialize every public static fields before refereced
static AvailabilityStatistics() static AvailabilityStatistics()
{ {
string temppath = Path.GetTempPath();
string temppath = Utils.GetTempPath();
AvailabilityStatisticsFile = Path.Combine(temppath, StatisticsFilesName); AvailabilityStatisticsFile = Path.Combine(temppath, StatisticsFilesName);
} }




+ 2
- 1
shadowsocks-csharp/Controller/Service/PolipoRunner.cs View File

@@ -9,6 +9,7 @@ using System.Text;
using System.Net.NetworkInformation; using System.Net.NetworkInformation;
using System.Net; using System.Net;
using System.Runtime.InteropServices; using System.Runtime.InteropServices;
using Shadowsocks.Util;
namespace Shadowsocks.Controller namespace Shadowsocks.Controller
{ {
@@ -20,7 +21,7 @@ namespace Shadowsocks.Controller
static PolipoRunner() static PolipoRunner()
{ {
temppath = Path.GetTempPath();
temppath = Utils.GetTempPath();
try try
{ {
FileManager.UncompressFile(temppath + "/ss_privoxy.exe", Resources.privoxy_exe); FileManager.UncompressFile(temppath + "/ss_privoxy.exe", Resources.privoxy_exe);


+ 2
- 1
shadowsocks-csharp/Encryption/PolarSSL.cs View File

@@ -1,5 +1,6 @@
using Shadowsocks.Controller; using Shadowsocks.Controller;
using Shadowsocks.Properties; using Shadowsocks.Properties;
using Shadowsocks.Util;
using System; using System;
using System.Collections.Generic; using System.Collections.Generic;
using System.IO; using System.IO;
@@ -18,7 +19,7 @@ namespace Shadowsocks.Encryption
static PolarSSL() static PolarSSL()
{ {
string tempPath = Path.GetTempPath();
string tempPath = Utils.GetTempPath();
string dllPath = tempPath + "/libsscrypto.dll"; string dllPath = tempPath + "/libsscrypto.dll";
try try
{ {


+ 2
- 1
shadowsocks-csharp/Encryption/Sodium.cs View File

@@ -1,5 +1,6 @@
using Shadowsocks.Controller; using Shadowsocks.Controller;
using Shadowsocks.Properties; using Shadowsocks.Properties;
using Shadowsocks.Util;
using System; using System;
using System.Collections.Generic; using System.Collections.Generic;
using System.IO; using System.IO;
@@ -14,7 +15,7 @@ namespace Shadowsocks.Encryption
static Sodium() static Sodium()
{ {
string tempPath = Path.GetTempPath();
string tempPath = Utils.GetTempPath();
string dllPath = tempPath + "/libsscrypto.dll"; string dllPath = tempPath + "/libsscrypto.dll";
try try
{ {


+ 19
- 0
shadowsocks-csharp/Util/Util.cs View File

@@ -5,11 +5,30 @@ using System.IO;
using System.IO.Compression; using System.IO.Compression;
using System.Runtime.InteropServices; using System.Runtime.InteropServices;
using System.Text; using System.Text;
using System.Windows.Forms;
namespace Shadowsocks.Util namespace Shadowsocks.Util
{ {
public class Utils public class Utils
{ {
// return path to store temporary files
public static string GetTempPath()
{
if (File.Exists(Application.StartupPath + "\\shadowsocks_portable_mode.txt"))
{
try
{
Directory.CreateDirectory(Application.StartupPath + "\\temp");
} catch (Exception e)
{
Console.WriteLine(e);
}
// don't use "/", it will fail when we call explorer /select xxx/temp\xxx.log
return Application.StartupPath + "\\temp";
}
return Path.GetTempPath();
}
public static void ReleaseMemory(bool removePages) public static void ReleaseMemory(bool removePages)
{ {
// release any unused pages // release any unused pages


+ 8
- 0
shadowsocks-csharp/View/ConfigForm.cs View File

@@ -276,6 +276,10 @@ namespace Shadowsocks.View
private void MoveUpButton_Click(object sender, EventArgs e) private void MoveUpButton_Click(object sender, EventArgs e)
{ {
if (!SaveOldSelectedServer())
{
return;
}
if (ServersListBox.SelectedIndex > 0) if (ServersListBox.SelectedIndex > 0)
{ {
MoveConfigItem(-1); // -1 means move backward MoveConfigItem(-1); // -1 means move backward
@@ -284,6 +288,10 @@ namespace Shadowsocks.View
private void MoveDownButton_Click(object sender, EventArgs e) private void MoveDownButton_Click(object sender, EventArgs e)
{ {
if (!SaveOldSelectedServer())
{
return;
}
if (ServersListBox.SelectedIndex < ServersListBox.Items.Count - 1) if (ServersListBox.SelectedIndex < ServersListBox.Items.Count - 1)
{ {
MoveConfigItem(+1); // +1 means move forward MoveConfigItem(+1); // +1 means move forward


+ 2
- 1
shadowsocks-csharp/View/LogForm.cs View File

@@ -106,7 +106,8 @@ namespace Shadowsocks.View
private void OpenLocationMenuItem_Click(object sender, EventArgs e) private void OpenLocationMenuItem_Click(object sender, EventArgs e)
{ {
string argument = @"/select, " + filename;
string argument = "/select, \"" + filename + "\"";
Console.WriteLine(argument);
System.Diagnostics.Process.Start("explorer.exe", argument); System.Diagnostics.Process.Start("explorer.exe", argument);
} }


Loading…
Cancel
Save