GUACAMOLE-324: Continuously write chunks of data until entire buffer has been sent.

This commit is contained in:
Michael Jumper 2018-02-06 21:29:31 -08:00
parent 1cf86e12a1
commit 9705b39c2b

View File

@ -102,10 +102,10 @@ ssize_t guac_socket_fd_write(guac_socket* socket,
#ifdef ENABLE_WINSOCK #ifdef ENABLE_WINSOCK
/* WSA only works with send() */ /* WSA only works with send() */
retval = send(data->fd, buf, count, 0); retval = send(data->fd, buffer, count, 0);
#else #else
/* Use write() for all other platforms */ /* Use write() for all other platforms */
retval = write(data->fd, buf, count); retval = write(data->fd, buffer, count);
#endif #endif
/* Record errors in guac_error */ /* Record errors in guac_error */
@ -115,7 +115,7 @@ ssize_t guac_socket_fd_write(guac_socket* socket,
return retval; return retval;
} }
/* Advance buffer as data retval */ /* Advance buffer to next chunk */
buffer += retval; buffer += retval;
count -= retval; count -= retval;