CGI: implement global CGI match rules

Signed-off-by: Eduardo Silva <edsiper@gmail.com>
Mimetype: remove lower case lookup

Signed-off-by: Eduardo Silva <edsiper@gmail.com>
polarssl: Don't return -1 from sendfile on EAGAIN.

If no data is sent, but EAGAIN is set, return 0 instead of the usual -1.
This is a workaround as EAGAIN isn't checked when sendfile is used in
core.

Signed-off-by: Sonny Karlsson <ksonny@lotrax.org>
polarssl: Rename polar_context_unset to context_unset.

Signed-off-by: Sonny Karlsson <ksonny@lotrax.org>
polarssl: Reset session in context_unset.

Signed-off-by: Sonny Karlsson <ksonny@lotrax.org>
polarssl: Use global entropy context.

Move entropy from thread context to global context.

Signed-off-by: Sonny Karlsson <ksonny@lotrax.org>
polarssl: Use dummy error_strerror() if not available.

Includes a dummy version of error_strerror() if POLARSSL_ERROR_C is
undefined and version <1.2.5.

Signed-off-by: Sonny Karlsson <ksonny@lotrax.org>
polarssl: Use DHM parameters from RFC5114 if available.

Uses built-in parameters and removes warnings if polarssl version >
1.2.0.

Signed-off-by: Sonny Karlsson <ksonny@lotrax.org>
polarssl: Fix assert failure on exit.

Return NULL if local contexts is requested outside worker threads.
Allows close calls from main process on exit.

Signed-off-by: Sonny Karlsson <ksonny@lotrax.org>
polarssl: Add support for TCP_FASTOPEN.

Signed-off-by: Sonny Karlsson <ksonny@lotrax.org>
mconf: List polarssl as https transport layer.

Signed-off-by: Sonny Karlsson <ksonny@lotrax.org>
Merge branch 'master' of ssh://git.monkey-project.com/srv/git/monkey
Configure: Fix #117: remove strip instructions

Signed-off-by: Eduardo Silva <edsiper@gmail.com>
CGI: Fix #174 / unhandled global rules

This patch Trac #174 problem, where the global rules for CGI
were not handled by the plugin. Now the plugin is able to run CGI
based scripts using rules from plugins/conf/cgi/cgi.conf.

Tested with simple Perl and PHP scripts.

Signed-off-by: Eduardo Silva <edsiper@gmail.com>
Merge fix for #174
PolarSSL: Fix makefile to link polarssl library properly

Signed-off-by: Eduardo Silva <edsiper@gmail.com>
PolarSSL: align configuration file indentation level

Signed-off-by: Eduardo Silva <edsiper@gmail.com>
Fixed bug #172. The problem was that the CONTENT_TYPE enviromental variable had to be set to application/x-www-form-urlencoded for the POST array to be accesed.Because the SHORTLEN value was not big enough the value copied on CONTENT_TYPE was application/x-www-form.

Signed-off-by: Eduardo Silva <edsiper@gmail.com>
Merge branch 'master' of ssh://git.monkey-project.com/srv/git/monkey
HTTP/API: Fix #161: restrict and validate return of MK_PLUGIN_RET_END.

This patch fix issue #161 where a plugin on stage_30 returns
MK_PLUGIN_RET_END without do nothing.

From now a STAGE_30 plugin when sending MK_PLUGIN_RET_END requires
that response HTTP headers have been sent, otherwise it will fail
with a mk_bug() from the plugin caller.

If the intention is to close the connection, use MK_PLUGIN_RET_CLOSE_CONX
instead.

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