commit
fe7cca7cc4
3 changed files with 17 additions and 16 deletions
|
@ -134,6 +134,7 @@ func handleLoggingParams(ctx *cli.Context, cfg config.ApplicationConfiguration)
|
|||
cc.EncoderConfig.EncodeTime = zapcore.ISO8601TimeEncoder
|
||||
cc.Encoding = "console"
|
||||
cc.Level = zap.NewAtomicLevelAt(level)
|
||||
cc.Sampling = nil
|
||||
|
||||
if logPath := cfg.LogPath; logPath != "" {
|
||||
if err := io.MakeDirForFile(logPath, "logger"); err != nil {
|
||||
|
|
|
@ -82,22 +82,22 @@ func (t *TCPTransport) handleConn(conn net.Conn) {
|
|||
t.server.register <- p
|
||||
|
||||
// When a new peer is connected we send out our version immediately.
|
||||
if err := t.server.sendVersion(p); err != nil {
|
||||
t.log.Error("error on sendVersion", zap.Stringer("addr", p.RemoteAddr()), zap.Error(err))
|
||||
}
|
||||
r := io.NewBinReaderFromIO(p.conn)
|
||||
for {
|
||||
msg := &Message{}
|
||||
err = msg.Decode(r)
|
||||
err = t.server.sendVersion(p)
|
||||
if err == nil {
|
||||
r := io.NewBinReaderFromIO(p.conn)
|
||||
for {
|
||||
msg := &Message{}
|
||||
err = msg.Decode(r)
|
||||
|
||||
if err == payload.ErrTooManyHeaders {
|
||||
t.log.Warn("not all headers were processed")
|
||||
r.Err = nil
|
||||
} else if err != nil {
|
||||
break
|
||||
}
|
||||
if err = t.server.handleMessage(p, msg); err != nil {
|
||||
break
|
||||
if err == payload.ErrTooManyHeaders {
|
||||
t.log.Warn("not all headers were processed")
|
||||
r.Err = nil
|
||||
} else if err != nil {
|
||||
break
|
||||
}
|
||||
if err = t.server.handleMessage(p, msg); err != nil {
|
||||
break
|
||||
}
|
||||
}
|
||||
}
|
||||
t.server.unregister <- peerDrop{p, err}
|
||||
|
|
|
@ -99,7 +99,7 @@ func (s *Server) requestHandler(w http.ResponseWriter, httpRequest *http.Request
|
|||
}
|
||||
|
||||
func (s *Server) methodHandler(w http.ResponseWriter, req *Request, reqParams Params) {
|
||||
s.log.Info("processing rpc request",
|
||||
s.log.Debug("processing rpc request",
|
||||
zap.String("method", req.Method),
|
||||
zap.String("params", fmt.Sprintf("%v", reqParams)))
|
||||
|
||||
|
|
Loading…
Reference in a new issue