mirror of
https://github.com/hufrea/byedpi.git
synced 2024-12-22 14:25:44 +00:00
Handle only conn reset
This commit is contained in:
parent
fc4e6b22bb
commit
0b4d6d72cc
2
error.h
2
error.h
@ -44,6 +44,8 @@ inline const int unie(int e)
|
|||||||
return EHOSTUNREACH;
|
return EHOSTUNREACH;
|
||||||
case WSAECONNREFUSED:
|
case WSAECONNREFUSED:
|
||||||
return ECONNREFUSED;
|
return ECONNREFUSED;
|
||||||
|
case WSAECONNRESET:
|
||||||
|
return ECONNRESET;
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
return e;
|
return e;
|
||||||
|
11
proxy.c
11
proxy.c
@ -472,7 +472,7 @@ static inline int on_tunnel(struct poolhd *pool, struct eval *val,
|
|||||||
break;
|
break;
|
||||||
if (n < 1) {
|
if (n < 1) {
|
||||||
if (n) uniperror("recv");
|
if (n) uniperror("recv");
|
||||||
return -1;
|
return get_e();
|
||||||
}
|
}
|
||||||
val->recv_count += n;
|
val->recv_count += n;
|
||||||
|
|
||||||
@ -565,12 +565,17 @@ int on_desync(struct poolhd *pool, struct eval *val,
|
|||||||
int m;
|
int m;
|
||||||
|
|
||||||
if (val->flag == FLAG_CONN) {
|
if (val->flag == FLAG_CONN) {
|
||||||
if (on_tunnel(pool, val, buffer, bfsize, 0)) {
|
int e = on_tunnel(pool, val, buffer, bfsize, 0);
|
||||||
return try_again(pool, val);
|
if (e) {
|
||||||
|
if (unie(e) == ECONNRESET) {
|
||||||
|
return try_again(pool, val);
|
||||||
|
}
|
||||||
|
return -1;
|
||||||
}
|
}
|
||||||
free(val->pair->buff.data);
|
free(val->pair->buff.data);
|
||||||
val->pair->buff.data = 0;
|
val->pair->buff.data = 0;
|
||||||
val->pair->buff.size = 0;
|
val->pair->buff.size = 0;
|
||||||
|
val->type = EV_TUNNEL;
|
||||||
|
|
||||||
m = val->pair->try_count;
|
m = val->pair->try_count;
|
||||||
return mode_add_get(
|
return mode_add_get(
|
||||||
|
Loading…
Reference in New Issue
Block a user