summaryrefslogtreecommitdiff
path: root/src/trg-main-window.c
diff options
context:
space:
mode:
authorGravatar Alan Fitton <ajf@eth0.org.uk>2011-04-12 11:25:27 +0000
committerGravatar Alan Fitton <ajf@eth0.org.uk>2011-04-12 11:25:27 +0000
commit03f0d32dee2e717ac3cf1fa1ca1563110403934e (patch)
tree4ba8c706f5f4c4a74bb35187c757bdb73c1c1b67 /src/trg-main-window.c
parent42eddac0e9f0216175fef223fd9b1023ed502a6e (diff)
introduce a 0.35 second sleep between acknowledgement of an interactive action and requesting a full update. Transmission seems to have a small lag before a pause takes effect.
Diffstat (limited to 'src/trg-main-window.c')
-rw-r--r--src/trg-main-window.c9
1 files changed, 8 insertions, 1 deletions
diff --git a/src/trg-main-window.c b/src/trg-main-window.c
index b1c78d8..52b5bc5 100644
--- a/src/trg-main-window.c
+++ b/src/trg-main-window.c
@@ -23,6 +23,7 @@
#include <stdlib.h>
#include <string.h>
+#include <time.h>
#include <glib.h>
#include <glib/gprintf.h>
#include <glib/gstdio.h>
@@ -1157,9 +1158,15 @@ on_generic_interactive_action(JsonObject * response, int status,
trg_dialog_error_handler(TRG_MAIN_WINDOW(data), response, status);
gdk_threads_leave();
- if (status == CURLE_OK || status == FAIL_RESPONSE_UNSUCCESSFUL)
+ if (status == CURLE_OK || status == FAIL_RESPONSE_UNSUCCESSFUL) {
+ struct timespec ts;
+ ts.tv_sec = 0;
+ ts.tv_nsec = 350000000;
+ nanosleep(&ts, NULL);
+
dispatch_async(priv->client, torrent_get(FALSE),
on_torrent_get_interactive, data);
+ }
}
response_unref(response);