Skip to content

Conversation

@Fliv
Copy link

@Fliv Fliv commented Aug 8, 2022

修复了业务代码在grpc中使用了一元拦截器(UnaryInterceptor)时候的报错https://github.com/HXSecurity/DongTai/issues/808
步骤如下:

  1. 增加了对grpc.UnaryInterceptor函数的hook,取出并保存业务代码中注册的一元拦截器,并把grpc.UnaryInterceptor返回置为nil
  2. 在grpc.NewServer的hook实现中把...grpc.ServerOption入参中的nil值去掉(即上一步中hook的一元拦截器),从unaryInterceptor.UnaryServerInterceptors取出上一步保存的一元拦截器,用第三方链式拦截器库go-grpc-middleware.ChainUnaryServer把agent的拦截器和业务拦截器一起加载

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant