From 0a65975b7e3c381c415cbc116255bffa08e509c0 Mon Sep 17 00:00:00 2001 From: ffdfgdfg Date: Thu, 9 Jan 2020 23:07:39 +0800 Subject: [PATCH 1/3] 64bit alignment --- lib/mux/conn.go | 4 ++-- lib/mux/queue.go | 15 +++++++++------ 2 files changed, 11 insertions(+), 8 deletions(-) diff --git a/lib/mux/conn.go b/lib/mux/conn.go index c0a5b7a..592de29 100644 --- a/lib/mux/conn.go +++ b/lib/mux/conn.go @@ -199,7 +199,7 @@ func (Self *window) CloseWindow() { type ReceiveWindow struct { window - bufQueue ReceiveWindowQueue + bufQueue *ReceiveWindowQueue element *common.ListElement count int8 bw *writeBandwidth @@ -210,7 +210,7 @@ type ReceiveWindow struct { func (Self *ReceiveWindow) New(mux *Mux) { // initial a window for receive - Self.bufQueue.New() + Self.bufQueue = NewReceiveWindowQueue() Self.element = common.ListElementPool.Get() Self.maxSizeDone = Self.pack(common.MAXIMUM_SEGMENT_SIZE*30, 0, false) Self.mux = mux diff --git a/lib/mux/queue.go b/lib/mux/queue.go index cc80407..b7cbb0b 100644 --- a/lib/mux/queue.go +++ b/lib/mux/queue.go @@ -209,10 +209,10 @@ func NewListElement(buf []byte, l uint16, part bool) (element *common.ListElemen } type ReceiveWindowQueue struct { + lengthWait uint64 chain *bufChain stopOp chan struct{} readOp chan struct{} - lengthWait uint64 // really strange ???? need put here // https://golang.org/pkg/sync/atomic/#pkg-note-BUG // On non-Linux ARM, the 64-bit functions use instructions unavailable before the ARMv6k core. // On ARM, x86-32, and 32-bit MIPS, it is the caller's responsibility @@ -221,11 +221,14 @@ type ReceiveWindowQueue struct { timeout time.Time } -func (Self *ReceiveWindowQueue) New() { - Self.readOp = make(chan struct{}) - Self.chain = new(bufChain) - Self.chain.new(64) - Self.stopOp = make(chan struct{}, 2) +func NewReceiveWindowQueue() *ReceiveWindowQueue { + queue := ReceiveWindowQueue{ + chain: new(bufChain), + stopOp: make(chan struct{}, 2), + readOp: make(chan struct{}), + } + queue.chain.new(64) + return &queue } func (Self *ReceiveWindowQueue) Push(element *common.ListElement) { From f95bb6c6d37798d0ef55508b0febe89984964c70 Mon Sep 17 00:00:00 2001 From: yzy613 <59520517+yzy613@users.noreply.github.com> Date: Sun, 9 Feb 2020 16:00:11 +0800 Subject: [PATCH 2/3] Update nps_use.md --- docs/nps_use.md | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/docs/nps_use.md b/docs/nps_use.md index 2681e8b..753d40b 100644 --- a/docs/nps_use.md +++ b/docs/nps_use.md @@ -29,7 +29,7 @@ nps.exe stop|restart ``` ## 服务端更新 -请首先执行`sudo nps stop`或者`nps.exe stop`停止运行,然后 +请首先执行 `sudo nps stop` 或者 `nps.exe stop` 停止运行,然后 对于linux ```shell @@ -40,6 +40,8 @@ nps-update.exe update ``` -更新完成后,执行执行`sudo nps start`或者`nps.exe start`重新运行即可完成升级 +更新完成后,执行执行 `sudo nps start` 或者 `nps.exe start` 重新运行即可完成升级 如果无法更新成功,可以直接自行下载releases压缩包然后覆盖原有的nps二进制文件和web目录 + +对于Redhat系的Linux(例如CentOS),二进制文件会默认存放在 `/usr/bin` 或者 `/usr/lib/bin ` From ed68410220dbe4a505e23c8ed61ae1defc438da4 Mon Sep 17 00:00:00 2001 From: yzy613 <59520517+yzy613@users.noreply.github.com> Date: Sun, 9 Feb 2020 16:15:16 +0800 Subject: [PATCH 3/3] Update nps_use.md --- docs/nps_use.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/nps_use.md b/docs/nps_use.md index 753d40b..696203b 100644 --- a/docs/nps_use.md +++ b/docs/nps_use.md @@ -44,4 +44,4 @@ 如果无法更新成功,可以直接自行下载releases压缩包然后覆盖原有的nps二进制文件和web目录 -对于Redhat系的Linux(例如CentOS),二进制文件会默认存放在 `/usr/bin` 或者 `/usr/lib/bin ` +注意:`nps install` 之后的 nps 不在原位置,请使用 `whereis nps` 查找具体目录覆盖 nps 二进制文件