50 Commits

Author SHA1 Message Date
Chen Yufei
cf262fafb8 Fix PAC error in test script. 2015-06-03 11:18:32 +08:00
Chen Yufei
f1fd6afbe1 Implement #328, allow specifying stat/blocked etc. in config file.
Also load stat/blocked/direct default from directory containing config file.
2015-06-03 00:41:34 +08:00
fzerorubigd
f65c3facaa add support for change stat file position in config
ref #328
2015-05-31 23:49:55 +04:30
fzerorubigd
c87cbb215e try to load stat.bak if stat is invalid, or start new one is both are
invalid
fixes #309
2015-05-10 23:27:22 +08:00
Chen Yufei
732b15f01f Close stat file after load. 2014-10-08 12:57:46 +08:00
Chen Yufei
a4fa2816b6 Refactor proxy selection. 2014-07-09 10:54:16 +08:00
Chen Yufei
64fb387c84 Rename dsFile to configPath. 2013-12-20 11:36:04 +08:00
Chen Yufei
0ef33fc5af Fix possible cross FS rename for stat. 2013-12-20 11:25:24 +08:00
Chen Yufei
c5432c9610 Decrease direct/blocked delta value.
To make learning take effect faster.
2013-12-02 20:40:06 +08:00
Chen Yufei
091d879367 Avoid stat corruption caused by signal during saving. 2013-11-22 14:47:32 +08:00
Chen Yufei
6af8122293 Fix AsDirect returns false for new site. 2013-10-31 22:14:55 +08:00
Chen Yufei
cd21806791 Do not retry if there's no parent proxy. 2013-10-31 22:14:15 +08:00
Chen Yufei
ce43a930b5 Use bufio.Scanner, remove ReadLine(Slice). 2013-08-05 19:04:39 +08:00
Chen Yufei
d369085005 Decrease directDelta to 15. 2013-08-02 23:33:30 +08:00
Chen Yufei
1088b0df10 Rename variable in site stat. 2013-07-10 01:14:05 +08:00
Chen Yufei
c4acd98fed Filter sites covered by user specified domain on load. 2013-07-10 01:12:52 +08:00
Chen Yufei
b80f89ae85 Specify go 1.1 in Travis, remove unnecessary return. 2013-06-13 22:27:14 +08:00
Chen Yufei
4696b72cf8 host2Domain return empty domain only for private IP. 2013-06-06 23:18:37 +08:00
Chen Yufei
78907f54f2 Do not update blocked count when setting site as temp blocked. 2013-04-12 12:40:04 +08:00
Chen Yufei
502cec0f5c PAC fix: do not add 2nd level domain with blocked host/sub domain.
Bug caused by uninitialized hasBlockedHost map when loading site stat.
2013-04-11 23:27:14 +08:00
Chen Yufei
aab4b4ae4e Do not update visit count if network connection is bad. 2013-04-09 18:15:17 +08:00
Chen Yufei
05ac4e2a9e Set direct count to 0 upon blocked visit. 2013-04-09 18:08:01 +08:00
Chen Yufei
2703398416 Better AsDirect test. 2013-03-14 14:49:56 +08:00
Chen Yufei
eb98778192 Do not include once blocked site into PAC. 2013-03-14 14:07:00 +08:00
Chen Yufei
5c118fa02c Reduce blocked/direct delta. 2013-03-05 21:29:14 +08:00
Chen Yufei
49bb3177f5 Use customized bufio package to avoid copy in sendBocyChunked. 2013-02-20 22:36:27 +08:00
Chen Yufei
078d565b36 Store site stat every hour on all platform. 2013-02-20 22:36:23 +08:00
Chen Yufei
314f7a74ec Use const bool to detect if running on Windows. 2013-02-20 22:35:15 +08:00
Chen Yufei
3c8043c243 Always load builtin and user specified list. 2013-02-19 19:12:35 +08:00
Chen Yufei
bf1496257c Temp blocked should increase blocked visit count once. 2013-02-10 13:46:30 +08:00
Chen Yufei
7d6cf46bb0 Add bdimg.com to direct. Remove host from stat after 15 days. 2013-02-10 13:00:32 +08:00
Chen Yufei
2a1a824a50 Do not update visit count if temp blocked. 2013-02-10 12:53:06 +08:00
Chen Yufei
916354a858 Refactor site stat. 2013-02-10 00:26:50 +08:00
Chen Yufei
b2cce90e62 Simplify site stat. 2013-02-09 21:30:47 +08:00
Chen Yufei
b2ef399e70 Check if host name is domain name before trying to get domain cnt. 2013-02-09 21:03:02 +08:00
Chen Yufei
dda8cd0b13 Fix bug in visitCnt.visit() 2013-02-09 21:00:30 +08:00
Chen Yufei
f38c9f8ef0 Handle blocked sites that will return EOF. 2013-02-09 20:58:42 +08:00
Chen Yufei
8805b7e828 Change directDelta to 30. 2013-02-07 17:36:48 +08:00
Chen Yufei
927f9b6756 Simplify site stat and optimize query. 2013-02-06 18:34:20 +08:00
Chen Yufei
1bd2b74dab Workaround for windows to save site stat. 2013-02-05 22:03:17 +08:00
Chen Yufei
bae968d38e Treat builtin site the same as user specified.
Remove them in the stat file.
2013-02-05 18:25:15 +08:00
Chen Yufei
76494d639b Avoid adding empty domain to hasBlockedHost. 2013-02-05 00:57:10 +08:00
Chen Yufei
9e35a662ad Adjust site stat constant. 2013-02-05 00:06:32 +08:00
Chen Yufei
fd9713dbe5 Customized impl of hostIsIP, also add in PAC. 2013-02-04 23:58:35 +08:00
Chen Yufei
ba07dc134c Cache generate PAC content for 10 minutes. 2013-02-04 20:34:26 +08:00
Chen Yufei
3e5362f52c Use site stat instead of domain set. 2013-02-04 18:43:25 +08:00
Chen Yufei
5a2cdd909e Use site stat to generate pac file. 2013-02-04 14:12:11 +08:00
Chen Yufei
46d681a8c7 Do not use real site name in site stat test.
To avoid conflict with builtin site list.
2013-02-04 11:49:59 +08:00
Chen Yufei
6749d08e34 More feature in site statistics.
Load builtin and user specified site list
Temporarily blocked set
2013-02-04 11:44:31 +08:00
Chen Yufei
c17f7ce472 Initial site statistics to replace current domainset. 2013-02-04 00:21:20 +08:00