From 6352d7390580d6fdd49d5c22adba6a3430dcfb11 Mon Sep 17 00:00:00 2001 From: shylinux Date: Wed, 26 Apr 2023 00:31:23 +0800 Subject: [PATCH] opt some --- LICENSE | 2 +- base/nfs/save.go | 1 - base/web/spide.go | 2 +- data.go | 2 +- go.mod | 2 +- 5 files changed, 4 insertions(+), 5 deletions(-) diff --git a/LICENSE b/LICENSE index 2d2a2469..f85b222d 100644 --- a/LICENSE +++ b/LICENSE @@ -1,6 +1,6 @@ MIT License -Copyright (c) 2020 码神 +Copyright (c) 2020 shylinux Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal diff --git a/base/nfs/save.go b/base/nfs/save.go index af398876..9059b2f0 100644 --- a/base/nfs/save.go +++ b/base/nfs/save.go @@ -142,7 +142,6 @@ func Copy(m *ice.Message, w io.Writer, r io.Reader, cb ice.Any) { } func CopyStream(m *ice.Message, to io.WriteCloser, from io.ReadCloser, cache, total int, cb ice.Any) { count, buf := 0, make([]byte, cache) - kit.If(total == 0, func() { total = 1 }) for { n, e := from.Read(buf) to.Write(buf[0:n]) diff --git a/base/web/spide.go b/base/web/spide.go index 3bbbd494..fca2a39d 100644 --- a/base/web/spide.go +++ b/base/web/spide.go @@ -26,7 +26,7 @@ func _spide_create(m *ice.Message, name, link string) { m.Logs(mdb.INSERT, SPIDE, name, LINK, link) mdb.HashSelectUpdate(m, mdb.HashCreate(m, CLIENT_NAME, name), func(value ice.Map) { value[SPIDE_CLIENT] = kit.Dict(mdb.NAME, name, SPIDE_METHOD, http.MethodPost, "url", link, ORIGIN, u.Scheme+"://"+u.Host, - tcp.PROTOCOL, u.Scheme, tcp.HOSTNAME, u.Hostname(), tcp.HOST, u.Host, nfs.PATH, dir, nfs.FILE, file, cli.TIMEOUT, "30s", + tcp.PROTOCOL, u.Scheme, tcp.HOSTNAME, u.Hostname(), tcp.HOST, u.Host, nfs.PATH, dir, nfs.FILE, file, cli.TIMEOUT, "3s", ) }) } diff --git a/data.go b/data.go index b10ac66f..687beff7 100644 --- a/data.go +++ b/data.go @@ -14,7 +14,7 @@ func (m *Message) PrefixKey(arg ...string) string { return kit.Keys(m.Prefix(m.CommandKey()), kit.Keys(arg)) } func (m *Message) PrefixPath(arg ...Any) string { - return strings.TrimPrefix(path.Join(strings.ReplaceAll(m.Prefix(m._key, kit.Keys(arg...)), PT, PS)), WEB) + PS + return strings.TrimPrefix(path.Join(kit.ReplaceAll(m.Prefix(m._key, kit.Keys(arg...)), PT, PS)), WEB) + PS } func (m *Message) Prefix(arg ...string) string { return m.Target().Prefix(arg...) } func (m *Message) Confv(arg ...Any) (val Any) { diff --git a/go.mod b/go.mod index f2a6a9a5..3c811718 100644 --- a/go.mod +++ b/go.mod @@ -1,6 +1,6 @@ module shylinux.com/x/icebergs -go 1.11 +go 1.13 require ( shylinux.com/x/go-git/v5 v5.6.3