diff --git a/VERSION b/VERSION index 3a9564c4..562ea52c 100644 --- a/VERSION +++ b/VERSION @@ -1 +1 @@ -B1-100-g2c59b5f557+1 \ No newline at end of file +B1-101-ge6154e685f+1 \ No newline at end of file diff --git a/client/spice/CMakeLists.txt b/client/spice/CMakeLists.txt index 272f5c2a..405b64cc 100644 --- a/client/spice/CMakeLists.txt +++ b/client/spice/CMakeLists.txt @@ -19,6 +19,7 @@ add_library(spice STATIC target_link_libraries(spice lg_common ${SPICE_PKGCONFIG_LIBRARIES} + gmp ) target_include_directories(spice diff --git a/client/spice/include/spice/spice.h b/client/spice/include/spice/spice.h index 686be5b7..07b5f732 100644 --- a/client/spice/include/spice/spice.h +++ b/client/spice/include/spice/spice.h @@ -40,7 +40,7 @@ typedef void (*SpiceClipboardRequest)(const SpiceDataType type); bool spice_connect(const char * host, const unsigned short port, const char * password); void spice_disconnect(); -bool spice_process(); +bool spice_process(int timeout); bool spice_ready(); bool spice_key_down (uint32_t code); @@ -61,4 +61,4 @@ bool spice_set_clipboard_cb( SpiceClipboardNotice cbNoticeFn, SpiceClipboardData cbDataFn, SpiceClipboardRelease cbReleaseFn, - SpiceClipboardRequest cbRequestFn); \ No newline at end of file + SpiceClipboardRequest cbRequestFn); diff --git a/client/spice/src/spice.c b/client/spice/src/spice.c index 8854cb0e..3ca27e29 100644 --- a/client/spice/src/spice.c +++ b/client/spice/src/spice.c @@ -236,18 +236,18 @@ bool spice_ready() // ============================================================================ -bool spice_process() +bool spice_process(int timeout) { fd_set readSet; FD_ZERO(&readSet); FD_SET(spice.scMain.socket , &readSet); FD_SET(spice.scInputs.socket, &readSet); - struct timeval timeout; - timeout.tv_sec = 1; - timeout.tv_usec = 0; + struct timeval tv; + tv.tv_sec = timeout / 1000; + tv.tv_usec = (timeout % 1000) * 1000; - int rc = select(FD_SETSIZE, &readSet, NULL, NULL, &timeout); + int rc = select(FD_SETSIZE, &readSet, NULL, NULL, &tv); if (rc < 0) { DEBUG_ERROR("select failure"); diff --git a/client/src/main.c b/client/src/main.c index 4fd6bea5..8fd0723f 100644 --- a/client/src/main.c +++ b/client/src/main.c @@ -464,7 +464,7 @@ static int frameThread(void * unused) int spiceThread(void * arg) { while(state.running) - if (!spice_process()) + if (!spice_process(1000)) { if (state.running) { @@ -1215,7 +1215,7 @@ static int lg_run() } while(state.running && !spice_ready()) - if (!spice_process()) + if (!spice_process(1000)) { state.running = false; DEBUG_ERROR("Failed to process spice messages");