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

The first frame after connection preface #795

Open
oimou opened this issue Feb 20, 2016 · 2 comments
Open

The first frame after connection preface #795

oimou opened this issue Feb 20, 2016 · 2 comments

Comments

@oimou
Copy link

oimou commented Feb 20, 2016

RFC7540 says

That is, the connection preface starts with the string "PRI *
HTTP/2.0\r\n\r\nSM\r\n\r\n"). This sequence MUST be followed by a
SETTINGS frame (Section 6.5), which MAY be empty.

in 3.5 HTTP/2 Connection Preface.

So, the first frame after connection preface should be SETTINGS. However, according to this output of h2i, h2o server seems to accept HEADERS frame as the first frame after connection preface.

 % ./h2o -c h2o.conf &
...

 % h2i -insecure localhost:8081
Connecting to localhost:8081 ...
Connected to [::1]:8081
Negotiated protocol "h2"
[FrameHeader SETTINGS len=12]
  [MAX_CONCURRENT_STREAMS = 100]
  [INITIAL_WINDOW_SIZE = 16777216]
h2i> HEADERS
(as HTTP/1.1)> GET / HTTP/1.1
(as HTTP/1.1)>
Opening Stream-ID 1:
 :authority =
 :method = GET
 :path = /
 :scheme = https
[FrameHeader HEADERS flags=END_HEADERS stream=1 len=63]
  :status = "404"
  server = "h2o/1.8.0-alpha1"
  date = "Sat, 20 Feb 2016 19:04:32 GMT"
  content-type = "text/plain; charset=utf-8"
  content-length = "9"
[FrameHeader DATA flags=END_STREAM stream=1 len=9]
  "not found"
h2i>

Is it expected behaviour?

@kazuho
Copy link
Member

kazuho commented Feb 22, 2016

according to this output of h2i, h2o server seems to accept HEADERS frame as the first frame after connection preface.

Thank you for pointing out. I think your observation is correct.

However, according to this output of h2i, h2o server seems to accept HEADERS frame as the first frame after connection preface.

I thought that h2i always sent SETTINGS frame as part of the preface without logging it. Is my understanding wrong, or did you use a modified version of h2i?

@oimou
Copy link
Author

oimou commented Feb 26, 2016

Thank you for your response. Anyway, I don't use a modified version. I looked into an implementation of h2i a bit and it seems not send implicit SETTINGS frame after client preface.
https://github.com/bradfitz/http2/blob/master/h2i%2Fh2i.go#L165

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

No branches or pull requests

2 participants