comparison src/event/modules/ngx_iocp_module.c @ 1354:f69d1aab6a0f

make 64-bit ngx_int_t on 64-bit platforms
author Igor Sysoev <igor@sysoev.ru>
date Sun, 29 Jul 2007 18:24:53 +0000
parents 63a820b0bc6c
children 0b592a68aade
comparison
equal deleted inserted replaced
1353:7443fbe0b013 1354:f69d1aab6a0f
11 11
12 12
13 static ngx_int_t ngx_iocp_init(ngx_cycle_t *cycle, ngx_msec_t timer); 13 static ngx_int_t ngx_iocp_init(ngx_cycle_t *cycle, ngx_msec_t timer);
14 static ngx_thread_value_t __stdcall ngx_iocp_timer(void *data); 14 static ngx_thread_value_t __stdcall ngx_iocp_timer(void *data);
15 static void ngx_iocp_done(ngx_cycle_t *cycle); 15 static void ngx_iocp_done(ngx_cycle_t *cycle);
16 static ngx_int_t ngx_iocp_add_event(ngx_event_t *ev, int event, u_int key); 16 static ngx_int_t ngx_iocp_add_event(ngx_event_t *ev, ngx_int_t event,
17 static ngx_int_t ngx_iocp_del_connection(ngx_connection_t *c, u_int flags); 17 ngx_uint_t key);
18 static ngx_int_t ngx_iocp_del_connection(ngx_connection_t *c, ngx_uint_t flags);
18 static ngx_int_t ngx_iocp_process_events(ngx_cycle_t *cycle, ngx_msec_t timer, 19 static ngx_int_t ngx_iocp_process_events(ngx_cycle_t *cycle, ngx_msec_t timer,
19 ngx_uint_t flags); 20 ngx_uint_t flags);
20 static void *ngx_iocp_create_conf(ngx_cycle_t *cycle); 21 static void *ngx_iocp_create_conf(ngx_cycle_t *cycle);
21 static char *ngx_iocp_init_conf(ngx_cycle_t *cycle, void *conf); 22 static char *ngx_iocp_init_conf(ngx_cycle_t *cycle, void *conf);
22 23
184 iocp = NULL; 185 iocp = NULL;
185 } 186 }
186 187
187 188
188 static ngx_int_t 189 static ngx_int_t
189 ngx_iocp_add_event(ngx_event_t *ev, int event, u_int key) 190 ngx_iocp_add_event(ngx_event_t *ev, ngx_int_t event, ngx_uint_t key)
190 { 191 {
191 ngx_connection_t *c; 192 ngx_connection_t *c;
192 193
193 c = (ngx_connection_t *) ev->data; 194 c = (ngx_connection_t *) ev->data;
194 195
195 c->read->active = 1; 196 c->read->active = 1;
196 c->write->active = 1; 197 c->write->active = 1;
197 198
198 ngx_log_debug3(NGX_LOG_DEBUG_EVENT, ev->log, 0, 199 ngx_log_debug3(NGX_LOG_DEBUG_EVENT, ev->log, 0,
199 "iocp add: fd:%d k:%d ov:%p", c->fd, key, &ev->ovlp); 200 "iocp add: fd:%d k:%ui ov:%p", c->fd, key, &ev->ovlp);
200 201
201 if (CreateIoCompletionPort((HANDLE) c->fd, iocp, key, 0) == NULL) { 202 if (CreateIoCompletionPort((HANDLE) c->fd, iocp, key, 0) == NULL) {
202 ngx_log_error(NGX_LOG_ALERT, c->log, ngx_errno, 203 ngx_log_error(NGX_LOG_ALERT, c->log, ngx_errno,
203 "CreateIoCompletionPort() failed"); 204 "CreateIoCompletionPort() failed");
204 return NGX_ERROR; 205 return NGX_ERROR;
207 return NGX_OK; 208 return NGX_OK;
208 } 209 }
209 210
210 211
211 static ngx_int_t 212 static ngx_int_t
212 ngx_iocp_del_connection(ngx_connection_t *c, u_int flags) 213 ngx_iocp_del_connection(ngx_connection_t *c, ngx_uint_t flags)
213 { 214 {
214 #if 0 215 #if 0
215 if (flags & NGX_CLOSE_EVENT) { 216 if (flags & NGX_CLOSE_EVENT) {
216 return NGX_OK; 217 return NGX_OK;
217 } 218 }