HTTP/2 C library and tools

Nghttp2 v1.11.0

We released nghttp2 v1.11.0.

This release fixes some bugs both in libnghttp2 and applications, and fixes minor API issue. We fixed compile error with OpenSSL 1.1.0 pre5. We also improved nghttpx functionality.

API bugs

libnghttp2 offers HPACK API. nghttp2_hd_inflate_hd() decodes incoming header block data to actual header field name/value pair. The shortcoming of its API is that its input parameter is not qualified as const. To fix this issue, we added new nghttp2_hd_inflate_hd2(). Other than the added const-ness, they share the same functionality.

Previously, nghttp2_submit_ping() ignored PING flag passed as flags parameter. This release fixes this bug.

kqueue issues

We use libev for our applications. According to the libev manual, kqueue is not selected as eligible backend for the BSD based system other than NetBSD. Because we usually use event for sockets, we explicitly enabled kqueue backend if it is available. For nghttpx, we have --no-kqueue option to disable it.

nghttp : Fixed zero length DATA frame issue

We fixed zero length DATA frame issue described in

This issue arises if nghttp client sends request body with content-length header field. If server only sends WINDOW_UPDATE with the same amount of content-length, tranfer stalls while all data have been sent. This comes from the design of libnghttp2; its nghttp2_data_source_read_callback is only called when there is at least 1 byte of flow control window. But it can completely be avoided. Since we have content-length, we can just tell libnghttp2 that we have read all data now. This effectively eliminates 0 length DATA farme

nghttpx: New attributes for mruby object, and other enhancements

In nghttpx, we added new env.server_addr, env.tls_used and env.server_port attributes. These are all documented in nghttpx manual page.

The timing when PID file is saved is pushed back, and it is now saved when setup of all listening sockets has completed. This is useful when we do graceful shutdown of nghttpx. Now we can just check PID file is changed, and then issue QUIT signal to the old process.

--backend option now has sni parameter to specify SNI field to send backend HTTPS server.

Previously, when we call fetch-ocsp-response script, we didn’t pass environ to the new program. Now we use execv to pass environ.

Previously, the proto and tls parameter in --backend option must be the same if they are the same routing pattern. Now this requirement is removed, and we can mix their combinations for the same pattern.

For HTTP/2 backend, we now consider the backend is alive only when we receive SETTINGS ACK from backend; just successfully connecting to the backend is not enough.