removed logging
This commit is contained in:
parent
69eb4d4810
commit
a98e9e7902
11
tcp/flow.go
11
tcp/flow.go
@ -5,7 +5,6 @@ import (
|
||||
"encoding/binary"
|
||||
"fmt"
|
||||
"io"
|
||||
"log"
|
||||
"mpbl3p/proxy"
|
||||
"mpbl3p/shared"
|
||||
"net"
|
||||
@ -188,9 +187,7 @@ func (f *Flow) Produce(v proxy.MacVerifier) (proxy.Packet, error) {
|
||||
|
||||
func (f *Flow) consumeMarshalled() {
|
||||
for {
|
||||
t1 := time.Now()
|
||||
data := <-f.toConsume
|
||||
t2 := time.Now()
|
||||
|
||||
err := f.conn.SetWriteDeadline(time.Now().Add(5 * time.Second))
|
||||
if err != nil {
|
||||
@ -202,9 +199,6 @@ func (f *Flow) consumeMarshalled() {
|
||||
f.consumeErrors <- err
|
||||
return
|
||||
}
|
||||
|
||||
t3 := time.Now()
|
||||
log.Printf("consumer: `%dns` spent waiting, `%dns` spent consuming", t2.Sub(t1).Nanoseconds(), t3.Sub(t2).Nanoseconds())
|
||||
}
|
||||
}
|
||||
|
||||
@ -212,7 +206,6 @@ func (f *Flow) produceMarshalled() {
|
||||
buf := bufio.NewReader(f.conn)
|
||||
|
||||
for {
|
||||
t1 := time.Now()
|
||||
lengthBytes := make([]byte, 4)
|
||||
if n, err := io.LimitReader(buf, 4).Read(lengthBytes); err != nil {
|
||||
f.produceErrors <- err
|
||||
@ -235,10 +228,6 @@ func (f *Flow) produceMarshalled() {
|
||||
}
|
||||
}
|
||||
|
||||
t2 := time.Now()
|
||||
f.produced <- dataBytes
|
||||
t3 := time.Now()
|
||||
|
||||
log.Printf("producer: `%dns` spent producing, `%dns` spent waiting", t2.Sub(t1).Nanoseconds(), t3.Sub(t2).Nanoseconds())
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user