GUACAMOLE-325: Use recv() on Windows platforms.

This commit is contained in:
Michael Jumper 2017-06-11 13:06:46 -07:00
parent 944857d130
commit 1c404d1881

View File

@ -146,8 +146,15 @@ static ssize_t guac_socket_fd_read_handler(guac_socket* socket,
guac_socket_fd_data* data = (guac_socket_fd_data*) socket->data;
/* Read from socket */
int retval = read(data->fd, buf, count);
int retval;
#ifdef __MINGW32__
/* MINGW32 WINSOCK only works with recv() */
retval = recv(data->fd, buf, count, 0);
#else
/* Use read() for all other platforms */
retval = read(data->fd, buf, count);
#endif
/* Record errors in guac_error */
if (retval < 0) {