Skip to content

Commit 91b8f47

Browse files
committed
fix work UDP.
1 parent f03ad4e commit 91b8f47

File tree

1 file changed

+14
-0
lines changed

1 file changed

+14
-0
lines changed

src/socketworks.c

+14
Original file line numberDiff line numberDiff line change
@@ -1344,6 +1344,16 @@ int sendmmsg(int rsock, struct mmsghdr *msg, int len, int t)
13441344
}
13451345
#endif
13461346

1347+
#ifdef GXAPI
1348+
int gx_sendmmsg(int rsock, struct mmsghdr *msg, int len, int t)
1349+
{
1350+
int i;
1351+
for (i = 0; i < len; i++)
1352+
writev(rsock, msg[i].msg_hdr.msg_iov, msg[i].msg_hdr.msg_iovlen);
1353+
return len;
1354+
}
1355+
#endif
1356+
13471357
int writev_udp(int rsock, struct iovec *iov, int iiov)
13481358
{
13491359
struct mmsghdr msg[1024];
@@ -1365,7 +1375,11 @@ int writev_udp(int rsock, struct iovec *iov, int iiov)
13651375
}
13661376
if (j > 0)
13671377
msg[j - 1].msg_hdr.msg_iovlen = i - last_i;
1378+
#ifdef GXAPI
1379+
retval = gx_sendmmsg(rsock, msg, j, 0);
1380+
#else
13681381
retval = sendmmsg(rsock, msg, j, 0);
1382+
#endif
13691383
if (retval == -1)
13701384
LOG("sendmmsg(): errno %d: %s", errno, strerror(errno))
13711385
else if (retval != j)

0 commit comments

Comments
 (0)