remove message from log.Print

merge_conn
fangdingjun 6 years ago
parent 9ff9e06fba
commit 2a656bcc35

@ -11,7 +11,6 @@ import (
"errors" "errors"
"fmt" "fmt"
"io" "io"
"log"
"net" "net"
"net/http" "net/http"
"strconv" "strconv"
@ -51,7 +50,8 @@ func NewClientConn(c net.Conn) (*ClientConn, error) {
} }
ret := C.send_client_connection_header(conn.session) ret := C.send_client_connection_header(conn.session)
if int(ret) < 0 { if int(ret) < 0 {
log.Printf("submit settings error: %s", conn.Close()
return nil, fmt.Errorf("submit settings error: %s",
C.GoString(C.nghttp2_strerror(ret))) C.GoString(C.nghttp2_strerror(ret)))
} }
go conn.run() go conn.run()
@ -61,7 +61,7 @@ func NewClientConn(c net.Conn) (*ClientConn, error) {
func (c *ClientConn) onDataRecv(buf []byte, streamID int) { func (c *ClientConn) onDataRecv(buf []byte, streamID int) {
s := c.streams[streamID] s := c.streams[streamID]
if s.res.Body == nil { if s.res.Body == nil {
log.Println("empty body") //log.Println("empty body")
return return
} }
@ -195,7 +195,7 @@ loop:
if int(ret) < 0 { if int(ret) < 0 {
c.err = fmt.Errorf("sesion send error: %s", c.err = fmt.Errorf("sesion send error: %s",
C.GoString(C.nghttp2_strerror(ret))) C.GoString(C.nghttp2_strerror(ret)))
log.Println(c.err) //log.Println(c.err)
break break
} }
} }
@ -210,7 +210,7 @@ loop:
if int(ret1) < 0 { if int(ret1) < 0 {
c.err = fmt.Errorf("sesion recv error: %s", c.err = fmt.Errorf("sesion recv error: %s",
C.GoString(C.nghttp2_strerror(ret))) C.GoString(C.nghttp2_strerror(ret)))
log.Println(c.err) //log.Println(c.err)
break loop break loop
} }
default: default:
@ -350,8 +350,8 @@ func NewServerConn(c net.Conn, handler http.Handler) (*ServerConn, error) {
//log.Println("send server connection header") //log.Println("send server connection header")
ret := C.send_server_connection_header(conn.session) ret := C.send_server_connection_header(conn.session)
if int(ret) < 0 { if int(ret) < 0 {
log.Println(C.GoString(C.nghttp2_strerror(ret))) return nil, fmt.Errorf(C.GoString(C.nghttp2_strerror(ret)))
return nil, fmt.Errorf("send connection header failed") //return nil, fmt.Errorf("send connection header failed")
} }
//go conn.run() //go conn.run()
return conn, nil return conn, nil
@ -429,7 +429,7 @@ loop:
if int(ret) < 0 { if int(ret) < 0 {
c.err = fmt.Errorf("sesion send error: %s", c.err = fmt.Errorf("sesion send error: %s",
C.GoString(C.nghttp2_strerror(ret))) C.GoString(C.nghttp2_strerror(ret)))
log.Println(c.err) //log.Println(c.err)
break break
} }
} }
@ -444,7 +444,7 @@ loop:
if int(ret1) < 0 { if int(ret1) < 0 {
c.err = fmt.Errorf("sesion recv error: %s", c.err = fmt.Errorf("sesion recv error: %s",
C.GoString(C.nghttp2_strerror(ret))) C.GoString(C.nghttp2_strerror(ret)))
log.Println(c.err) //log.Println(c.err)
break loop break loop
} }
default: default:

Loading…
Cancel
Save