Commit Graph
820 Commits
Author SHA1 Message Date
noisyfox e6e9fc8588 Refactor to make OTA code more independent and clear.
and misc changes
2016-09-03 08:57:33 +08:00
noisyfox 4c5376ce0b Remove unnecessary call to InitKey. 2016-09-03 08:57:31 +08:00
noisyfox 0266ad9d59 Remove redundant lock.
Lock is evil.

This will actually affect the accuracy of GetDelta because
inboundDelta and outboundDelta may be calculated based on
the data collected at different time (eg. UpdateOutbound
get called before Interlocked.Read(ref _outbound)).

But that's not a problem. We can tolerate this little
inaccuracy. Besides, the _inbound, _outbound, _lastInbound
and _lastOutbound will be totally good because we use Interlocked.
2016-09-03 08:57:30 +08:00
Syrone Wong cbc94e0eb7 Update privoxy to 3.0.26
Close #686

Signed-off-by: Syrone Wong <wong.syrone@gmail.com>
2016-08-29 21:30:38 +08:00
Syrone Wong f70b177e56 Misc
Signed-off-by: Syrone Wong <wong.syrone@gmail.com>
2016-08-29 21:30:05 +08:00
Syrone Wong e7c00dd8e7 Merge pull request #682 from Noisyfox/dev
New approach to record and calculate inbound/outbound speed.
2016-08-27 10:33:04 +08:00
noisyfox 5b2327776a Fix a null ref exception. 2016-08-27 03:35:33 +10:00
noisyfox ed54b249db Close services while closing listener.
Now it will close all existing TCP relay connections
while reloading the listener.

Signed-off-by: noisyfox <timemanager.rick@gmail.com>
2016-08-26 21:08:04 +10:00
noisyfox 65d72fdfed New approach to record and calculate inbound/outbound speed.
Use lock to sync between threads.This should fix issue #679
and other same issue.

Fix a bug in UpdateSpeed() that only save the first xxxSpeedRecord.
2016-08-26 13:49:44 +10:00
noisyfox a7b0ce5bcb Use atomic long read.
Signed-off-by: noisyfox <timemanager.rick@gmail.com>
2016-08-26 12:23:21 +10:00
Syrone Wong f935514c05 Merge pull request #667 from Noisyfox/dev
Minor bug fix and improvements.
2016-08-22 15:10:05 +08:00
noisyfox 37d894594e Use immutable remote reference during async process.
To prevent "The IAsyncResult object was not returned from
the corresponding asynchronous method on this class." exception.

Signed-off-by: noisyfox <timemanager.rick@gmail.com>
2016-08-22 11:49:53 +10:00
noisyfox 28fe2fdc54 Only output some debug exceptions in debug mode.
Signed-off-by: noisyfox <timemanager.rick@gmail.com>
2016-08-22 10:53:18 +10:00
noisyfox f676d2185e Use Socket.ConnectAsync instead of socket.BeginConnect.
Socket.ConnectAsync will create socket and handle the address family
itself. This solves some compatibility issues on win7.

Signed-off-by: noisyfox <timemanager.rick@gmail.com>
2016-08-20 11:36:27 +10:00
noisyfox b335e6c8f5 Revert changes in UDPRelay.cs
UDP SendTo doesn't support DnsEndPoint.

Signed-off-by: noisyfox <timemanager.rick@gmail.com>
2016-08-20 11:33:59 +10:00
noisyfox 80fc8b4ccf Fix an exception caused by process.MainModule.
Try to access a dead process's MainModule will cause
"A 32 bit processes cannot access modules of
a 64 bit process." exception on win7 x64.
Simply ignore it.

Signed-off-by: noisyfox <timemanager.rick@gmail.com>
2016-08-20 10:57:13 +10:00
noisyfox 70624e35d9 Fix compatibility issue on vista and win7.
Signed-off-by: noisyfox <timemanager.rick@gmail.com>
2016-08-19 13:56:55 +10:00
noisyfox 2ed8ab50cd Only parse socks5 header once per connection.
To avoid unreadable and uncessary output

