You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@apisix.apache.org by GitBox <gi...@apache.org> on 2021/09/13 03:41:17 UTC

[GitHub] [apisix-go-plugin-runner] spacewander commented on a change in pull request #38: Remove the util.RPCTest hack

spacewander commented on a change in pull request #38:
URL: https://github.com/apache/apisix-go-plugin-runner/pull/38#discussion_r706983998



##########
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:
       Let's remove the definition of RPCTest too




-- 
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: notifications-unsubscribe@apisix.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org