comparison src/http/ngx_http.c @ 2:ffffe1499bce

nginx-0.0.1-2002-08-16-19:27:03 import
author Igor Sysoev <igor@sysoev.ru>
date Fri, 16 Aug 2002 15:27:03 +0000
parents
children 34a521b1a148
comparison
equal deleted inserted replaced
1:d220029ac7f3 2:ffffe1499bce
1
2 #include <ngx_http.h>
3
4
5 /* STUB */
6
7 static struct sockaddr_in addr;
8 static char addr_text[22];
9
10 static ngx_http_server_t ngx_http_server;
11
12 int ngx_http_init(ngx_pool_t *pool)
13 {
14 ngx_listen_t *ls;
15
16 ngx_http_server.handler = ngx_http_init_connection;
17
18 ngx_http_server.buff_size = 1024;
19
20 ngx_http_server.doc_root = "/home/is/work/xml/site-1.0.0/html";
21 ngx_http_server.doc_root_len = strlen(server.doc_root);
22
23 ls = ngx_push_array(ngx_listening_sockets);
24 ngx_memzero(ls, sizeof(nxg_listen_t));
25
26 addr.sin_family = AF_INET;
27 addr.sin_addr.s_addr = inet_addr(optarg)
28 addr.sin_port = htons(8000);
29
30 ngx_snprintf(ngx_cpystrn(addr_text, inet_ntoa(addr.sin_addr), 16),
31 7, ":%d", ntohs(addr.sin_port));
32
33 ls->family = AF_INET;
34 ls->type = SOCK_STREAM;
35 ls->protocol = 0;
36 ls->addr = &addr;
37 ls->addr_len = sizeof(sockaddr_in);
38 ls->text = &addr_text;
39 ls->backlog = -1;
40 ls->nonblocking = 1;
41
42 return 1;
43 }
44
45 /* */