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"
|
"encoding/binary"
|
||||||
"fmt"
|
"fmt"
|
||||||
"io"
|
"io"
|
||||||
"log"
|
|
||||||
"mpbl3p/proxy"
|
"mpbl3p/proxy"
|
||||||
"mpbl3p/shared"
|
"mpbl3p/shared"
|
||||||
"net"
|
"net"
|
||||||
@ -188,9 +187,7 @@ func (f *Flow) Produce(v proxy.MacVerifier) (proxy.Packet, error) {
|
|||||||
|
|
||||||
func (f *Flow) consumeMarshalled() {
|
func (f *Flow) consumeMarshalled() {
|
||||||
for {
|
for {
|
||||||
t1 := time.Now()
|
|
||||||
data := <-f.toConsume
|
data := <-f.toConsume
|
||||||
t2 := time.Now()
|
|
||||||
|
|
||||||
err := f.conn.SetWriteDeadline(time.Now().Add(5 * time.Second))
|
err := f.conn.SetWriteDeadline(time.Now().Add(5 * time.Second))
|
||||||
if err != nil {
|
if err != nil {
|
||||||
@ -202,9 +199,6 @@ func (f *Flow) consumeMarshalled() {
|
|||||||
f.consumeErrors <- err
|
f.consumeErrors <- err
|
||||||
return
|
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)
|
buf := bufio.NewReader(f.conn)
|
||||||
|
|
||||||
for {
|
for {
|
||||||
t1 := time.Now()
|
|
||||||
lengthBytes := make([]byte, 4)
|
lengthBytes := make([]byte, 4)
|
||||||
if n, err := io.LimitReader(buf, 4).Read(lengthBytes); err != nil {
|
if n, err := io.LimitReader(buf, 4).Read(lengthBytes); err != nil {
|
||||||
f.produceErrors <- err
|
f.produceErrors <- err
|
||||||
@ -235,10 +228,6 @@ func (f *Flow) produceMarshalled() {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
t2 := time.Now()
|
|
||||||
f.produced <- dataBytes
|
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