mirror of
https://github.com/wangyu-/UDPspeeder.git
synced 2025-09-18 13:14:31 +08:00
Compare commits
109 Commits
place_hold
...
v2@2017111
Author | SHA1 | Date | |
---|---|---|---|
|
6f55b8a2fc | ||
|
85122b7155 | ||
|
0cef4503be | ||
|
744c8f56ae | ||
|
8680b06882 | ||
|
57cce3a424 | ||
|
6ab4294bd9 | ||
|
ebdabb4598 | ||
|
c254545290 | ||
|
1301fdc96d | ||
|
f58dfe4fdd | ||
|
3fd198a1e2 | ||
|
017e851c2d | ||
|
2929eead0e | ||
|
e2c2f2dfec | ||
|
d0ebd67dbd | ||
|
211fcee8db | ||
|
6b4a2dfe21 | ||
|
65939eb9e7 | ||
|
9c00a2f3a6 | ||
|
4706e51fad | ||
|
c3786a91d8 | ||
|
680f127350 | ||
|
7713cf0c15 | ||
|
5024a02d20 | ||
|
f2d9deb2a3 | ||
|
c5c440245c | ||
|
c95e2db1af | ||
|
82a2b3cb9a | ||
|
8ecc696da5 | ||
|
6e6fc62fb8 | ||
|
ea03e5f8ec | ||
|
3be2642397 | ||
|
d05bcfc2f8 | ||
|
e50292bd4a | ||
|
363aec12d4 | ||
|
4364a7b789 | ||
|
17a42a1218 | ||
|
9152fef474 | ||
|
eb7406e6f3 | ||
|
296a84be3c | ||
|
69558ab16c | ||
|
37b7eb7282 | ||
|
4ca57cf656 | ||
|
1a744d69ea | ||
|
86b68697e1 | ||
|
63a2f923ab | ||
|
5774b478fc | ||
|
e91dcf6647 | ||
|
f6c97af854 | ||
|
2f097d720d | ||
|
c6de39acc8 | ||
|
0f425a3a98 | ||
|
2cc560088b | ||
|
b83b21f2eb | ||
|
f526046846 | ||
|
1be5fb5fc1 | ||
|
27874aa413 | ||
|
fde2329528 | ||
|
30b78c1339 | ||
|
17a3074b34 | ||
|
cce7d18163 | ||
|
90029e1ea7 | ||
|
c26a4708ee | ||
|
fdbf4ab205 | ||
|
7ee72ee84c | ||
|
cac5f8271c | ||
|
219e8e2592 | ||
|
02b4d59500 | ||
|
894bf7cd0d | ||
|
a8cab43139 | ||
|
369a9d8e1b | ||
|
0f7894f42f | ||
|
d7daae25bf | ||
|
d7271b74b4 | ||
|
1eeef14470 | ||
|
9d30caffc9 | ||
|
e50e383ede | ||
|
c73a197971 | ||
|
ba44617124 | ||
|
19e718f0a3 | ||
|
bd323be9c4 | ||
|
35a85e38ae | ||
|
4871983b8f | ||
|
fec3c39cad | ||
|
4d55348a4d | ||
|
36eef02d8a | ||
|
3fd48dd20e | ||
|
766aa274d9 | ||
|
d961537682 | ||
|
4dcfe87bd3 | ||
|
2aa0ece465 | ||
|
05fd84b675 | ||
|
1e00ff7c87 | ||
|
c76818c6a8 | ||
|
e3e2fe6d36 | ||
|
7cd87e7b59 | ||
|
c3aae9579b | ||
|
d9f80781a2 | ||
|
203604e1b5 | ||
|
5ac6e30c8e | ||
|
6728d5a561 | ||
|
f9eaae172f | ||
|
a0eeedb12a | ||
|
324d34c87a | ||
|
1fe64b5689 | ||
|
d5e900e91c | ||
|
8e00273db4 | ||
|
73d68a2baf |
@@ -1,6 +0,0 @@
|
|||||||
For English speaking user:
|
|
||||||
https://github.com/wangyu-/UDPspeeder/wiki/Issue-Guide
|
|
||||||
|
|
||||||
中文用户请看:
|
|
||||||
https://github.com/wangyu-/UDPspeeder/wiki/发Issue前请看
|
|
||||||
(否则Issue可能被忽略,或被直接关掉)
|
|
22
README.md
22
README.md
@@ -78,7 +78,7 @@ Assume your server ip is 44.55.66.77, you have a service listening on udp port 7
|
|||||||
./speederv2 -c -l0.0.0.0:3333 -r44.55.66.77:4096 -f20:10 -k "passwd"
|
./speederv2 -c -l0.0.0.0:3333 -r44.55.66.77:4096 -f20:10 -k "passwd"
|
||||||
```
|
```
|
||||||
|
|
||||||
Now connecting to UDP port 3333 at the client side is equivalent to connecting to port 7777 at the server side, and the connection has been boosted by UDPspeeder.
|
Now connecting to UDP port 3333 at the client side is equivalent to connecting to port 7777 at the server side, and the connection is boosted by UDPspeeder.
|
||||||
|
|
||||||
##### Note
|
##### Note
|
||||||
|
|
||||||
@@ -86,43 +86,43 @@ Now connecting to UDP port 3333 at the client side is equivalent to connecting t
|
|||||||
|
|
||||||
`-k` enables simple XOR encryption
|
`-k` enables simple XOR encryption
|
||||||
|
|
||||||
|
To run stably, pay attention to MTU. You can also try `--mode 0`,there will be no MTU problem in this mode.
|
||||||
|
|
||||||
# Advanced Topic
|
# Advanced Topic
|
||||||
### Full Options
|
### Full Options
|
||||||
```
|
```
|
||||||
UDPspeeder V2
|
UDPspeeder V2
|
||||||
git version: 6f55b8a2fc build date: Nov 19 2017 06:11:23
|
git version:8e7a8aed92 build date:Oct 25 2017 02:00:54
|
||||||
repository: https://github.com/wangyu-/UDPspeeder
|
repository: https://github.com/wangyu-/UDPspeeder
|
||||||
|
|
||||||
usage:
|
usage:
|
||||||
run as client : ./this_program -c -l local_listen_ip:local_port -r server_ip:server_port [options]
|
run as client : ./this_program -c -l local_listen_ip:local_port -r server_ip:server_port [options]
|
||||||
run as server : ./this_program -s -l server_listen_ip:server_port -r remote_ip:remote_port [options]
|
run as server : ./this_program -s -l server_listen_ip:server_port -r remote_ip:remote_port [options]
|
||||||
|
|
||||||
common options, must be same on both sides:
|
common option,must be same on both sides:
|
||||||
-k,--key <string> key for simple xor encryption. if not set,xor is disabled
|
-k,--key <string> key for simple xor encryption. if not set,xor is disabled
|
||||||
main options:
|
main options:
|
||||||
-f,--fec x:y forward error correction,send y redundant packets for every x packets
|
-f,--fec x:y forward error correction,send y redundant packets for every x packets
|
||||||
--timeout <number> how long could a packet be held in queue before doing fec,unit: ms,default :8ms
|
--timeout <number> how long could a packet be held in queue before doing fec,unit: ms,default :8ms
|
||||||
|
--mode <number> fec-mode,available values: 0,1 ; 0 cost less bandwidth,1 cost less latency(default)
|
||||||
--report <number> turn on send/recv report,and set a period for reporting,unit:s
|
--report <number> turn on send/recv report,and set a period for reporting,unit:s
|
||||||
advanced options:
|
advanced options:
|
||||||
--mode <number> fec-mode,available values: 0,1; mode 0(default) costs less bandwidth,no mtu problem.
|
--mtu <number> mtu. for mode 0,the program will split packet to segment smaller than mtu_value.
|
||||||
mode 1 usually introduces less latency, but you have to care about mtu.
|
|
||||||
--mtu <number> mtu. for mode 0, the program will split packet to segment smaller than mtu value.
|
|
||||||
for mode 1,no packet will be split,the program just check if the mtu is exceed.
|
for mode 1,no packet will be split,the program just check if the mtu is exceed.
|
||||||
default value: 1250. you typically shouldnt change this value.
|
default value:1250
|
||||||
-q,--queue-len <number> fec queue len, only for mode 0, fec will be performed immediately after queue is full.
|
|
||||||
default value: 200.
|
|
||||||
-j,--jitter <number> simulated jitter.randomly delay first packet for 0~<number> ms,default value:0.
|
-j,--jitter <number> simulated jitter.randomly delay first packet for 0~<number> ms,default value:0.
|
||||||
do not use if you dont know what it means.
|
do not use if you dont know what it means.
|
||||||
-i,--interval <number> scatter each fec group to a interval of <number> ms,to protect burst packet loss.
|
-i,--interval <number> scatter each fec group to a interval of <number> ms,to protect burst packet loss.
|
||||||
default value:0.do not use if you dont know what it means.
|
default value:0.do not use if you dont know what it means.
|
||||||
--random-drop <number> simulate packet loss, unit: 0.01%. default value: 0.
|
--random-drop <number> simulate packet loss ,unit:0.01%. default value: 0
|
||||||
--disable-obscure <number> disable obscure, to save a bit bandwidth and cpu.
|
--disable-obscure <number> disable obscure,to save a bit bandwidth and cpu
|
||||||
developer options:
|
developer options:
|
||||||
--fifo <string> use a fifo(named pipe) for sending commands to the running program,so that you
|
--fifo <string> use a fifo(named pipe) for sending commands to the running program,so that you
|
||||||
can change fec encode parameters dynamically,check readme.md in repository for
|
can change fec encode parameters dynamically,check readme.md in repository for
|
||||||
supported commands.
|
supported commands.
|
||||||
-j ,--jitter jmin:jmax similiar to -j above,but create jitter randomly between jmin and jmax
|
-j ,--jitter jmin:jmax similiar to -j above,but create jitter randomly between jmin and jmax
|
||||||
-i,--interval imin:imax similiar to -i above,but scatter randomly between imin and imax
|
-i,--interval imin:imax similiar to -i above,but scatter randomly between imin and imax
|
||||||
|
-q,--queue-len <number> max fec queue len,only for mode 0
|
||||||
--decode-buf <number> size of buffer of fec decoder,unit:packet,default:2000
|
--decode-buf <number> size of buffer of fec decoder,unit:packet,default:2000
|
||||||
--fix-latency <number> try to stabilize latency,only for mode 0
|
--fix-latency <number> try to stabilize latency,only for mode 0
|
||||||
--delay-capacity <number> max number of delayed packets
|
--delay-capacity <number> max number of delayed packets
|
||||||
|
@@ -52,7 +52,7 @@ u64_t get_current_time()//ms
|
|||||||
{
|
{
|
||||||
timespec tmp_time;
|
timespec tmp_time;
|
||||||
clock_gettime(CLOCK_MONOTONIC, &tmp_time);
|
clock_gettime(CLOCK_MONOTONIC, &tmp_time);
|
||||||
return ((u64_t)tmp_time.tv_sec)*1000llu+((u64_t)tmp_time.tv_nsec)/(1000*1000llu);
|
return tmp_time.tv_sec*1000+tmp_time.tv_nsec/(1000*1000l);
|
||||||
}
|
}
|
||||||
|
|
||||||
u64_t get_current_time_us()
|
u64_t get_current_time_us()
|
||||||
|
@@ -94,39 +94,37 @@ https://github.com/wangyu-/UDPspeeder/releases
|
|||||||
### 命令选项
|
### 命令选项
|
||||||
```
|
```
|
||||||
UDPspeeder V2
|
UDPspeeder V2
|
||||||
git version: 6f55b8a2fc build date: Nov 19 2017 06:11:23
|
git version:8e7a8aed92 build date:Oct 25 2017 02:00:54
|
||||||
repository: https://github.com/wangyu-/UDPspeeder
|
repository: https://github.com/wangyu-/UDPspeeder
|
||||||
|
|
||||||
usage:
|
usage:
|
||||||
run as client : ./this_program -c -l local_listen_ip:local_port -r server_ip:server_port [options]
|
run as client : ./this_program -c -l local_listen_ip:local_port -r server_ip:server_port [options]
|
||||||
run as server : ./this_program -s -l server_listen_ip:server_port -r remote_ip:remote_port [options]
|
run as server : ./this_program -s -l server_listen_ip:server_port -r remote_ip:remote_port [options]
|
||||||
|
|
||||||
common options, must be same on both sides:
|
common option,must be same on both sides:
|
||||||
-k,--key <string> key for simple xor encryption. if not set,xor is disabled
|
-k,--key <string> key for simple xor encryption. if not set,xor is disabled
|
||||||
main options:
|
main options:
|
||||||
-f,--fec x:y forward error correction,send y redundant packets for every x packets
|
-f,--fec x:y forward error correction,send y redundant packets for every x packets
|
||||||
--timeout <number> how long could a packet be held in queue before doing fec,unit: ms,default :8ms
|
--timeout <number> how long could a packet be held in queue before doing fec,unit: ms,default :8ms
|
||||||
|
--mode <number> fec-mode,available values: 0,1 ; 0 cost less bandwidth,1 cost less latency(default)
|
||||||
--report <number> turn on send/recv report,and set a period for reporting,unit:s
|
--report <number> turn on send/recv report,and set a period for reporting,unit:s
|
||||||
advanced options:
|
advanced options:
|
||||||
--mode <number> fec-mode,available values: 0,1; mode 0(default) costs less bandwidth,no mtu problem.
|
--mtu <number> mtu. for mode 0,the program will split packet to segment smaller than mtu_value.
|
||||||
mode 1 usually introduces less latency, but you have to care about mtu.
|
|
||||||
--mtu <number> mtu. for mode 0, the program will split packet to segment smaller than mtu value.
|
|
||||||
for mode 1,no packet will be split,the program just check if the mtu is exceed.
|
for mode 1,no packet will be split,the program just check if the mtu is exceed.
|
||||||
default value: 1250. you typically shouldnt change this value.
|
default value:1250
|
||||||
-q,--queue-len <number> fec queue len, only for mode 0, fec will be performed immediately after queue is full.
|
|
||||||
default value: 200.
|
|
||||||
-j,--jitter <number> simulated jitter.randomly delay first packet for 0~<number> ms,default value:0.
|
-j,--jitter <number> simulated jitter.randomly delay first packet for 0~<number> ms,default value:0.
|
||||||
do not use if you dont know what it means.
|
do not use if you dont know what it means.
|
||||||
-i,--interval <number> scatter each fec group to a interval of <number> ms,to protect burst packet loss.
|
-i,--interval <number> scatter each fec group to a interval of <number> ms,to protect burst packet loss.
|
||||||
default value:0.do not use if you dont know what it means.
|
default value:0.do not use if you dont know what it means.
|
||||||
--random-drop <number> simulate packet loss, unit: 0.01%. default value: 0.
|
--random-drop <number> simulate packet loss ,unit:0.01%. default value: 0
|
||||||
--disable-obscure <number> disable obscure, to save a bit bandwidth and cpu.
|
--disable-obscure <number> disable obscure,to save a bit bandwidth and cpu
|
||||||
developer options:
|
developer options:
|
||||||
--fifo <string> use a fifo(named pipe) for sending commands to the running program,so that you
|
--fifo <string> use a fifo(named pipe) for sending commands to the running program,so that you
|
||||||
can change fec encode parameters dynamically,check readme.md in repository for
|
can change fec encode parameters dynamically,check readme.md in repository for
|
||||||
supported commands.
|
supported commands.
|
||||||
-j ,--jitter jmin:jmax similiar to -j above,but create jitter randomly between jmin and jmax
|
-j ,--jitter jmin:jmax similiar to -j above,but create jitter randomly between jmin and jmax
|
||||||
-i,--interval imin:imax similiar to -i above,but scatter randomly between imin and imax
|
-i,--interval imin:imax similiar to -i above,but scatter randomly between imin and imax
|
||||||
|
-q,--queue-len <number> max fec queue len,only for mode 0
|
||||||
--decode-buf <number> size of buffer of fec decoder,unit:packet,default:2000
|
--decode-buf <number> size of buffer of fec decoder,unit:packet,default:2000
|
||||||
--fix-latency <number> try to stabilize latency,only for mode 0
|
--fix-latency <number> try to stabilize latency,only for mode 0
|
||||||
--delay-capacity <number> max number of delayed packets
|
--delay-capacity <number> max number of delayed packets
|
||||||
@@ -139,8 +137,6 @@ log and help options:
|
|||||||
--disable-color disable log color
|
--disable-color disable log color
|
||||||
-h,--help print this help message
|
-h,--help print this help message
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
```
|
```
|
||||||
### 包发送选项,两端设置可以不同。 只影响本地包发送。
|
### 包发送选项,两端设置可以不同。 只影响本地包发送。
|
||||||
##### `-f` 选项
|
##### `-f` 选项
|
||||||
@@ -240,9 +236,7 @@ run at client side:
|
|||||||
|
|
||||||
如果只需要加速UDP,不需要加速TCP,可以把kcptun换成其他的任意端口转发方式,比如ncat/socat/ssh tunnel/iptables/[tinyPortMapper](https://github.com/wangyu-/tinyPortMapper/releases)。
|
如果只需要加速UDP,不需要加速TCP,可以把kcptun换成其他的任意端口转发方式,比如ncat/socat/ssh tunnel/iptables/[tinyPortMapper](https://github.com/wangyu-/tinyPortMapper/releases)。
|
||||||
|
|
||||||
如果你没有kcptun只有BBR/锐速的话,也可以把kcptun换成ncat/socat/ssh tunnel/iptables/[tinyPortMapper](https://github.com/wangyu-/tinyPortMapper/releases)。这样,TCP流量由锐速/BBR加速,UDP由UDPspeeder加速。
|
另外,如果没有kcptun只有BBR/锐速的话,也可以把kcptun换成ncat/socat/ssh tunnel/iptables/[tinyPortMapper](https://github.com/wangyu-/tinyPortMapper/releases)。这样,TCP流量由锐速/BBR加速,UDP由UDPspeeder加速。
|
||||||
|
|
||||||
另外,即使你不想使用$\*\*\*的TCP功能,你也必须把$\*\*\*的TCP端口转发过来,否则无法使用UDP功能,这是socks5协议的工作方式决定的。($\*\*\*-redir方式不受此限制)
|
|
||||||
|
|
||||||
#### UDPspeeder + openvpn + $*** 混合方案,也适用于其他VPN
|
#### UDPspeeder + openvpn + $*** 混合方案,也适用于其他VPN
|
||||||
也是我正在用的方案。优点是可以随时在vpn和$\*\*\*方案间快速切换。
|
也是我正在用的方案。优点是可以随时在vpn和$\*\*\*方案间快速切换。
|
||||||
@@ -263,23 +257,12 @@ run at client side:
|
|||||||
https://github.com/wangyu-/UDPspeeder/wiki/win10系统UDPspeeder-OpenVPN的完整设置
|
https://github.com/wangyu-/UDPspeeder/wiki/win10系统UDPspeeder-OpenVPN的完整设置
|
||||||
|
|
||||||
|
|
||||||
#### UDPspeeder+OpenVPN运行在linux上,透明加速linux本机的网络
|
|
||||||
|
|
||||||
https://github.com/wangyu-/tinyFecVPN/wiki/tinyFecVPN运行在linux上,透明加速linux本机的网络
|
|
||||||
|
|
||||||
|
|
||||||
#### UDPspeeder+OpenVPN运行在虚拟机中,加速windows和局域网内其他主机的网络
|
|
||||||
|
|
||||||
https://github.com/wangyu-/tinyFecVPN/wiki/tinyFecVPN运行在虚拟机中,加速windows和局域网内其他主机的网络
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
#### 用树莓派做路由器,搭建透明代理,加速游戏主机的网络
|
#### 用树莓派做路由器,搭建透明代理,加速游戏主机的网络
|
||||||
|
|
||||||
https://github.com/wangyu-/UDPspeeder/wiki/用树莓派做路由器,搭建透明代理,加速游戏主机的网络
|
https://github.com/wangyu-/UDPspeeder/wiki/用树莓派做路由器,搭建透明代理,加速游戏主机的网络
|
||||||
|
|
||||||
|
|
||||||
# 编译教程
|
# 编译教程
|
||||||
暂时先参考udp2raw的这篇教程,几乎一样的过程。
|
暂时先参考udp2raw的这篇教程,几乎一样的过程。
|
||||||
|
|
||||||
https://github.com/wangyu-/udp2raw-tunnel/blob/master/doc/build_guide.zh-cn.md
|
https://github.com/wangyu-/udp2raw-tunnel/blob/master/doc/build_guide.zh-cn.md
|
||||||
|
|
||||||
|
7
misc.cpp
7
misc.cpp
@@ -15,7 +15,6 @@ int mtu_warn=1350;
|
|||||||
|
|
||||||
int disable_mtu_warn=1;
|
int disable_mtu_warn=1;
|
||||||
int disable_fec=0;
|
int disable_fec=0;
|
||||||
int disable_checksum=0;
|
|
||||||
|
|
||||||
int debug_force_flush_fec=0;
|
int debug_force_flush_fec=0;
|
||||||
|
|
||||||
@@ -559,7 +558,6 @@ void process_arg(int argc, char *argv[])
|
|||||||
{"disable-fec", no_argument, 0, 1},
|
{"disable-fec", no_argument, 0, 1},
|
||||||
{"disable-obscure", no_argument, 0, 1},
|
{"disable-obscure", no_argument, 0, 1},
|
||||||
{"disable-xor", no_argument, 0, 1},
|
{"disable-xor", no_argument, 0, 1},
|
||||||
{"disable-checksum", no_argument, 0, 1},
|
|
||||||
{"fix-latency", no_argument, 0, 1},
|
{"fix-latency", no_argument, 0, 1},
|
||||||
{"sock-buf", required_argument, 0, 1},
|
{"sock-buf", required_argument, 0, 1},
|
||||||
{"random-drop", required_argument, 0, 1},
|
{"random-drop", required_argument, 0, 1},
|
||||||
@@ -780,11 +778,6 @@ void process_arg(int argc, char *argv[])
|
|||||||
mylog(log_info,"xor disabled\n");
|
mylog(log_info,"xor disabled\n");
|
||||||
disable_xor=1;
|
disable_xor=1;
|
||||||
}
|
}
|
||||||
else if(strcmp(long_options[option_index].name,"disable-checksum")==0)
|
|
||||||
{
|
|
||||||
disable_checksum=1;
|
|
||||||
mylog(log_warn,"checksum disabled\n");
|
|
||||||
}
|
|
||||||
else if(strcmp(long_options[option_index].name,"fix-latency")==0)
|
else if(strcmp(long_options[option_index].name,"fix-latency")==0)
|
||||||
{
|
{
|
||||||
mylog(log_info,"fix-latency enabled\n");
|
mylog(log_info,"fix-latency enabled\n");
|
||||||
|
1
misc.h
1
misc.h
@@ -22,7 +22,6 @@ extern int mtu_warn;
|
|||||||
|
|
||||||
extern int disable_mtu_warn;
|
extern int disable_mtu_warn;
|
||||||
extern int disable_fec;
|
extern int disable_fec;
|
||||||
extern int disable_checksum;
|
|
||||||
|
|
||||||
extern int debug_force_flush_fec;
|
extern int debug_force_flush_fec;
|
||||||
|
|
||||||
|
@@ -9,7 +9,6 @@
|
|||||||
#include "common.h"
|
#include "common.h"
|
||||||
#include "log.h"
|
#include "log.h"
|
||||||
#include "packet.h"
|
#include "packet.h"
|
||||||
#include "misc.h"
|
|
||||||
|
|
||||||
int iv_min=4;
|
int iv_min=4;
|
||||||
int iv_max=32;//< 256;
|
int iv_max=32;//< 256;
|
||||||
@@ -316,7 +315,6 @@ int get_conv0(u32_t &conv,const char *input,int len_in,char *&output,int &len_ou
|
|||||||
}
|
}
|
||||||
int put_crc32(char * s,int &len)
|
int put_crc32(char * s,int &len)
|
||||||
{
|
{
|
||||||
if(disable_checksum)return 0;
|
|
||||||
assert(len>=0);
|
assert(len>=0);
|
||||||
//if(len<0) return -1;
|
//if(len<0) return -1;
|
||||||
u32_t crc32=crc32h((unsigned char *)s,len);
|
u32_t crc32=crc32h((unsigned char *)s,len);
|
||||||
@@ -357,8 +355,8 @@ int de_cook(char * s,int &len)
|
|||||||
}
|
}
|
||||||
int rm_crc32(char * s,int &len)
|
int rm_crc32(char * s,int &len)
|
||||||
{
|
{
|
||||||
if(disable_checksum)return 0;
|
|
||||||
assert(len>=0);
|
assert(len>=0);
|
||||||
|
|
||||||
len-=sizeof(u32_t);
|
len-=sizeof(u32_t);
|
||||||
if(len<0) return -1;
|
if(len<0) return -1;
|
||||||
u32_t crc32_in=read_u32(s+len);
|
u32_t crc32_in=read_u32(s+len);
|
||||||
|
12
tunnel.cpp
12
tunnel.cpp
@@ -113,12 +113,12 @@ int tunnel_client_event_loop()
|
|||||||
if (nfds < 0) { //allow zero
|
if (nfds < 0) { //allow zero
|
||||||
if(errno==EINTR )
|
if(errno==EINTR )
|
||||||
{
|
{
|
||||||
mylog(log_info,"epoll interrupted by signal continue\n");
|
mylog(log_info,"epoll interrupted by signal\n");
|
||||||
//myexit(0);
|
myexit(0);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
mylog(log_fatal,"epoll_wait return %d,%s\n", nfds,strerror(errno));
|
mylog(log_fatal,"epoll_wait return %d\n", nfds);
|
||||||
myexit(-1);
|
myexit(-1);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -417,12 +417,12 @@ int tunnel_server_event_loop()
|
|||||||
if (nfds < 0) { //allow zero
|
if (nfds < 0) { //allow zero
|
||||||
if(errno==EINTR )
|
if(errno==EINTR )
|
||||||
{
|
{
|
||||||
mylog(log_info,"epoll interrupted by signal,continue\n");
|
mylog(log_info,"epoll interrupted by signal\n");
|
||||||
//myexit(0);
|
myexit(0);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
mylog(log_fatal,"epoll_wait return %d,%s\n", nfds,strerror(errno));
|
mylog(log_fatal,"epoll_wait return %d\n", nfds);
|
||||||
myexit(-1);
|
myexit(-1);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user