Explorar el Código

Remove debug infomation

V2Ray hace 10 años
padre
commit
919fd5b16b
Se han modificado 2 ficheros con 3 adiciones y 6 borrados
  1. 0 2
      io/encryption.go
  2. 3 4
      net/transport.go

+ 0 - 2
io/encryption.go

@@ -25,7 +25,6 @@ func NewCryptionReader(stream cipher.Stream, reader io.Reader) *CryptionReader {
 // a multiply of BlockSize()
 func (reader CryptionReader) Read(blocks []byte) (int, error) {
 	nBytes, err := reader.reader.Read(blocks)
-	log.Debug("CryptionReader: Read %d bytes", nBytes)
 	if nBytes > 0 {
 		reader.stream.XORKeyStream(blocks[:nBytes], blocks[:nBytes])
 	}
@@ -52,7 +51,6 @@ func NewCryptionWriter(stream cipher.Stream, writer io.Writer) *CryptionWriter {
 // Write writes the give blocks to underlying writer. The length of the blocks
 // must be a multiply of BlockSize()
 func (writer CryptionWriter) Write(blocks []byte) (int, error) {
-	log.Debug("CryptionWriter writing %d bytes", len(blocks))
 	writer.stream.XORKeyStream(blocks, blocks)
 	return writer.writer.Write(blocks)
 }

+ 3 - 4
net/transport.go

@@ -3,11 +3,11 @@ package net
 import (
 	"io"
 
-	"github.com/v2ray/v2ray-core/log"
+	_ "github.com/v2ray/v2ray-core/log"
 )
 
 const (
-	bufferSize = 8192
+	bufferSize = 32 * 1024
 )
 
 func ReaderToChan(stream chan<- []byte, reader io.Reader) error {
@@ -24,8 +24,7 @@ func ReaderToChan(stream chan<- []byte, reader io.Reader) error {
 
 func ChanToWriter(writer io.Writer, stream <-chan []byte) error {
 	for buffer := range stream {
-		nBytes, err := writer.Write(buffer)
-		log.Debug("Writing %d bytes with error %v", nBytes, err)
+		_, err := writer.Write(buffer)
 		if err != nil {
 			return err
 		}