Commit Graph
856 Commits
Author SHA1 Message Date
Syrone Wong aa99d56e2c Merge pull request #726 from Noisyfox/master
Improve Socket Handling
2016-09-17 03:44:32 -05:00
noisyfox 063cf111cb Fix a bug that a TCPHandler may be shutdown immediately
after creation.

Becuase we put handler.Start() call after timeout check and
lastActivity is initialized in Start(), this will lead to a
incorrect timeout.

Also because we will call handler.Start() right after the
constructor and timeout check, so it makes no difference
where we put the initializtion of lastActivity. We won't do
this again in Start() because DateTime.Now will consumes a
lot of cpu time.
2016-09-17 16:21:03 +10:00
noisyfox 390144351a Fix #710
When using http proxy, this will cause distinct latency
if we are trying to resolve localhost.

Currently it's unnecessary to do that because our privoxy
doesn't listern on ipv6 address, so it's ok to hard code
the ipv4 address.

There is a plan to add a cache to record the ipv6 connectivity
so that we needn't to try both ipv4 and ipv6 every time when we
attempt to connect a DnsEndPoint.
2016-09-17 16:13:12 +10:00
Syrone Wong 433c3bfbcc Delay 5 seconds to start controller when OS is about to resume
Workaround for slow computers

Credit to GangZhou's code

