commit 17f08a4799c46418f2bfab4f8ae08397baca6eb8
parent b545f73e08350adc733b6e56d1665270fd23df09
Author: Peter Kosyh <p.kosyh@gmail.com>
Date: Tue, 8 Sep 2020 15:24:57 +0100
fix in fetcher
Diffstat:
2 files changed, 10 insertions(+), 6 deletions(-)
diff --git a/ii-tool/main.go b/ii-tool/main.go
@@ -73,11 +73,11 @@ Commands:
send <server> <pauth> <msg|-> - send message
fetch <url> [echofile|-] - fetch
store <bundle|-> - import bundle to database
- get <msgid> - show message from database
- select <echo> [[start]:lim] - get slice from echo
- cc <name> [[start]:lim] - get msgs to name
- index - recreate index
- blacklist <msgid> - blacklist msg
+ get <msgid> - show message from database
+ select <echo> [[start]:lim] - get slice from echo
+ cc <name> [[start]:lim] - get msgs to name
+ index - recreate index
+ blacklist <msgid> - blacklist msg
useradd <name> <e-mail> <password> - adduser
Options:
-db=<path> - database path
@@ -177,7 +177,7 @@ Options:
if len(args) > 2 {
str := GetFile(args[2])
for _, v := range strings.Split(str, "\n") {
- echolist = append(echolist, v)
+ echolist = append(echolist, strings.Split(v, ":")[0])
}
}
err = n.Fetch(db, echolist, *lim_opt)
diff --git a/ii/net.go b/ii/net.go
@@ -64,6 +64,10 @@ func (n *Node) Fetcher(db *DB, Echo string, limit int, wait *sync.WaitGroup, con
defer wait.Done()
if n.IsFeature("u/e") { /* fast path */
id, err := http_get_id(n.Host + "/u/e/" + Echo + "/-1:1")
+ if !IsMsgId(id) {
+ Info.Printf("%s: no valid MsgId", Echo)
+ return
+ }
if err == nil && db.Exists(id) != nil { /* no sync needed */
Info.Printf("%s: no sync needed", Echo)
return