mirror of
https://github.com/3proxy/3proxy.git
synced 2026-11-26 23:59:41 +08:00
Use non-blocking sockets for UDP
This commit is contained in:
1 parent
ab11e6c4a3
commit
fd7b25bf06
3 files changed
+14
-2
No files matched your search
@@ -106,6 +106,7 @@ int udpsockmap(struct clientparam *param, int timeo)
|
||||
len = param->srv->so._recvfrom(param->sostate, param->clisock,
|
||||
(char *)param->srvbuf + recvoff, UDPBUFSIZE - recvoff,
|
||||
0, (struct sockaddr *)&sin, &sasize);
|
||||
if (len < 0 && (errno == EAGAIN || errno == EINTR)) continue;
|
||||
if (len <= 0) return 482;
|
||||
|
||||
if (SAADDRLEN(&sin) != SAADDRLEN(¶m->sincr) ||
|
||||
@@ -182,6 +183,7 @@ int udpsockmap(struct clientparam *param, int timeo)
|
||||
len = param->srv->so._recvfrom(param->sostate, param->remsock,
|
||||
(char *)param->srvbuf + hdrsize, UDPBUFSIZE - hdrsize, 0,
|
||||
(struct sockaddr *)&from, &sasize);
|
||||
if (len < 0 && (errno == EAGAIN || errno == EINTR)) continue;
|
||||
if (len <= 0) return 486;
|
||||
if (nhops >= 1) {
|
||||
if (!SAISNULL(¶m->sinsr) && *SAPORT(¶m->sinsr)) {
|
||||
|
||||
Reference in new issue
Block a user