-
Notifications
You must be signed in to change notification settings - Fork 6
Week 3
Maru Berezin edited this page Feb 15, 2018
·
5 revisions
This week was all about coding !
What I learned this week:
- autoconf and how the configure script is generated.
- pkg-config: get the correct compiler options (instead of hard-coding values)
- LD_LIBRARY_PATH: if your library is not in a default/standard library directory (such as /usr/lib), add its path to this variable (directories separated by colon: VAR=/path1:/path2)
I have a very first prototype of the new library. I wrote the skeleton code needed to handle HTTP/2 connections:
-
Add the --enable-http2 and --with-nghttp2 options to script configure
-
MHD uses autoconf to generate the configure script (from the template configure.ac).
-
Used the
--enable-https
and--with-gnutls
options as a code example. -
Used code from curl and apache to check if libnghttp2 is installed.
-
Added
NGHTTP2_CPPFLAGS
andNGHTTP2_LDFLAGS
for compiling. -
Still not sure about the minimum version for nghttp2
-
Preprocessor variable
HTTP2_SUPPORT
is defined when running configure:./configure --enable-http2 --with-nghttp2
-
-
Add MHD_USE_HTTP2 to enum MHD_FLAG:
- The server accepts only HTTP2 connections (for now).
- Support for upgrade from HTTP/1 will be added in the future.
-
Connection read, idle and write callbacks:
- Added function pointers to struct MHD_Connection:
- ConnectionReadCallback read_cls
- ConnectionIdleCallback idle_cls
- ConnectionWriteCallback write_cls
- Created functions to set the function pointers for HTTP1 and HTTP2:
- MHD_set_connection_http1_callbacks_
- MHD_set_connection_http2_callbacks_
- Added function pointers to struct MHD_Connection: