Skip to content
Discussion options

You must be logged in to vote

You don't need to copy from the chain, you can use the data in-place or convert it to a Vec of &[u8] slice references (see ngx_output_chain_to_iovec for a rough example). The chain's data is guaranteed to live until you free it, pass to a chain writer (important for phase handlers other than content handler), or terminate the request.
The reallocation and copying is only necessary if you want a single contiguous buffer, and even then you'd want to avoid TemporaryBuffer/MemoryBuffer and use something like Vec backed by ngx_pool_t instead.

temp_file.file.info is a zero-initialized reserved storage for ngx_fd_info (fstat(2)) results. ngx_http_read_client_request_body does not use ngx_fd_info,…

Replies: 1 comment

Comment options

You must be logged in to vote
0 replies
Answer selected by pschyska
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants