mirror of
https://github.com/hufrea/byedpi.git
synced 2024-12-22 14:25:44 +00:00
Handle empty response
This commit is contained in:
parent
efee93cfd9
commit
bd2eb4e4e1
29
extend.c
29
extend.c
@ -206,6 +206,30 @@ int on_torst(struct poolhd *pool, struct eval *val)
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
int on_fin(struct poolhd *pool, struct eval *val)
|
||||||
|
{
|
||||||
|
int m = val->pair->attempt + 1;
|
||||||
|
|
||||||
|
for (; m < params.dp_count; m++) {
|
||||||
|
struct desync_params *dp = ¶ms.dp[m];
|
||||||
|
if (!dp->detect) {
|
||||||
|
return -1;
|
||||||
|
}
|
||||||
|
if (!(dp->detect & DETECT_TLS_ERR)) {
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
char *req = val->pair->buff.data;
|
||||||
|
ssize_t qn = val->pair->buff.size;
|
||||||
|
|
||||||
|
if (!is_tls_chello(req, qn)) {
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
return reconnect(pool, val, m);
|
||||||
|
}
|
||||||
|
return -1;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
int on_response(struct poolhd *pool, struct eval *val,
|
int on_response(struct poolhd *pool, struct eval *val,
|
||||||
char *resp, ssize_t sn)
|
char *resp, ssize_t sn)
|
||||||
{
|
{
|
||||||
@ -260,11 +284,10 @@ int on_tunnel_check(struct poolhd *pool, struct eval *val,
|
|||||||
case ECONNRESET:
|
case ECONNRESET:
|
||||||
case ECONNREFUSED:
|
case ECONNREFUSED:
|
||||||
case ETIMEDOUT:
|
case ETIMEDOUT:
|
||||||
break;
|
|
||||||
default: return -1;
|
|
||||||
}
|
|
||||||
return on_torst(pool, val);
|
return on_torst(pool, val);
|
||||||
}
|
}
|
||||||
|
return on_fin(pool, val);
|
||||||
|
}
|
||||||
//
|
//
|
||||||
if (on_response(pool, val, buffer, n) == 0) {
|
if (on_response(pool, val, buffer, n) == 0) {
|
||||||
return 0;
|
return 0;
|
||||||
|
Loading…
Reference in New Issue
Block a user