Added ngx.req.set_keepalive and ngx.req.get_keepalive to control the keepalive option for the request.
Added SSL support for TCP cosockets.
Multiple changes:
 - Now receive and send operations can be done simultaneous from several threads.
 - A different timeout can be set for receive and send.
 - Added fake_close for the client socket (ngx.req.socket), so that a thread that receives on this socket can be notified that we don't want to read from it anymore.
Added the option 'bsd_receive' to the receive method, which enables us to receive just like BSD's recv call, meaning the maximum number of bytes given.
This will only work only when a number is given as the first parameter for receive.
Note that this differs from the original LuaSocket API.
Added the lua_correct_location_header directive. If off, when setting the "Location" response header, Nginx won't try to make absolute in case it's relative.
Default is on.
Added two killing functions -
 ngx.thread.kill - kills a thread.
 ngx.thread.kill_sleeping - either kills immediately a sleeping thread, or, if the thread is not sleeping, can wait for it to end. Useful for a thread that has a loop in which it sleeps.
Lua subrequests - added support for passing the method optional parameter as a string.
If the method string isn't a known Nginx method, it is still passed (and Nginx considers it as unknown).
Added ngx.location.capture_stream, which enables a single subrequest to be performed in a streaming fashion.
Added fake_close to the raw socket as well.
del_thread doesn't remove the sleeping timer, which may cause segfaults when using ngx.thread.kill_sleeping.
Now removing the timer.
Added all necessary safe guards to protect the subrequest streaming feature.
Corrected the killing of a thread due to a useful review by @agentzh
It seems that this makes kill_sleeping unnecessary, so it was removed.
ngx_http_lua_socket_read_handler was declared twice...
Reverted unnecessary changes.
(cherry picked from commit e9e1dec69b88803a0080cbdbcb28151e31674fd9)
Reverted unnecessary changes.
Revereted unnecessary changes.
Reverted unnecessary changes.
Reverted unnecessary changes.
Made a correction in the safe guard of the capture streaming.
Previously, the resume handler was set to ngx_http_lua_subrequest_resume even when the subrequest is streaming, meaning the Lua code would return from a wrong context.
Fixed and tested.
Setting `ctx->writing_raw_req_socket` to 0 when the raw downstream socket is finalized, so that if `ngx_http_lua_wev_handler` runs after the raw downstream socket is closed, it won't try to call its read/write handler.