Merge pull request #601 from getcwd/master

Add synonym "lru"  for "purge_lru" in cache config
Support for repeated headers in responses in the Lua plugin

This is needed for WSAPI conformance, and important for having
good support of Set-Cookie.
Add a basic test app for the lua plugin
Merge pull request #603 from tizoc/master

Support for repeated headers in responses in the Lua plugin
Enabling OpenBSD support for uWSGI embedded config
better manage ready/accepting vassals states
Merge pull request #604 from blablacio/master

Enabling OpenBSD support for uWSGI embedded config
afaik only darwin misses objcopy
Support for graceful reload of mule processes.

- On reload master now signals mule with HUP instead of KILL.
- Added optional call to PyOS_AfterFork to enable cpython child
  processes to override and trap HUP signal.
- Copied cursed_at/no_mercy_at pattern used with worker processes.
- Added mule_reload_mercy option.
Merge pull request #602 from paulegan/mule-graceful-reload

Support for graceful reload of mule processes.
plugins/alarm_curl: turn on SMTP protocol

Compiler ignores SMTP support because enums CURLOPT_MAIL_RCPT and
CURLPROTO_SMTP are misused as macros for conditional compilation.

Replace the enums with real macro CURLPROTO_SMTP so compiler can
detect them.
plugins/alarm_curl: exit when requested protocol is not support

When SMTP is not supported by libcurl, or user doesn't provide
required URL for libcurl, throw an error message and then exit.
plugins/alarm_curl: free memory used during parsing args
plugins/alarm_curl: use CRLF instead of LF for line break in MIME

Though most programs accept LF, MIME RFC explicitly requires CRLF.
plugins/alarm_curl: add SSL option to skip certificate verification

The new option ssl_insecure is equivalent to curl command line
option --insecure or -k, which is useful for posting alarms via
HTTPS to a server with self-generated certificate installed.
plugins/alarm_curl: fix read callback function for libcurl

The read callback for libcurl shouldn't return size that is larger
than the requested size when it's too small to hold email header.
Otherwise curl will abort the operation. And we shouldn't return
1 (which is the current behavior) while there is no header at all.

The email header remains unchanged for each alarm_curl instance,
which means we don't have to generate it per alarm request. Based
on this, the solution is quite simple: we generate the header once
during initialization and use it for all alarms.
plugins/alarm_curl: fix race condition

A thread may run immediately after it's created. Trying to pass
parameter to thread using uwsgi_thread->data without preventing
the thread from accessing it first is a race condition. If the
thread accesses uwsgi_thread->data first, uwsgi gets killed by
SIGSEGV.

And creating a dedicated thread for each alarm_curl instance is
overkilling. If we worry libcurl would block the master process,
we set its timeout to small value or reuse the alarm thread created
by the master process.

This patch removes the dedicated thread for alarm_curl thus fixes
the problem. Next patch will make alarm_curl to reuse the alarm
thread created by the master process.
plugins/alarm_curl: use alarm thread to handle curl-based alarms

The alarm_curl instance created by the master process can be
accessed in the alarm thread without any problem because all
the data is stored in heap which is shared by the thread and
the master process.

Reusing the alarm thread for alarm_curl will eliminate the
need of creating dedicated thread from each alarm_curl instance
and prevent the alarm_curl from blocking the master process.