nginx-0.0.1-2004-01-23-12:26:18 import

This commit is contained in:
Igor Sysoev 2004-01-23 09:26:18 +00:00
parent 54c80845ea
commit 5c8c52f858
7 changed files with 85 additions and 40 deletions

View File

@ -6,6 +6,9 @@ OBJS=objs
TEST_BUILD_DEVPOLL=NO
SELECT=YES
POLL=YES
HTTP_REWRITE=YES
HTTP_GZIP=YES
HTTP_PROXY=YES
@ -35,6 +38,9 @@ do
--builddir=*) OBJS="$value" ;;
--without-select_module) SELECT=NO ;;
--without-poll_module) POLL=NO ;;
--without-http_rewrite_module) HTTP_REWRITE=NO ;;
--without-http_gzip_module) HTTP_GZIP=NO ;;
--without-http_proxy_module) HTTP_PROXY=NO ;;
@ -57,17 +63,22 @@ done
if [ $help = yes ]; then
echo
echo " --help this message"
echo " --without-http_gzip_module disable http_gzip_module"
echo " --without-http_proxy_module disable http_proxy_module"
echo " --with-cc=NAME name of or path to C compiler"
echo " --help this message"
echo
echo " --with-pcre=DIR path to PCRE library"
echo " --with-md5=DIR path to md5 library"
echo " --with-zlib=DIR path to zlib library"
echo " --without-select_module disable select_module"
echo " --without-poll_module disable poll_module"
echo " --without-http_rewrite_module disable http_rewrite_module"
echo " --without-http_gzip_module disable http_gzip_module"
echo " --without-http_proxy_module disable http_proxy_module"
echo " --with-cc=NAME name of or path to C compiler"
echo
echo " --with-pcre=DIR path to PCRE library"
echo " --with-md5=DIR path to md5 library"
echo " --with-zlib=DIR path to zlib library"
echo
exit 1

View File

@ -2,12 +2,21 @@
CORE_INCS="$UNIX_INCS"
CORE_DEPS="$UNIX_DEPS $FREEBSD_DEPS"
CORE_SRCS="$UNIX_SRCS $FREEBSD_SRCS $SELECT_SRCS $POLL_SRCS"
EVENT_MODULES="$EVENT_MODULES $SELECT_MODULE $POLL_MODULE"
CORE_SRCS="$UNIX_SRCS $FREEBSD_SRCS"
MD5_LIB="-lmd"
ZLIB_LIB="-lz"
if [ $SELECT = YES ]; then
CORE_SRCS="$CORE_SRCS $SELECT_SRCS"
EVENT_MODULES="$EVENT_MODULES $SELECT_MODULE"
fi
if [ $POLL = YES ]; then
CORE_SRCS="$CORE_SRCS $POLL_SRCS"
EVENT_MODULES="$EVENT_MODULES $POLL_MODULE"
fi
version=`grep "#define __FreeBSD_version" /usr/include/osreldate.h \
| sed -e 's/^.* \(.*\)$/\1/'`

View File

@ -635,8 +635,8 @@ static void ngx_worker_process_cycle(ngx_cycle_t *cycle, void *data)
if (ngx_quit) {
ngx_log_error(NGX_LOG_INFO, cycle->log, 0,
"gracefully shutdowning");
ngx_setproctitle("worker process is shutdowning");
"gracefully shutting down");
ngx_setproctitle("worker process is shutting down");
break;
}

View File

@ -2,9 +2,11 @@
#define _NGX_CONFIG_H_INCLUDED_
#if 0
/* STUB to allocate a big ngx_connections */
#undef FD_SETSIZE
#define FD_SETSIZE 5000
#endif
#if defined __FreeBSD__

View File

