Fix a typo in Pavel Brylov's configuration refactoring
Remove forgotten "auth_basic" from ngx_http_auth_basic_create_loc_conf()
Minor refactoring and cleanup

- Renamed ngx_ldap_server to ngx_http_auth_ldap_server_t.
- Used NGX_CONF_ANY instead of many NGX_CONF_TAKExxxx for the configuration
  option taking any number of arguments.
Remove ngx_ldap_userinfo and custom parsing of the Authorization header

The core fills both decoded user name and password into r->headers_in.user
or r->headers_in.passwd, respectively, when ngx_http_auth_basic_user() is
called. Maybe it did not work like this before, but there is definitely no
need to handle the decoding ourselves now (nginx 1.4.1).
Use ngx_http_complex_value_t instead of custom script handling

Makes the code smaller and cleaner by just using the core functionality.
Simplify processing of auth_ldap configuration directives
Resolve server names only once during configuration
Allow specifying the full user DN to avoid searching the LDAP

The configuration can now contain a directive like this
  require valid_user cn=$remote_user,dc=example,dc=com
which will result in the bind as the respective user to be the
only command sent to the server, skipping the search request.
Implement a per-process cache for increased performance

A configured number of cached (server,username,password) entries is held
for a configured amount of time to avoid repeated authentications for
each of several requests quickly following each other.
Add contribution notice to the licenses
Clean function order a bit before further big changes
Minor code formatting cleanup
Unification and small cleanup of log messages

Most importantly, all messages start with "http_auth_ldap: " now.
Handle LDAP operations asynchronously using nginx event architecture

A connection is opened using nginx framework and then fed to OpenLDAP using
ldap_init_fd() call with custom SockBuf IO handlers. When some credentials
need to be validated, ngx_http_auth_ldap_authenticate() is called multiple
times, returning NGX_AGAIN each time the process is waiting for the LDAP
server to reply.

(Note: This only an initial implementation and as such, it is of course
very buggy and limited. Further work is needed to make it useful.)
Open configurable amount of connections to all servers

Only one connection to the first server was opened up to now.
Fix intermittent authentication failures

Sometimes the authentication handler got called again just after the
search operation has been started, immediately failing because nothing
has been found yet. Added an extra safety check for these cases.
Implement reconnect when LDAP connection goes down
Update README.md
Merge remote-tracking branch 'upstream/master'
Merge pull request #16 from yirkha/master

Persistent asynchronous connections, credentials cache etc.