Skip to content

Commit

Permalink
GUACAMOLE-1841: Fixes for telnet on windows.
Browse files Browse the repository at this point in the history
  • Loading branch information
jmuehlner committed Sep 30, 2024
1 parent e2085d5 commit d803f28
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion src/protocols/telnet/telnet.c
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,11 @@ static int __guac_telnet_write_all(int fd, const char* buffer, int size) {
while (remaining > 0) {

/* Attempt to write data */
#ifdef WINDOWS_BUILD
int ret_val = send(fd, buffer, remaining, 0);
#else
int ret_val = write(fd, buffer, remaining);
#endif
if (ret_val <= 0)
return -1;

Expand Down Expand Up @@ -637,8 +641,11 @@ void* guac_telnet_client_thread(void* data) {
/* Resume waiting of no data available */
if (wait_result == 0)
continue;

#ifdef WINDOWS_BUILD
int bytes_read = recv(telnet_client->socket_fd, buffer, sizeof(buffer), 0);
#else
int bytes_read = read(telnet_client->socket_fd, buffer, sizeof(buffer));
#endif
if (bytes_read <= 0)
break;

Expand Down

0 comments on commit d803f28

Please sign in to comment.