From b4d065610ae43e6e3c0eb5ddc290475869bee320 Mon Sep 17 00:00:00 2001 From: Darien Raymond Date: Sat, 25 Aug 2018 23:27:09 +0200 Subject: [PATCH] fix windows reader --- common/buf/readv_test.go | 2 -- common/buf/readv_windows.go | 4 +--- 2 files changed, 1 insertion(+), 5 deletions(-) diff --git a/common/buf/readv_test.go b/common/buf/readv_test.go index 6526a0b80..4a6575a06 100644 --- a/common/buf/readv_test.go +++ b/common/buf/readv_test.go @@ -2,7 +2,6 @@ package buf_test import ( "crypto/rand" - "fmt" "net" "testing" @@ -51,7 +50,6 @@ func TestReadvReader(t *testing.T) { t.Fatal("unexpected error: ", err) } rmb.AppendMulti(mb) - fmt.Println("Len=", rmb.Len()) if rmb.Len() == size { break } diff --git a/common/buf/readv_windows.go b/common/buf/readv_windows.go index 8d376781f..88975f079 100644 --- a/common/buf/readv_windows.go +++ b/common/buf/readv_windows.go @@ -3,7 +3,6 @@ package buf import ( - "fmt" "syscall" ) @@ -16,7 +15,7 @@ func (r *windowsReader) Init(bs []*Buffer) { r.bufs = make([]syscall.WSABuf, 0, len(bs)) } for _, b := range bs { - r.bufs = append(r.bufs, syscall.WSABuf{Len: uint32(b.Len()), Buf: &b.v[0]}) + r.bufs = append(r.bufs, syscall.WSABuf{Len: uint32(Size), Buf: &b.v[0]}) } } @@ -32,7 +31,6 @@ func (r *windowsReader) Read(fd uintptr) int32 { var flags uint32 err := syscall.WSARecv(syscall.Handle(fd), &r.bufs[0], uint32(len(r.bufs)), &nBytes, &flags, nil, nil) if err != nil { - fmt.Println("Err=", err) return -1 } return int32(nBytes)