Configure: fix broken plugins path on previous contributor patch

Signed-off-by: Eduardo Silva <edsiper@gmail.com>
Epoll: Fix not catched peer close after events modifications (EPOLLRDHUP)

If a socket created on the event loop did some events modifications and
the peer closed the connection, the core did not trap this event. This
patch re-enable the EPOLLRDHUP flag.

Signed-off-by: Eduardo Silva <edsiper@gmail.com>
Monkey configuration: add program options for configuration paths

This patch solves the issue #36.

4 additional program arguments were added for specifying different
configuration files and directories:

-m, --mimes-conf-file # path to monkey.mime
-P, --plugins-conf-dir # path to plugins configuration directory
-l, --plugin-load-conf-file # path to plugins.load file
-S, --sites-conf-dir # path to sites directory

Each option has a default value.

Monkey will try to interpret the options by prepending their values
to default configuration directory. If the obtained path does not
exist, the options will be treated as absolute paths.

I tested using ./configure --prefix=path --plugdir=--path2 and
default build. I was able to load different configuration files
from custom locations with custom names, overriding the default
names which were hardcoded in Monkey.

The patch also contains an unrelated fix to:

bin/monkey --confdir # was not working, while provided by --help

Signed-off-by: Vladimir Cernov <gg.kaspersky@gmail.com>
IOV: store buffer using void data type instead of char

Signed-off-by: Eduardo Silva <edsiper@gmail.com>
IOV: store buffer type changed to void in function '_mk_iov_set_free'
Merge pull request #120 from tssavita/iov_patch2

IOV: store buffer type from char changed to void in function 'void _mk_iov_set_free'
Vhost: skip files ending in '~' (editor backups)

Signed-off-by: Eduardo Silva <edsiper@gmail.com>
Epoll: when adding a new FD, return status value

Signed-off-by: Eduardo Silva <edsiper@gmail.com>
Memory: upgrade Jemalloc to 3.6.0

Signed-off-by: Eduardo Silva <edsiper@gmail.com>
Merge branch 'master' of github.com:monkey/monkey
Scheduler: Moving and renaming function mk_sched_worker_info() to mk_plugin_sched_get_thread_conf
Merge pull request #122 from tssavita/sched_plugin

Scheduler-Plugin: Moving and renaming function mk_sched_worker_info()
Systemd: add unit file monkey.service

This patch adds a unit file for systemd init system, as described in issue #39.
The installation of the unit file is triggered by the "--systemddir" passed to configure script, in the following way:
$ ./configure                           # no systemd unit file deployed
$ ./configure --systemddir              # Unit file systemd.service is created with default installation path "/lib/systemd/system"
$ ./configure --systemddir=CUSTOM_PATH  # Unit file systemd.service is created with installation path "CUSTOM_PATH"

The unit file is deployed is deployed using "make install" command, so you should also specify "--prefix" option for configure.

I tested the patch on archlinux and fedora (systemd init system) deploying the unit file in different system paths. The following commands were successful:
$ service monkey start
$ systemctl start monkey.service

I also tested on ubuntu (upstart init system), ensuring nothing is broken.

Signed-off-by: Vladimir Cernov <gg.kaspersky@gmail.com>
Merge pull request #123 from kaspersky/systemd

Systemd: add unit file monkey.service
Merge pull request #115 from kaspersky/master

Monkey configuration: add program options for configuration paths
Socket: handle new Kernel 3.14 tcp_autocorking feature.

the server use the TCP_CORK feature to instruct the Kernel to
wait for some data before dispatch it on the socket buffer. This
is a common approach when sending HTTP response headers and then
a content body (file data).

The Linux Kernel 3.14 introduce a new feature called 'tcp autocorking',
it basically do TCP_CORK by default based on specific conditions of
each socket status. This is a good approach to let the Kernel to decide
when it can be used and also it avoid user space to invoke two system
calls to enable/disable the TCP_CORK.

This patch makes the Server to validate if the new feature exists on the
running Kernel and if is enabled, it will disable all manual corking done,
for more details about how it works at Kernel level refer to the following
patch:

    http://goo.gl/AMFIuI

Note: on an older Kernel it will continue working as usual.

Signed-off-by: Eduardo Silva <edsiper@gmail.com>
HTTP: Fix comments' grammar and punctuation in mk_http.c
Merge pull request #125 from TamerTas/master

HTTP: Fix comments' grammar and punctuation in mk_http.c
Removing unnecessary conditionals from src/mk_http.c
Merge pull request #127 from tssavita/http-conditionals

HTTP: Removing unnecessary conditionals from src/mk_http.c