|
|
@ -66,13 +66,15 @@ int get_movies(ssh_session session, char **buffer, size_t size) { |
|
|
|
|
|
|
|
nbytes = ssh_channel_read(channel, read_buffer, sizeof(read_buffer), 0); |
|
|
|
|
|
|
|
if (nbytes < 0) { |
|
|
|
fprintf(stderr, "Failed to read bytes from channel"); |
|
|
|
ssh_channel_close(channel); |
|
|
|
ssh_channel_free(channel); |
|
|
|
return SSH_ERROR; |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
if (nbytes < 0) { |
|
|
|
fprintf(stderr, "Failed to read bytes from channel"); |
|
|
|
ssh_channel_close(channel); |
|
|
|
ssh_channel_free(channel); |
|
|
|
return SSH_ERROR; |
|
|
|
} |
|
|
|
|
|
|
|
ssh_channel_send_eof(channel); |
|
|
|
ssh_channel_close(channel); |
|
|
|
ssh_channel_free(channel); |
|
|
|