mirror of
https://github.com/solemnwarning/ipxwrapper
synced 2024-12-30 16:45:37 +01:00
Updated recv to work with SPX sockets.
This commit is contained in:
parent
e31d0d51a9
commit
499bb4659c
@ -628,19 +628,31 @@ int WSAAPI recvfrom(SOCKET fd, char *buf, int len, int flags, struct sockaddr *a
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
int WSAAPI recv(SOCKET fd, char *buf, int len, int flags) {
|
int WSAAPI recv(SOCKET fd, char *buf, int len, int flags)
|
||||||
ipx_socket *sockptr = get_socket(fd);
|
{
|
||||||
|
ipx_socket *sock = get_socket(fd);
|
||||||
|
|
||||||
if(sockptr) {
|
if(sock)
|
||||||
int rval = recv_packet(sockptr, buf, len, flags, NULL, 0);
|
{
|
||||||
|
if(sock->flags & IPX_IS_SPX)
|
||||||
if(rval > len) {
|
{
|
||||||
WSASetLastError(WSAEMSGSIZE);
|
unlock_sockets();
|
||||||
return -1;
|
|
||||||
|
return r_recv(fd, buf, len, flags);
|
||||||
}
|
}
|
||||||
|
else{
|
||||||
return rval;
|
int rval = recv_packet(sock, buf, len, flags, NULL, 0);
|
||||||
}else{
|
|
||||||
|
if(rval > len)
|
||||||
|
{
|
||||||
|
WSASetLastError(WSAEMSGSIZE);
|
||||||
|
return -1;
|
||||||
|
}
|
||||||
|
|
||||||
|
return rval;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else{
|
||||||
return r_recv(fd, buf, len, flags);
|
return r_recv(fd, buf, len, flags);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user