mirror of
https://github.com/gyurix1968/guacamole-client.git
synced 2025-09-06 05:07:41 +00:00
Fixed closing of stream on transfer.
This commit is contained in:
@@ -49,6 +49,7 @@ ssize_t guac_flush_base64(GUACIO* io);
|
|||||||
ssize_t guac_flush(GUACIO* io);
|
ssize_t guac_flush(GUACIO* io);
|
||||||
int guac_select(GUACIO* io, int usec_timeout);
|
int guac_select(GUACIO* io, int usec_timeout);
|
||||||
void guac_close(GUACIO* io);
|
void guac_close(GUACIO* io);
|
||||||
|
void guac_close_final(GUACIO* io);
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
@@ -197,7 +197,7 @@ void guac_start_client(guac_client* client) {
|
|||||||
|
|
||||||
/* Accept changes to client I/O only before handling messages */
|
/* Accept changes to client I/O only before handling messages */
|
||||||
if (client_copy.io != client->io) {
|
if (client_copy.io != client->io) {
|
||||||
guac_close(client_copy.io); /* Close old I/O */
|
guac_close_final(client_copy.io); /* Close old I/O and fd */
|
||||||
client_copy.io = client->io;
|
client_copy.io = client->io;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@@ -60,6 +60,12 @@ void guac_close(GUACIO* io) {
|
|||||||
free(io);
|
free(io);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void guac_close_final(GUACIO* io) {
|
||||||
|
guac_flush(io);
|
||||||
|
close(io->fd);
|
||||||
|
free(io);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
/* Write bytes, limit rate */
|
/* Write bytes, limit rate */
|
||||||
ssize_t __guac_write(GUACIO* io, const char* buf, int count) {
|
ssize_t __guac_write(GUACIO* io, const char* buf, int count) {
|
||||||
|
Reference in New Issue
Block a user