Signed-off-by: Syrone Wong <wong.syrone@gmail.com>
2016-09-17 13:24:30 +08:00
noisyfox 5e082e2961 Fix comment
Signed-off-by: noisyfox <timemanager.rick@gmail.com>
2016-09-17 15:12:48 +10:00
noisyfox 2a12ac5578 Merge branch 'master' of https://github.com/shadowsocks/shadowsocks-windows.git 2016-09-17 14:57:54 +10:00
Syrone Wong 99bdec334c Add global hotkey support (#724)
Design:

Use the plain string for both config and hotkey parsing
and make use of KeyConverter, ModifierKeysConverter
to make it more rubust.

Find corresponding label (to display operation result) and callback (to do the real work) based on textbox name. In this case, they should be named as `<Feature-Name><Control-Name>`.

ShowLogsTextBox,
ShowLogsLabel,
ShowLogsCallback.

If this requirement doesn't meet, throw an exception at runtime.

Logic:

How to input keys:
1. put focus in the corresponding textbox
2. press the key combination you want to use
3. when you think it is ready, release all keys
4. the textbox shows your input

How to change keys:
1. put focus in the corresponding textbox
2. press BackSpace to clear content
3. re-input new one

How to deactivate:
1. clear content in the textbox
2. press OK button

Meaning of label color:
- Green: this combination is not occupied by other programs and register successfully
- Yellow: this combination is occupied by other programs and you have to change to another one
- Transparent without color: initial status

Signed-off-by: Syrone Wong <wong.syrone@gmail.com>
2016-09-16 23:42:16 -05:00
Syrone Wong 6e6be823ad Fix #710 by @breakwa11
- Drop irrelevant changes
- Closes #723

Signed-off-by: Syrone Wong <wong.syrone@gmail.com>
2016-09-16 13:33:14 +08:00
破娃酱 7586739a52 remove all tuple (#718) 2016-09-15 22:02:55 -05:00
Syrone Wong 33b2ca8c8a Refactor
- Only use one instance of LogForm

Signed-off-by: Syrone Wong <wong.syrone@gmail.com>
2016-09-16 00:47:05 +08:00
Syrone Wong be63f96d50 Merge branch 'proxy-form' 2016-09-15 10:21:52 +08:00
破娃酱 836a58775f optimize LogMessageTextBox (#719)
* optimize LogMessageTextBox

* StringBuilder instead
2016-09-14 21:14:33 -05:00
Syrone Wong c1ec851627 Refine ProxyForm
- Save empty config if null ref
- only save config when clicking OK button

Signed-off-by: Syrone Wong <wong.syrone@gmail.com>
2016-09-15 10:09:04 +08:00
Syrone Wong d3c6039c61 Refine Proxy config
- Move to seperate model

Signed-off-by: Syrone Wong <wong.syrone@gmail.com>
2016-09-14 23:19:39 +08:00
破娃酱 ea9c7b093a Refine Encryption module (#717)
- use EncryptorInfo struct instead of Dictionary<string, int[]>>
2016-09-13 22:16:37 -05:00
破娃酱 a9cf3992e1 Refine traditional Chinese translation (#716) 2016-09-13 21:27:22 -05:00
noisyfox 05063f074a Fix an issue that the socket may not be released.
- New wrapper to handle tcp socket connection.
- Fix some memory leak.

Signed-off-by: noisyfox <timemanager.rick@gmail.com>
2016-09-14 04:23:18 +10:00
Syrone Wong ab464ca8b1 change controller status if needed
- Change controller based on power mode
- Stop before exiting

Based on GangZhuo's code

Signed-off-by: Syrone Wong <wong.syrone@gmail.com>
2016-09-12 16:23:03 +08:00
Syrone Wong 42b2308374 Update LICENSE
Signed-off-by: Syrone Wong <wong.syrone@gmail.com>
2016-09-12 15:35:02 +08:00
Syrone Wong c359be2342 Add GitHub issue template
Signed-off-by: Syrone Wong <wong.syrone@gmail.com>
2016-09-12 15:13:51 +08:00
破娃酱 2a6da8af3f smooth traffic chart lines (#709) 2016-09-11 06:32:37 +08:00
Syrone Wong 4b6d641d17 Update CHANGES and bump version
Signed-off-by: Syrone Wong <wong.syrone@gmail.com>
3.3
2016-09-09 17:48:22 +08:00
破娃酱 59c315d465 new traffic chart style (#704)
* new traffic chart style
- remove invoke
- force to set AxisY.Maximum not zero
- format LogForm.cs

* avoid data race
2016-09-08 15:24:46 +08:00
Syrone Wong f8c9bdda12 Drop redundant type casting
Signed-off-by: Syrone Wong <wong.syrone@gmail.com>
2016-09-08 08:20:12 +08:00
破娃酱 707442163d New traffic icon style (#703) 2016-09-07 20:00:31 +08:00
Syrone Wong bb7171674b Refine traditional Chinese translation again
Signed-off-by: Syrone Wong <wong.syrone@gmail.com>
2016-09-07 10:08:56 +08:00
Syrone Wong 3b1ac7500f typo
Signed-off-by: Syrone Wong <wong.syrone@gmail.com>
2016-09-07 09:54:35 +08:00
Syrone Wong 2bebe515fa Refine traditional Chinese translation
- Respect shadowsocks-android translation by @LNDDYL
- pretend to be native speaker

Signed-off-by: Syrone Wong <wong.syrone@gmail.com>
2016-09-07 09:49:56 +08:00
Syrone Wong 4367a56f46 Drop .NET Framework lower than 4.0 explicitly
Signed-off-by: Syrone Wong <wong.syrone@gmail.com>
2016-09-06 20:20:19 +08:00
破娃酱 d958c5c393 fix bandwidthScale of the LogForm (#701)
- Revert bandwidthScale when throughput gets smaller
- Don't save coordinates when LogForm is minimized. Otherwise, we get negative values
- activate ConfigForm & ProxyForm & LogForm
2016-09-06 18:46:35 +08:00
Syrone Wong c3b7c3dcfd Update AppVeyor
Added debug artifact for debugging purpose.

Signed-off-by: Syrone Wong <wong.syrone@gmail.com>
2016-09-06 16:57:12 +08:00
破娃酱 d73b77ff88 fix ss URL bug with no padding base64 (#700) 2016-09-06 14:31:22 +08:00
破娃酱 da234ef857 add Traditional Chinese (#698)
* add Traditional Chinese

* fix a resource type

* fix the Traditional Chinese name of "address", "port", "screen", "Open Location"
2016-09-06 11:39:05 +08:00
Syrone Wong 514bb02098 Fix config selection
User wants to use that server after selected it in the ConfigForm. If user deletes
the server in use, we can't find its index, then the previous logic will revert to
index 0, which is not expected behaviour.

Since we handled 'ServersListBox.SelectedIndex' in various event handlers, we can
trust it all the time.

Signed-off-by: Syrone Wong <wong.syrone@gmail.com>
2016-09-04 08:04:56 +08:00
noisyfox e364457b1b Fix a memory leak.
Caused by not call SocketAsyncEventArgs.Dispose().
2016-09-03 15:17:16 +08:00
noisyfox be85ab55a7 Fix #561 2016-09-03 08:58:13 +08:00
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