mirror of
https://shylinux.com/x/icebergs
synced 2025-04-25 17:18:05 +08:00
opt some
This commit is contained in:
parent
7a551aaa4b
commit
281840b799
@ -142,6 +142,7 @@ 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])
|
||||
|
@ -64,7 +64,7 @@ func init() {
|
||||
ISLOCAL: {Hand: func(m *ice.Message, arg ...string) {
|
||||
if arg[0] = strings.Split(strings.TrimPrefix(arg[0], "["), "]")[0]; arg[0] == "::1" || strings.HasPrefix(arg[0], "127.") {
|
||||
m.Echo(ice.OK)
|
||||
} else if mdb.HashSelectField(m, strings.Split(arg[0], nfs.DF)[0], mdb.TYPE) == aaa.WHITE {
|
||||
} else if mdb.HashSelectField(m, arg[0], mdb.TYPE) == aaa.WHITE {
|
||||
m.Echo(ice.OK)
|
||||
}
|
||||
}},
|
||||
|
@ -49,7 +49,7 @@ func _space_fork(m *ice.Message) {
|
||||
addr := kit.Select(m.R.RemoteAddr, m.R.Header.Get(ice.MSG_USERADDR))
|
||||
name := kit.ReplaceAll(kit.Select(addr, m.Option(mdb.NAME)), "[", "_", "]", "_", nfs.DF, "_", nfs.PT, "_")
|
||||
text := kit.Select(addr, m.Option(mdb.TEXT))
|
||||
if kit.IsIn(m.Option(mdb.TYPE), CHROME) || !(ice.Info.Localhost && tcp.IsLocalHost(m, m.R.RemoteAddr) ||
|
||||
if kit.IsIn(m.Option(mdb.TYPE), CHROME) || !(ice.Info.Localhost && tcp.IsLocalHost(m, strings.Split(m.R.RemoteAddr, nfs.DF)[0]) ||
|
||||
m.Option(TOKEN) != "" && m.Cmdv(TOKEN, m.Option(TOKEN), mdb.TIME) > m.Time()) {
|
||||
name = kit.ReplaceAll(addr, "[", "_", "]", "_", nfs.DF, "_", nfs.PT, "_")
|
||||
text = kit.Select(addr, m.Option(mdb.NAME), m.Option(mdb.TEXT))
|
||||
|
@ -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, "3s",
|
||||
tcp.PROTOCOL, u.Scheme, tcp.HOSTNAME, u.Hostname(), tcp.HOST, u.Host, nfs.PATH, dir, nfs.FILE, file, cli.TIMEOUT, "30s",
|
||||
)
|
||||
})
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user