Mercurial > hg > nginx
comparison src/http/ngx_http_core.c @ 19:d7908993fdeb
nginx-0.0.1-2002-12-02-19:09:40 import; resume after 2 months stall
author | Igor Sysoev <igor@sysoev.ru> |
---|---|
date | Mon, 02 Dec 2002 16:09:40 +0000 |
parents | 2aba961a1d34 |
children | 77c7629a2627 |
comparison
equal
deleted
inserted
replaced
18:72ad26c77d2d | 19:d7908993fdeb |
---|---|
4 #include <ngx_http.h> | 4 #include <ngx_http.h> |
5 #include <ngx_http_core.h> | 5 #include <ngx_http_core.h> |
6 #include <ngx_http_config.h> | 6 #include <ngx_http_config.h> |
7 | 7 |
8 | 8 |
9 static void *ngx_http_core_create_conf(ngx_pool_t *pool); | 9 static void *ngx_http_core_create_srv_conf(ngx_pool_t *pool); |
10 static void *ngx_http_core_create_loc_conf(ngx_pool_t *pool); | |
10 | 11 |
11 | 12 |
12 static ngx_command_t ngx_http_core_commands[]; | 13 static ngx_command_t ngx_http_core_commands[]; |
13 | 14 |
14 | 15 |
15 ngx_http_module_t ngx_http_core_module = { | 16 ngx_http_module_t ngx_http_core_module = { |
16 NGX_HTTP_MODULE, | 17 NGX_HTTP_MODULE, |
17 NULL, /* create server config */ | 18 ngx_http_core_create_srv_conf, /* create server config */ |
18 ngx_http_core_create_conf, /* create location config */ | 19 ngx_http_core_create_loc_conf, /* create location config */ |
19 ngx_http_core_commands, /* module directives */ | 20 ngx_http_core_commands, /* module directives */ |
20 NULL, /* init module */ | 21 NULL, /* init module */ |
21 NULL /* init output body filter */ | 22 NULL /* init output body filter */ |
22 }; | 23 }; |
23 | 24 |
24 | 25 |
25 static ngx_command_t ngx_http_core_commands[] = { | 26 static ngx_command_t ngx_http_core_commands[] = { |
26 | 27 |
27 {"send_timeout", ngx_conf_set_time_slot, | 28 {"send_timeout", ngx_conf_set_time_slot, |
28 offsetof(ngx_http_core_conf_t, send_timeout), | 29 offsetof(ngx_http_core_loc_conf_t, send_timeout), |
29 NGX_HTTP_LOC_CONF, NGX_CONF_TAKE1, | 30 NGX_HTTP_LOC_CONF, NGX_CONF_TAKE1, |
30 "set timeout for sending response"}, | 31 "set timeout for sending response"}, |
31 | 32 |
32 {NULL} | 33 {NULL} |
33 | 34 |
34 }; | 35 }; |
35 | 36 |
36 | 37 |
37 static void *ngx_http_core_create_conf(ngx_pool_t *pool) | 38 static void *ngx_http_core_create_srv_conf(ngx_pool_t *pool) |
38 { | 39 { |
39 ngx_http_core_conf_t *conf; | 40 ngx_http_core_srv_conf_t *conf; |
40 | 41 |
41 ngx_test_null(conf, | 42 ngx_test_null(conf, |
42 ngx_pcalloc(pool, sizeof(ngx_http_core_conf_t)), | 43 ngx_pcalloc(pool, sizeof(ngx_http_core_srv_conf_t)), |
44 NULL); | |
45 | |
46 return conf; | |
47 } | |
48 | |
49 static void *ngx_http_core_create_loc_conf(ngx_pool_t *pool) | |
50 { | |
51 ngx_http_core_loc_conf_t *conf; | |
52 | |
53 ngx_test_null(conf, | |
54 ngx_pcalloc(pool, sizeof(ngx_http_core_loc_conf_t)), | |
43 NULL); | 55 NULL); |
44 | 56 |
45 conf->send_timeout = NGX_CONF_UNSET; | 57 conf->send_timeout = NGX_CONF_UNSET; |
46 | 58 |
47 return conf; | 59 return conf; |
48 } | 60 } |
49 | 61 |
62 #if 0 | |
63 static void *ngx_http_core_create_conf(ngx_pool_t *pool) | |
64 { | |
65 | |
66 ngx_test_null(conf, ngx_palloc(pool, sizeof(ngx_http_core_conf_t)), NULL); | |
67 | |
68 ngx_test_null(conf->srv, ngx_http_core_create_srv_conf_t(pool), NULL); | |
69 ngx_test_null(conf->loc, ngx_http_core_create_loc_conf_t(pool), NULL); | |
70 conf->parent = | |
71 conf->next = NULL; | |
72 } | |
73 #endif |