mirror of
https://github.com/refraction-networking/uquic.git
synced 2025-04-06 05:37:36 +03:00
accept 0-RTT request in the http3 server
This commit is contained in:
parent
91543322f6
commit
950f278362
2 changed files with 2 additions and 7 deletions
|
@ -173,10 +173,8 @@ func (s *Server) handleConn(sess quic.EarlySession) {
|
||||||
(&settingsFrame{}).Write(buf)
|
(&settingsFrame{}).Write(buf)
|
||||||
str.Write(buf.Bytes())
|
str.Write(buf.Bytes())
|
||||||
|
|
||||||
// Wait for completion of the handshake.
|
// Process all requests immediately.
|
||||||
// TODO(#2311): allow 0-RTT requests.
|
// It's the client's responsibility to decide which requests are eligible for 0-RTT.
|
||||||
<-sess.HandshakeComplete().Done()
|
|
||||||
|
|
||||||
for {
|
for {
|
||||||
str, err := sess.AcceptStream(context.Background())
|
str, err := sess.AcceptStream(context.Background())
|
||||||
if err != nil {
|
if err != nil {
|
||||||
|
|
|
@ -172,9 +172,6 @@ var _ = Describe("Server", func() {
|
||||||
sess = mockquic.NewMockEarlySession(mockCtrl)
|
sess = mockquic.NewMockEarlySession(mockCtrl)
|
||||||
controlStr := mockquic.NewMockStream(mockCtrl)
|
controlStr := mockquic.NewMockStream(mockCtrl)
|
||||||
controlStr.EXPECT().Write(gomock.Any())
|
controlStr.EXPECT().Write(gomock.Any())
|
||||||
ctx, cancel := context.WithCancel(context.Background())
|
|
||||||
cancel()
|
|
||||||
sess.EXPECT().HandshakeComplete().Return(ctx)
|
|
||||||
sess.EXPECT().OpenUniStream().Return(controlStr, nil)
|
sess.EXPECT().OpenUniStream().Return(controlStr, nil)
|
||||||
sess.EXPECT().AcceptStream(gomock.Any()).Return(str, nil)
|
sess.EXPECT().AcceptStream(gomock.Any()).Return(str, nil)
|
||||||
sess.EXPECT().AcceptStream(gomock.Any()).Return(nil, errors.New("done"))
|
sess.EXPECT().AcceptStream(gomock.Any()).Return(nil, errors.New("done"))
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue