Mercurial > hg > nginx
annotate src/os/win32/ngx_files.h @ 9322:d6f75dd66761 default tip
Mp4: added and updated sanity checks for "end" handling.
When handling incorrect data in ngx_http_mp4_crop_stsc_data(),
trak->end_chunk_samples might end up being arbitrary large, leading
to reading before the buffer in ngx_http_mp4_update_stsz_atom(). Fix
is to check that trak->end_chunk_samples corresponds to a memory within
the stsz atom data. For consistency, trak->start_chunk_samples
is checked similarly.
Similarly, trak->end_chunk might end up being smaller than trak->start_chunk,
leading to reading memory after the buffer in ngx_http_mp4_update_stco_atom()
and ngx_http_mp4_update_co64_atom(). Corresponding checks are updated
to explicitly test (trak->end_chunk - trak->start_chunk) instead of just
checking trak->end_chunk and assuming it is larger than trak->start_chunk.
This is generally in line with existing checks of
(trak->end_sample - trak->start_sample) in ngx_http_mp4_update_stsz_atom(),
where trak->end_sample might also become smaller than trak->start_sample
when handling incorrect data in ngx_http_mp4_crop_stts_data().
author | Maxim Dounin <mdounin@mdounin.ru> |
---|---|
date | Sun, 25 Aug 2024 06:35:40 +0300 |
parents | e818ed227735 |
children |
rev | line source |
---|---|
441
da8c5707af39
nginx-0.1.0-2004-09-28-12:34:51 import; set copyright and remove unused files
Igor Sysoev <igor@sysoev.ru>
parents:
336
diff
changeset
|
1 |
da8c5707af39
nginx-0.1.0-2004-09-28-12:34:51 import; set copyright and remove unused files
Igor Sysoev <igor@sysoev.ru>
parents:
336
diff
changeset
|
2 /* |
444
42d11f017717
nginx-0.1.0-2004-09-29-20:00:49 import; remove years from copyright
Igor Sysoev <igor@sysoev.ru>
parents:
441
diff
changeset
|
3 * Copyright (C) Igor Sysoev |
4412 | 4 * Copyright (C) Nginx, Inc. |
441
da8c5707af39
nginx-0.1.0-2004-09-28-12:34:51 import; set copyright and remove unused files
Igor Sysoev <igor@sysoev.ru>
parents:
336
diff
changeset
|
5 */ |
da8c5707af39
nginx-0.1.0-2004-09-28-12:34:51 import; set copyright and remove unused files
Igor Sysoev <igor@sysoev.ru>
parents:
336
diff
changeset
|
6 |
da8c5707af39
nginx-0.1.0-2004-09-28-12:34:51 import; set copyright and remove unused files
Igor Sysoev <igor@sysoev.ru>
parents:
336
diff
changeset
|
7 |
8
708f8bb772ec
nginx-0.0.1-2002-09-02-18:48:24 import
Igor Sysoev <igor@sysoev.ru>
parents:
6
diff
changeset
|
8 #ifndef _NGX_FILES_H_INCLUDED_ |
708f8bb772ec
nginx-0.0.1-2002-09-02-18:48:24 import
Igor Sysoev <igor@sysoev.ru>
parents:
6
diff
changeset
|
9 #define _NGX_FILES_H_INCLUDED_ |
3
34a521b1a148
nginx-0.0.1-2002-08-20-18:48:28 import
Igor Sysoev <igor@sysoev.ru>
parents:
diff
changeset
|
10 |
34a521b1a148
nginx-0.0.1-2002-08-20-18:48:28 import
Igor Sysoev <igor@sysoev.ru>
parents:
diff
changeset
|
11 |
34a521b1a148
nginx-0.0.1-2002-08-20-18:48:28 import
Igor Sysoev <igor@sysoev.ru>
parents:
diff
changeset
|
12 #include <ngx_config.h> |
100
7ebc8b7fb816
nginx-0.0.1-2003-06-03-19:42:58 import
Igor Sysoev <igor@sysoev.ru>
parents:
99
diff
changeset
|
13 #include <ngx_core.h> |
57
a499e0d1f16e
nginx-0.0.1-2003-01-30-10:28:09 import
Igor Sysoev <igor@sysoev.ru>
parents:
28
diff
changeset
|
14 |
3
34a521b1a148
nginx-0.0.1-2002-08-20-18:48:28 import
Igor Sysoev <igor@sysoev.ru>
parents:
diff
changeset
|
15 |
2234
c7c319896bb4
*) autoconfigure struct dirent capabilities
Igor Sysoev <igor@sysoev.ru>
parents:
2232
diff
changeset
|
16 typedef HANDLE ngx_fd_t; |
c7c319896bb4
*) autoconfigure struct dirent capabilities
Igor Sysoev <igor@sysoev.ru>
parents:
2232
diff
changeset
|
17 typedef BY_HANDLE_FILE_INFORMATION ngx_file_info_t; |
c7c319896bb4
*) autoconfigure struct dirent capabilities
Igor Sysoev <igor@sysoev.ru>
parents:
2232
diff
changeset
|
18 typedef uint64_t ngx_file_uniq_t; |
c7c319896bb4
*) autoconfigure struct dirent capabilities
Igor Sysoev <igor@sysoev.ru>
parents:
2232
diff
changeset
|
19 |
3651 | 20 |
21 typedef struct { | |
22 u_char *name; | |
23 size_t size; | |
24 void *addr; | |
25 ngx_fd_t fd; | |
26 HANDLE handle; | |
27 ngx_log_t *log; | |
28 } ngx_file_mapping_t; | |
29 | |
30 | |
2234
c7c319896bb4
*) autoconfigure struct dirent capabilities
Igor Sysoev <igor@sysoev.ru>
parents:
2232
diff
changeset
|
31 typedef struct { |
c7c319896bb4
*) autoconfigure struct dirent capabilities
Igor Sysoev <igor@sysoev.ru>
parents:
2232
diff
changeset
|
32 HANDLE dir; |
8130
b0a06c50c1b4
Win32: non-ASCII names support in autoindex (ticket #458).
Maxim Dounin <mdounin@mdounin.ru>
parents:
7670
diff
changeset
|
33 WIN32_FIND_DATAW finddata; |
b0a06c50c1b4
Win32: non-ASCII names support in autoindex (ticket #458).
Maxim Dounin <mdounin@mdounin.ru>
parents:
7670
diff
changeset
|
34 |
b0a06c50c1b4
Win32: non-ASCII names support in autoindex (ticket #458).
Maxim Dounin <mdounin@mdounin.ru>
parents:
7670
diff
changeset
|
35 u_char *name; |
b0a06c50c1b4
Win32: non-ASCII names support in autoindex (ticket #458).
Maxim Dounin <mdounin@mdounin.ru>
parents:
7670
diff
changeset
|
36 size_t namelen; |
b0a06c50c1b4
Win32: non-ASCII names support in autoindex (ticket #458).
Maxim Dounin <mdounin@mdounin.ru>
parents:
7670
diff
changeset
|
37 size_t allocated; |
2234
c7c319896bb4
*) autoconfigure struct dirent capabilities
Igor Sysoev <igor@sysoev.ru>
parents:
2232
diff
changeset
|
38 |
c7c319896bb4
*) autoconfigure struct dirent capabilities
Igor Sysoev <igor@sysoev.ru>
parents:
2232
diff
changeset
|
39 unsigned valid_info:1; |
3200
26784c34e8be
*) reset cached dirent.d_type after stat()
Igor Sysoev <igor@sysoev.ru>
parents:
3178
diff
changeset
|
40 unsigned type:1; |
2234
c7c319896bb4
*) autoconfigure struct dirent capabilities
Igor Sysoev <igor@sysoev.ru>
parents:
2232
diff
changeset
|
41 unsigned ready:1; |
c7c319896bb4
*) autoconfigure struct dirent capabilities
Igor Sysoev <igor@sysoev.ru>
parents:
2232
diff
changeset
|
42 } ngx_dir_t; |
c7c319896bb4
*) autoconfigure struct dirent capabilities
Igor Sysoev <igor@sysoev.ru>
parents:
2232
diff
changeset
|
43 |
c7c319896bb4
*) autoconfigure struct dirent capabilities
Igor Sysoev <igor@sysoev.ru>
parents:
2232
diff
changeset
|
44 |
c7c319896bb4
*) autoconfigure struct dirent capabilities
Igor Sysoev <igor@sysoev.ru>
parents:
2232
diff
changeset
|
45 typedef struct { |
c7c319896bb4
*) autoconfigure struct dirent capabilities
Igor Sysoev <igor@sysoev.ru>
parents:
2232
diff
changeset
|
46 HANDLE dir; |
8131
751f79bd802c
Win32: non-ASCII names support in "include" with wildcards.
Maxim Dounin <mdounin@mdounin.ru>
parents:
8130
diff
changeset
|
47 WIN32_FIND_DATAW finddata; |
2234
c7c319896bb4
*) autoconfigure struct dirent capabilities
Igor Sysoev <igor@sysoev.ru>
parents:
2232
diff
changeset
|
48 |
c7c319896bb4
*) autoconfigure struct dirent capabilities
Igor Sysoev <igor@sysoev.ru>
parents:
2232
diff
changeset
|
49 unsigned ready:1; |
c7c319896bb4
*) autoconfigure struct dirent capabilities
Igor Sysoev <igor@sysoev.ru>
parents:
2232
diff
changeset
|
50 unsigned test:1; |
c7c319896bb4
*) autoconfigure struct dirent capabilities
Igor Sysoev <igor@sysoev.ru>
parents:
2232
diff
changeset
|
51 unsigned no_match:1; |
c7c319896bb4
*) autoconfigure struct dirent capabilities
Igor Sysoev <igor@sysoev.ru>
parents:
2232
diff
changeset
|
52 |
c7c319896bb4
*) autoconfigure struct dirent capabilities
Igor Sysoev <igor@sysoev.ru>
parents:
2232
diff
changeset
|
53 u_char *pattern; |
c7c319896bb4
*) autoconfigure struct dirent capabilities
Igor Sysoev <igor@sysoev.ru>
parents:
2232
diff
changeset
|
54 ngx_str_t name; |
c7c319896bb4
*) autoconfigure struct dirent capabilities
Igor Sysoev <igor@sysoev.ru>
parents:
2232
diff
changeset
|
55 size_t last; |
c7c319896bb4
*) autoconfigure struct dirent capabilities
Igor Sysoev <igor@sysoev.ru>
parents:
2232
diff
changeset
|
56 ngx_log_t *log; |
c7c319896bb4
*) autoconfigure struct dirent capabilities
Igor Sysoev <igor@sysoev.ru>
parents:
2232
diff
changeset
|
57 } ngx_glob_t; |
c7c319896bb4
*) autoconfigure struct dirent capabilities
Igor Sysoev <igor@sysoev.ru>
parents:
2232
diff
changeset
|
58 |
c7c319896bb4
*) autoconfigure struct dirent capabilities
Igor Sysoev <igor@sysoev.ru>
parents:
2232
diff
changeset
|
59 |
c7c319896bb4
*) autoconfigure struct dirent capabilities
Igor Sysoev <igor@sysoev.ru>
parents:
2232
diff
changeset
|
60 |
183
4c698194c56d
nginx-0.0.1-2003-11-13-19:16:33 import
Igor Sysoev <igor@sysoev.ru>
parents:
182
diff
changeset
|
61 /* INVALID_FILE_ATTRIBUTES is specified but not defined at least in MSVC6SP2 */ |
3
34a521b1a148
nginx-0.0.1-2002-08-20-18:48:28 import
Igor Sysoev <igor@sysoev.ru>
parents:
diff
changeset
|
62 #ifndef INVALID_FILE_ATTRIBUTES |
183
4c698194c56d
nginx-0.0.1-2003-11-13-19:16:33 import
Igor Sysoev <igor@sysoev.ru>
parents:
182
diff
changeset
|
63 #define INVALID_FILE_ATTRIBUTES 0xffffffff |
3
34a521b1a148
nginx-0.0.1-2002-08-20-18:48:28 import
Igor Sysoev <igor@sysoev.ru>
parents:
diff
changeset
|
64 #endif |
34a521b1a148
nginx-0.0.1-2002-08-20-18:48:28 import
Igor Sysoev <igor@sysoev.ru>
parents:
diff
changeset
|
65 |
183
4c698194c56d
nginx-0.0.1-2003-11-13-19:16:33 import
Igor Sysoev <igor@sysoev.ru>
parents:
182
diff
changeset
|
66 /* INVALID_SET_FILE_POINTER is not defined at least in MSVC6SP2 */ |
4c698194c56d
nginx-0.0.1-2003-11-13-19:16:33 import
Igor Sysoev <igor@sysoev.ru>
parents:
182
diff
changeset
|
67 #ifndef INVALID_SET_FILE_POINTER |
4c698194c56d
nginx-0.0.1-2003-11-13-19:16:33 import
Igor Sysoev <igor@sysoev.ru>
parents:
182
diff
changeset
|
68 #define INVALID_SET_FILE_POINTER 0xffffffff |
4c698194c56d
nginx-0.0.1-2003-11-13-19:16:33 import
Igor Sysoev <igor@sysoev.ru>
parents:
182
diff
changeset
|
69 #endif |
4c698194c56d
nginx-0.0.1-2003-11-13-19:16:33 import
Igor Sysoev <igor@sysoev.ru>
parents:
182
diff
changeset
|
70 |
4c698194c56d
nginx-0.0.1-2003-11-13-19:16:33 import
Igor Sysoev <igor@sysoev.ru>
parents:
182
diff
changeset
|
71 |
26
53cb81681040
nginx-0.0.1-2002-12-15-09:25:09 import
Igor Sysoev <igor@sysoev.ru>
parents:
8
diff
changeset
|
72 #define NGX_INVALID_FILE INVALID_HANDLE_VALUE |
53cb81681040
nginx-0.0.1-2002-12-15-09:25:09 import
Igor Sysoev <igor@sysoev.ru>
parents:
8
diff
changeset
|
73 #define NGX_FILE_ERROR 0 |
53cb81681040
nginx-0.0.1-2002-12-15-09:25:09 import
Igor Sysoev <igor@sysoev.ru>
parents:
8
diff
changeset
|
74 |
3
34a521b1a148
nginx-0.0.1-2002-08-20-18:48:28 import
Igor Sysoev <igor@sysoev.ru>
parents:
diff
changeset
|
75 |
2628
64a10d6b97bd
win32 ngx_open_file() supports utf8 names and NGX_FILE_APPEND
Igor Sysoev <igor@sysoev.ru>
parents:
2615
diff
changeset
|
76 ngx_fd_t ngx_open_file(u_char *name, u_long mode, u_long create, u_long access); |
99
a059e1aa65d4
nginx-0.0.1-2003-06-02-19:24:30 import
Igor Sysoev <igor@sysoev.ru>
parents:
98
diff
changeset
|
77 #define ngx_open_file_n "CreateFile()" |
a059e1aa65d4
nginx-0.0.1-2003-06-02-19:24:30 import
Igor Sysoev <igor@sysoev.ru>
parents:
98
diff
changeset
|
78 |
a059e1aa65d4
nginx-0.0.1-2003-06-02-19:24:30 import
Igor Sysoev <igor@sysoev.ru>
parents:
98
diff
changeset
|
79 #define NGX_FILE_RDONLY GENERIC_READ |
1054 | 80 #define NGX_FILE_WRONLY GENERIC_WRITE |
99
a059e1aa65d4
nginx-0.0.1-2003-06-02-19:24:30 import
Igor Sysoev <igor@sysoev.ru>
parents:
98
diff
changeset
|
81 #define NGX_FILE_RDWR GENERIC_READ|GENERIC_WRITE |
2628
64a10d6b97bd
win32 ngx_open_file() supports utf8 names and NGX_FILE_APPEND
Igor Sysoev <igor@sysoev.ru>
parents:
2615
diff
changeset
|
82 #define NGX_FILE_APPEND FILE_APPEND_DATA|SYNCHRONIZE |
3497
ac281bc4c187
use non-blocking open() not to hang on FIFO files, etc.
Igor Sysoev <igor@sysoev.ru>
parents:
3382
diff
changeset
|
83 #define NGX_FILE_NONBLOCK 0 |
2628
64a10d6b97bd
win32 ngx_open_file() supports utf8 names and NGX_FILE_APPEND
Igor Sysoev <igor@sysoev.ru>
parents:
2615
diff
changeset
|
84 |
99
a059e1aa65d4
nginx-0.0.1-2003-06-02-19:24:30 import
Igor Sysoev <igor@sysoev.ru>
parents:
98
diff
changeset
|
85 #define NGX_FILE_CREATE_OR_OPEN OPEN_ALWAYS |
a059e1aa65d4
nginx-0.0.1-2003-06-02-19:24:30 import
Igor Sysoev <igor@sysoev.ru>
parents:
98
diff
changeset
|
86 #define NGX_FILE_OPEN OPEN_EXISTING |
2686
9e0ae986b587
adopt NGX_FILE_TRUNCATE for win32
Igor Sysoev <igor@sysoev.ru>
parents:
2628
diff
changeset
|
87 #define NGX_FILE_TRUNCATE CREATE_ALWAYS |
100
7ebc8b7fb816
nginx-0.0.1-2003-06-03-19:42:58 import
Igor Sysoev <igor@sysoev.ru>
parents:
99
diff
changeset
|
88 |
1048
c4f666fc3a7e
ngx_open_file(name, access, create) > ngx_open_file(name, mode, create, access)
Igor Sysoev <igor@sysoev.ru>
parents:
1047
diff
changeset
|
89 #define NGX_FILE_DEFAULT_ACCESS 0 |
2592
3a8a53c0c42f
a prelimiary proxy cache support
Igor Sysoev <igor@sysoev.ru>
parents:
2461
diff
changeset
|
90 #define NGX_FILE_OWNER_ACCESS 0 |
1048
c4f666fc3a7e
ngx_open_file(name, access, create) > ngx_open_file(name, mode, create, access)
Igor Sysoev <igor@sysoev.ru>
parents:
1047
diff
changeset
|
91 |
100
7ebc8b7fb816
nginx-0.0.1-2003-06-03-19:42:58 import
Igor Sysoev <igor@sysoev.ru>
parents:
99
diff
changeset
|
92 |
8139
e818ed227735
Win32: non-ASCII names support in ngx_open_tempfile().
Maxim Dounin <mdounin@mdounin.ru>
parents:
8138
diff
changeset
|
93 ngx_fd_t ngx_open_tempfile(u_char *name, ngx_uint_t persistent, |
e818ed227735
Win32: non-ASCII names support in ngx_open_tempfile().
Maxim Dounin <mdounin@mdounin.ru>
parents:
8138
diff
changeset
|
94 ngx_uint_t access); |
92
19cc647ecd91
nginx-0.0.1-2003-05-20-19:37:55 import
Igor Sysoev <igor@sysoev.ru>
parents:
74
diff
changeset
|
95 #define ngx_open_tempfile_n "CreateFile()" |
19cc647ecd91
nginx-0.0.1-2003-05-20-19:37:55 import
Igor Sysoev <igor@sysoev.ru>
parents:
74
diff
changeset
|
96 |
19cc647ecd91
nginx-0.0.1-2003-05-20-19:37:55 import
Igor Sysoev <igor@sysoev.ru>
parents:
74
diff
changeset
|
97 |
26
53cb81681040
nginx-0.0.1-2002-12-15-09:25:09 import
Igor Sysoev <igor@sysoev.ru>
parents:
8
diff
changeset
|
98 #define ngx_close_file CloseHandle |
53cb81681040
nginx-0.0.1-2002-12-15-09:25:09 import
Igor Sysoev <igor@sysoev.ru>
parents:
8
diff
changeset
|
99 #define ngx_close_file_n "CloseHandle()" |
3
34a521b1a148
nginx-0.0.1-2002-08-20-18:48:28 import
Igor Sysoev <igor@sysoev.ru>
parents:
diff
changeset
|
100 |
186
c1f3a3c7c5db
nginx-0.0.1-2003-11-17-00:49:42 import
Igor Sysoev <igor@sysoev.ru>
parents:
185
diff
changeset
|
101 |
1634
d3cbb96818f1
fix win32 ngx_read_fd() and ngx_write_fd()
Igor Sysoev <igor@sysoev.ru>
parents:
1632
diff
changeset
|
102 ssize_t ngx_read_fd(ngx_fd_t fd, void *buf, size_t size); |
1055 | 103 #define ngx_read_fd_n "ReadFile()" |
104 | |
1634
d3cbb96818f1
fix win32 ngx_read_fd() and ngx_write_fd()
Igor Sysoev <igor@sysoev.ru>
parents:
1632
diff
changeset
|
105 |
d3cbb96818f1
fix win32 ngx_read_fd() and ngx_write_fd()
Igor Sysoev <igor@sysoev.ru>
parents:
1632
diff
changeset
|
106 ssize_t ngx_write_fd(ngx_fd_t fd, void *buf, size_t size); |
1055 | 107 #define ngx_write_fd_n "WriteFile()" |
108 | |
1634
d3cbb96818f1
fix win32 ngx_read_fd() and ngx_write_fd()
Igor Sysoev <igor@sysoev.ru>
parents:
1632
diff
changeset
|
109 |
2769
9d986c4e796f
introduce ngx_write_console() to support OEM code pages
Igor Sysoev <igor@sysoev.ru>
parents:
2758
diff
changeset
|
110 ssize_t ngx_write_console(ngx_fd_t fd, void *buf, size_t size); |
9d986c4e796f
introduce ngx_write_console() to support OEM code pages
Igor Sysoev <igor@sysoev.ru>
parents:
2758
diff
changeset
|
111 |
9d986c4e796f
introduce ngx_write_console() to support OEM code pages
Igor Sysoev <igor@sysoev.ru>
parents:
2758
diff
changeset
|
112 |
571 | 113 #define ngx_linefeed(p) *p++ = CR; *p++ = LF; |
114 #define NGX_LINEFEED_SIZE 2 | |
4283
f72496073689
Introduction of simple ngx_write_stderr() instead of ngx_log_stderr()
Igor Sysoev <igor@sysoev.ru>
parents:
3970
diff
changeset
|
115 #define NGX_LINEFEED CRLF |
571 | 116 |
117 | |
8137
4b06186670ed
Win32: non-ASCII names support in ngx_delete_file().
Maxim Dounin <mdounin@mdounin.ru>
parents:
8134
diff
changeset
|
118 ngx_int_t ngx_delete_file(u_char *name); |
186
c1f3a3c7c5db
nginx-0.0.1-2003-11-17-00:49:42 import
Igor Sysoev <igor@sysoev.ru>
parents:
185
diff
changeset
|
119 #define ngx_delete_file_n "DeleteFile()" |
c1f3a3c7c5db
nginx-0.0.1-2003-11-17-00:49:42 import
Igor Sysoev <igor@sysoev.ru>
parents:
185
diff
changeset
|
120 |
180
2d143372a1ee
nginx-0.0.1-2003-11-12-01:16:11 import
Igor Sysoev <igor@sysoev.ru>
parents:
179
diff
changeset
|
121 |
8138
96d894b38667
Win32: non-ASCII names support in ngx_rename_file().
Maxim Dounin <mdounin@mdounin.ru>
parents:
8137
diff
changeset
|
122 ngx_int_t ngx_rename_file(u_char *from, u_char *to); |
186
c1f3a3c7c5db
nginx-0.0.1-2003-11-17-00:49:42 import
Igor Sysoev <igor@sysoev.ru>
parents:
185
diff
changeset
|
123 #define ngx_rename_file_n "MoveFile()" |
3382
6be1f25bae90
fix Win32 error messages when an temporary file replaces an existent file:
Igor Sysoev <igor@sysoev.ru>
parents:
3200
diff
changeset
|
124 ngx_err_t ngx_win32_rename_file(ngx_str_t *from, ngx_str_t *to, ngx_log_t *log); |
74
17ab1af8c3dd
nginx-0.0.1-2003-04-11-20:01:14 import
Igor Sysoev <igor@sysoev.ru>
parents:
57
diff
changeset
|
125 |
186
c1f3a3c7c5db
nginx-0.0.1-2003-11-17-00:49:42 import
Igor Sysoev <igor@sysoev.ru>
parents:
185
diff
changeset
|
126 |
681 | 127 |
128 ngx_int_t ngx_set_file_time(u_char *name, ngx_fd_t fd, time_t s); | |
129 #define ngx_set_file_time_n "SetFileTime()" | |
130 | |
131 | |
467 | 132 ngx_int_t ngx_file_info(u_char *filename, ngx_file_info_t *fi); |
186
c1f3a3c7c5db
nginx-0.0.1-2003-11-17-00:49:42 import
Igor Sysoev <igor@sysoev.ru>
parents:
185
diff
changeset
|
133 #define ngx_file_info_n "GetFileAttributesEx()" |
3
34a521b1a148
nginx-0.0.1-2002-08-20-18:48:28 import
Igor Sysoev <igor@sysoev.ru>
parents:
diff
changeset
|
134 |
186
c1f3a3c7c5db
nginx-0.0.1-2003-11-17-00:49:42 import
Igor Sysoev <igor@sysoev.ru>
parents:
185
diff
changeset
|
135 |
c1f3a3c7c5db
nginx-0.0.1-2003-11-17-00:49:42 import
Igor Sysoev <igor@sysoev.ru>
parents:
185
diff
changeset
|
136 #define ngx_fd_info(fd, fi) GetFileInformationByHandle(fd, fi) |
681 | 137 #define ngx_fd_info_n "GetFileInformationByHandle()" |
186
c1f3a3c7c5db
nginx-0.0.1-2003-11-17-00:49:42 import
Igor Sysoev <igor@sysoev.ru>
parents:
185
diff
changeset
|
138 |
3
34a521b1a148
nginx-0.0.1-2002-08-20-18:48:28 import
Igor Sysoev <igor@sysoev.ru>
parents:
diff
changeset
|
139 |
3501
423ff11e3018
use lstat() for WebDAV DELETE, COPY, and MOVE to handle symlinks
Igor Sysoev <igor@sysoev.ru>
parents:
3497
diff
changeset
|
140 #define ngx_link_info(name, fi) ngx_file_info(name, fi) |
423ff11e3018
use lstat() for WebDAV DELETE, COPY, and MOVE to handle symlinks
Igor Sysoev <igor@sysoev.ru>
parents:
3497
diff
changeset
|
141 #define ngx_link_info_n "GetFileAttributesEx()" |
423ff11e3018
use lstat() for WebDAV DELETE, COPY, and MOVE to handle symlinks
Igor Sysoev <igor@sysoev.ru>
parents:
3497
diff
changeset
|
142 |
423ff11e3018
use lstat() for WebDAV DELETE, COPY, and MOVE to handle symlinks
Igor Sysoev <igor@sysoev.ru>
parents:
3497
diff
changeset
|
143 |
2461 | 144 #define ngx_is_dir(fi) \ |
145 (((fi)->dwFileAttributes & FILE_ATTRIBUTE_DIRECTORY) != 0) | |
146 #define ngx_is_file(fi) \ | |
147 (((fi)->dwFileAttributes & FILE_ATTRIBUTE_DIRECTORY) == 0) | |
669 | 148 #define ngx_is_link(fi) 0 |
1436 | 149 #define ngx_is_exec(fi) 0 |
186
c1f3a3c7c5db
nginx-0.0.1-2003-11-17-00:49:42 import
Igor Sysoev <igor@sysoev.ru>
parents:
185
diff
changeset
|
150 |
1053
b9fa23cda4cc
ngx_file_access() and ngx_de_access()
Igor Sysoev <igor@sysoev.ru>
parents:
1050
diff
changeset
|
151 #define ngx_file_access(fi) 0 |
3
34a521b1a148
nginx-0.0.1-2002-08-20-18:48:28 import
Igor Sysoev <igor@sysoev.ru>
parents:
diff
changeset
|
152 |
186
c1f3a3c7c5db
nginx-0.0.1-2003-11-17-00:49:42 import
Igor Sysoev <igor@sysoev.ru>
parents:
185
diff
changeset
|
153 #define ngx_file_size(fi) \ |
497 | 154 (((off_t) (fi)->nFileSizeHigh << 32) | (fi)->nFileSizeLow) |
3899
e7cd13b7f759
Use more precise stat.st_blocks to account cache size on Unix
Igor Sysoev <igor@sysoev.ru>
parents:
3651
diff
changeset
|
155 #define ngx_file_fs_size(fi) ngx_file_size(fi) |
3
34a521b1a148
nginx-0.0.1-2002-08-20-18:48:28 import
Igor Sysoev <igor@sysoev.ru>
parents:
diff
changeset
|
156 |
186
c1f3a3c7c5db
nginx-0.0.1-2003-11-17-00:49:42 import
Igor Sysoev <igor@sysoev.ru>
parents:
185
diff
changeset
|
157 #define ngx_file_uniq(fi) (*(ngx_file_uniq_t *) &(fi)->nFileIndexHigh) |
3
34a521b1a148
nginx-0.0.1-2002-08-20-18:48:28 import
Igor Sysoev <igor@sysoev.ru>
parents:
diff
changeset
|
158 |
179
9f3a78b06c48
nginx-0.0.1-2003-11-11-21:13:43 import
Igor Sysoev <igor@sysoev.ru>
parents:
176
diff
changeset
|
159 |
9f3a78b06c48
nginx-0.0.1-2003-11-11-21:13:43 import
Igor Sysoev <igor@sysoev.ru>
parents:
176
diff
changeset
|
160 /* 116444736000000000 is commented in src/os/win32/ngx_time.c */ |
26
53cb81681040
nginx-0.0.1-2002-12-15-09:25:09 import
Igor Sysoev <igor@sysoev.ru>
parents:
8
diff
changeset
|
161 |
186
c1f3a3c7c5db
nginx-0.0.1-2003-11-17-00:49:42 import
Igor Sysoev <igor@sysoev.ru>
parents:
185
diff
changeset
|
162 #define ngx_file_mtime(fi) \ |
c1f3a3c7c5db
nginx-0.0.1-2003-11-17-00:49:42 import
Igor Sysoev <igor@sysoev.ru>
parents:
185
diff
changeset
|
163 (time_t) (((((unsigned __int64) (fi)->ftLastWriteTime.dwHighDateTime << 32) \ |
c1f3a3c7c5db
nginx-0.0.1-2003-11-17-00:49:42 import
Igor Sysoev <igor@sysoev.ru>
parents:
185
diff
changeset
|
164 | (fi)->ftLastWriteTime.dwLowDateTime) \ |
26
53cb81681040
nginx-0.0.1-2002-12-15-09:25:09 import
Igor Sysoev <igor@sysoev.ru>
parents:
8
diff
changeset
|
165 - 116444736000000000) / 10000000) |
53cb81681040
nginx-0.0.1-2002-12-15-09:25:09 import
Igor Sysoev <igor@sysoev.ru>
parents:
8
diff
changeset
|
166 |
3651 | 167 ngx_int_t ngx_create_file_mapping(ngx_file_mapping_t *fm); |
168 void ngx_close_file_mapping(ngx_file_mapping_t *fm); | |
169 | |
170 | |
4564
13eb3193cd63
Fixed win32 build after realpath changes in r4559.
Maxim Dounin <mdounin@mdounin.ru>
parents:
4558
diff
changeset
|
171 u_char *ngx_realpath(u_char *path, u_char *resolved); |
2259 | 172 #define ngx_realpath_n "" |
8132
8ea2e052feb4
Win32: non-ASCII directory names support in ngx_getcwd().
Maxim Dounin <mdounin@mdounin.ru>
parents:
8131
diff
changeset
|
173 |
8ea2e052feb4
Win32: non-ASCII directory names support in ngx_getcwd().
Maxim Dounin <mdounin@mdounin.ru>
parents:
8131
diff
changeset
|
174 |
8ea2e052feb4
Win32: non-ASCII directory names support in ngx_getcwd().
Maxim Dounin <mdounin@mdounin.ru>
parents:
8131
diff
changeset
|
175 size_t ngx_getcwd(u_char *buf, size_t size); |
336
ca9a7f8c86da
nginx-0.0.3-2004-05-18-19:29:08 import
Igor Sysoev <igor@sysoev.ru>
parents:
292
diff
changeset
|
176 #define ngx_getcwd_n "GetCurrentDirectory()" |
8132
8ea2e052feb4
Win32: non-ASCII directory names support in ngx_getcwd().
Maxim Dounin <mdounin@mdounin.ru>
parents:
8131
diff
changeset
|
177 |
8ea2e052feb4
Win32: non-ASCII directory names support in ngx_getcwd().
Maxim Dounin <mdounin@mdounin.ru>
parents:
8131
diff
changeset
|
178 |
2744 | 179 #define ngx_path_separator(c) ((c) == '/' || (c) == '\\') |
180 | |
4558
8865fd1f3aa5
Fixed unconditional MAX_PATH usage (ticket #22).
Maxim Dounin <mdounin@mdounin.ru>
parents:
4412
diff
changeset
|
181 #define NGX_HAVE_MAX_PATH 1 |
336
ca9a7f8c86da
nginx-0.0.3-2004-05-18-19:29:08 import
Igor Sysoev <igor@sysoev.ru>
parents:
292
diff
changeset
|
182 #define NGX_MAX_PATH MAX_PATH |
ca9a7f8c86da
nginx-0.0.3-2004-05-18-19:29:08 import
Igor Sysoev <igor@sysoev.ru>
parents:
292
diff
changeset
|
183 |
186
c1f3a3c7c5db
nginx-0.0.1-2003-11-17-00:49:42 import
Igor Sysoev <igor@sysoev.ru>
parents:
185
diff
changeset
|
184 |
467 | 185 ngx_int_t ngx_open_dir(ngx_str_t *name, ngx_dir_t *dir); |
186
c1f3a3c7c5db
nginx-0.0.1-2003-11-17-00:49:42 import
Igor Sysoev <igor@sysoev.ru>
parents:
185
diff
changeset
|
186 #define ngx_open_dir_n "FindFirstFile()" |
c1f3a3c7c5db
nginx-0.0.1-2003-11-17-00:49:42 import
Igor Sysoev <igor@sysoev.ru>
parents:
185
diff
changeset
|
187 |
c1f3a3c7c5db
nginx-0.0.1-2003-11-17-00:49:42 import
Igor Sysoev <igor@sysoev.ru>
parents:
185
diff
changeset
|
188 |
467 | 189 ngx_int_t ngx_read_dir(ngx_dir_t *dir); |
186
c1f3a3c7c5db
nginx-0.0.1-2003-11-17-00:49:42 import
Igor Sysoev <igor@sysoev.ru>
parents:
185
diff
changeset
|
190 #define ngx_read_dir_n "FindNextFile()" |
c1f3a3c7c5db
nginx-0.0.1-2003-11-17-00:49:42 import
Igor Sysoev <igor@sysoev.ru>
parents:
185
diff
changeset
|
191 |
c1f3a3c7c5db
nginx-0.0.1-2003-11-17-00:49:42 import
Igor Sysoev <igor@sysoev.ru>
parents:
185
diff
changeset
|
192 |
5749
a680bf4dddd5
Win32: ngx_open_dir() and ngx_close_dir() fixes.
Maxim Dounin <mdounin@mdounin.ru>
parents:
5389
diff
changeset
|
193 ngx_int_t ngx_close_dir(ngx_dir_t *dir); |
186
c1f3a3c7c5db
nginx-0.0.1-2003-11-17-00:49:42 import
Igor Sysoev <igor@sysoev.ru>
parents:
185
diff
changeset
|
194 #define ngx_close_dir_n "FindClose()" |
c1f3a3c7c5db
nginx-0.0.1-2003-11-17-00:49:42 import
Igor Sysoev <igor@sysoev.ru>
parents:
185
diff
changeset
|
195 |
c1f3a3c7c5db
nginx-0.0.1-2003-11-17-00:49:42 import
Igor Sysoev <igor@sysoev.ru>
parents:
185
diff
changeset
|
196 |
8133
e0f385521c79
Win32: non-ASCII directory names support in ngx_create_dir().
Maxim Dounin <mdounin@mdounin.ru>
parents:
8132
diff
changeset
|
197 ngx_int_t ngx_create_dir(u_char *name, ngx_uint_t access); |
186
c1f3a3c7c5db
nginx-0.0.1-2003-11-17-00:49:42 import
Igor Sysoev <igor@sysoev.ru>
parents:
185
diff
changeset
|
198 #define ngx_create_dir_n "CreateDirectory()" |
c1f3a3c7c5db
nginx-0.0.1-2003-11-17-00:49:42 import
Igor Sysoev <igor@sysoev.ru>
parents:
185
diff
changeset
|
199 |
c1f3a3c7c5db
nginx-0.0.1-2003-11-17-00:49:42 import
Igor Sysoev <igor@sysoev.ru>
parents:
185
diff
changeset
|
200 |
8134
7d60e4584d9e
Win32: non-ASCII directory names support in ngx_delete_dir().
Maxim Dounin <mdounin@mdounin.ru>
parents:
8133
diff
changeset
|
201 ngx_int_t ngx_delete_dir(u_char *name); |
186
c1f3a3c7c5db
nginx-0.0.1-2003-11-17-00:49:42 import
Igor Sysoev <igor@sysoev.ru>
parents:
185
diff
changeset
|
202 #define ngx_delete_dir_n "RemoveDirectory()" |
c1f3a3c7c5db
nginx-0.0.1-2003-11-17-00:49:42 import
Igor Sysoev <igor@sysoev.ru>
parents:
185
diff
changeset
|
203 |
c1f3a3c7c5db
nginx-0.0.1-2003-11-17-00:49:42 import
Igor Sysoev <igor@sysoev.ru>
parents:
185
diff
changeset
|
204 |
1089
b2e6eb425770
use ngx_dir_access() to enable search bits for directory
Igor Sysoev <igor@sysoev.ru>
parents:
1055
diff
changeset
|
205 #define ngx_dir_access(a) (a) |
b2e6eb425770
use ngx_dir_access() to enable search bits for directory
Igor Sysoev <igor@sysoev.ru>
parents:
1055
diff
changeset
|
206 |
b2e6eb425770
use ngx_dir_access() to enable search bits for directory
Igor Sysoev <igor@sysoev.ru>
parents:
1055
diff
changeset
|
207 |
8130
b0a06c50c1b4
Win32: non-ASCII names support in autoindex (ticket #458).
Maxim Dounin <mdounin@mdounin.ru>
parents:
7670
diff
changeset
|
208 #define ngx_de_name(dir) (dir)->name |
b0a06c50c1b4
Win32: non-ASCII names support in autoindex (ticket #458).
Maxim Dounin <mdounin@mdounin.ru>
parents:
7670
diff
changeset
|
209 #define ngx_de_namelen(dir) (dir)->namelen |
501 | 210 |
211 ngx_int_t ngx_de_info(u_char *name, ngx_dir_t *dir); | |
186
c1f3a3c7c5db
nginx-0.0.1-2003-11-17-00:49:42 import
Igor Sysoev <igor@sysoev.ru>
parents:
185
diff
changeset
|
212 #define ngx_de_info_n "dummy()" |
501 | 213 |
214 ngx_int_t ngx_de_link_info(u_char *name, ngx_dir_t *dir); | |
497 | 215 #define ngx_de_link_info_n "dummy()" |
501 | 216 |
1047 | 217 #define ngx_de_is_dir(dir) \ |
2461 | 218 (((dir)->finddata.dwFileAttributes & FILE_ATTRIBUTE_DIRECTORY) != 0) |
1047 | 219 #define ngx_de_is_file(dir) \ |
2461 | 220 (((dir)->finddata.dwFileAttributes & FILE_ATTRIBUTE_DIRECTORY) == 0) |
497 | 221 #define ngx_de_is_link(dir) 0 |
1053
b9fa23cda4cc
ngx_file_access() and ngx_de_access()
Igor Sysoev <igor@sysoev.ru>
parents:
1050
diff
changeset
|
222 #define ngx_de_access(dir) 0 |
1047 | 223 #define ngx_de_size(dir) \ |
727 | 224 (((off_t) (dir)->finddata.nFileSizeHigh << 32) | (dir)->finddata.nFileSizeLow) |
3970
2d05952a324d
elimination of reading cache files by cache loader
Igor Sysoev <igor@sysoev.ru>
parents:
3899
diff
changeset
|
225 #define ngx_de_fs_size(dir) ngx_de_size(dir) |
186
c1f3a3c7c5db
nginx-0.0.1-2003-11-17-00:49:42 import
Igor Sysoev <igor@sysoev.ru>
parents:
185
diff
changeset
|
226 |
c1f3a3c7c5db
nginx-0.0.1-2003-11-17-00:49:42 import
Igor Sysoev <igor@sysoev.ru>
parents:
185
diff
changeset
|
227 /* 116444736000000000 is commented in src/os/win32/ngx_time.c */ |
c1f3a3c7c5db
nginx-0.0.1-2003-11-17-00:49:42 import
Igor Sysoev <igor@sysoev.ru>
parents:
185
diff
changeset
|
228 |
1047 | 229 #define ngx_de_mtime(dir) \ |
230 (time_t) (((((unsigned __int64) \ | |
231 (dir)->finddata.ftLastWriteTime.dwHighDateTime << 32) \ | |
232 | (dir)->finddata.ftLastWriteTime.dwLowDateTime) \ | |
186
c1f3a3c7c5db
nginx-0.0.1-2003-11-17-00:49:42 import
Igor Sysoev <igor@sysoev.ru>
parents:
185
diff
changeset
|
233 - 116444736000000000) / 10000000) |
c1f3a3c7c5db
nginx-0.0.1-2003-11-17-00:49:42 import
Igor Sysoev <igor@sysoev.ru>
parents:
185
diff
changeset
|
234 |
727 | 235 |
236 ngx_int_t ngx_open_glob(ngx_glob_t *gl); | |
2129 | 237 #define ngx_open_glob_n "FindFirstFile()" |
727 | 238 |
239 ngx_int_t ngx_read_glob(ngx_glob_t *gl, ngx_str_t *name); | |
240 void ngx_close_glob(ngx_glob_t *gl); | |
186
c1f3a3c7c5db
nginx-0.0.1-2003-11-17-00:49:42 import
Igor Sysoev <igor@sysoev.ru>
parents:
185
diff
changeset
|
241 |
c1f3a3c7c5db
nginx-0.0.1-2003-11-17-00:49:42 import
Igor Sysoev <igor@sysoev.ru>
parents:
185
diff
changeset
|
242 |
290
87e73f067470
nginx-0.0.2-2004-03-16-10:10:12 import
Igor Sysoev <igor@sysoev.ru>
parents:
278
diff
changeset
|
243 ssize_t ngx_read_file(ngx_file_t *file, u_char *buf, size_t size, off_t offset); |
98
c9b243802a17
nginx-0.0.1-2003-05-30-18:27:59 import
Igor Sysoev <igor@sysoev.ru>
parents:
92
diff
changeset
|
244 #define ngx_read_file_n "ReadFile()" |
c9b243802a17
nginx-0.0.1-2003-05-30-18:27:59 import
Igor Sysoev <igor@sysoev.ru>
parents:
92
diff
changeset
|
245 |
290
87e73f067470
nginx-0.0.2-2004-03-16-10:10:12 import
Igor Sysoev <igor@sysoev.ru>
parents:
278
diff
changeset
|
246 ssize_t ngx_write_file(ngx_file_t *file, u_char *buf, size_t size, |
497 | 247 off_t offset); |
182
3c49eaf3f522
nginx-0.0.1-2003-11-13-09:14:05 import
Igor Sysoev <igor@sysoev.ru>
parents:
180
diff
changeset
|
248 |
3c49eaf3f522
nginx-0.0.1-2003-11-13-09:14:05 import
Igor Sysoev <igor@sysoev.ru>
parents:
180
diff
changeset
|
249 ssize_t ngx_write_chain_to_file(ngx_file_t *file, ngx_chain_t *ce, |
497 | 250 off_t offset, ngx_pool_t *pool); |
182
3c49eaf3f522
nginx-0.0.1-2003-11-13-09:14:05 import
Igor Sysoev <igor@sysoev.ru>
parents:
180
diff
changeset
|
251 |
3178 | 252 ngx_int_t ngx_read_ahead(ngx_fd_t fd, size_t n); |
253 #define ngx_read_ahead_n "ngx_read_ahead_n" | |
182
3c49eaf3f522
nginx-0.0.1-2003-11-13-09:14:05 import
Igor Sysoev <igor@sysoev.ru>
parents:
180
diff
changeset
|
254 |
2248
1adec90a0e46
disable directio for unaligned reads in Linux
Igor Sysoev <igor@sysoev.ru>
parents:
2234
diff
changeset
|
255 ngx_int_t ngx_directio_on(ngx_fd_t fd); |
1adec90a0e46
disable directio for unaligned reads in Linux
Igor Sysoev <igor@sysoev.ru>
parents:
2234
diff
changeset
|
256 #define ngx_directio_on_n "ngx_directio_on_n" |
1adec90a0e46
disable directio for unaligned reads in Linux
Igor Sysoev <igor@sysoev.ru>
parents:
2234
diff
changeset
|
257 |
1adec90a0e46
disable directio for unaligned reads in Linux
Igor Sysoev <igor@sysoev.ru>
parents:
2234
diff
changeset
|
258 ngx_int_t ngx_directio_off(ngx_fd_t fd); |
1adec90a0e46
disable directio for unaligned reads in Linux
Igor Sysoev <igor@sysoev.ru>
parents:
2234
diff
changeset
|
259 #define ngx_directio_off_n "ngx_directio_off_n" |
2129 | 260 |
2615 | 261 size_t ngx_fs_bsize(u_char *name); |
7670
ccb5ff87ab3e
Cache: introduced min_free cache clearing.
Maxim Dounin <mdounin@mdounin.ru>
parents:
7433
diff
changeset
|
262 off_t ngx_fs_available(u_char *name); |
2615 | 263 |
2129 | 264 |
6186
db138b3b645e
Core: added support for writing to stdout.
Vladimir Homutov <vl@nginx.com>
parents:
5749
diff
changeset
|
265 #define ngx_stdout GetStdHandle(STD_OUTPUT_HANDLE) |
2743
d8316f307b6a
issue start up errors and warning on both stderr and error_log
Igor Sysoev <igor@sysoev.ru>
parents:
2687
diff
changeset
|
266 #define ngx_stderr GetStdHandle(STD_ERROR_HANDLE) |
d8316f307b6a
issue start up errors and warning on both stderr and error_log
Igor Sysoev <igor@sysoev.ru>
parents:
2687
diff
changeset
|
267 #define ngx_set_stderr(fd) SetStdHandle(STD_ERROR_HANDLE, fd) |
d8316f307b6a
issue start up errors and warning on both stderr and error_log
Igor Sysoev <igor@sysoev.ru>
parents:
2687
diff
changeset
|
268 #define ngx_set_stderr_n "SetStdHandle(STD_ERROR_HANDLE)" |
d8316f307b6a
issue start up errors and warning on both stderr and error_log
Igor Sysoev <igor@sysoev.ru>
parents:
2687
diff
changeset
|
269 |
d8316f307b6a
issue start up errors and warning on both stderr and error_log
Igor Sysoev <igor@sysoev.ru>
parents:
2687
diff
changeset
|
270 |
8
708f8bb772ec
nginx-0.0.1-2002-09-02-18:48:24 import
Igor Sysoev <igor@sysoev.ru>
parents:
6
diff
changeset
|
271 #endif /* _NGX_FILES_H_INCLUDED_ */ |