qa: Add if_modified_since_test04.htt.

This test together with test01 should guarantee will guarantee that time
conversion is properly performed both on negative and positive GMT
offsets.

Signed-off-by: Sonny Karlsson <ksonny@lotrax.org>
mk_utils: Properly convert GMT to time_t.

Fix if_modified_since_test01.htt failure in GMT+ zones and
if_modified_since_test04.htt failure in GMT- zones.

Signed-off-by: Sonny Karlsson <ksonny@lotrax.org>
Revert "mk_utils: Properly convert GMT to time_t."

This reverts commit 63b90609f1863eefb5ab17d6effb69e0efef3b99.
mk_utils: Use timegm() instead of mktime().

Fix if_modified_since_test01.htt failure in GMT+ zones and
if_modified_since_test04.htt failure in GMT- zones.

Signed-off-by: Sonny Karlsson <ksonny@lotrax.org>
FastCGI: use IOV_MAX instead of UIO_MAXIOV

Signed-off-by: Eduardo Silva <edsiper@gmail.com>
core: add support for 'musl' C library, use --musl-mode

Signed-off-by: Eduardo Silva <edsiper@gmail.com>
signal: do not use sys_siglist array anymore

Signed-off-by: Eduardo Silva <edsiper@gmail.com>
configure: auto-check for backtrace support

Signed-off-by: Eduardo Silva <edsiper@gmail.com>
configure: Use generic function to check for headers and functions

Signed-off-by: Valentin Ochs <a-monkey@0au.de>
Signed-off-by: Sonny Karlsson <ksonny@lotrax.org>
configure: Use tab for indentation consistently

Signed-off-by: Valentin Ochs <a-monkey@0au.de>
Signed-off-by: Sonny Karlsson <ksonny@lotrax.org>
configure: check_generic returns false on warnings, links against needed libraries, gets documentation.

configure: pthread test runs one function from pthread.h

Signed-off-by: Valentin Ochs <a-monkey@0au.de>
Signed-off-by: Sonny Karlsson <ksonny@lotrax.org>
Core: new argument '-b' to print build information to stdout

Signed-off-by: Eduardo Silva <edsiper@gmail.com>
Event: if wakeup fails, do not stop the server, just warn and return -1

Signed-off-by: Eduardo Silva <edsiper@gmail.com>
Event: check that socket is alive before trigger hooks.

When the events take place in the worker epoll queue, the timeout
routine can remove and inactivate a client session, but sometimes
a write event reporeted by the same epoll_wait() loop can be queued
and can cause some inconsistences.

For safety this patch makes the read and write event connection hooks
to validate the epoll state before to proceed.

Signed-off-by: Eduardo Silva <edsiper@gmail.com>
Event: move event check to plugin logic

Signed-off-by: Eduardo Silva <edsiper@gmail.com>
Event: verbose message on error when waking up connection

Signed-off-by: Eduardo Silva <edsiper@gmail.com>
Core: on segfault... abort

Signed-off-by: Eduardo Silva <edsiper@gmail.com>
HTTP: add support for OPTIONS method

Signed-off-by: Nil Croustillac <nilcroustillac@gmail.com>
Signed-off-by: Eduardo Silva <edsiper@gmail.com>
Core: initialize clock before load plugins.

Some plugins could use the core clock API or buffer cache to perform
some timing operations (or format strings), before this patch the plugin
would crash as the clock was not initialized before spawn it.

This patch moves the sequential initialization before to load the plugins.

Signed-off-by: Eduardo Silva <edsiper@gmail.com>
Mimetype: replace bsearch by red-black-tree (50% improvement)

The mime types lookup algorithm was using a qsort()ed array plus a
binary search with two main arrays: a top ten list (common) and another
one for the rest.

Even the solution was optimal for some cases, it have a huge dependency
of a righ configuration of the top ten list, and considering the support
of virtual host and different types of content we need a more generic
solution that scale and optimize for all cases.

This patch deprecate the top-ten list and replace the binary search by a
red-black-tree solution, looking at the results after a benchmark we can
see the following:

                       +-----------+-----------------+--------+
                       | bsearch   | red-black-tree  |   gain |
 +---------------------+-----------+-----------------+--------+
 |  mk_mimetype_find   |   11.54   |           5.82  |   ~50% |
 +---------------------+-----------+-----------------+--------+

More graphical details here:

 http://edsiper.linuxchile.cl/mimetype_performance_improvement_001.png

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