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

Adapt Http2ServerDowngrader to work with clients #7233

Closed
wants to merge 1 commit into
base: 4.1
from

Conversation

Projects
None yet
3 participants
@lionelli1
Contributor

lionelli1 commented Sep 20, 2017

Motivation:
Http2ServerDowngrader is specifically built for server channels where
inbound Http2StreamFrames are converted into HttpRequests, and outbound
HttpResponses are converted into Http2StreamFrames. It can be easily
made to be more generic to work with client channels where inbound
Http2StreamFrames are converted into HttpResponses, and outbound
HttpRequests are converted into Http2StreamFrames.

Modification:

  • Renamed Http2ServerDowngrader to a more general
    Http2StreamFrameToHttpObjectCodec
  • Made it take in an "isServer" parameter to determine whether encoding
    inbound Http2StreamFrames should create HttpRequests (for server) or
    HttpResponses (for client)

Result:
Now Http2StreamFrameToHttpObjectCodec can be used to translate
Http2StreamFrame to HttpObject for both server and client.

Fixes #7171

@lionelli1

This comment has been minimized.

Show comment
Hide comment
@lionelli1

lionelli1 Sep 20, 2017

Contributor

@normanmaurer @Scottmitch PTAL thanks!

Contributor

lionelli1 commented Sep 20, 2017

@normanmaurer @Scottmitch PTAL thanks!

@lionelli1

This comment has been minimized.

Show comment
Hide comment
@lionelli1

lionelli1 Sep 20, 2017

Contributor

@normanmaurer i've addressed your review comments. back to you. thanks!

Contributor

lionelli1 commented Sep 20, 2017

@normanmaurer i've addressed your review comments. back to you. thanks!

@Scottmitch

few changes ... it would be nice to also have a test with SNI handler (which will modify the pipeline after the handshake).

Adapt Http2ServerDowngrader to work with clients
Motivation:
Http2ServerDowngrader is specifically built for server channels where
inbound Http2StreamFrames are converted into HttpRequests, and outbound
HttpResponses are converted into Http2StreamFrames. It can be easily
made to be more generic to work with client channels where inbound
Http2StreamFrames are converted into HttpResponses, and outbound
HttpRequests are converted into Http2StreamFrames.

Modification:
- Renamed Http2ServerDowngrader to a more general
  Http2StreamFrameToHttpObjectCodec
- Made it take in an "isServer" parameter to determine whether encoding
  inbound Http2StreamFrames should create HttpRequests (for server) or
  HttpResponses (for client)
- Norman fixed a leak in the unit test. Thanks! :-)

Result:
Now Http2StreamFrameToHttpObjectCodec can be used to translate
Http2StreamFrame to HttpObject for both server and client.

@normanmaurer normanmaurer self-assigned this Sep 22, 2017

@normanmaurer normanmaurer added defect feature and removed defect labels Sep 22, 2017

@normanmaurer normanmaurer added this to the 4.1.16.Final milestone Sep 22, 2017

@normanmaurer

This comment has been minimized.

Show comment
Hide comment
@normanmaurer

normanmaurer Sep 22, 2017

Member

Cherry-picked into 4.1 (e069079)

Member

normanmaurer commented Sep 22, 2017

Cherry-picked into 4.1 (e069079)

@lionelli1 lionelli1 deleted the lionelli1:4.1-Http2StreamFrameToHttpObjectCodec branch Oct 17, 2017

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