Author: felix
Date: Tue Jan 12 11:54:13 2010
New Revision: 8319
URL: http://svn.slimdevices.com/jive?rev=8319&view=rev
Log:
Bug: 11455
Description:
- Reduced DNS timeout to 10 seconds (was 2 minutes). My tests on Jive, Baby and
Touch showed that a 10 seconds timeout is still enough to allow the message
pipe to empty even if a lot of DNS resolve requests are queued up while the
network is down.
- Fixed slow memory leak in DNS resolver thread (occured while the network was
down)
Modified:
7.4/trunk/squeezeplay/src/squeezeplay/src/net/jive_dns.c
Modified: 7.4/trunk/squeezeplay/src/squeezeplay/src/net/jive_dns.c
URL:
http://svn.slimdevices.com/jive/7.4/trunk/squeezeplay/src/squeezeplay/src/net/jive_dns.c?rev=8319&r1=8318&r2=8319&view=diff
==============================================================================
--- 7.4/trunk/squeezeplay/src/squeezeplay/src/net/jive_dns.c (original)
+++ 7.4/trunk/squeezeplay/src/squeezeplay/src/net/jive_dns.c Tue Jan 12
11:54:13 2010
@@ -23,7 +23,22 @@
#endif
-#define RESOLV_TIMEOUT (2 * 60 * 1000) /* 2 minutes */
+/* fm - 01/12/2010
+Userland DNS resolve requests are queued into a pipe in jiveL_dns_write(), then
+dns_resolver_thread() reads the pipe and calls gethostbyaddr() or
gethostbyname().
+Both of these functions are blocking and can take a couple of seconds to
return,
+especially if the network is down.
+To allow the pipe to empty if a lot of DNS requests are issued while the
network
+is down a 'shortcut' is taken as long as the following timeout is active. The
+shortcut path doesn't call the blocking functions but just reads from the pipe
+and returns the last error code again.
+The timeout was set to 2 minutes which I found in my tests on Jive, Baby and
+Touch not to be necessary to make sure the pipe gets emptied. 10 seconds seem
+to be enough.
+The 10 seconds timeout also makes reconnecting a lot quicker when the network
is
+re-established.
+*/
+#define RESOLV_TIMEOUT (10 * 1000) /* 10 seconds (was 2 minutes) */
/*
@@ -208,6 +223,7 @@
if (now - failed_timeout < RESOLV_TIMEOUT) {
write_str(fd, failed_error);
+ free(buf);
continue;
}
}
_______________________________________________
Jive-checkins mailing list
[email protected]
http://lists.slimdevices.com/mailman/listinfo/jive-checkins