comparison src/core/ngx_file.c @ 7433:061ec464813f

Win32: removed NGX_DIR_MASK concept. Previous interface of ngx_open_dir() assumed that passed directory name has a room for NGX_DIR_MASK at the end (NGX_DIR_MASK_LEN bytes). While all direct users of ngx_dir_open() followed this interface, this also implied similar requirements for indirect uses - in particular, via ngx_walk_tree(). Currently none of ngx_walk_tree() uses provides appropriate space, and fixing this does not look like a right way to go. Instead, ngx_dir_open() interface was changed to not require any additional space and use appropriate allocations instead.
author Maxim Dounin <mdounin@mdounin.ru>
date Mon, 24 Dec 2018 21:07:05 +0300
parents 63a76a594dd8
children
comparison
equal deleted inserted replaced
7432:ecc97cb0eda4 7433:061ec464813f
1015 continue; 1015 continue;
1016 } 1016 }
1017 1017
1018 file.len = tree->len + 1 + len; 1018 file.len = tree->len + 1 + len;
1019 1019
1020 if (file.len + NGX_DIR_MASK_LEN > buf.len) { 1020 if (file.len > buf.len) {
1021 1021
1022 if (buf.len) { 1022 if (buf.len) {
1023 ngx_free(buf.data); 1023 ngx_free(buf.data);
1024 } 1024 }
1025 1025
1026 buf.len = tree->len + 1 + len + NGX_DIR_MASK_LEN; 1026 buf.len = tree->len + 1 + len;
1027 1027
1028 buf.data = ngx_alloc(buf.len + 1, ctx->log); 1028 buf.data = ngx_alloc(buf.len + 1, ctx->log);
1029 if (buf.data == NULL) { 1029 if (buf.data == NULL) {
1030 goto failed; 1030 goto failed;
1031 } 1031 }