나는 nginx 체인을 구성하는 nginx 모듈을 작성하고 나중에이 체인 버퍼를 nginx 임시 파일에 작성하여 나중에 사용한다.ngx_write_chain_to_temp_file을 올바르게 사용하는 방법은 무엇입니까?
// Create temp file to test
ngx_temp_file_t *tf;
tf = ngx_pcalloc(r->pool, sizeof (ngx_temp_file_t));
if (tf == NULL) {
return NGX_HTTP_INTERNAL_SERVER_ERROR;
}
tf->file.fd = NGX_INVALID_FILE;
tf->file.log = nlog;
tf->path = clcf->client_body_temp_path;
tf->pool = r->pool;
tf->log_level = r->request_body_file_log_level;
tf->persistent = r->request_body_in_persistent_file;
tf->clean = r->request_body_in_clean_file;
// if (r->request_body_file_group_access) {
// tf->access = 0660;
// }
if (ngx_create_temp_file(&tf->file, tf->path, tf->pool, tf->persistent, tf->clean, tf->access) != NGX_OK) {
return NGX_HTTP_INTERNAL_SERVER_ERROR;
}
if (ngx_write_chain_to_temp_file(tf, bucket->first) == NGX_ERROR) {
return NGX_HTTP_INTERNAL_SERVER_ERROR;
}
이 코드는 NGX_ERROR를 반환하지 않습니다,이 client_body_temporay_path에 nginx를 성공적으로 쓰기 임시 파일을 의미한다 : 나는 모든 페이지 및 유일한 해결책이 마련 검색 봤는데 울부 짖는 사람은? 그 대답은 네, 그 후, 나는 파일을 열려면 fopen을 사용하고, 그 파일은 존재하지 않습니까?
아무에게도 ngx_write_chain_to_temp_file을 (를) 처리하는 데 올바른 해결책을 제공 할 수 있습니까?