Imported Upstream version 1.0.0
[platform/upstream/nghttp2.git] / doc / nghttp2_option_set_no_recv_client_magic.rst
1
2 nghttp2_option_set_no_recv_client_magic
3 =======================================
4
5 Synopsis
6 --------
7
8 *#include <nghttp2/nghttp2.h>*
9
10 .. function:: void nghttp2_option_set_no_recv_client_magic(nghttp2_option *option, int val)
11
12     
13     By default, nghttp2 library, if configured as server, requires
14     first 24 bytes of client magic byte string (MAGIC).  In most cases,
15     this will simplify the implementation of server.  But sometimes
16     server may want to detect the application protocol based on first
17     few bytes on clear text communication.
18     
19     If this option is used with nonzero *val*, nghttp2 library does not
20     handle MAGIC.  It still checks following SETTINGS frame.  This
21     means that applications should deal with MAGIC by themselves.
22     
23     If this option is not used or used with zero value, if MAGIC does
24     not match :macro:`NGHTTP2_CLIENT_MAGIC`, `nghttp2_session_recv()`
25     and `nghttp2_session_mem_recv()` will return error
26     :macro:`NGHTTP2_ERR_BAD_CLIENT_MAGIC`, which is fatal error.