Skip to content
Maru Berezin edited this page Feb 15, 2018 · 1 revision

This week was all about coding a first prototype!

Now an HTTP/2 client can connect to our server, send a GET request and receive a (fixed) response.

What I learned this week:

  • Use asserts to check values of variables or conditions. This will save you a lot of time in debugging and understanding the root of a problem (such as a segmentation fault!).

  • h2spec is a conformance testing tool for HTTP/2 implementation. This tool is compliant with RFC 7540 (HTTP/2) and RFC 7541 (HPACK). I use it to test (and debug :P) my code.

Coding

  • Variables

    • daemon->h2_settings: server HTTP/2 settings, configured at start-up.
  • Structures

    • http2_conn: handles an HTTP/2 connection. Each connection has a unique session: connection->h2 A session can have multiple active streams, stored in a doubly linked list (or do we need a hash table?). A session has its own settings (initialized by the daemon settings, they can change during the session): h2->settings

    • http2_stream: handles an HTTP/2 frame in a session. Every stream has a unique identifier in the session (in fact, odd-numbered identifiers!).

  • Functions

    • send_callback: nghttp2 doesn't use the MHD_Connection write_buffer for the responses.
Clone this wiki locally