Mercurial > hg > nginx-quic
view src/os/unix/ngx_setaffinity.c @ 8222:967cfa6e2ff8
Request body: removed error assumption (ticket #2058).
Before introduction of request body filter in 42d9beeb22db, the only
possible return code from the ngx_http_request_body_filter() call
without actual buffers was NGX_HTTP_INTERNAL_SERVER_ERROR, and
the code in ngx_http_read_client_request_body() hardcoded the only
possible error to simplify the code of initial call to set rb->rest.
This is no longer true after introduction of request body filters though,
as a request body filter might need to return other errors, such as 403.
Fix is to preserve the error code actually returned by the call
instead of assuming 500.
author | Maxim Dounin <mdounin@mdounin.ru> |
---|---|
date | Mon, 09 Nov 2020 22:41:54 +0300 |
parents | 7296b38f6416 |
children |
line wrap: on
line source
/* * Copyright (C) Nginx, Inc. */ #include <ngx_config.h> #include <ngx_core.h> #if (NGX_HAVE_CPUSET_SETAFFINITY) void ngx_setaffinity(ngx_cpuset_t *cpu_affinity, ngx_log_t *log) { ngx_uint_t i; for (i = 0; i < CPU_SETSIZE; i++) { if (CPU_ISSET(i, cpu_affinity)) { ngx_log_error(NGX_LOG_NOTICE, log, 0, "cpuset_setaffinity(): using cpu #%ui", i); } } if (cpuset_setaffinity(CPU_LEVEL_WHICH, CPU_WHICH_PID, -1, sizeof(cpuset_t), cpu_affinity) == -1) { ngx_log_error(NGX_LOG_ALERT, log, ngx_errno, "cpuset_setaffinity() failed"); } } #elif (NGX_HAVE_SCHED_SETAFFINITY) void ngx_setaffinity(ngx_cpuset_t *cpu_affinity, ngx_log_t *log) { ngx_uint_t i; for (i = 0; i < CPU_SETSIZE; i++) { if (CPU_ISSET(i, cpu_affinity)) { ngx_log_error(NGX_LOG_NOTICE, log, 0, "sched_setaffinity(): using cpu #%ui", i); } } if (sched_setaffinity(0, sizeof(cpu_set_t), cpu_affinity) == -1) { ngx_log_error(NGX_LOG_ALERT, log, ngx_errno, "sched_setaffinity() failed"); } } #endif