diff options
author | Andrei Belov <defan@nginx.com> | 2019-10-03 17:46:28 +0300 |
---|---|---|
committer | Andrei Belov <defan@nginx.com> | 2019-10-03 17:46:28 +0300 |
commit | 3dd3f861f4c3aa320aa137802f033f8f1fc7dc41 (patch) | |
tree | 357577c560920eb0f5837b7d073999f5c7a1a2cd /src/nxt_http_static.c | |
parent | 9de7aea721245cda9f079a2b29d8efaf99c440fd (diff) | |
parent | 59db9a3887211fccdaec04b7952ad0140090de22 (diff) | |
download | unit-3dd3f861f4c3aa320aa137802f033f8f1fc7dc41.tar.gz unit-3dd3f861f4c3aa320aa137802f033f8f1fc7dc41.tar.bz2 |
Merged with the default branch.
Diffstat (limited to '')
-rw-r--r-- | src/nxt_http_static.c | 14 |
1 files changed, 13 insertions, 1 deletions
diff --git a/src/nxt_http_static.c b/src/nxt_http_static.c index 44b85389..48a989cf 100644 --- a/src/nxt_http_static.c +++ b/src/nxt_http_static.c @@ -94,9 +94,20 @@ nxt_http_static_handler(nxt_task_t *task, nxt_http_request_t *r, if (nxt_slow_path(ret != NXT_OK)) { switch (f->error) { + /* + * For Unix domain sockets "errno" is set to: + * - ENXIO on Linux; + * - EOPNOTSUPP on *BSD, MacOSX, and Solaris. + */ + case NXT_ENOENT: case NXT_ENOTDIR: case NXT_ENAMETOOLONG: +#if (NXT_LINUX) + case NXT_ENXIO: +#else + case NXT_EOPNOTSUPP: +#endif level = NXT_LOG_ERR; status = NXT_HTTP_NOT_FOUND; break; @@ -209,7 +220,6 @@ nxt_http_static_handler(nxt_task_t *task, nxt_http_request_t *r, /* Not a file. */ nxt_file_close(task, f); - f = NULL; if (nxt_slow_path(!nxt_is_dir(&fi))) { nxt_log(task, NXT_LOG_ERR, "\"%FN\" is not a regular file", @@ -218,6 +228,8 @@ nxt_http_static_handler(nxt_task_t *task, nxt_http_request_t *r, return NULL; } + f = NULL; + r->status = NXT_HTTP_MOVED_PERMANENTLY; r->resp.content_length_n = 0; |