|
@@ -2,6 +2,7 @@ package main
|
|
|
|
|
|
import (
|
|
import (
|
|
"bufio"
|
|
"bufio"
|
|
|
|
+ "crypto/sha1"
|
|
"encoding/csv"
|
|
"encoding/csv"
|
|
"flag"
|
|
"flag"
|
|
"fmt"
|
|
"fmt"
|
|
@@ -546,9 +547,11 @@ func replayFile() {
|
|
natsEC.Publish(config.NatsQueue, &req)
|
|
natsEC.Publish(config.NatsQueue, &req)
|
|
|
|
|
|
if strings.Index(r[1], ".") < 0 {
|
|
if strings.Index(r[1], ".") < 0 {
|
|
|
|
+ hash := sha1.New()
|
|
|
|
+ io.WriteString(hash, r[0])
|
|
fp := data.Fingerprint{
|
|
fp := data.Fingerprint{
|
|
ClientID: "scw",
|
|
ClientID: "scw",
|
|
- Fingerprint: fmt.Sprintf("%x%x%x%x\n", rand.Int(), rand.Int(), rand.Int(), rand.Int()),
|
|
|
|
|
|
+ Fingerprint: fmt.Sprintf("%x", hash.Sum(nil)),
|
|
Remote: r[0],
|
|
Remote: r[0],
|
|
Url: r[1],
|
|
Url: r[1],
|
|
Source: r[0],
|
|
Source: r[0],
|
|
@@ -558,7 +561,7 @@ func replayFile() {
|
|
if strings.HasPrefix(r[0], "50.31.") {
|
|
if strings.HasPrefix(r[0], "50.31.") {
|
|
fp.Fingerprint = "a1f2c2ee560ce6580d66d451a9c8dfbf"
|
|
fp.Fingerprint = "a1f2c2ee560ce6580d66d451a9c8dfbf"
|
|
natsJsonEC.Publish("fingerprints_scw", fp)
|
|
natsJsonEC.Publish("fingerprints_scw", fp)
|
|
- } else if rand.Intn(10) < 8 {
|
|
|
|
|
|
+ } else if rand.Intn(10) < 5 {
|
|
natsJsonEC.Publish("fingerprints_scw", fp)
|
|
natsJsonEC.Publish("fingerprints_scw", fp)
|
|
}
|
|
}
|
|
|
|
|