1
0
Fork 0
mirror of https://github.com/warmcat/libwebsockets.git synced 2025-03-09 00:00:04 +01:00

udp: cast sendto payload to be compatible with windows perversions

https://github.com/warmcat/libwebsockets/issues/1277
This commit is contained in:
Andy Green 2018-05-16 08:13:59 +08:00
parent 8140c716b6
commit 3d96df62d0

View file

@ -253,9 +253,12 @@ lws_ssl_capable_write_no_ssl(struct lws *wsi, unsigned char *buf, int len)
if (lws_wsi_is_udp(wsi)) {
#if !defined(LWS_WITH_ESP32)
if (wsi->trunc_len)
n = sendto(wsi->desc.sockfd, buf, len, 0, &wsi->udp->sa_pending, wsi->udp->salen_pending);
n = sendto(wsi->desc.sockfd, (const char *)buf,
len, 0, &wsi->udp->sa_pending,
wsi->udp->salen_pending);
else
n = sendto(wsi->desc.sockfd, buf, len, 0, &wsi->udp->sa, wsi->udp->salen);
n = sendto(wsi->desc.sockfd, (const char *)buf,
len, 0, &wsi->udp->sa, wsi->udp->salen);
#endif
} else
n = send(wsi->desc.sockfd, (char *)buf, len, MSG_NOSIGNAL);