mirror of
https://github.com/solemnwarning/ipxwrapper
synced 2024-12-30 16:45:37 +01:00
Bugfix: Don't choke on rpacket_header in ioctlsocket/FIONREAD.
This commit is contained in:
parent
57131bb5ff
commit
4340e3f5b2
@ -783,7 +783,6 @@ int PASCAL ioctlsocket(SOCKET fd, long cmd, u_long *argp) {
|
|||||||
ipx_socket *sockptr = get_socket(fd);
|
ipx_socket *sockptr = get_socket(fd);
|
||||||
|
|
||||||
if(sockptr && cmd == FIONREAD) {
|
if(sockptr && cmd == FIONREAD) {
|
||||||
ipx_packet packet;
|
|
||||||
fd_set fdset;
|
fd_set fdset;
|
||||||
struct timeval tv = {0,0};
|
struct timeval tv = {0,0};
|
||||||
|
|
||||||
@ -798,13 +797,14 @@ int PASCAL ioctlsocket(SOCKET fd, long cmd, u_long *argp) {
|
|||||||
RETURN(0);
|
RETURN(0);
|
||||||
}
|
}
|
||||||
|
|
||||||
r = r_recv(sockptr->fd, (char*)&packet, sizeof(packet), MSG_PEEK);
|
char tmp_buf;
|
||||||
if(r == -1 && WSAGetLastError() != WSAEMSGSIZE) {
|
|
||||||
RETURN(-1);
|
if((r = recv_packet(sockptr, &tmp_buf, 1, MSG_PEEK, NULL, 0)) == -1) {
|
||||||
|
return -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
*(unsigned long*)argp = packet.size;
|
*(unsigned long*)argp = r;
|
||||||
RETURN(0);
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
if(sockptr) {
|
if(sockptr) {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user