mirror of
https://github.com/cgrates/cgrates.git
synced 2026-02-11 10:06:24 +05:00
Fix caps error typo
This commit is contained in:
committed by
Dan Christian Bogos
parent
7c7c701b2c
commit
b27ed9f53e
@@ -101,8 +101,8 @@ func (c *capsServerCodec) ReadRequestBody(x interface{}) error {
|
||||
return c.sc.ReadRequestBody(x)
|
||||
}
|
||||
func (c *capsServerCodec) WriteResponse(r *rpc.Response, x interface{}) error {
|
||||
if r.Error == utils.ErrMaxConcurentRPCExceededNoCaps.Error() {
|
||||
r.Error = utils.ErrMaxConcurentRPCExceeded.Error()
|
||||
if r.Error == utils.ErrMaxConcurrentRPCExceededNoCaps.Error() {
|
||||
r.Error = utils.ErrMaxConcurrentRPCExceeded.Error()
|
||||
} else {
|
||||
defer c.caps.Deallocate()
|
||||
}
|
||||
@@ -164,7 +164,8 @@ type capsBiRPCCodec struct {
|
||||
// ReadHeader must read a message and populate either the request
|
||||
// or the response by inspecting the incoming message.
|
||||
func (c *capsBiRPCCodec) ReadHeader(req *rpc2.Request, resp *rpc2.Response) (err error) {
|
||||
if err = c.sc.ReadHeader(req, resp); err != nil || req.Method == utils.EmptyString {
|
||||
if err = c.sc.ReadHeader(req, resp); err != nil ||
|
||||
req.Method == utils.EmptyString { // caps will not process replies
|
||||
return
|
||||
}
|
||||
if err = c.caps.Allocate(); err != nil {
|
||||
@@ -191,8 +192,8 @@ func (c *capsBiRPCCodec) WriteRequest(req *rpc2.Request, x interface{}) error {
|
||||
|
||||
// WriteResponse must be safe for concurrent use by multiple goroutines.
|
||||
func (c *capsBiRPCCodec) WriteResponse(r *rpc2.Response, x interface{}) error {
|
||||
if r.Error == utils.ErrMaxConcurentRPCExceededNoCaps.Error() {
|
||||
r.Error = utils.ErrMaxConcurentRPCExceeded.Error()
|
||||
if r.Error == utils.ErrMaxConcurrentRPCExceededNoCaps.Error() {
|
||||
r.Error = utils.ErrMaxConcurrentRPCExceeded.Error()
|
||||
} else {
|
||||
defer c.caps.Deallocate()
|
||||
}
|
||||
|
||||
@@ -80,8 +80,8 @@ func TestNewCapsServerCodec(t *testing.T) {
|
||||
t.Fatal(err)
|
||||
}
|
||||
|
||||
if err = codec.ReadRequestBody("args"); err != utils.ErrMaxConcurentRPCExceededNoCaps {
|
||||
t.Errorf("Expected error: %v ,received: %v ", utils.ErrMaxConcurentRPCExceededNoCaps, err)
|
||||
if err = codec.ReadRequestBody("args"); err != utils.ErrMaxConcurrentRPCExceededNoCaps {
|
||||
t.Errorf("Expected error: %v ,received: %v ", utils.ErrMaxConcurrentRPCExceededNoCaps, err)
|
||||
}
|
||||
|
||||
if err = codec.WriteResponse(&rpc.Response{
|
||||
@@ -93,7 +93,7 @@ func TestNewCapsServerCodec(t *testing.T) {
|
||||
}
|
||||
|
||||
if err = codec.WriteResponse(&rpc.Response{
|
||||
Error: utils.ErrMaxConcurentRPCExceededNoCaps.Error(),
|
||||
Error: utils.ErrMaxConcurrentRPCExceededNoCaps.Error(),
|
||||
Seq: 0,
|
||||
ServiceMethod: utils.CoreSv1Ping,
|
||||
}, "reply"); err != nil {
|
||||
@@ -184,8 +184,8 @@ func TestNewCapsBiRPCCodec(t *testing.T) {
|
||||
t.Fatal(err)
|
||||
}
|
||||
|
||||
if err = codec.ReadRequestBody("args"); err != utils.ErrMaxConcurentRPCExceededNoCaps {
|
||||
t.Errorf("Expected error: %v ,received: %v ", utils.ErrMaxConcurentRPCExceededNoCaps, err)
|
||||
if err = codec.ReadRequestBody("args"); err != utils.ErrMaxConcurrentRPCExceededNoCaps {
|
||||
t.Errorf("Expected error: %v ,received: %v ", utils.ErrMaxConcurrentRPCExceededNoCaps, err)
|
||||
}
|
||||
|
||||
if err = codec.WriteResponse(&rpc2.Response{
|
||||
@@ -207,7 +207,7 @@ func TestNewCapsBiRPCCodec(t *testing.T) {
|
||||
}
|
||||
|
||||
if err = codec.WriteResponse(&rpc2.Response{
|
||||
Error: utils.ErrMaxConcurentRPCExceededNoCaps.Error(),
|
||||
Error: utils.ErrMaxConcurrentRPCExceededNoCaps.Error(),
|
||||
Seq: 0,
|
||||
}, "reply"); err != nil {
|
||||
t.Fatal(err)
|
||||
|
||||
Reference in New Issue
Block a user