1.remove debug

2.return a copy of this.receiveBuff

Signed-off-by: dmy@lab <dmy@lab.com>
This commit is contained in:
dmy@lab 2015-11-02 17:15:56 +08:00
parent 171d12146e
commit af0b6302d8
2 changed files with 8 additions and 4 deletions

4
.gitignore vendored
View File

@ -1,2 +1,4 @@
TransX.exe
TransX
TransX
server.log*
client.log*

View File

@ -6,7 +6,6 @@ import (
"github.com/TransX/utils"
"io"
"net"
"runtime/debug"
"strconv"
"strings"
)
@ -55,7 +54,11 @@ func NewCarrier(conn net.Conn, cipher Cipher, cache []byte, id string) *Carrier
func (this *Carrier) GetReceiveBuff() []byte {
log.Debug("id %d receivebuff Get, len %d", this.AttachedTunnelID, len(this.receiveBuff))
return this.receiveBuff
buff := this.receiveBuff
_b := make([]byte, len(buff), cap(buff))
copy(_b, buff)
return _b
// return this.receiveBuff
}
func (this *Carrier) SetReceiveBuff(buff []byte) {
@ -169,7 +172,6 @@ func RowReceiveData(carrier *Carrier) (n int, err error) {
func ReceiveData(carrier *Carrier) (n int, err error) {
defer func() {
if r := recover(); r != nil {
debug.PrintStack()
log.Error("ReceiveData err %s", r)
}
}()