diff --git a/pkg/cbng/processor/core.go b/pkg/cbng/processor/core.go index 9c6474e..9a4956e 100644 --- a/pkg/cbng/processor/core.go +++ b/pkg/cbng/processor/core.go @@ -109,23 +109,22 @@ func isVandalism(l *logrus.Entry, parentCtx context.Context, configuration *conf } defer conn.Close() - if err := conn.SetDeadline(time.Now().Add(time.Second * 10)); err != nil { + if err := conn.SetDeadline(time.Now().Add(time.Second * 20)); err != nil { scoreSpan.SetStatus(codes.Error, err.Error()) logger.Errorf("Could not set deadline: %v", err) return false, err } - if err := conn.SetReadDeadline(time.Now().Add(time.Second * 10)); err != nil { + if _, err := conn.Write(xmlData); err != nil { scoreSpan.SetStatus(codes.Error, err.Error()) - logger.Errorf("Could not set read deadline: %v", err) + logger.Infof("Could not write payload: %v", err) return false, err } - if _, err := conn.Write(xmlData); err != nil { + if err := conn.SetReadDeadline(time.Now().Add(time.Second * 20)); err != nil { scoreSpan.SetStatus(codes.Error, err.Error()) - logger.Infof("Could not write payload: %v", err) + logger.Errorf("Could not set read deadline: %v", err) return false, err } - response := []byte{} tmp := make([]byte, 4096) i := 0