From 5b1a62ee631f7158b2659e33c58842ee119a8fee Mon Sep 17 00:00:00 2001 From: Liang Ding Date: Wed, 8 Oct 2014 13:54:16 +0800 Subject: [PATCH] =?UTF-8?q?=E6=A0=BC=E5=BC=8F=E5=8C=96=E6=B3=A8=E9=87=8A?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- file/files.go | 4 ++-- main.go | 4 ++-- session/sessions.go | 10 +++++----- shell/shells.go | 1 + 4 files changed, 10 insertions(+), 9 deletions(-) diff --git a/file/files.go b/file/files.go index 6930e7c..68b0f28 100644 --- a/file/files.go +++ b/file/files.go @@ -343,8 +343,8 @@ func getEditorMode(filenameExtension string) string { // // fileType: // -// "f": 文件 -// "d": 目录 +// "f": 文件 +// "d": 目录 func createFile(path, fileType string) bool { switch fileType { case "f": diff --git a/main.go b/main.go index 1271828..6e9c0b5 100644 --- a/main.go +++ b/main.go @@ -222,8 +222,8 @@ func main() { // // 共性处理: // -// 1. panic recover -// 2. 请求计时 +// 1. panic recover +// 2. 请求计时 func handlerWrapper(f func(w http.ResponseWriter, r *http.Request)) func(w http.ResponseWriter, r *http.Request) { handler := panicRecover(f) handler = stopwatch(handler) diff --git a/session/sessions.go b/session/sessions.go index 4af0920..ee8e597 100644 --- a/session/sessions.go +++ b/session/sessions.go @@ -2,8 +2,8 @@ // // Wide 服务器端需要维护两种会话: // -// 1. HTTP 会话:主要用于验证登录 -// 2. Wide 会话:浏览器 tab 打开/刷新会创建一个,并和 HTTP 会话进行关联 +// 1. HTTP 会话:主要用于验证登录 +// 2. Wide 会话:浏览器 tab 打开/刷新会创建一个,并和 HTTP 会话进行关联 // // 当会话失效时:释放所有和该会话相关的资源,例如运行中的程序进程、事件队列等. package session @@ -226,9 +226,9 @@ func (sessions *Sessions) Get(sid string) *WideSession { // // 会话相关资源: // -// 1. 用户事件队列 -// 2. 运行中的进程集 -// 3. WebSocket 通道 +// 1. 用户事件队列 +// 2. 运行中的进程集 +// 3. WebSocket 通道 func (sessions *Sessions) Remove(sid string) { mutex.Lock() defer mutex.Unlock() diff --git a/shell/shells.go b/shell/shells.go index 5fda99e..dcd8607 100644 --- a/shell/shells.go +++ b/shell/shells.go @@ -127,6 +127,7 @@ func WSHandler(w http.ResponseWriter, r *http.Request) { } } +// 以管道方式执行多个命令. func pipeCommands(username string, commands ...*exec.Cmd) string { for i, command := range commands[:len(commands)-1] { setCmdEnv(command, username)