This change removed client::session::connect_timeout() functon, and
connect timeout should be given to client::session constructor. This
is required since async operation starts in the constructor.
When connection is dropped, we get "nonzero" error code ec in
read_socket callback. We can just call on_error callback if ec is
nonzero. But there is a problem when we did ordered shutdown. In
this case, we also get EOF in ec, but we don't want to call on_error
because it is not an error. To workaround this, we check return value
of should_stop(). If it is true, then we assume that HTTP/2 session
cleanly ended, and we don't call on_error.
Previously nghttp2_session_send() and nghttp2_session_mem_send() did
not send 24 bytes client magic byte string (MAGIC). We made
nghttp2_session_recv() and nghttp2_session_mem_recv() process MAGIC by
default, so it is natural to make library send MAGIC as well. This
commit makes nghttp2_session_send() and nghttp2_session_mem_send()
send MAGIC. This commit also replace "connection preface" with
"client magic", since we call MAGIC as "connection preface" but it is
just a part of connection preface. NGHTTP2_CLIENT_CONNECTION_PREFACE
macro was replaced with NGHTTP2_CLIENT_MAGIC. The already deprecated
NGHTTP2_CLIENT_CONNECTION_HEADER macro was removed permanently.
nghttp2_option_set_no_recv_client_preface() was renamed as
nghttp2_option_set_no_recv_client_magic(). NGHTTP2_ERR_BAD_PREFACE
was renamed as NGHTTP2_ERR_BAD_CLIENT_MAGIC.