[Pkg-mozext-commits] [wot] 07/226: Fixed query timeout issues on Firefox 12+

David Prévot taffit at moszumanska.debian.org
Fri May 1 00:35:28 UTC 2015


This is an automated email from the git hooks/post-receive script.

taffit pushed a commit to branch master
in repository wot.

commit 1d5170c0962c82c94fd7fa2fd27178e08bb887ef
Author: Sami Tolvanen <sami at mywot.com>
Date:   Sun Feb 5 17:12:20 2012 +0200

    Fixed query timeout issues on Firefox 12+
---
 content/api.js    | 29 +++++++++++------------------
 content/config.js | 10 +++++-----
 2 files changed, 16 insertions(+), 23 deletions(-)

diff --git a/content/api.js b/content/api.js
index 61f3e96..4893ecc 100644
--- a/content/api.js
+++ b/content/api.js
@@ -1,6 +1,6 @@
 /*
 	api.js
-	Copyright © 2005-2011  WOT Services Oy <info at mywot.com>
+	Copyright © 2005-2012  WOT Services Oy <info at mywot.com>
 
 	This file is part of WOT.
 
@@ -213,14 +213,18 @@ var wot_api_query =
 				wot_crypto.authenticate_query(qs));
 
 			new wot_cookie_remover(request);
-			request.timeout = null;
 
-			request.onload = function(event)
+			/* If we don't receive data reasonably soon, retry */
+			var timeout =
+				window.setTimeout(function() {
+						wot_api_query.timetout(request, hostname, callback);
+					},	WOT_TIMEOUT_QUERY);
+
+			request.onload = function(ev)
 			{
 				try {
-					if (request.timeout) {
-						window.clearTimeout(request.timeout);
-						request.timeout = null;
+					if (timeout) {
+						window.clearTimeout(timeout);
 					}
 
 					wot_cache.set(hostname, "time", Date.now());
@@ -258,12 +262,7 @@ var wot_api_query =
 				}
 			};
 
-			request.send(null);
-
-			/* If we don't receive data reasonably soon, retry */
-			request.timeout = window.setTimeout(this.timeout,
-				WOT_TIMEOUT_QUERY, request, hostname, callback);
-
+			request.send();
 			return true;
 		} catch (e) {
 			dump("wot_api_query.send: failed with " + e + "\n");
@@ -274,11 +273,6 @@ var wot_api_query =
 	timeout: function(request, hostname, callback) /* XMLHttpRequest */
 	{
 		try {
-			if (request.timeout) {
-				window.clearTimeout(request.timeout);
-				request.timeout = null;
-			}
-
 			if (!wot_cache.get(hostname, "inprogress")) {
 				return;
 			}
@@ -465,7 +459,6 @@ const WOT_REGISTER_RUNNING = "wot_register_running";
 var wot_api_register =
 {
 	ready: false,
-	timeout: null,
 	tries: 0,
 
 	geteid: function()
diff --git a/content/config.js b/content/config.js
index 512ad17..06b80d8 100644
--- a/content/config.js
+++ b/content/config.js
@@ -19,7 +19,7 @@
 */
 
 const WOT_PLATFORM = "firefox";
-const WOT_VERSION  = "20120126";
+const WOT_VERSION  = "20120205";
 
 /*
  * Constants
@@ -135,18 +135,18 @@ const WOT_SCORECARD_RATE = "/rate";
 
 /* Operation intervals (in ms) */
 const WOT_DELAY_WARNING					= 1000;				/* 1 s */
-const WOT_INTERVAL_BLOCK_ERROR			= 30 * 1000;		/* 30 s */
+const WOT_INTERVAL_BLOCK_ERROR			= 15 * 1000;		/* 15 s */
 const WOT_INTERVAL_CACHE_REFRESH 	  	= 30 * 60 * 1000;	/* 30 min */
 const WOT_INTERVAL_CACHE_REFRESH_BLOCK 	= 18000 * 1000;		/* 5 h */
-const WOT_INTERVAL_CACHE_REFRESH_ERROR	= 5 * 60 * 1000;	/* 5 min */
+const WOT_INTERVAL_CACHE_REFRESH_ERROR	= 30 * 1000;		/* 30 s */
 const WOT_INTERVAL_LINK_RETRY			= 2 * 1000;			/* 2 s */
-const WOT_INTERVAL_REGISTER_ERROR 	  	= 60 * 1000;		/* 1 min */
+const WOT_INTERVAL_REGISTER_ERROR 	  	= 30 * 1000;		/* 30 s */
 const WOT_INTERVAL_REGISTER_OFFLINE	  	= 30 * 1000;		/* 30 s */
 const WOT_INTERVAL_RELOAD_ERROR 	  	= 5 * 60 * 1000;	/* 5 min */
 const WOT_INTERVAL_SUBMIT_ERROR 		= 5 * 60 * 1000;	/* 5 min */
 const WOT_INTERVAL_UPDATE_CHECK		  	= 10800 * 1000;		/* 3 h */
 const WOT_MIN_INTERVAL_UPDATE_CHECK		= 30 * 60 * 1000;	/* 30 min */
-const WOT_MAX_INTERVAL_UPDATE_CHECK		= 3 * 86400 * 1000;	/* 3d */
+const WOT_MAX_INTERVAL_UPDATE_CHECK		= 3 * 86400 * 1000;	/* 3 d */
 const WOT_INTERVAL_UPDATE_ERROR		  	= 15 * 60 * 1000;	/* 15 min */
 const WOT_INTERVAL_UPDATE_OFFLINE 	  	= 30 * 1000;		/* 30 s */
 const WOT_TIMEOUT_QUERY 				= 15 * 1000;		/* 15 s */

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-mozext/wot.git



More information about the Pkg-mozext-commits mailing list