fixing server side updating IP table
This commit is contained in:
@@ -2,9 +2,9 @@
|
||||
"ip_address": [
|
||||
{
|
||||
"ipv4": "145.40.90.151",
|
||||
"latency": 271458528,
|
||||
"download": 738.0909641092161,
|
||||
"upload": 1715.925379038264
|
||||
"latency": 262976449,
|
||||
"download": 6.2124926386045,
|
||||
"upload": 5144.270090126969
|
||||
}
|
||||
]
|
||||
}
|
||||
@@ -46,8 +46,6 @@ func Server() error{
|
||||
ClientHost.Ipv4 = c.ClientIP()
|
||||
// Variable to store IP table information
|
||||
var IPTable p2p.IpAddresses
|
||||
//Add Client IP address to IPTable struct
|
||||
IPTable.IpAddress = append(IPTable.IpAddress, ClientHost)
|
||||
|
||||
// Receive file from POST request
|
||||
body, err := c.FormFile("json")
|
||||
@@ -69,6 +67,9 @@ func Server() error{
|
||||
|
||||
json.Unmarshal(file,&IPTable)
|
||||
|
||||
//Add Client IP address to IPTable struct
|
||||
IPTable.IpAddress = append(IPTable.IpAddress, ClientHost)
|
||||
|
||||
// Runs speed test to return only servers in the IP table pingable
|
||||
err = IPTable.SpeedTestUpdatedIPTable()
|
||||
if err != nil {
|
||||
|
||||
Reference in New Issue
Block a user