Mercurial > hg > nginx
annotate src/os/win32/ngx_win32_init.c @ 2494:693132294e21
AIX has no WCOREDUMP()
author | Igor Sysoev <igor@sysoev.ru> |
---|---|
date | Thu, 05 Feb 2009 16:01:50 +0000 |
parents | 0b592a68aade |
children | b3b8c66bd520 |
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:
373
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:
373
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 |
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:
373
diff
changeset
|
4 */ |
da8c5707af39
nginx-0.1.0-2004-09-28-12:34:51 import; set copyright and remove unused files
Igor Sysoev <igor@sysoev.ru>
parents:
373
diff
changeset
|
5 |
91
637625a2acdb
nginx-0.0.1-2003-05-19-20:39:14 import
Igor Sysoev <igor@sysoev.ru>
parents:
diff
changeset
|
6 |
92
19cc647ecd91
nginx-0.0.1-2003-05-20-19:37:55 import
Igor Sysoev <igor@sysoev.ru>
parents:
91
diff
changeset
|
7 #include <ngx_config.h> |
19cc647ecd91
nginx-0.0.1-2003-05-20-19:37:55 import
Igor Sysoev <igor@sysoev.ru>
parents:
91
diff
changeset
|
8 #include <ngx_core.h> |
541 | 9 #include <nginx.h> |
92
19cc647ecd91
nginx-0.0.1-2003-05-20-19:37:55 import
Igor Sysoev <igor@sysoev.ru>
parents:
91
diff
changeset
|
10 |
103
6dfda4cf5200
nginx-0.0.1-2003-06-11-19:28:34 import
Igor Sysoev <igor@sysoev.ru>
parents:
102
diff
changeset
|
11 |
449
3b1e8c9df9ad
nginx-0.1.0-2004-10-04-00:02:06 import
Igor Sysoev <igor@sysoev.ru>
parents:
444
diff
changeset
|
12 ngx_uint_t ngx_win32_version; |
3b1e8c9df9ad
nginx-0.1.0-2004-10-04-00:02:06 import
Igor Sysoev <igor@sysoev.ru>
parents:
444
diff
changeset
|
13 ngx_uint_t ngx_ncpu; |
461 | 14 ngx_uint_t ngx_max_wsabufs; |
449
3b1e8c9df9ad
nginx-0.1.0-2004-10-04-00:02:06 import
Igor Sysoev <igor@sysoev.ru>
parents:
444
diff
changeset
|
15 ngx_int_t ngx_max_sockets; |
3b1e8c9df9ad
nginx-0.1.0-2004-10-04-00:02:06 import
Igor Sysoev <igor@sysoev.ru>
parents:
444
diff
changeset
|
16 ngx_uint_t ngx_inherited_nonblocking = 1; |
473 | 17 ngx_uint_t ngx_tcp_nodelay_and_tcp_nopush; |
18 | |
449
3b1e8c9df9ad
nginx-0.1.0-2004-10-04-00:02:06 import
Igor Sysoev <igor@sysoev.ru>
parents:
444
diff
changeset
|
19 ngx_fd_t ngx_stderr_fileno; |
92
19cc647ecd91
nginx-0.0.1-2003-05-20-19:37:55 import
Igor Sysoev <igor@sysoev.ru>
parents:
91
diff
changeset
|
20 |
19cc647ecd91
nginx-0.0.1-2003-05-20-19:37:55 import
Igor Sysoev <igor@sysoev.ru>
parents:
91
diff
changeset
|
21 |
19cc647ecd91
nginx-0.0.1-2003-05-20-19:37:55 import
Igor Sysoev <igor@sysoev.ru>
parents:
91
diff
changeset
|
22 ngx_os_io_t ngx_os_io = { |
93
738fe44c70d5
nginx-0.0.1-2003-05-21-17:28:21 import
Igor Sysoev <igor@sysoev.ru>
parents:
92
diff
changeset
|
23 ngx_wsarecv, |
186
c1f3a3c7c5db
nginx-0.0.1-2003-11-17-00:49:42 import
Igor Sysoev <igor@sysoev.ru>
parents:
184
diff
changeset
|
24 ngx_wsarecv_chain, |
1689 | 25 ngx_udp_wsarecv, |
92
19cc647ecd91
nginx-0.0.1-2003-05-20-19:37:55 import
Igor Sysoev <igor@sysoev.ru>
parents:
91
diff
changeset
|
26 NULL, |
103
6dfda4cf5200
nginx-0.0.1-2003-06-11-19:28:34 import
Igor Sysoev <igor@sysoev.ru>
parents:
102
diff
changeset
|
27 ngx_wsasend_chain, |
6dfda4cf5200
nginx-0.0.1-2003-06-11-19:28:34 import
Igor Sysoev <igor@sysoev.ru>
parents:
102
diff
changeset
|
28 0 |
92
19cc647ecd91
nginx-0.0.1-2003-05-20-19:37:55 import
Igor Sysoev <igor@sysoev.ru>
parents:
91
diff
changeset
|
29 }; |
19cc647ecd91
nginx-0.0.1-2003-05-20-19:37:55 import
Igor Sysoev <igor@sysoev.ru>
parents:
91
diff
changeset
|
30 |
91
637625a2acdb
nginx-0.0.1-2003-05-19-20:39:14 import
Igor Sysoev <igor@sysoev.ru>
parents:
diff
changeset
|
31 |
282
30310107dbc9
nginx-0.0.2-2004-03-09-22:47:07 import
Igor Sysoev <igor@sysoev.ru>
parents:
210
diff
changeset
|
32 typedef struct { |
30310107dbc9
nginx-0.0.2-2004-03-09-22:47:07 import
Igor Sysoev <igor@sysoev.ru>
parents:
210
diff
changeset
|
33 WORD wServicePackMinor; |
30310107dbc9
nginx-0.0.2-2004-03-09-22:47:07 import
Igor Sysoev <igor@sysoev.ru>
parents:
210
diff
changeset
|
34 WORD wSuiteMask; |
30310107dbc9
nginx-0.0.2-2004-03-09-22:47:07 import
Igor Sysoev <igor@sysoev.ru>
parents:
210
diff
changeset
|
35 BYTE wProductType; |
30310107dbc9
nginx-0.0.2-2004-03-09-22:47:07 import
Igor Sysoev <igor@sysoev.ru>
parents:
210
diff
changeset
|
36 } ngx_osviex_stub_t; |
30310107dbc9
nginx-0.0.2-2004-03-09-22:47:07 import
Igor Sysoev <igor@sysoev.ru>
parents:
210
diff
changeset
|
37 |
30310107dbc9
nginx-0.0.2-2004-03-09-22:47:07 import
Igor Sysoev <igor@sysoev.ru>
parents:
210
diff
changeset
|
38 |
461 | 39 static u_int osviex; |
40 static OSVERSIONINFOEX osvi; | |
41 | |
100
7ebc8b7fb816
nginx-0.0.1-2003-06-03-19:42:58 import
Igor Sysoev <igor@sysoev.ru>
parents:
93
diff
changeset
|
42 /* Should these pointers be per protocol ? */ |
1633
74b2a52bc3c9
TransmitPackets(), ConnectEx(), and DisconnectEx()
Igor Sysoev <igor@sysoev.ru>
parents:
860
diff
changeset
|
43 LPFN_ACCEPTEX ngx_acceptex; |
74b2a52bc3c9
TransmitPackets(), ConnectEx(), and DisconnectEx()
Igor Sysoev <igor@sysoev.ru>
parents:
860
diff
changeset
|
44 LPFN_GETACCEPTEXSOCKADDRS ngx_getacceptexsockaddrs; |
74b2a52bc3c9
TransmitPackets(), ConnectEx(), and DisconnectEx()
Igor Sysoev <igor@sysoev.ru>
parents:
860
diff
changeset
|
45 LPFN_TRANSMITFILE ngx_transmitfile; |
74b2a52bc3c9
TransmitPackets(), ConnectEx(), and DisconnectEx()
Igor Sysoev <igor@sysoev.ru>
parents:
860
diff
changeset
|
46 LPFN_TRANSMITPACKETS ngx_transmitpackets; |
74b2a52bc3c9
TransmitPackets(), ConnectEx(), and DisconnectEx()
Igor Sysoev <igor@sysoev.ru>
parents:
860
diff
changeset
|
47 LPFN_CONNECTEX ngx_connectex; |
74b2a52bc3c9
TransmitPackets(), ConnectEx(), and DisconnectEx()
Igor Sysoev <igor@sysoev.ru>
parents:
860
diff
changeset
|
48 LPFN_DISCONNECTEX ngx_disconnectex; |
100
7ebc8b7fb816
nginx-0.0.1-2003-06-03-19:42:58 import
Igor Sysoev <igor@sysoev.ru>
parents:
93
diff
changeset
|
49 |
1633
74b2a52bc3c9
TransmitPackets(), ConnectEx(), and DisconnectEx()
Igor Sysoev <igor@sysoev.ru>
parents:
860
diff
changeset
|
50 static GUID ax_guid = WSAID_ACCEPTEX; |
100
7ebc8b7fb816
nginx-0.0.1-2003-06-03-19:42:58 import
Igor Sysoev <igor@sysoev.ru>
parents:
93
diff
changeset
|
51 static GUID as_guid = WSAID_GETACCEPTEXSOCKADDRS; |
7ebc8b7fb816
nginx-0.0.1-2003-06-03-19:42:58 import
Igor Sysoev <igor@sysoev.ru>
parents:
93
diff
changeset
|
52 static GUID tf_guid = WSAID_TRANSMITFILE; |
1633
74b2a52bc3c9
TransmitPackets(), ConnectEx(), and DisconnectEx()
Igor Sysoev <igor@sysoev.ru>
parents:
860
diff
changeset
|
53 static GUID tp_guid = WSAID_TRANSMITPACKETS; |
74b2a52bc3c9
TransmitPackets(), ConnectEx(), and DisconnectEx()
Igor Sysoev <igor@sysoev.ru>
parents:
860
diff
changeset
|
54 static GUID cx_guid = WSAID_CONNECTEX; |
74b2a52bc3c9
TransmitPackets(), ConnectEx(), and DisconnectEx()
Igor Sysoev <igor@sysoev.ru>
parents:
860
diff
changeset
|
55 static GUID dx_guid = WSAID_DISCONNECTEX; |
100
7ebc8b7fb816
nginx-0.0.1-2003-06-03-19:42:58 import
Igor Sysoev <igor@sysoev.ru>
parents:
93
diff
changeset
|
56 |
7ebc8b7fb816
nginx-0.0.1-2003-06-03-19:42:58 import
Igor Sysoev <igor@sysoev.ru>
parents:
93
diff
changeset
|
57 |
449
3b1e8c9df9ad
nginx-0.1.0-2004-10-04-00:02:06 import
Igor Sysoev <igor@sysoev.ru>
parents:
444
diff
changeset
|
58 ngx_int_t ngx_os_init(ngx_log_t *log) |
91
637625a2acdb
nginx-0.0.1-2003-05-19-20:39:14 import
Igor Sysoev <igor@sysoev.ru>
parents:
diff
changeset
|
59 { |
461 | 60 DWORD bytes; |
61 SOCKET s; | |
62 WSADATA wsd; | |
860
201d017ea470
slab allocator in shared memory
Igor Sysoev <igor@sysoev.ru>
parents:
589
diff
changeset
|
63 ngx_uint_t n; |
461 | 64 SYSTEM_INFO si; |
102
7e86d028d8f0
nginx-0.0.1-2003-06-06-18:59:20 import
Igor Sysoev <igor@sysoev.ru>
parents:
100
diff
changeset
|
65 |
7e86d028d8f0
nginx-0.0.1-2003-06-06-18:59:20 import
Igor Sysoev <igor@sysoev.ru>
parents:
100
diff
changeset
|
66 /* get Windows version */ |
7e86d028d8f0
nginx-0.0.1-2003-06-06-18:59:20 import
Igor Sysoev <igor@sysoev.ru>
parents:
100
diff
changeset
|
67 |
103
6dfda4cf5200
nginx-0.0.1-2003-06-11-19:28:34 import
Igor Sysoev <igor@sysoev.ru>
parents:
102
diff
changeset
|
68 ngx_memzero(&osvi, sizeof(OSVERSIONINFOEX)); |
102
7e86d028d8f0
nginx-0.0.1-2003-06-06-18:59:20 import
Igor Sysoev <igor@sysoev.ru>
parents:
100
diff
changeset
|
69 osvi.dwOSVersionInfoSize = sizeof(OSVERSIONINFOEX); |
7e86d028d8f0
nginx-0.0.1-2003-06-06-18:59:20 import
Igor Sysoev <igor@sysoev.ru>
parents:
100
diff
changeset
|
70 |
7e86d028d8f0
nginx-0.0.1-2003-06-06-18:59:20 import
Igor Sysoev <igor@sysoev.ru>
parents:
100
diff
changeset
|
71 osviex = GetVersionEx((OSVERSIONINFO *) &osvi); |
7e86d028d8f0
nginx-0.0.1-2003-06-06-18:59:20 import
Igor Sysoev <igor@sysoev.ru>
parents:
100
diff
changeset
|
72 |
7e86d028d8f0
nginx-0.0.1-2003-06-06-18:59:20 import
Igor Sysoev <igor@sysoev.ru>
parents:
100
diff
changeset
|
73 if (osviex == 0) { |
7e86d028d8f0
nginx-0.0.1-2003-06-06-18:59:20 import
Igor Sysoev <igor@sysoev.ru>
parents:
100
diff
changeset
|
74 osvi.dwOSVersionInfoSize = sizeof(OSVERSIONINFOEX); |
103
6dfda4cf5200
nginx-0.0.1-2003-06-11-19:28:34 import
Igor Sysoev <igor@sysoev.ru>
parents:
102
diff
changeset
|
75 if (GetVersionEx((OSVERSIONINFO *) &osvi) == 0) { |
102
7e86d028d8f0
nginx-0.0.1-2003-06-06-18:59:20 import
Igor Sysoev <igor@sysoev.ru>
parents:
100
diff
changeset
|
76 ngx_log_error(NGX_LOG_EMERG, log, ngx_errno, |
7e86d028d8f0
nginx-0.0.1-2003-06-06-18:59:20 import
Igor Sysoev <igor@sysoev.ru>
parents:
100
diff
changeset
|
77 "GetVersionEx() failed"); |
7e86d028d8f0
nginx-0.0.1-2003-06-06-18:59:20 import
Igor Sysoev <igor@sysoev.ru>
parents:
100
diff
changeset
|
78 return NGX_ERROR; |
7e86d028d8f0
nginx-0.0.1-2003-06-06-18:59:20 import
Igor Sysoev <igor@sysoev.ru>
parents:
100
diff
changeset
|
79 } |
7e86d028d8f0
nginx-0.0.1-2003-06-06-18:59:20 import
Igor Sysoev <igor@sysoev.ru>
parents:
100
diff
changeset
|
80 } |
7e86d028d8f0
nginx-0.0.1-2003-06-06-18:59:20 import
Igor Sysoev <igor@sysoev.ru>
parents:
100
diff
changeset
|
81 |
7e86d028d8f0
nginx-0.0.1-2003-06-06-18:59:20 import
Igor Sysoev <igor@sysoev.ru>
parents:
100
diff
changeset
|
82 /* |
210
00cafae0bdf1
nginx-0.0.1-2003-12-14-23:10:27 import
Igor Sysoev <igor@sysoev.ru>
parents:
186
diff
changeset
|
83 * Windows 3.1 Win32s 0xxxxx |
00cafae0bdf1
nginx-0.0.1-2003-12-14-23:10:27 import
Igor Sysoev <igor@sysoev.ru>
parents:
186
diff
changeset
|
84 * |
103
6dfda4cf5200
nginx-0.0.1-2003-06-11-19:28:34 import
Igor Sysoev <igor@sysoev.ru>
parents:
102
diff
changeset
|
85 * Windows 95 140000 |
6dfda4cf5200
nginx-0.0.1-2003-06-11-19:28:34 import
Igor Sysoev <igor@sysoev.ru>
parents:
102
diff
changeset
|
86 * Windows 98 141000 |
6dfda4cf5200
nginx-0.0.1-2003-06-11-19:28:34 import
Igor Sysoev <igor@sysoev.ru>
parents:
102
diff
changeset
|
87 * Windows ME 149000 |
6dfda4cf5200
nginx-0.0.1-2003-06-11-19:28:34 import
Igor Sysoev <igor@sysoev.ru>
parents:
102
diff
changeset
|
88 * Windows NT 3.51 235100 |
6dfda4cf5200
nginx-0.0.1-2003-06-11-19:28:34 import
Igor Sysoev <igor@sysoev.ru>
parents:
102
diff
changeset
|
89 * Windows NT 4.0 240000 |
6dfda4cf5200
nginx-0.0.1-2003-06-11-19:28:34 import
Igor Sysoev <igor@sysoev.ru>
parents:
102
diff
changeset
|
90 * Windows NT 4.0 SP5 240050 |
6dfda4cf5200
nginx-0.0.1-2003-06-11-19:28:34 import
Igor Sysoev <igor@sysoev.ru>
parents:
102
diff
changeset
|
91 * Windows 2000 250000 |
6dfda4cf5200
nginx-0.0.1-2003-06-11-19:28:34 import
Igor Sysoev <igor@sysoev.ru>
parents:
102
diff
changeset
|
92 * Windows XP 250100 |
6dfda4cf5200
nginx-0.0.1-2003-06-11-19:28:34 import
Igor Sysoev <igor@sysoev.ru>
parents:
102
diff
changeset
|
93 * Windows 2003 250200 |
1633
74b2a52bc3c9
TransmitPackets(), ConnectEx(), and DisconnectEx()
Igor Sysoev <igor@sysoev.ru>
parents:
860
diff
changeset
|
94 * Windows Vista/2008 260000 |
210
00cafae0bdf1
nginx-0.0.1-2003-12-14-23:10:27 import
Igor Sysoev <igor@sysoev.ru>
parents:
186
diff
changeset
|
95 * |
00cafae0bdf1
nginx-0.0.1-2003-12-14-23:10:27 import
Igor Sysoev <igor@sysoev.ru>
parents:
186
diff
changeset
|
96 * Windows CE x.x 3xxxxx |
102
7e86d028d8f0
nginx-0.0.1-2003-06-06-18:59:20 import
Igor Sysoev <igor@sysoev.ru>
parents:
100
diff
changeset
|
97 */ |
7e86d028d8f0
nginx-0.0.1-2003-06-06-18:59:20 import
Igor Sysoev <igor@sysoev.ru>
parents:
100
diff
changeset
|
98 |
103
6dfda4cf5200
nginx-0.0.1-2003-06-11-19:28:34 import
Igor Sysoev <igor@sysoev.ru>
parents:
102
diff
changeset
|
99 ngx_win32_version = osvi.dwPlatformId * 100000 |
6dfda4cf5200
nginx-0.0.1-2003-06-11-19:28:34 import
Igor Sysoev <igor@sysoev.ru>
parents:
102
diff
changeset
|
100 + osvi.dwMajorVersion * 10000 |
6dfda4cf5200
nginx-0.0.1-2003-06-11-19:28:34 import
Igor Sysoev <igor@sysoev.ru>
parents:
102
diff
changeset
|
101 + osvi.dwMinorVersion * 100; |
102
7e86d028d8f0
nginx-0.0.1-2003-06-06-18:59:20 import
Igor Sysoev <igor@sysoev.ru>
parents:
100
diff
changeset
|
102 |
7e86d028d8f0
nginx-0.0.1-2003-06-06-18:59:20 import
Igor Sysoev <igor@sysoev.ru>
parents:
100
diff
changeset
|
103 if (osviex) { |
103
6dfda4cf5200
nginx-0.0.1-2003-06-11-19:28:34 import
Igor Sysoev <igor@sysoev.ru>
parents:
102
diff
changeset
|
104 ngx_win32_version += osvi.wServicePackMajor * 10 |
6dfda4cf5200
nginx-0.0.1-2003-06-11-19:28:34 import
Igor Sysoev <igor@sysoev.ru>
parents:
102
diff
changeset
|
105 + osvi.wServicePackMinor; |
102
7e86d028d8f0
nginx-0.0.1-2003-06-06-18:59:20 import
Igor Sysoev <igor@sysoev.ru>
parents:
100
diff
changeset
|
106 } |
7e86d028d8f0
nginx-0.0.1-2003-06-06-18:59:20 import
Igor Sysoev <igor@sysoev.ru>
parents:
100
diff
changeset
|
107 |
346
55e496a8ece3
nginx-0.0.3-2004-06-06-23:49:18 import
Igor Sysoev <igor@sysoev.ru>
parents:
282
diff
changeset
|
108 GetSystemInfo(&si); |
55e496a8ece3
nginx-0.0.3-2004-06-06-23:49:18 import
Igor Sysoev <igor@sysoev.ru>
parents:
282
diff
changeset
|
109 ngx_pagesize = si.dwPageSize; |
373
018569a8f09c
nginx-0.0.7-2004-06-30-19:30:41 import
Igor Sysoev <igor@sysoev.ru>
parents:
346
diff
changeset
|
110 ngx_ncpu = si.dwNumberOfProcessors; |
589 | 111 ngx_cacheline_size = NGX_CPU_CACHE_LINE; |
346
55e496a8ece3
nginx-0.0.3-2004-06-06-23:49:18 import
Igor Sysoev <igor@sysoev.ru>
parents:
282
diff
changeset
|
112 |
860
201d017ea470
slab allocator in shared memory
Igor Sysoev <igor@sysoev.ru>
parents:
589
diff
changeset
|
113 for (n = ngx_pagesize; n >>= 1; ngx_pagesize_shift++) { /* void */ } |
201d017ea470
slab allocator in shared memory
Igor Sysoev <igor@sysoev.ru>
parents:
589
diff
changeset
|
114 |
100
7ebc8b7fb816
nginx-0.0.1-2003-06-03-19:42:58 import
Igor Sysoev <igor@sysoev.ru>
parents:
93
diff
changeset
|
115 |
7ebc8b7fb816
nginx-0.0.1-2003-06-03-19:42:58 import
Igor Sysoev <igor@sysoev.ru>
parents:
93
diff
changeset
|
116 /* init Winsock */ |
7ebc8b7fb816
nginx-0.0.1-2003-06-03-19:42:58 import
Igor Sysoev <igor@sysoev.ru>
parents:
93
diff
changeset
|
117 |
7ebc8b7fb816
nginx-0.0.1-2003-06-03-19:42:58 import
Igor Sysoev <igor@sysoev.ru>
parents:
93
diff
changeset
|
118 if (WSAStartup(MAKEWORD(2,2), &wsd) != 0) { |
7ebc8b7fb816
nginx-0.0.1-2003-06-03-19:42:58 import
Igor Sysoev <igor@sysoev.ru>
parents:
93
diff
changeset
|
119 ngx_log_error(NGX_LOG_EMERG, log, ngx_socket_errno, |
102
7e86d028d8f0
nginx-0.0.1-2003-06-06-18:59:20 import
Igor Sysoev <igor@sysoev.ru>
parents:
100
diff
changeset
|
120 "WSAStartup() failed"); |
100
7ebc8b7fb816
nginx-0.0.1-2003-06-03-19:42:58 import
Igor Sysoev <igor@sysoev.ru>
parents:
93
diff
changeset
|
121 return NGX_ERROR; |
7ebc8b7fb816
nginx-0.0.1-2003-06-03-19:42:58 import
Igor Sysoev <igor@sysoev.ru>
parents:
93
diff
changeset
|
122 } |
7ebc8b7fb816
nginx-0.0.1-2003-06-03-19:42:58 import
Igor Sysoev <igor@sysoev.ru>
parents:
93
diff
changeset
|
123 |
282
30310107dbc9
nginx-0.0.2-2004-03-09-22:47:07 import
Igor Sysoev <igor@sysoev.ru>
parents:
210
diff
changeset
|
124 if (ngx_win32_version < NGX_WIN_NT) { |
461 | 125 ngx_max_wsabufs = 16; |
282
30310107dbc9
nginx-0.0.2-2004-03-09-22:47:07 import
Igor Sysoev <igor@sysoev.ru>
parents:
210
diff
changeset
|
126 return NGX_OK; |
30310107dbc9
nginx-0.0.2-2004-03-09-22:47:07 import
Igor Sysoev <igor@sysoev.ru>
parents:
210
diff
changeset
|
127 } |
30310107dbc9
nginx-0.0.2-2004-03-09-22:47:07 import
Igor Sysoev <igor@sysoev.ru>
parents:
210
diff
changeset
|
128 |
461 | 129 /* STUB: ngx_uint_t max */ |
130 ngx_max_wsabufs = 1024 * 1024; | |
131 | |
1633
74b2a52bc3c9
TransmitPackets(), ConnectEx(), and DisconnectEx()
Igor Sysoev <igor@sysoev.ru>
parents:
860
diff
changeset
|
132 /* |
74b2a52bc3c9
TransmitPackets(), ConnectEx(), and DisconnectEx()
Igor Sysoev <igor@sysoev.ru>
parents:
860
diff
changeset
|
133 * get AcceptEx(), GetAcceptExSockAddrs(), TransmitFile(), |
74b2a52bc3c9
TransmitPackets(), ConnectEx(), and DisconnectEx()
Igor Sysoev <igor@sysoev.ru>
parents:
860
diff
changeset
|
134 * TransmitPackets(), ConnectEx(), and DisconnectEx() addresses |
74b2a52bc3c9
TransmitPackets(), ConnectEx(), and DisconnectEx()
Igor Sysoev <igor@sysoev.ru>
parents:
860
diff
changeset
|
135 */ |
100
7ebc8b7fb816
nginx-0.0.1-2003-06-03-19:42:58 import
Igor Sysoev <igor@sysoev.ru>
parents:
93
diff
changeset
|
136 |
461 | 137 s = ngx_socket(AF_INET, SOCK_STREAM, IPPROTO_IP); |
100
7ebc8b7fb816
nginx-0.0.1-2003-06-03-19:42:58 import
Igor Sysoev <igor@sysoev.ru>
parents:
93
diff
changeset
|
138 if (s == -1) { |
7ebc8b7fb816
nginx-0.0.1-2003-06-03-19:42:58 import
Igor Sysoev <igor@sysoev.ru>
parents:
93
diff
changeset
|
139 ngx_log_error(NGX_LOG_EMERG, log, ngx_socket_errno, |
461 | 140 ngx_socket_n " falied"); |
91
637625a2acdb
nginx-0.0.1-2003-05-19-20:39:14 import
Igor Sysoev <igor@sysoev.ru>
parents:
diff
changeset
|
141 return NGX_ERROR; |
637625a2acdb
nginx-0.0.1-2003-05-19-20:39:14 import
Igor Sysoev <igor@sysoev.ru>
parents:
diff
changeset
|
142 } |
637625a2acdb
nginx-0.0.1-2003-05-19-20:39:14 import
Igor Sysoev <igor@sysoev.ru>
parents:
diff
changeset
|
143 |
1633
74b2a52bc3c9
TransmitPackets(), ConnectEx(), and DisconnectEx()
Igor Sysoev <igor@sysoev.ru>
parents:
860
diff
changeset
|
144 if (WSAIoctl(s, SIO_GET_EXTENSION_FUNCTION_POINTER, &ax_guid, sizeof(GUID), |
74b2a52bc3c9
TransmitPackets(), ConnectEx(), and DisconnectEx()
Igor Sysoev <igor@sysoev.ru>
parents:
860
diff
changeset
|
145 &ngx_acceptex, sizeof(LPFN_ACCEPTEX), &bytes, NULL, NULL) |
74b2a52bc3c9
TransmitPackets(), ConnectEx(), and DisconnectEx()
Igor Sysoev <igor@sysoev.ru>
parents:
860
diff
changeset
|
146 == -1) |
74b2a52bc3c9
TransmitPackets(), ConnectEx(), and DisconnectEx()
Igor Sysoev <igor@sysoev.ru>
parents:
860
diff
changeset
|
147 { |
74b2a52bc3c9
TransmitPackets(), ConnectEx(), and DisconnectEx()
Igor Sysoev <igor@sysoev.ru>
parents:
860
diff
changeset
|
148 ngx_log_error(NGX_LOG_NOTICE, log, ngx_socket_errno, |
100
7ebc8b7fb816
nginx-0.0.1-2003-06-03-19:42:58 import
Igor Sysoev <igor@sysoev.ru>
parents:
93
diff
changeset
|
149 "WSAIoctl(SIO_GET_EXTENSION_FUNCTION_POINTER, " |
7ebc8b7fb816
nginx-0.0.1-2003-06-03-19:42:58 import
Igor Sysoev <igor@sysoev.ru>
parents:
93
diff
changeset
|
150 "WSAID_ACCEPTEX) failed"); |
7ebc8b7fb816
nginx-0.0.1-2003-06-03-19:42:58 import
Igor Sysoev <igor@sysoev.ru>
parents:
93
diff
changeset
|
151 } |
7ebc8b7fb816
nginx-0.0.1-2003-06-03-19:42:58 import
Igor Sysoev <igor@sysoev.ru>
parents:
93
diff
changeset
|
152 |
7ebc8b7fb816
nginx-0.0.1-2003-06-03-19:42:58 import
Igor Sysoev <igor@sysoev.ru>
parents:
93
diff
changeset
|
153 if (WSAIoctl(s, SIO_GET_EXTENSION_FUNCTION_POINTER, &as_guid, sizeof(GUID), |
1633
74b2a52bc3c9
TransmitPackets(), ConnectEx(), and DisconnectEx()
Igor Sysoev <igor@sysoev.ru>
parents:
860
diff
changeset
|
154 &ngx_getacceptexsockaddrs, sizeof(LPFN_GETACCEPTEXSOCKADDRS), |
74b2a52bc3c9
TransmitPackets(), ConnectEx(), and DisconnectEx()
Igor Sysoev <igor@sysoev.ru>
parents:
860
diff
changeset
|
155 &bytes, NULL, NULL) |
74b2a52bc3c9
TransmitPackets(), ConnectEx(), and DisconnectEx()
Igor Sysoev <igor@sysoev.ru>
parents:
860
diff
changeset
|
156 == -1) |
74b2a52bc3c9
TransmitPackets(), ConnectEx(), and DisconnectEx()
Igor Sysoev <igor@sysoev.ru>
parents:
860
diff
changeset
|
157 { |
74b2a52bc3c9
TransmitPackets(), ConnectEx(), and DisconnectEx()
Igor Sysoev <igor@sysoev.ru>
parents:
860
diff
changeset
|
158 ngx_log_error(NGX_LOG_NOTICE, log, ngx_socket_errno, |
100
7ebc8b7fb816
nginx-0.0.1-2003-06-03-19:42:58 import
Igor Sysoev <igor@sysoev.ru>
parents:
93
diff
changeset
|
159 "WSAIoctl(SIO_GET_EXTENSION_FUNCTION_POINTER, " |
1633
74b2a52bc3c9
TransmitPackets(), ConnectEx(), and DisconnectEx()
Igor Sysoev <igor@sysoev.ru>
parents:
860
diff
changeset
|
160 "WSAID_GETACCEPTEXSOCKADDRS) failed"); |
100
7ebc8b7fb816
nginx-0.0.1-2003-06-03-19:42:58 import
Igor Sysoev <igor@sysoev.ru>
parents:
93
diff
changeset
|
161 } |
7ebc8b7fb816
nginx-0.0.1-2003-06-03-19:42:58 import
Igor Sysoev <igor@sysoev.ru>
parents:
93
diff
changeset
|
162 |
7ebc8b7fb816
nginx-0.0.1-2003-06-03-19:42:58 import
Igor Sysoev <igor@sysoev.ru>
parents:
93
diff
changeset
|
163 if (WSAIoctl(s, SIO_GET_EXTENSION_FUNCTION_POINTER, &tf_guid, sizeof(GUID), |
1633
74b2a52bc3c9
TransmitPackets(), ConnectEx(), and DisconnectEx()
Igor Sysoev <igor@sysoev.ru>
parents:
860
diff
changeset
|
164 &ngx_transmitfile, sizeof(LPFN_TRANSMITFILE), &bytes, |
74b2a52bc3c9
TransmitPackets(), ConnectEx(), and DisconnectEx()
Igor Sysoev <igor@sysoev.ru>
parents:
860
diff
changeset
|
165 NULL, NULL) |
74b2a52bc3c9
TransmitPackets(), ConnectEx(), and DisconnectEx()
Igor Sysoev <igor@sysoev.ru>
parents:
860
diff
changeset
|
166 == -1) |
74b2a52bc3c9
TransmitPackets(), ConnectEx(), and DisconnectEx()
Igor Sysoev <igor@sysoev.ru>
parents:
860
diff
changeset
|
167 { |
74b2a52bc3c9
TransmitPackets(), ConnectEx(), and DisconnectEx()
Igor Sysoev <igor@sysoev.ru>
parents:
860
diff
changeset
|
168 ngx_log_error(NGX_LOG_NOTICE, log, ngx_socket_errno, |
100
7ebc8b7fb816
nginx-0.0.1-2003-06-03-19:42:58 import
Igor Sysoev <igor@sysoev.ru>
parents:
93
diff
changeset
|
169 "WSAIoctl(SIO_GET_EXTENSION_FUNCTION_POINTER, " |
7ebc8b7fb816
nginx-0.0.1-2003-06-03-19:42:58 import
Igor Sysoev <igor@sysoev.ru>
parents:
93
diff
changeset
|
170 "WSAID_TRANSMITFILE) failed"); |
1633
74b2a52bc3c9
TransmitPackets(), ConnectEx(), and DisconnectEx()
Igor Sysoev <igor@sysoev.ru>
parents:
860
diff
changeset
|
171 } |
74b2a52bc3c9
TransmitPackets(), ConnectEx(), and DisconnectEx()
Igor Sysoev <igor@sysoev.ru>
parents:
860
diff
changeset
|
172 |
74b2a52bc3c9
TransmitPackets(), ConnectEx(), and DisconnectEx()
Igor Sysoev <igor@sysoev.ru>
parents:
860
diff
changeset
|
173 if (WSAIoctl(s, SIO_GET_EXTENSION_FUNCTION_POINTER, &tp_guid, sizeof(GUID), |
74b2a52bc3c9
TransmitPackets(), ConnectEx(), and DisconnectEx()
Igor Sysoev <igor@sysoev.ru>
parents:
860
diff
changeset
|
174 &ngx_transmitpackets, sizeof(LPFN_TRANSMITPACKETS), &bytes, |
74b2a52bc3c9
TransmitPackets(), ConnectEx(), and DisconnectEx()
Igor Sysoev <igor@sysoev.ru>
parents:
860
diff
changeset
|
175 NULL, NULL) |
74b2a52bc3c9
TransmitPackets(), ConnectEx(), and DisconnectEx()
Igor Sysoev <igor@sysoev.ru>
parents:
860
diff
changeset
|
176 == -1) |
74b2a52bc3c9
TransmitPackets(), ConnectEx(), and DisconnectEx()
Igor Sysoev <igor@sysoev.ru>
parents:
860
diff
changeset
|
177 { |
74b2a52bc3c9
TransmitPackets(), ConnectEx(), and DisconnectEx()
Igor Sysoev <igor@sysoev.ru>
parents:
860
diff
changeset
|
178 ngx_log_error(NGX_LOG_NOTICE, log, ngx_socket_errno, |
74b2a52bc3c9
TransmitPackets(), ConnectEx(), and DisconnectEx()
Igor Sysoev <igor@sysoev.ru>
parents:
860
diff
changeset
|
179 "WSAIoctl(SIO_GET_EXTENSION_FUNCTION_POINTER, " |
74b2a52bc3c9
TransmitPackets(), ConnectEx(), and DisconnectEx()
Igor Sysoev <igor@sysoev.ru>
parents:
860
diff
changeset
|
180 "WSAID_TRANSMITPACKETS) failed"); |
74b2a52bc3c9
TransmitPackets(), ConnectEx(), and DisconnectEx()
Igor Sysoev <igor@sysoev.ru>
parents:
860
diff
changeset
|
181 } |
74b2a52bc3c9
TransmitPackets(), ConnectEx(), and DisconnectEx()
Igor Sysoev <igor@sysoev.ru>
parents:
860
diff
changeset
|
182 |
74b2a52bc3c9
TransmitPackets(), ConnectEx(), and DisconnectEx()
Igor Sysoev <igor@sysoev.ru>
parents:
860
diff
changeset
|
183 if (WSAIoctl(s, SIO_GET_EXTENSION_FUNCTION_POINTER, &cx_guid, sizeof(GUID), |
74b2a52bc3c9
TransmitPackets(), ConnectEx(), and DisconnectEx()
Igor Sysoev <igor@sysoev.ru>
parents:
860
diff
changeset
|
184 &ngx_connectex, sizeof(LPFN_CONNECTEX), &bytes, |
74b2a52bc3c9
TransmitPackets(), ConnectEx(), and DisconnectEx()
Igor Sysoev <igor@sysoev.ru>
parents:
860
diff
changeset
|
185 NULL, NULL) |
74b2a52bc3c9
TransmitPackets(), ConnectEx(), and DisconnectEx()
Igor Sysoev <igor@sysoev.ru>
parents:
860
diff
changeset
|
186 == -1) |
74b2a52bc3c9
TransmitPackets(), ConnectEx(), and DisconnectEx()
Igor Sysoev <igor@sysoev.ru>
parents:
860
diff
changeset
|
187 { |
74b2a52bc3c9
TransmitPackets(), ConnectEx(), and DisconnectEx()
Igor Sysoev <igor@sysoev.ru>
parents:
860
diff
changeset
|
188 ngx_log_error(NGX_LOG_NOTICE, log, ngx_socket_errno, |
74b2a52bc3c9
TransmitPackets(), ConnectEx(), and DisconnectEx()
Igor Sysoev <igor@sysoev.ru>
parents:
860
diff
changeset
|
189 "WSAIoctl(SIO_GET_EXTENSION_FUNCTION_POINTER, " |
74b2a52bc3c9
TransmitPackets(), ConnectEx(), and DisconnectEx()
Igor Sysoev <igor@sysoev.ru>
parents:
860
diff
changeset
|
190 "WSAID_CONNECTEX) failed"); |
74b2a52bc3c9
TransmitPackets(), ConnectEx(), and DisconnectEx()
Igor Sysoev <igor@sysoev.ru>
parents:
860
diff
changeset
|
191 } |
74b2a52bc3c9
TransmitPackets(), ConnectEx(), and DisconnectEx()
Igor Sysoev <igor@sysoev.ru>
parents:
860
diff
changeset
|
192 |
74b2a52bc3c9
TransmitPackets(), ConnectEx(), and DisconnectEx()
Igor Sysoev <igor@sysoev.ru>
parents:
860
diff
changeset
|
193 if (WSAIoctl(s, SIO_GET_EXTENSION_FUNCTION_POINTER, &dx_guid, sizeof(GUID), |
74b2a52bc3c9
TransmitPackets(), ConnectEx(), and DisconnectEx()
Igor Sysoev <igor@sysoev.ru>
parents:
860
diff
changeset
|
194 &ngx_disconnectex, sizeof(LPFN_DISCONNECTEX), &bytes, |
74b2a52bc3c9
TransmitPackets(), ConnectEx(), and DisconnectEx()
Igor Sysoev <igor@sysoev.ru>
parents:
860
diff
changeset
|
195 NULL, NULL) |
74b2a52bc3c9
TransmitPackets(), ConnectEx(), and DisconnectEx()
Igor Sysoev <igor@sysoev.ru>
parents:
860
diff
changeset
|
196 == -1) |
74b2a52bc3c9
TransmitPackets(), ConnectEx(), and DisconnectEx()
Igor Sysoev <igor@sysoev.ru>
parents:
860
diff
changeset
|
197 { |
74b2a52bc3c9
TransmitPackets(), ConnectEx(), and DisconnectEx()
Igor Sysoev <igor@sysoev.ru>
parents:
860
diff
changeset
|
198 ngx_log_error(NGX_LOG_NOTICE, log, ngx_socket_errno, |
74b2a52bc3c9
TransmitPackets(), ConnectEx(), and DisconnectEx()
Igor Sysoev <igor@sysoev.ru>
parents:
860
diff
changeset
|
199 "WSAIoctl(SIO_GET_EXTENSION_FUNCTION_POINTER, " |
74b2a52bc3c9
TransmitPackets(), ConnectEx(), and DisconnectEx()
Igor Sysoev <igor@sysoev.ru>
parents:
860
diff
changeset
|
200 "WSAID_DISCONNECTEX) failed"); |
100
7ebc8b7fb816
nginx-0.0.1-2003-06-03-19:42:58 import
Igor Sysoev <igor@sysoev.ru>
parents:
93
diff
changeset
|
201 } |
7ebc8b7fb816
nginx-0.0.1-2003-06-03-19:42:58 import
Igor Sysoev <igor@sysoev.ru>
parents:
93
diff
changeset
|
202 |
7ebc8b7fb816
nginx-0.0.1-2003-06-03-19:42:58 import
Igor Sysoev <igor@sysoev.ru>
parents:
93
diff
changeset
|
203 if (ngx_close_socket(s) == -1) { |
7ebc8b7fb816
nginx-0.0.1-2003-06-03-19:42:58 import
Igor Sysoev <igor@sysoev.ru>
parents:
93
diff
changeset
|
204 ngx_log_error(NGX_LOG_ALERT, log, ngx_socket_errno, |
7ebc8b7fb816
nginx-0.0.1-2003-06-03-19:42:58 import
Igor Sysoev <igor@sysoev.ru>
parents:
93
diff
changeset
|
205 ngx_close_socket_n " failed"); |
7ebc8b7fb816
nginx-0.0.1-2003-06-03-19:42:58 import
Igor Sysoev <igor@sysoev.ru>
parents:
93
diff
changeset
|
206 } |
7ebc8b7fb816
nginx-0.0.1-2003-06-03-19:42:58 import
Igor Sysoev <igor@sysoev.ru>
parents:
93
diff
changeset
|
207 |
91
637625a2acdb
nginx-0.0.1-2003-05-19-20:39:14 import
Igor Sysoev <igor@sysoev.ru>
parents:
diff
changeset
|
208 return NGX_OK; |
637625a2acdb
nginx-0.0.1-2003-05-19-20:39:14 import
Igor Sysoev <igor@sysoev.ru>
parents:
diff
changeset
|
209 } |
449
3b1e8c9df9ad
nginx-0.1.0-2004-10-04-00:02:06 import
Igor Sysoev <igor@sysoev.ru>
parents:
444
diff
changeset
|
210 |
3b1e8c9df9ad
nginx-0.1.0-2004-10-04-00:02:06 import
Igor Sysoev <igor@sysoev.ru>
parents:
444
diff
changeset
|
211 |
3b1e8c9df9ad
nginx-0.1.0-2004-10-04-00:02:06 import
Igor Sysoev <igor@sysoev.ru>
parents:
444
diff
changeset
|
212 void ngx_os_status(ngx_log_t *log) |
3b1e8c9df9ad
nginx-0.1.0-2004-10-04-00:02:06 import
Igor Sysoev <igor@sysoev.ru>
parents:
444
diff
changeset
|
213 { |
461 | 214 ngx_osviex_stub_t *osviex_stub; |
215 | |
541 | 216 ngx_log_error(NGX_LOG_NOTICE, log, 0, NGINX_VER); |
217 | |
461 | 218 if (osviex) { |
219 | |
220 /* | |
221 * the MSVC 6.0 SP2 defines wSuiteMask and wProductType | |
222 * as WORD wReserved[2] | |
223 */ | |
224 osviex_stub = (ngx_osviex_stub_t *) &osvi.wServicePackMinor; | |
225 | |
226 ngx_log_error(NGX_LOG_INFO, log, 0, | |
227 "OS: %ud build:%ud, \"%s\", suite:%Xd, type:%ud", | |
228 ngx_win32_version, osvi.dwBuildNumber, osvi.szCSDVersion, | |
229 osviex_stub->wSuiteMask, osviex_stub->wProductType); | |
230 | |
231 } else { | |
232 if (osvi.dwPlatformId == VER_PLATFORM_WIN32_WINDOWS) { | |
233 | |
234 /* Win9x build */ | |
235 | |
236 ngx_log_error(NGX_LOG_INFO, log, 0, | |
237 "OS: %u build:%ud.%ud.%ud, \"%s\"", | |
238 ngx_win32_version, | |
239 osvi.dwBuildNumber >> 24, | |
240 (osvi.dwBuildNumber >> 16) & 0xff, | |
241 osvi.dwBuildNumber & 0xffff, | |
242 osvi.szCSDVersion); | |
243 | |
244 } else { | |
245 | |
246 /* | |
247 * VER_PLATFORM_WIN32_NT | |
248 * | |
249 * we do not currently support VER_PLATFORM_WIN32_CE | |
250 * and we do not support VER_PLATFORM_WIN32s at all | |
251 */ | |
252 | |
253 ngx_log_error(NGX_LOG_INFO, log, 0, "OS: %ud build:%ud, \"%s\"", | |
254 ngx_win32_version, osvi.dwBuildNumber, | |
255 osvi.szCSDVersion); | |
256 } | |
257 } | |
449
3b1e8c9df9ad
nginx-0.1.0-2004-10-04-00:02:06 import
Igor Sysoev <igor@sysoev.ru>
parents:
444
diff
changeset
|
258 } |