yunkunrao commented on a change in pull request #38:
URL:
https://github.com/apache/apisix-go-plugin-runner/pull/38#discussion_r707040767
##########
File path: internal/server/server.go
##########
@@ -62,19 +71,11 @@ func recoverPanic() {
}
func dispatchRPC(ty byte, in []byte, conn net.Conn) (*flatbuffers.Builder,
error) {
- var err error
- var bd *flatbuffers.Builder
- switch ty {
- case util.RPCPrepareConf:
- bd, err = plugin.PrepareConf(in)
- case util.RPCHTTPReqCall:
- bd, err = plugin.HTTPReqCall(in, conn)
- case util.RPCTest: // Just for test
- bd, err = dealRPCTest(in)
- default:
- err = UnknownType{ty}
+ hl, ok := typeHandlerMap[ty]
+ if !ok {
+ return nil, UnknownType{ty}
}
- return bd, err
+ return hl(in, conn)
Review comment:
OK~
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]