Skip to content

Commit

Permalink
Fix XcpTl_Send()
Browse files Browse the repository at this point in the history
  • Loading branch information
christoph2 committed Oct 1, 2019
1 parent bb6667d commit 1cb3e8f
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 5 deletions.
2 changes: 1 addition & 1 deletion examples/simwin/xcp_config.h
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@

#define XCP_ENABLE_EXTERN_C_GUARDS XCP_OFF

#define XCP_ENABLE_SLAVE_BLOCKMODE XCP_OFF
#define XCP_ENABLE_SLAVE_BLOCKMODE XCP_ON
#define XCP_ENABLE_MASTER_BLOCKMODE XCP_OFF

#define XCP_ENABLE_STIM XCP_OFF
Expand Down
6 changes: 2 additions & 4 deletions src/tl/eth/wineth_iocp.c
Original file line number Diff line number Diff line change
Expand Up @@ -343,7 +343,7 @@ void XcpTl_Send(uint8_t const * buf, uint16_t len)
SecureZeroMemory(&sendOlap.overlapped, sizeof(OVERLAPPED));
if (XcpTl_Connection.socketType == SOCK_DGRAM) {
addrLen = sizeof(SOCKADDR_STORAGE);
WSASendTo(XcpTl_Connection.boundSocket,
if (WSASendTo(XcpTl_Connection.boundSocket,
&sendOlap.wsabuf,
1,
&bytesWritten,
Expand All @@ -352,9 +352,7 @@ void XcpTl_Send(uint8_t const * buf, uint16_t len)
addrLen,
(LPWSAOVERLAPPED)&sendOlap.overlapped,
NULL
);
if (sendto(XcpTl_Connection.boundSocket, (char const *)buf, len, 0,
(SOCKADDR * )(SOCKADDR_STORAGE const *)&XcpTl_Connection.connectionAddress, addrSize) == SOCKET_ERROR) {
) == SOCKET_ERROR) {
Win_ErrorMsg("XcpTl_Send:WSASendTo()", WSAGetLastError());
}
} else if (XcpTl_Connection.socketType == SOCK_STREAM) {
Expand Down

0 comments on commit 1cb3e8f

Please sign in to comment.