From cf33a78c30fae791e58d726e5f54c622db415c4b Mon Sep 17 00:00:00 2001 From: Liang Ding Date: Tue, 23 Sep 2014 09:45:56 +0800 Subject: [PATCH] =?UTF-8?q?=E5=81=9C=E6=AD=A2=E8=BF=90=E8=A1=8C?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- main.go | 2 ++ output/outputs.go | 4 ++-- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/main.go b/main.go index 2ba5d79..83c2d1a 100644 --- a/main.go +++ b/main.go @@ -160,6 +160,8 @@ func main() { // IDE http.HandleFunc("/login", loginHandler) http.HandleFunc("/", indexHandler) + + // 会话 http.HandleFunc("/session/ws", session.WSHandler) http.HandleFunc("/session/save", session.SaveContent) diff --git a/output/outputs.go b/output/outputs.go index cda1fe5..8e100b4 100644 --- a/output/outputs.go +++ b/output/outputs.go @@ -104,7 +104,7 @@ func RunHandler(w http.ResponseWriter, r *http.Request) { count, err := reader.Read(buf) if nil != err || 0 == count { - // 从用户进程集中移除这个执行完毕的进程 + // 从用户进程集中移除这个执行完毕(或是被主动停止)的进程 processes.remove(wSession, cmd.Process) glog.V(3).Infof("Session [%s] 's running [id=%d, file=%s] has done", sid, runningId, filePath) @@ -534,7 +534,7 @@ func StopHandler(w http.ResponseWriter, r *http.Request) { } sid := args["sid"].(string) - pid := args["pid"].(int) + pid := int(args["pid"].(float64)) wSession := session.WideSessions.Get(sid) if nil == wSession {