mirror of
https://github.com/v2fly/v2ray-core.git
synced 2024-12-09 19:56:44 -05:00
Remove debug infomation
This commit is contained in:
parent
d12737b3b8
commit
919fd5b16b
@ -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,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
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user