sahvx655-wq opened a new pull request, #3622: URL: https://github.com/apache/brpc/pull/3622
### What problem does this PR solve? Issue Number: resolve Problem Summary: #3525 limited `ServerOptions.internal_port` to builtin and Tabbed services in baidu_std, hulu, sofa, nshead, thrift, mongo and redis, but `ParseRtmpMessage` still accepts RTMP there. That leaves the authentication latch described in #3525 open for rtmp: `VerifyHttpRequest()` returns true without a credential for a builtin service on `internal_port`, the connection is marked authenticated, and the `IsAuthenticated()` check added to `ParseRtmpMessage` in #3598 then passes. With `auth`, `internal_port` and `rtmp_service` all set, sending `GET /version` followed by an RTMP C0C1 on the same connection to `internal_port` gets an S0S1S2 back and reaches `rtmp_service`, even with an authenticator that rejects every credential. ### What is changed and the side effects? Changed: `ParseRtmpMessage` returns `PARSE_ERROR_TRY_OTHERS` on `internal_port`, the same way `ParseRedisMessage` does, since there is no Controller to fail the request with. `RtmpTest.not_served_on_internal_port` covers the sequence above; it fails on master (the server answers the handshake) and passes with the fix. All of `brpc_rtmp_unittest` passes locally. Side effects: - Performance effects: one port comparison when a new RTMP connection is parsed. - Breaking backward compatibility: RTMP clients pointed at `internal_port` are no longer served there and should use the port passed to `Server::Start()`, as already documented for the other protocols. --- ### Check List: - Please make sure your changes are compilable. - When providing us with a new feature, it is best to add related tests. - Please follow [Contributor Covenant Code of Conduct](https://github.com/apache/brpc/blob/master/CODE_OF_CONDUCT.md). -- 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] --------------------------------------------------------------------- To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected]
