1
0
mirror of https://shylinux.com/x/ContextOS synced 2025-04-26 01:04:06 +08:00

add signal segv

Change-Id: I2c871fbb31d2a93cc1b475fc1fa23169c4e65799
This commit is contained in:
shaoying 2019-03-19 09:10:10 +08:00
parent 3694db8a41
commit 0054d4bff1
3 changed files with 9 additions and 0 deletions

View File

@ -94,6 +94,7 @@ func (gdb *GDB) Start(m *ctx.Message, arg ...string) bool {
action := m.Conf("signal", sig)
m.Log("signal", "signal %v %v", sig, action)
switch action {
case "segv":
case "quit":
m.Cmd("cli.exit", 0)
case "restart":
@ -121,6 +122,7 @@ var Index = &ctx.Context{Name: "gdb", Help: "调试中心",
"signal": &ctx.Config{Name: "signal", Value: map[string]interface{}{
"3": "quit",
"10": "restart",
"11": "segv",
"12": "upgrade",
}, Help: "信号"},
"debug": &ctx.Config{Name: "debug", Value: map[string]interface{}{"value": map[string]interface{}{"enable": false},

View File

@ -127,6 +127,7 @@ var Index = &ctx.Context{Name: "ssh", Help: "集群中心",
// 清理主机
nfs.Free(func(nfs *ctx.Message) bool {
m.Conf("timer", m.Cmdx("cli.timer", "repeat", m.Conf("timer_interval"), "context", "ssh", "remote", "redial", arg[1:]))
m.Cmd("aaa.auth", m.Cmdx("aaa.auth", "nodes", node.Append("node.name")), "delete", "node")
m.Log("info", "delete node %s", node.Append("node.name"))
delete(m.Confm("node"), node.Append("node.name"))

View File

@ -533,6 +533,7 @@ var Index = &ctx.Context{Name: "web", Help: "应用中心",
m.Log("info", "body %v", string(uri[index+1:]))
body = strings.NewReader(uri[index+1:])
m.Option("content_type", "application/x-www-form-urlencoded")
m.Option("content_length", len(uri[index+1:]))
}
uri, uri_arg = uri[:index], "?"+uuu.RawQuery
}
@ -546,6 +547,7 @@ var Index = &ctx.Context{Name: "web", Help: "应用中心",
}
req, e := http.NewRequest(method, uri, body)
m.Log("info", "%#v", req)
m.Assert(e)
m.Log("info", "%s %s", req.Method, req.URL)
@ -561,6 +563,10 @@ var Index = &ctx.Context{Name: "web", Help: "应用中心",
if m.Options("content_type") {
req.Header.Set("Content-Type", m.Option("content_type"))
}
if m.Options("content_length") {
req.Header.Set("Content-Length", m.Option("content_length"))
}
m.Log("info", "%#v", req)
m.Confm("spide", []string{which, "cookie"}, func(key string, value string) {
if key != "" {
req.AddCookie(&http.Cookie{Name: key, Value: value})