28 Commits

Author SHA1 Message Date
Chen Yufei
5325d01407 Remove unused function copyNWithBuf. 2015-06-03 00:47:10 +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
Chen Yufei
ec2f656743 Add IsASCIILetter and TrimTrailingSpace. 2013-08-05 19:55:38 +08:00
Chen Yufei
ce43a930b5 Use bufio.Scanner, remove ReadLine(Slice). 2013-08-05 19:04:39 +08:00
Chen Yufei
0f69e4db45 One pass to copy&convert upper/lower case for ascii. 2013-07-10 10:23:49 +08:00
Chen Yufei
adf9541ad4 Always direct for loop back IP. 2013-06-07 15:12:43 +08:00
Chen Yufei
4696b72cf8 host2Domain return empty domain only for private IP. 2013-06-06 23:18:37 +08:00
Chen Yufei
8ce8ce602a Util func: copyN with bufio.Reader as src. 2013-02-22 22:30:53 +08:00
Chen Yufei
5c2e9dac30 Rename copyN to copyNWithBuf, make dst as first parameter.
Parameter position switching is to keep consistency with the signature
of copy.
2013-02-22 22:30:53 +08:00
Chen Yufei
9e9dff4f2e Simplify FieldsN. 2013-02-21 20:09:46 +08:00
Chen Yufei
ef5e37d035 New util function: FieldsN. 2013-02-21 16:50:21 +08:00
Chen Yufei
5ba2751c8e Use 256 byte table for IsSpace. 2013-02-21 09:37:45 +08:00
Chen Yufei
49bb3177f5 Use customized bufio package to avoid copy in sendBocyChunked. 2013-02-20 22:36:27 +08:00
Chen Yufei
73659419d2 Use table to convert byte to int. 2013-02-20 22:36:26 +08:00
Chen Yufei
a787498442 Replace bytes.NewBufferString with strings.NewReader in test. 2013-02-20 22:36:26 +08:00
Chen Yufei
4fd8ba3025 Use io.MultipleWriter to simplify send body function. 2013-02-18 17:05:50 +08:00
Chen Yufei
424335e101 Parse integer from bytes directly. 2013-02-18 00:00:32 +08:00
Chen Yufei
de3995fadb TrimSpace utility function. 2013-02-06 22:10:44 +08:00
Chen Yufei
546e628c8b Switch back to using bufio.ReadLine for better performance. 2013-02-06 15:07:10 +08:00
Chen Yufei
fd9713dbe5 Customized impl of hostIsIP, also add in PAC. 2013-02-04 23:58:35 +08:00
Chen Yufei
3c0b632e48 Move host2Domain into util. 2013-02-03 23:57:42 +08:00
Chen Yufei
ecedab9cad Use bufio.ReadString to implement ReadLine without ending CR or LF. 2013-01-30 17:31:38 +08:00
Chen Yufei
979f66018e NewIPV4Mask function. 2013-01-28 23:09:17 +08:00
Chen Yufei
0f837aa8d0 Add test for isFileExists. 2012-12-23 14:18:48 +08:00
Chen Yufei
46b8ec20d5 Allow copyN to append prefix data.
This avoids small writes for chunk size.
2012-12-18 17:01:04 +08:00
Chen Yufei
516a459866 Avoid recording domains like bbc.co.uk as co.uk 2012-11-10 02:53:00 +08:00
Chen Yufei
3bc010a879 Specify blocked domain and serve with socks proxy. 2012-10-30 02:51:53 +08:00
Chen Yufei
e57e699949 Code refactor. 2012-08-27 16:07:34 +08:00