@ -243,8 +243,10 @@ static char *ngx_http_block(ngx_conf_t *cf, ngx_command_t *cmd, void *conf)
cmcf->phases[NGX_HTTP_CONTENT_PHASE].type = NGX_OK;
/* create the lists of the ports, the addresses and the server names
to allow quickly find the server core module configuration at run-time */
/*
* create the lists of the ports, the addresses and the server names
* to allow quickly find the server core module configuration at run-time
*/
ngx_init_array(in_ports, cf->pool, 10, sizeof(ngx_http_in_port_t),
NGX_CONF_ERROR);
@ -282,8 +284,10 @@ static char *ngx_http_block(ngx_conf_t *cf, ngx_command_t *cmd, void *conf)
s_name = cscfp[s]->server_names.elts;
for (n = 0; n < cscfp[s]->server_names.nelts; n++) {
/* add the server name and server core module
configuration to the address:port */
/*
* add the server name and server core module
* configuration to the address:port
*/
/* TODO: duplicate names can be checked here */
@ -295,8 +299,10 @@ static char *ngx_http_block(ngx_conf_t *cf, ngx_command_t *cmd, void *conf)
name->core_srv_conf = s_name[n].core_srv_conf;
}
/* check duplicate "default" server that
serves this address:port */
/*
* check duplicate "default" server that
* serves this address:port
*/
if (lscf[l].flags & NGX_HTTP_DEFAULT_SERVER) {
if (in_addr[a].flags
@ -320,9 +326,11 @@ static char *ngx_http_block(ngx_conf_t *cf, ngx_command_t *cmd, void *conf)
} else if (in_addr[a].addr == INADDR_ANY) {
/* "*:port" must be the last resort so move it
to the end of the address list and add
the new address at its place */
/*
* "*:port" must be the last resort so move it
* to the end of the address list and add
* the new address at its place
*/
ngx_test_null(inaddr,
ngx_push_array(&in_port[p].addrs),
@ -335,8 +343,10 @@ static char *ngx_http_block(ngx_conf_t *cf, ngx_command_t *cmd, void *conf)
in_addr[a].flags = lscf[l].flags;
in_addr[a].core_srv_conf = cscfp[s];
/* create the empty list of the server names that
can be served on this address:port */
/*
* create the empty list of the server names that
* can be served on this address:port
*/
ngx_init_array(inaddr->names, cf->pool, 10,
sizeof(ngx_http_server_name_t),
@ -350,8 +360,10 @@ static char *ngx_http_block(ngx_conf_t *cf, ngx_command_t *cmd, void *conf)
if (!addr_found) {
/* add the address to the addresses list that
bound to this port */
/*
* add the address to the addresses list that
* bound to this port
*/
ngx_test_null(inaddr,
ngx_push_array(&in_port[p].addrs),
@ -361,8 +373,10 @@ static char *ngx_http_block(ngx_conf_t *cf, ngx_command_t *cmd, void *conf)
inaddr->flags = lscf[l].flags;
inaddr->core_srv_conf = cscfp[s];
/* create the empty list of the server names that
can be served on this address:port */
/*
* create the empty list of the server names that
* can be served on this address:port
*/
ngx_init_array(inaddr->names, cf->pool, 10,
sizeof(ngx_http_server_name_t),
@ -402,8 +416,10 @@ static char *ngx_http_block(ngx_conf_t *cf, ngx_command_t *cmd, void *conf)
inaddr->flags = lscf[l].flags;
inaddr->core_srv_conf = cscfp[s];
/* create the empty list of the server names that
can be served on this address:port */
/*
* create the empty list of the server names that
* can be served on this address:port
*/
ngx_init_array(inaddr->names, cf->pool, 10,
sizeof(ngx_http_server_name_t),
@ -434,16 +450,20 @@ static char *ngx_http_block(ngx_conf_t *cf, ngx_command_t *cmd, void *conf)
}
}
/* if the all server names point to the same server
then we do not need to check them at run-time */
/*
* if the all server names point to the same server
* then we do not need to check them at run-time
*/
if (!virtual_names) {
in_addr[a].names.nelts = 0;
}
}
/* if there's the binding to "*:port" then we need to bind()
to "*:port" only and ignore the other bindings */
/*
* if there's the binding to "*:port" then we need to bind()
* to "*:port" only and ignore the other bindings
*/
if (in_addr[a - 1].addr == INADDR_ANY) {
a--;
@ -522,8 +542,10 @@ static char *ngx_http_block(ngx_conf_t *cf, ngx_command_t *cmd, void *conf)
in_addr = in_port[p].addrs.elts;
if (in_addr[in_port[p].addrs.nelts - 1].addr != INADDR_ANY) {
/* if this port has not the "*:port" binding then create
the separate ngx_http_in_port_t for the all bindings */
/*
* if this port has not the "*:port" binding then create
* the separate ngx_http_in_port_t for the all bindings
*/
ngx_test_null(inport,
ngx_palloc(cf->pool,

View File

@ -75,8 +75,9 @@ static ngx_str_t http_codes[] = {
ngx_null_string, /* "412 Precondition Failed" */
ngx_string("413 Request Entity Too Large"),
ngx_null_string, /* "414 Request-URI Too Large" but we never send it
because we treat such requests as the HTTP/0.9 requests
and send only the body without the header */
* because we treat such requests as the HTTP/0.9
* requests and send only a body without a header
*/
ngx_null_string, /* "415 Unsupported Media Type" */
ngx_string("416 Requested Range Not Satisfiable"),

View File

@ -123,7 +123,7 @@ void ngx_signal_handler(int signo)
case ngx_signal_value(NGX_SHUTDOWN_SIGNAL):
ngx_quit = 1;
action = ", shutdowning";
action = ", shutting down";
break;
case ngx_signal_value(NGX_TERMINATE_SIGNAL):
@ -184,7 +184,7 @@ void ngx_signal_handler(int signo)
case ngx_signal_value(NGX_SHUTDOWN_SIGNAL):
ngx_quit = 1;
action = ", shutdowning";
action = ", shutting down";
break;
case ngx_signal_value(NGX_TERMINATE_SIGNAL):