diff --git a/frontend/lgproxy.go b/frontend/lgproxy.go index 99c9620..f5798c2 100644 --- a/frontend/lgproxy.go +++ b/frontend/lgproxy.go @@ -55,11 +55,11 @@ func batchRequest(servers []string, endpoint string, command string) []string { } buf := make([]byte, 65536) - _, err = io.ReadFull(response.Body, buf) + n, err := io.ReadFull(response.Body, buf) if err != nil && err != io.ErrUnexpectedEOF { ch <- channelData{i, err.Error()} } else { - ch <- channelData{i, string(buf)} + ch <- channelData{i, string(buf[:n])} } }(url, i) } diff --git a/frontend/whois.go b/frontend/whois.go index cd17d47..8c28e1b 100644 --- a/frontend/whois.go +++ b/frontend/whois.go @@ -21,9 +21,9 @@ func whois(s string) string { conn.Write([]byte(s + "\r\n")) buf := make([]byte, 65536) - _, err = io.ReadFull(conn, buf) + n, err := io.ReadFull(conn, buf) if err != nil && err != io.ErrUnexpectedEOF { return err.Error() } - return string(buf) + return string(buf[:n]) }