This commit is contained in:
ffdfgdfg
2019-08-26 18:47:23 +08:00
parent 00900c1315
commit f35a73f734
5 changed files with 89 additions and 22 deletions

View File

@@ -6,6 +6,7 @@ import (
"encoding/binary"
"github.com/cnlh/nps/lib/crypt"
"github.com/cnlh/nps/lib/pool"
"github.com/cnlh/nps/vender/github.com/astaxie/beego/logs"
"html/template"
"io"
"io/ioutil"
@@ -268,8 +269,10 @@ func CopyBuffer(dst io.Writer, src io.Reader) (written int64, err error) {
defer pool.PutBufPoolCopy(buf)
for {
nr, er := src.Read(buf)
logs.Warn("read finish", nr, er)
if nr > 0 {
nw, ew := dst.Write(buf[0:nr])
logs.Warn("write finish", nw, ew)
if nw > 0 {
written += int64(nw)
}