From 3d260ca9c049a82502ac797de671f3a0886e129e Mon Sep 17 00:00:00 2001 From: mengskysama Date: Tue, 23 Sep 2014 11:23:39 +0800 Subject: [PATCH] Encryptor bugfix --- shadowsocks-csharp/Encrypt/OpensslEncryptor.cs | 4 ++-- shadowsocks-csharp/Local.cs | 8 ++++---- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/shadowsocks-csharp/Encrypt/OpensslEncryptor.cs b/shadowsocks-csharp/Encrypt/OpensslEncryptor.cs index a6d2c2e7..390d0df3 100644 --- a/shadowsocks-csharp/Encrypt/OpensslEncryptor.cs +++ b/shadowsocks-csharp/Encrypt/OpensslEncryptor.cs @@ -13,7 +13,7 @@ namespace shadowsocks_csharp.Encrypt public OpensslEncryptor(string method, string password) : base(method, password) { - InitKey(Method, Password); + InitKey(method, password); } public override byte[] Encrypt(byte[] buf, int length) @@ -79,7 +79,7 @@ namespace shadowsocks_csharp.Encrypt private IntPtr _encryptCtx; private IntPtr _decryptCtx; - private void InitKey(string password, string method) + private void InitKey(string method, string password) { string k = method + ":" + password; if (CachedKeys.ContainsKey(k)) diff --git a/shadowsocks-csharp/Local.cs b/shadowsocks-csharp/Local.cs index 1aa6ff90..87c2fe50 100755 --- a/shadowsocks-csharp/Local.cs +++ b/shadowsocks-csharp/Local.cs @@ -54,10 +54,10 @@ namespace shadowsocks_csharp // Get the socket that handles the client request. Socket listener = (Socket)ar.AsyncState; - if (!listener.Connected) - { - return; - } + //if (!listener.Connected) + //{ + // return; + //} listener.BeginAccept( new AsyncCallback(AcceptCallback),