Skip to content

Commit

Permalink
feat: implemented pass through feature for postgres parser (#1149)
Browse files Browse the repository at this point in the history
* solved halting execution due to keploy config error

Signed-off-by: EraKin575 <tejaskumar574@gmail.com>

* solved halting execution due to errors in keploy-config

Signed-off-by: EraKin575 <tejaskumar574@gmail.com>

* solved halting execution due to errors in keploy-config

Signed-off-by: EraKin575 <tejaskumar574@gmail.com>

* implemented passthrough in postgres parser

Signed-off-by: EraKin575 <tejaskumar574@gmail.com>

* added continue

Signed-off-by: EraKin575 <tejaskumar574@gmail.com>

* removed unnecessary packages

Signed-off-by: EraKin575 <tejaskumar574@gmail.com>

---------

Signed-off-by: EraKin575 <tejaskumar574@gmail.com>
Co-authored-by: Sarthak Shyngle <50234097+Sarthak160@users.noreply.github.com>
  • Loading branch information
EraKin575 and Sarthak160 committed Dec 28, 2023
1 parent 3d21ac5 commit 9bf6f28
Showing 1 changed file with 8 additions and 3 deletions.
11 changes: 8 additions & 3 deletions pkg/proxy/integrations/postgresParser/postgres_parser.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@ import (
"context"
"encoding/base64"
"encoding/binary"
"errors"
"io"
"net"
"os"
Expand Down Expand Up @@ -483,8 +482,14 @@ func decodePostgresOutgoing(requestBuffer []byte, clientConn, destConn net.Conn,
matched, pgResponses := matchingReadablePG(tcsMocks, pgRequests, h)

if !matched {
logger.Error("failed to match the dependency call from user application", zap.Any("request packets", len(pgRequests)))
return errors.New("failed to match the dependency call from user application")
_, err = util.Passthrough(clientConn, destConn, pgRequests, h.Recover, logger)

if err != nil {
logger.Error("failed to match the dependency call from user application", zap.Any("request packets", len(pgRequests)))
return err
}
continue

}

for _, pgResponse := range pgResponses {
Expand Down

0 comments on commit 9bf6f28

Please sign in to comment.