Browse code

fix mirror stats

Tomasz Kojm authored on 2011/06/09 01:12:20
Showing 1 changed files
... ...
@@ -1757,7 +1757,7 @@ static int updatedb(const char *dbname, const char *hostname, char *ip, int *sig
1757 1757
 	if(!nodb && !ims) {
1758 1758
 	    logg("%s is up to date (version: %d, sigs: %d, f-level: %d, builder: %s)\n", localname, current->version, current->sigs, current->fl, current->builder);
1759 1759
 	    *signo += current->sigs;
1760
-	    if(mirror_stats) {
1760
+	    if(mirror_stats && strlen(ip)) {
1761 1761
 		snprintf(squery, sizeof(squery), "%s.%u.%u.%u.%u.%s.ping.clamav.net", dbname, current->version, flevel, 1, w32, ip);
1762 1762
 		dnsquery(squery, T_A, NULL);
1763 1763
 	    }
... ...
@@ -1767,7 +1767,7 @@ static int updatedb(const char *dbname, const char *hostname, char *ip, int *sig
1767 1767
 
1768 1768
 	if(!remote) {
1769 1769
 	    logg("^Can't read %s header from %s (IP: %s)\n", cvdfile, hostname, ip);
1770
-	    if(mirror_stats) {
1770
+	    if(mirror_stats && strlen(ip)) {
1771 1771
 		snprintf(squery, sizeof(squery), "%s.%u.%u.%u.%u.%s.ping.clamav.net", dbname, current->version + 1, flevel, 0, w32, ip);
1772 1772
 		dnsquery(squery, T_A, NULL);
1773 1773
 	    }
... ...
@@ -1824,7 +1824,7 @@ static int updatedb(const char *dbname, const char *hostname, char *ip, int *sig
1824 1824
     if(nodb) {
1825 1825
 	ret = getcvd(cvdfile, newfile, hostname, ip, localip, proxy, port, user, pass, uas, newver, ctimeout, rtimeout, mdat, logerr, can_whitelist, opts);
1826 1826
 	if(ret) {
1827
-	    if(mirror_stats) {
1827
+	    if(mirror_stats && strlen(ip)) {
1828 1828
 		snprintf(squery, sizeof(squery), "%s.%u.%u.%u.%u.%s.ping.clamav.net", dbname, 0, flevel, 0, w32, ip);
1829 1829
 		dnsquery(squery, T_A, NULL);
1830 1830
 	    }
... ...
@@ -1846,7 +1846,7 @@ static int updatedb(const char *dbname, const char *hostname, char *ip, int *sig
1846 1846
 		    llogerr = (j == maxattempts - 1);
1847 1847
 		ret = getpatch(dbname, tmpdir, i, hostname, ip, localip, proxy, port, user, pass, uas, ctimeout, rtimeout, mdat, llogerr, can_whitelist, opts);
1848 1848
 		if(ret == 52 || ret == 58) {
1849
-		    if(mirror_stats) {
1849
+		    if(mirror_stats && strlen(ip)) {
1850 1850
 			snprintf(squery, sizeof(squery), "%s.%u.%u.%u.%u.%s.ping.clamav.net", dbname, i, flevel, 0, w32, ip);
1851 1851
 			dnsquery(squery, T_A, NULL);
1852 1852
 		    }
... ...
@@ -1868,7 +1868,7 @@ static int updatedb(const char *dbname, const char *hostname, char *ip, int *sig
1868 1868
 	    mirman_whitelist(mdat, 2);
1869 1869
 	    ret = getcvd(cvdfile, newfile, hostname, ip, localip, proxy, port, user, pass, uas, newver, ctimeout, rtimeout, mdat, logerr, can_whitelist, opts);
1870 1870
 	    if(ret) {
1871
-		if(mirror_stats) {
1871
+		if(mirror_stats && strlen(ip)) {
1872 1872
 		    snprintf(squery, sizeof(squery), "%s.%u.%u.%u.%u.%s.ping.clamav.net", dbname, 0, flevel, 0, w32, ip);
1873 1873
 		    dnsquery(squery, T_A, NULL);
1874 1874
 		}
... ...
@@ -1967,7 +1967,7 @@ static int updatedb(const char *dbname, const char *hostname, char *ip, int *sig
1967 1967
     }
1968 1968
 
1969 1969
     *signo += current->sigs;
1970
-    if(mirror_stats) {
1970
+    if(mirror_stats && strlen(ip)) {
1971 1971
 	snprintf(squery, sizeof(squery), "%s.%u.%u.%u.%u.%s.ping.clamav.net", dbname, current->version, flevel, 1, w32, ip);
1972 1972
 	dnsquery(squery, T_A, NULL);
1973 1973
     }