Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

您好,请问多路复用的映射关系在哪里记录的呢? #2354

Closed
zzqCh opened this issue Nov 2, 2023 · 2 comments
Closed

您好,请问多路复用的映射关系在哪里记录的呢? #2354

zzqCh opened this issue Nov 2, 2023 · 2 comments

Comments

@zzqCh
Copy link

zzqCh commented Nov 2, 2023

Your question

您好,请问多路复用的映射关系在哪里记录的呢?

Environment

  • MOSN Version

Logs

  • Paste the logs you see.
@taoyuanyuan
Copy link
Contributor

没有啥多路复用的映射关系表哟
可以看下整个id的修改,替换过程,差不多就是支持多路复用的关键点。

  1. 这个保存了原始的id

    serverStream.id = frame.GetRequestId()

  2. 转发给upstream的时候分配了一个新id

    clientStream.id = sc.protocol.GenerateRequestID(&sc.clientStreamIDBase)

  3. 返回请求的时候,把id还原为原始的id

    s.frame.SetRequestId(s.id)

@zzqCh
Copy link
Author

zzqCh commented Nov 2, 2023

没有啥多路复用的映射关系表哟
可以看下整个id的修改,替换过程,差不多就是支持多路复用的关键点。

  1. 这个保存了原始的id

    serverStream.id = frame.GetRequestId()

  2. 转发给upstream的时候分配了一个新id

    clientStream.id = sc.protocol.GenerateRequestID(&sc.clientStreamIDBase)

  3. 返回请求的时候,把id还原为原始的id

    s.frame.SetRequestId(s.id)

好的我学习学习,谢谢您

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

No branches or pull requests

3 participants