plugin: Invoke stage_40 in http_request_end().

Fix a bug where stage_40 is never invoked if plugin ends request outside
of stage_* callbacks.

Bug discovered by mchubby
(github.com/ksonny/fastcgi-monkey-plugin/issues/1).

Signed-off-by: Sonny Karlsson <ksonny@lotrax.org>
fastcgi: Change event mode of fcgi_fd correctly.

Prevent fcgi_fd from causing error when write event occur when
receiving.

Signed-off-by: Sonny Karlsson <ksonny@lotrax.org>
Fix some remaining places from the monkey.h > libmonkey.h rename

Configure, man pages, and examples were not updated in
fd9c07d6ccc2fe8d37093bb213d375fbbd77cd29

Signed-off-by: Lauri Kasanen <cand@gmx.com>
cgi: Make sure stderr is handled
fastcgi: Remove use of strndup().

Signed-off-by: Sonny Karlsson <ksonny@lotrax.org>
Merge branch 'master' of monkey.io:/srv/git/monkey
Set close-on-exec flag on new connections
cgi: Don't access freed memory
cgi: Don't call close on self
cgi: Should return NEXT here
Debian: add missing 404.html file

Signed-off-by: Eduardo Silva <edsiper@gmail.com>
Scheduler: protect from zombie connections

Signed-off-by: Eduardo Silva <edsiper@gmail.com>
String: validate length of substring first.

This patch makes to validate the substring string length
to avoid extra memory allocation and release.

Signed-off-by: Zeying Xie <swpdtz@gmail.com>
Signed-off-by: Eduardo Silva <edsiper@gmail.com>
Config: Fix substring length for copy

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