Request: unlink request node from cs->request_lists

Signed-off-by: Eduardo Silva <eduardo@monkey.io>

Conflicts:
	src/mk_request.c
Request: set correct path size when truncated

If snprintf can't write the entire string out to the buffer, it will
still null-terminate it. Hence, the length of the string is one less
than the maximum passed in, not the maximum itself.

Signed-off-by: Matthew Daley <mattd@bugfuzz.com>
Signed-off-by: Eduardo Silva <eduardo@monkey.io>
Mimetype: don't iterate off the start of the filename when looking for an extension

Check the iterator position before checking for an extension.

Signed-off-by: Matthew Daley <mattd@bugfuzz.com>
Signed-off-by: Eduardo Silva <eduardo@monkey.io>
Method: correctly extract content length value from body buffer when pre-parsing

The buffer offset and the end position passed to mk_string_copy_substr
is incorrect.

Signed-off-by: Matthew Daley <mattd@bugfuzz.com>
Signed-off-by: Eduardo Silva <eduardo@monkey.io>
Request: don't search off the end of the body buffer for query strings

mk_string_char_search takes a length, not an end position.

Signed-off-by: Matthew Daley <mattd@bugfuzz.com>
Signed-off-by: Eduardo Silva <eduardo@monkey.io>
Utils: allocate enough space to include the null terminator when URL-decoding URLs

Signed-off-by: Matthew Daley <mattd@bugfuzz.com>
Signed-off-by: Eduardo Silva <eduardo@monkey.io>
Request: new request session flag to mark those files opened by FDT

This patch aims to fix a potential DDoS problem that can be caused
in the server quering repetitive non-existent resources.

When serving a static file, the core use Vhost FDT mechanism, but if
it sends a static error page it does a direct open(2). When closing
the resources for the same request it was just calling mk_vhost_close()
which did not clear properly the file descriptor.

This patch adds a new field on the struct session_request called 'fd_is_fdt',
which contains MK_TRUE or MK_FALSE depending of how fd_file was opened.

Thanks to Matthew Daley <mattd@bugfuzz.com> for report and troubleshoot this
problem.

Signed-off-by: Eduardo Silva <eduardo@monkey.io>
Debian: bump to 1.5.3

Signed-off-by: Eduardo Silva <eduardo@monkey.io>
Libmonkey: bump to 1.5.3

Signed-off-by: Eduardo Silva <eduardo@monkey.io>
Mandril: fix network address reference

Signed-off-by: Eduardo Silva <eduardo@monkey.io>
Mandril: remove trace msg

Signed-off-by: Eduardo Silva <eduardo@monkey.io>
Libmonkey: do not use SO_REUSEPORT and set Mime default

Signed-off-by: Eduardo Silva <eduardo@monkey.io>
Epoll: validate when registering connection with the Scheduler

In the epoll event loop, when registering a new connection with
the Scheduler, there were not check if this was successfull or not,
a common example may be a security plugin dropping a connection
at STAGE_10.

This patch adds a validation on the return value when trying to register
a connection with the Scheduler. If it fails, the socket will be closed
right away.

Signed-off-by: Eduardo Silva <eduardo@monkey.io>
Scheduler: on Libmonkey mode IP_CHECK, drop socket

If the user code on top of Libmonkey decided to drop the connection,
let the Scheduler handler that requirement right away inside the
registration phase.

Signed-off-by: Eduardo Silva <eduardo@monkey.io>
HTML: bump to 1.5.3

Signed-off-by: Eduardo Silva <eduardo@monkey.io>
Version: bump to 1.5.3

Signed-off-by: Eduardo Silva <eduardo@monkey.io>
Update ChangeLog for v1.5.3

Signed-off-by: Eduardo Silva <eduardo@monkey.io>