From 3d96df62d0bdab017e089b8168609b0ce9aa55b8 Mon Sep 17 00:00:00 2001 From: Andy Green Date: Wed, 16 May 2018 08:13:59 +0800 Subject: [PATCH] udp: cast sendto payload to be compatible with windows perversions https://github.com/warmcat/libwebsockets/issues/1277 --- lib/core/output.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/lib/core/output.c b/lib/core/output.c index 6aa8d057b..639006dd7 100644 --- a/lib/core/output.c +++ b/lib/core/output.c @@ -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);