Signed-off-by: noisyfox <timemanager.rick@gmail.com>
2016-08-19 13:36:49 +10:00
Noisyfox a1eef6eac1 Multiple instances of ss_privoxy (#665)
* Use job object to manage polipo service's external processes.

Signed-off-by: noisyfox <timemanager.rick@gmail.com>

* Only kill those ss_privoxy.exe created by this ss instance.

Signed-off-by: noisyfox <timemanager.rick@gmail.com>

* Update README

Signed-off-by: noisyfox <timemanager.rick@gmail.com>
2016-08-18 19:31:01 +08:00
Syrone Wong e30487207b Add error message
Signed-off-by: Syrone Wong <wong.syrone@gmail.com>
2016-08-17 17:02:30 +08:00
Syrone Wong 8637277c27 Cleanup
- drop unused using directive
- add a comment

Signed-off-by: Syrone Wong <wong.syrone@gmail.com>
2016-08-17 15:58:00 +08:00
Syrone Wong 2b4b6cba07 Minor ConfigForm changes
- add event handler for KeyDown
- drop unused code, we don't support
  table and rc4 now

Signed-off-by: Syrone Wong <wong.syrone@gmail.com>
2016-08-17 15:56:00 +08:00
Syrone Wong acf7963de7 OTA is stable now
Signed-off-by: Syrone Wong <wong.syrone@gmail.com>
2016-08-17 15:52:42 +08:00
Syrone Wong 64e21e031d Merge PR #660 from @Noisyfox
Resolving domain name through socks5 proxy
and
dual-mode socket
2016-08-17 14:12:38 +08:00
Syrone Wong ddb7374432 Refine Windows registry again(#512)
Used a method added in .NET 4, user may not have
this version installed, reverting to an older
method seems to be a better solution.

Signed-off-by: Syrone Wong <wong.syrone@gmail.com>
2016-08-17 11:13:35 +08:00
Syrone Wong 3417a984fa Change requirements
- Running on Windows Vista or above

Signed-off-by: Syrone Wong <wong.syrone@gmail.com>
2016-08-17 11:13:25 +08:00
noisyfox 6cb58b229d Fix a null ref exception.
At that time the remote even doesn't exist.
Also this debug output doesn't make any sense because when handling
udp request, this tcp connection won't have any meaningful data.
So I simply removed these two lines.

Signed-off-by: noisyfox <timemanager.rick@gmail.com>
2016-08-16 20:52:53 +10:00
noisyfox 53ce1948e4 Unified ipv4, ipv6 and domain connections.
-Use dual-mode socket & DnsEndPoint to handle all domain name connection.
-Move all socket creation into one single function.

So that we could treat domain name just like ipv4 & ipv6 address.
This also solves the async domain solving problem because the os will
hanlde it for us.
2016-08-16 20:40:09 +10:00
noisyfox ad15c7e64b Improve host address handling using DnsEndPoint
Signed-off-by: noisyfox <timemanager.rick@gmail.com>
2016-08-16 17:28:26 +10:00
noisyfox aef88543d2 Fix typo
Update translate

Signed-off-by: noisyfox <timemanager.rick@gmail.com>
2016-08-16 15:47:55 +10:00
noisyfox 22740c5102 Let Socks5 proxy handle server host's domain name.
Don't resolve it locally because socks5 support domain name connection.

Signed-off-by: noisyfox <timemanager.rick@gmail.com>
2016-08-16 02:10:38 +10:00
noisyfox a02cd11dc9 Let proxy module handle name resolving itself.
Fix wrong output in proxyConnectTimer_Elapsed.

Signed-off-by: noisyfox <timemanager.rick@gmail.com>
2016-08-16 01:11:33 +10:00
Syrone Wong 21618ef08d Cleanup
- Drop redundant code.
  I should read code carefully, mbed TLS will set operation
  when invoking mbedtls_cipher_setkey(), the last param
  const mbedtls_operation_t operation is what we want.
- minor changes

Signed-off-by: Syrone Wong <wong.syrone@gmail.com>
2016-08-14 22:29:48 +08:00
Syrone Wong e15e2cf700 Update CHANGES
Signed-off-by: Syrone Wong <wong.syrone@gmail.com>
2016-08-14 22:28:50 +08:00
Syrone Wong 5d554d966a Bump version and update CHANGES
Signed-off-by: Syrone Wong <wong.syrone@gmail.com>
3.2
2016-08-13 19:01:15 +08:00
Syrone Wong d67b94c76b Minor changes
- Revert UncompressFile() changes
- Simplify code

Signed-off-by: Syrone Wong <wong.syrone@gmail.com>
2016-08-13 18:12:11 +08:00
Syrone Wong 30aadf0909 Merge pull request #654 from 772807886/master
日志相关修改
2016-08-13 17:54:40 +08:00
Syrone Wong 2fafc52def Refine encryption(#655)
* Refine encryption

- Add AES-CTR, blowfish and camellia ciphers

aes-256-ctr
aes-192-ctr
aes-128-ctr
bf-cfb
camellia-128-cfb
camellia-192-cfb
camellia-256-cfb

- Merge the previous PolarSSL and MbedTLS
- Switch to MbedTLS's cipher layer functions
- Add workaround to set cipher operation(encrypt/decrypt)

Signed-off-by: Syrone Wong <wong.syrone@gmail.com>

* Add function to get MbedTLS cipher context size

and drop hard-coded ctx sizes

Signed-off-by: Syrone Wong <wong.syrone@gmail.com>
2016-08-13 14:28:09 +08:00
金黎明 81188103f2 日志清理改为直接清理文件
日志文件越来越大,原有的清空日志只是清理记录窗口中显示的日志,实际并没有真的删除。
2016-08-13 10:50:21 +08:00
金黎明 6116388262 日志窗口支持记录最大化显示状态 2016-08-13 09:52:45 +08:00
Syrone Wong 3268c03d21 Seperate strategy and servers menugroup
User requested.

Signed-off-by: Syrone Wong <wong.syrone@gmail.com>
2016-08-11 16:12:35 +08:00
Syrone Wong 6a552a03d0 Fix typo
Signed-off-by: Syrone Wong <wong.syrone@gmail.com>
2016-08-11 10:06:58 +08:00
Syrone Wong ebd6f8f538 Update NuGet packages
Signed-off-by: Syrone Wong <wong.syrone@gmail.com>
2016-08-11 09:31:46 +08:00
Syrone Wong 6a26436850 Refine Windows registry handling(#512)
- Added a util function to handle x86 and x64
  currently, we only handle keys in HKCU
- Close registry key after operations

Signed-off-by: Syrone Wong <wong.syrone@gmail.com>
2016-08-10 17:42:37 +08:00
Syrone Wong a9af9fdfc0 Refactor
- use null conditional access in case some connections been
  cancelled unexpectedly and may cause null reference exception
- Refine error message
- use conditional operator to simplify some code

Signed-off-by: Syrone Wong <wong.syrone@gmail.com>
2016-08-10 15:27:38 +08:00
Syrone Wong a4fead74db Update libsscrypto
- update libsodium to tagged 1.0.11
- update mbedtls to tagged 2.3.0

Signed-off-by: Syrone Wong <wong.syrone@gmail.com>
2016-08-10 15:24:52 +08:00
Syrone Wong 4795340999 Check whether form handle been created(#650)
Signed-off-by: Syrone Wong <wong.syrone@gmail.com>
2016-08-10 14:15:48 +08:00
Syrone Wong 50de65624c Refine user-friendly server name
Forgot to consider domain name.

Signed-off-by: Syrone Wong <wong.syrone@gmail.com>
2016-08-10 13:49:17 +08:00
Syrone Wong 9607751bf8 Merge PR #604 from @Noisyfox(#649) 2016-08-09 08:43:58 +08:00
Syrone Wong 4fcddc3e82 Check server IP address validity and log it
Signed-off-by: Syrone Wong <wong.syrone@gmail.com>
2016-08-09 08:32:16 +08:00