mirror of
https://shylinux.com/x/icebergs
synced 2025-04-25 09:08:06 +08:00
opt some
This commit is contained in:
parent
281840b799
commit
6352d73905
2
LICENSE
2
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
|
||||
|
@ -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])
|
||||
|
@ -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",
|
||||
)
|
||||
})
|
||||
}
|
||||
|
2
data.go
2
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) {
|
||||
|
Loading…
x
Reference in New Issue
Block a user