forked from Janhouse/tespeed
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request Janhouse#4 from ruffyen/master
Fixed bug I was having with a server near me that had a latency of 0ms Cleaning up
- Loading branch information
Showing
1 changed file
with
1 addition
and
7 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -3,18 +3,13 @@ | |
# Copyright 2012 Janis Jansons ([email protected]) | ||
# | ||
|
||
import os | ||
import urllib | ||
import urllib2 | ||
import gzip | ||
import sys | ||
from multiprocessing import Process, Pipe, Manager | ||
from lxml import etree | ||
import time | ||
import gzip | ||
import time | ||
import string | ||
import random | ||
from math import radians, cos, sin, asin, sqrt | ||
|
||
from StringIO import StringIO | ||
|
@@ -136,7 +131,7 @@ def TestLatency(self, servers): | |
for server in servers: | ||
now=self.TestSingleLatency(server['url']+"latency.txt?x=" + str( time.time() ))*1000 | ||
now=now/2 # Evil hack or just pure stupidity? Nobody knows... | ||
if now == -1: | ||
if now == -1 or now == 0: | ||
continue | ||
print "%0.0f ms latency for %s (%s, %s, %s) [%0.2f km]" % (now, server['url'], server['sponsor'], server['name'], server['country'], server['distance']) | ||
|
||
|
@@ -445,4 +440,3 @@ def main(argv): | |
|
||
if __name__ == '__main__': | ||
main(sys.argv) | ||
|