Fixing body fd access racing condition.

To avoid closing the body fd prematurely, the fd value is moved from
the request struct to the app link.  The body fd should not be closed
immediately after the request is sent to the application due to possible
request rescheduling.
This commit is contained in:
Max Romanov
2020-03-17 14:44:11 +03:00
parent efbcd517fc
commit c6f9ca79e6
3 changed files with 32 additions and 18 deletions

View File

@@ -50,6 +50,7 @@ struct nxt_request_app_link_s {
nxt_http_request_t *request;
nxt_msg_info_t msg_info;
nxt_request_rpc_data_t *req_rpc_data;
nxt_fd_t body_fd;
nxt_nsec_t res_time;