Scheduler: new REUSEPORT balancing method/architecture.

Starting from Linux Kernel 3.9, there is a new TCP/UDP socket option which allows
to bind same port and address from multiples threads (or any instance under the
same process context).

This patch implements the SO_REUSEPORT TCP Flag if the running Kernel is >= 3.9,
so on that mode each working thread create it own socket that bind the same address,
with this implementation we reduce the number of system calls involved when a new
connection arrives, avoid lookup the lowest loaded thread and also we allow the
Kernel to perform a better Scheduling on SMP systems that requires to scale.

If the detected Kernel is lower than 3.9, it will use the old Fair Balancing
mechanism.

Signed-off-by: Eduardo Silva <edsiper@gmail.com>
Scheduler: Little improvements over REUSEPORT implementation.

Signed-off-by: Eduardo Silva <edsiper@gmail.com>
Kernel: new features interfaces and core flags

Signed-off-by: Eduardo Silva <edsiper@gmail.com>
Kernel: remove unused variable

Signed-off-by: Eduardo Silva <edsiper@gmail.com>
Config: check kernel_features flag for REUSEPORT

Signed-off-by: Eduardo Silva <edsiper@gmail.com>
HTTP/Server: use new server_cork_flag() interface

Signed-off-by: Eduardo Silva <edsiper@gmail.com>
Plugin API: export mk_kernel_features_print

Signed-off-by: Eduardo Silva <edsiper@gmail.com>
Cheetah: on status command, print new Kernel features

Signed-off-by: Eduardo Silva <edsiper@gmail.com>
Scheduler: enable TCP_DEFER_ACCEPT on REUSEPORT mode

Signed-off-by: Eduardo Silva <edsiper@gmail.com>
PolarSSL: Drops polarssl v1.1 support.

Signed-off-by: Sonny Karlsson <ksonny@lotrax.org>
PolarSSL: Fixes error where connection isn't terminated on error.

Signed-off-by: Sonny Karlsson <ksonny@lotrax.org>
PolarSSL: Enable session cache.

Sets session cache on ssl context.
Moves pk_context to local thread context to allow use of polarssl
compiled without threading support.

Signed-off-by: Sonny Karlsson <ksonny@lotrax.org>
PolarSSL: Enable REUSEPORT feature

Signed-off-by: Eduardo Silva <edsiper@gmail.com>
Socket: fix array index.

Signed-off-by: Eduardo Silva <edsiper@gmail.com>
Auth: Rewrite mk_passwd in C (close #131).

This patch drops the mk_passwd python script from auth plugin, by adding an
equivalent C implementation.

The C implementation makes use of Monkey functions, whenever possible, so it
links with Monkey objects.

In order to make the linking possible, some minor modifications had to be made
to the configure script, monkey.c and mk_config.c source files.

Signed-off-by: Vladimir Cernov <gg.kaspersky@gmail.com>
Doc: CONTRIBUTING.md: specify number of chars per line

Signed-off-by: Eduardo Silva <edsiper@gmail.com>
Debian: minor updates

Signed-off-by: Eduardo Silva <edsiper@gmail.com>
Lib: fix parameters for mk_socket_server() call

Signed-off-by: Eduardo Silva <edsiper@gmail.com>
Request: optimize initialization of session_request

Signed-off-by: Eduardo Silva <edsiper@gmail.com>
Auth: make mk_passwd work without Monkey internals.

This patch adds a few workarounds to make mk_passwd avoid Monkey
internals about memory allocations and string lines dependencies.

Signed-off-by: Eduardo Silva <edsiper@gmail.com>