diff options
author | Angelo Mantellini <angelo.mantellini@cisco.com> | 2020-03-26 12:02:23 +0100 |
---|---|---|
committer | Angelo Mantellini <angelo.mantellini@cisco.com> | 2020-03-31 11:35:33 +0200 |
commit | 3718e549ee31ac764b327bbf3d6e51dd7e224b46 (patch) | |
tree | 5bfc2147e348a5fd4b0291ad458dacf3feececc0 /hicn-light/src/hicn/io/udpConnection.c | |
parent | 4b36dc3d5dd3ec206aa24d49557c61ae5886be2b (diff) |
[HICN-581] update hicn stack to support windows, again
Signed-off-by: Angelo Mantellini <angelo.mantellini@cisco.com>
Change-Id: Ic5cfeae600fde8140a076807fa1e411da1933a02
Diffstat (limited to 'hicn-light/src/hicn/io/udpConnection.c')
-rw-r--r-- | hicn-light/src/hicn/io/udpConnection.c | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/hicn-light/src/hicn/io/udpConnection.c b/hicn-light/src/hicn/io/udpConnection.c index 14ffe1e5b..cd3ccc84a 100644 --- a/hicn-light/src/hicn/io/udpConnection.c +++ b/hicn-light/src/hicn/io/udpConnection.c @@ -326,18 +326,19 @@ static bool _sendIOVBuffer(IoOperations *ops, struct iovec *message, return false; } #else - WSABUF dataBuf[ARRAY_SIZE(message)]; + + WSABUF *dataBuf = (WSABUF *) malloc(size * sizeof (dataBuf)); DWORD BytesSent = 0; - for (int i = 0; i < ARRAY_SIZE(message); i++) { + for (int i = 0; i < size; i++) { dataBuf[i].buf = message[i].iov_base; dataBuf[i].len = (ULONG)message[i].iov_len; } - int rc = WSASendTo(udpConnState->udpListenerSocket, dataBuf, ARRAY_SIZE(message), + int rc = WSASendTo(udpConnState->udpListenerSocket, dataBuf, size, &BytesSent, 0, (SOCKADDR *)udpConnState->peerAddress, udpConnState->peerAddressLength, NULL, NULL); - + free(dataBuf); if (rc == SOCKET_ERROR) { return false; } |