mirror of
https://github.com/gnif/LookingGlass.git
synced 2025-08-09 20:24:14 +00:00
[client] fix improper spice socket shutdown
This commit is contained in:
@@ -646,7 +646,17 @@ bool spice_connect_channel(struct SpiceChannel * channel)
|
||||
void spice_disconnect_channel(struct SpiceChannel * channel)
|
||||
{
|
||||
if (channel->connected)
|
||||
{
|
||||
shutdown(channel->socket, SHUT_WR);
|
||||
|
||||
char buffer[1024];
|
||||
ssize_t len = 0;
|
||||
do
|
||||
len = read(channel->socket, buffer, sizeof(buffer));
|
||||
while(len > 0);
|
||||
|
||||
close(channel->socket);
|
||||
}
|
||||
channel->connected = false;
|
||||
LG_LOCK_FREE(channel->lock);
|
||||
}
|
||||
|
@@ -22,6 +22,7 @@ Place, Suite 330, Boston, MA 02111-1307 USA
|
||||
#include <stdint.h>
|
||||
|
||||
bool spice_connect(const char * host, const short port, const char * password);
|
||||
void spice_drain();
|
||||
void spice_disconnect();
|
||||
bool spice_process();
|
||||
bool spice_ready();
|
||||
|
Reference in New Issue
Block a user