From 90ed6d2d107c3cd97e8670fda61dee05bfb9962d Mon Sep 17 00:00:00 2001 From: waker Date: Wed, 3 Oct 2012 17:27:04 +0200 Subject: mms: fixed connection timeout handling -- now we wait about 6 seconds (200 attemps 30 ms each) before giving up --- plugins/mms/libmms/mms.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'plugins') diff --git a/plugins/mms/libmms/mms.c b/plugins/mms/libmms/mms.c index 8ffccc79..766a5761 100644 --- a/plugins/mms/libmms/mms.c +++ b/plugins/mms/libmms/mms.c @@ -159,7 +159,7 @@ static off_t fallback_io_read(void *data, int socket, char *buf, off_t num) off_t len = 0, ret; /* lprintf("%d\n", fallback_io_select(data, socket, MMS_IO_READ_READY, 1000)); */ errno = 0; - int nretry = 5; + int nretry = 200; while (len < num && nretry > 0) { ret = (off_t)read(socket, buf + len, num - len); @@ -171,6 +171,7 @@ static off_t fallback_io_read(void *data, int socket, char *buf, off_t num) switch(errno) { case EAGAIN: + usleep (30000); // sleeping 30ms 200 times will give us about 6 sec of time to complete the request nretry--; continue; default: -- cgit v1.2.3