srv-mux: do not print peek protocol EOF err msg (#3402)

EOF err message in Peek Protocol is shown when a client closes the
connection in the middle of peek protocol, this commit hides it since it
doesn't make sense to show it
master
Anis Elleuch 8 years ago committed by Harshavardhana
parent 3b455d6137
commit 5c9a95df32
  1. 5
      cmd/server-mux.go

@ -20,6 +20,7 @@ import (
"bufio" "bufio"
"crypto/tls" "crypto/tls"
"errors" "errors"
"io"
"net" "net"
"net/http" "net/http"
"net/url" "net/url"
@ -75,7 +76,9 @@ func NewConnMux(c net.Conn) *ConnMux {
func (c *ConnMux) PeekProtocol() string { func (c *ConnMux) PeekProtocol() string {
buf, err := c.bufrw.Peek(maxHTTPVerbLen) buf, err := c.bufrw.Peek(maxHTTPVerbLen)
if err != nil { if err != nil {
errorIf(err, "Unable to peek into the protocol") if err != io.EOF {
errorIf(err, "Unable to peek into the protocol")
}
return "http" return "http"
} }
for _, m := range defaultHTTP1Methods { for _, m := range defaultHTTP1Methods {

Loading…
Cancel
Save