mirror of
https://github.com/nginx/nginx.git
synced 2025-06-07 17:52:38 +08:00
nginx-0.0.10-2004-09-14-19:55:24 import
This commit is contained in:
parent
562626ae6c
commit
e2ff3ea920
@ -4,7 +4,7 @@ CORE_DEPS="$UNIX_DEPS $SOLARIS_DEPS"
|
|||||||
CORE_SRCS="$UNIX_SRCS $SOLARIS_SRCS "
|
CORE_SRCS="$UNIX_SRCS $SOLARIS_SRCS "
|
||||||
EVENT_MODULES="$EVENT_MODULES"
|
EVENT_MODULES="$EVENT_MODULES"
|
||||||
|
|
||||||
CORE_LIBS="$CORE_LIBS -lsocket -lnsl"
|
CORE_LIBS="$CORE_LIBS -lsocket -lnsl -lrt"
|
||||||
|
|
||||||
# the Solaris's make support
|
# the Solaris's make support
|
||||||
MAKE_SL=YES
|
MAKE_SL=YES
|
||||||
|
32
auto/summary
32
auto/summary
@ -8,32 +8,32 @@ if [ $USE_PCRE = DISABLED ]; then
|
|||||||
|
|
||||||
else
|
else
|
||||||
case $PCRE in
|
case $PCRE in
|
||||||
YES) echo " using system PCRE library" ;;
|
YES) echo " + using system PCRE library" ;;
|
||||||
NONE) echo " PCRE library is not used" ;;
|
NONE) echo " + PCRE library is not used" ;;
|
||||||
NO) echo " PCRE library is not found" ;;
|
NO) echo " + PCRE library is not found" ;;
|
||||||
*) echo " using PCRE library: $PCRE" ;;
|
*) echo " + using PCRE library: $PCRE" ;;
|
||||||
esac
|
esac
|
||||||
fi
|
fi
|
||||||
|
|
||||||
case $MD5 in
|
case $MD5 in
|
||||||
YES) echo " md5: using system $MD5_LIB library" ;;
|
YES) echo " + md5: using system $MD5_LIB library" ;;
|
||||||
NONE) echo " md5 library is not used" ;;
|
NONE) echo " + md5 library is not used" ;;
|
||||||
NO) echo " md5 library is not found" ;;
|
NO) echo " + md5 library is not found" ;;
|
||||||
*) echo " using md5 library: $MD5" ;;
|
*) echo " + using md5 library: $MD5" ;;
|
||||||
esac
|
esac
|
||||||
|
|
||||||
case $OPENSSL in
|
case $OPENSSL in
|
||||||
YES) echo " using system OpenSSL library" ;;
|
YES) echo " + using system OpenSSL library" ;;
|
||||||
NONE) echo " OpenSSL library is not used" ;;
|
NONE) echo " + OpenSSL library is not used" ;;
|
||||||
NO) echo " OpenSSL library is not found" ;;
|
NO) echo " + OpenSSL library is not found" ;;
|
||||||
*) echo " using OpenSSL library: $OPENSSL" ;;
|
*) echo " + using OpenSSL library: $OPENSSL" ;;
|
||||||
esac
|
esac
|
||||||
|
|
||||||
case $ZLIB in
|
case $ZLIB in
|
||||||
YES) echo " using system zlib library" ;;
|
YES) echo " + using system zlib library" ;;
|
||||||
NONE) echo " zlib library is not used" ;;
|
NONE) echo " + zlib library is not used" ;;
|
||||||
NO) echo " zlib library is not found" ;;
|
NO) echo " + zlib library is not found" ;;
|
||||||
*) echo " using zlib library: $ZLIB" ;;
|
*) echo " + using zlib library: $ZLIB" ;;
|
||||||
esac
|
esac
|
||||||
|
|
||||||
echo
|
echo
|
||||||
|
@ -210,3 +210,58 @@ ngx_int_t ngx_ptocidr(ngx_str_t *text, void *cidr)
|
|||||||
|
|
||||||
return NGX_OK;
|
return NGX_OK;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
#if 0
|
||||||
|
|
||||||
|
ngx_int_t ngx_inet_addr_port(ngx_conf_t *cf, ngx_command_t *cmd,
|
||||||
|
ngx_str_t *addr_port)
|
||||||
|
{
|
||||||
|
u_char *host;
|
||||||
|
ngx_int_t port;
|
||||||
|
ngx_uint_t p;
|
||||||
|
struct hostent *h;
|
||||||
|
|
||||||
|
for (p = 0; p < addr_port->len; p++) {
|
||||||
|
if (addr_port->data[p] == ':') {
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
in_addr->host.len = p;
|
||||||
|
if (!(in_addr->host.data = ngx_palloc(pool, p + 1))) {
|
||||||
|
return NGX_ERROR;
|
||||||
|
}
|
||||||
|
|
||||||
|
ngx_cpystrn(in_addr->host.data, addr_port->data, p + 1);
|
||||||
|
|
||||||
|
if (p == addr_port->len) {
|
||||||
|
p = 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
port = ngx_atoi(&addr[p], args[1].len - p);
|
||||||
|
if (port == NGX_ERROR && p == 0) {
|
||||||
|
|
||||||
|
/* default port */
|
||||||
|
iap->port = 0;
|
||||||
|
|
||||||
|
} else if ((port == NGX_ERROR && p != 0) /* "listen host:NONNUMBER" */
|
||||||
|
|| (port < 1 || port > 65536)) { /* "listen 99999" */
|
||||||
|
|
||||||
|
ngx_conf_log_error(NGX_LOG_EMERG, cf, 0,
|
||||||
|
"invalid port \"%s\" in \"%s\" directive, "
|
||||||
|
"it must be a number between 1 and 65535",
|
||||||
|
&addr[p], cmd->name.data);
|
||||||
|
|
||||||
|
return NGX_CONF_ERROR;
|
||||||
|
|
||||||
|
} else if (p == 0) {
|
||||||
|
ls->addr = INADDR_ANY;
|
||||||
|
ls->port = (in_port_t) port;
|
||||||
|
return NGX_CONF_OK;
|
||||||
|
}
|
||||||
|
|
||||||
|
return NGX_OK;
|
||||||
|
}
|
||||||
|
|
||||||
|
#endif
|
||||||
|
@ -707,11 +707,11 @@ static ngx_int_t ngx_kqueue_process_events(ngx_cycle_t *cycle)
|
|||||||
|
|
||||||
static ngx_int_t ngx_kqueue_process_changes(ngx_cycle_t *cycle, ngx_uint_t try)
|
static ngx_int_t ngx_kqueue_process_changes(ngx_cycle_t *cycle, ngx_uint_t try)
|
||||||
{
|
{
|
||||||
int n;
|
int n;
|
||||||
ngx_int_t rc;
|
ngx_int_t rc;
|
||||||
ngx_err_t err;
|
ngx_err_t err;
|
||||||
struct timespec ts;
|
struct timespec ts;
|
||||||
struct kevent *changes;
|
struct kevent *changes;
|
||||||
|
|
||||||
if (ngx_mutex_lock(kevent_mutex) == NGX_ERROR) {
|
if (ngx_mutex_lock(kevent_mutex) == NGX_ERROR) {
|
||||||
return NGX_ERROR;
|
return NGX_ERROR;
|
||||||
|
@ -95,12 +95,14 @@ void ngx_event_accept(ngx_event_t *ev)
|
|||||||
err = ngx_socket_errno;
|
err = ngx_socket_errno;
|
||||||
|
|
||||||
if (err == NGX_EAGAIN) {
|
if (err == NGX_EAGAIN) {
|
||||||
|
#if 0
|
||||||
if (!(ngx_event_flags & NGX_USE_RTSIG_EVENT))
|
if (!(ngx_event_flags & NGX_USE_RTSIG_EVENT))
|
||||||
{
|
{
|
||||||
ngx_log_error(NGX_LOG_NOTICE, log, err,
|
ngx_log_error(NGX_LOG_NOTICE, log, err,
|
||||||
"EAGAIN after %d accepted connection(s)",
|
"EAGAIN after %d accepted connection(s)",
|
||||||
accepted);
|
accepted);
|
||||||
}
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
ngx_destroy_pool(pool);
|
ngx_destroy_pool(pool);
|
||||||
return;
|
return;
|
||||||
|
@ -1479,10 +1479,14 @@ static char *ngx_set_listen(ngx_conf_t *cf, ngx_command_t *cmd, void *conf)
|
|||||||
ngx_str_t *args;
|
ngx_str_t *args;
|
||||||
ngx_http_listen_t *ls;
|
ngx_http_listen_t *ls;
|
||||||
|
|
||||||
/* TODO: check duplicate 'listen' directives,
|
/*
|
||||||
add resolved name to server names ??? */
|
* TODO: check duplicate 'listen' directives,
|
||||||
|
* add resolved name to server names ???
|
||||||
|
*/
|
||||||
|
|
||||||
ngx_test_null(ls, ngx_push_array(&scf->listen), NGX_CONF_ERROR);
|
if (!(ls = ngx_array_push(&scf->listen))) {
|
||||||
|
return NGX_CONF_ERROR;
|
||||||
|
}
|
||||||
|
|
||||||
/* AF_INET only */
|
/* AF_INET only */
|
||||||
|
|
||||||
|
@ -68,6 +68,57 @@ static ngx_inline uint32_t ngx_atomic_cmp_set(ngx_atomic_t *lock,
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
#elif ( __sparc__ )
|
||||||
|
|
||||||
|
typedef volatile uint32_t ngx_atomic_t;
|
||||||
|
|
||||||
|
|
||||||
|
static ngx_inline uint32_t ngx_atomic_inc(ngx_atomic_t *value)
|
||||||
|
{
|
||||||
|
uint32_t old, new, res;
|
||||||
|
|
||||||
|
old = *value;
|
||||||
|
|
||||||
|
for ( ;; ) {
|
||||||
|
|
||||||
|
new = old + 1;
|
||||||
|
res = new;
|
||||||
|
|
||||||
|
__asm__ volatile (
|
||||||
|
|
||||||
|
"casa [%1]ASI_P, %2, %0"
|
||||||
|
|
||||||
|
: "+r" (res) : "r" (value), "r" (old));
|
||||||
|
|
||||||
|
if (res == old) {
|
||||||
|
return new;
|
||||||
|
}
|
||||||
|
|
||||||
|
old = res;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/* STUB */
|
||||||
|
#define ngx_atomic_dec(x) (*(x))--;
|
||||||
|
/**/
|
||||||
|
|
||||||
|
|
||||||
|
static ngx_inline uint32_t ngx_atomic_cmp_set(ngx_atomic_t *lock,
|
||||||
|
ngx_atomic_t old,
|
||||||
|
ngx_atomic_t set)
|
||||||
|
{
|
||||||
|
uint32_t res = (u_int32_t) set;
|
||||||
|
|
||||||
|
__asm__ volatile (
|
||||||
|
|
||||||
|
"casa [%1]ASI_P, %2, %0"
|
||||||
|
|
||||||
|
: "+r" (res) : "r" (lock), "r" (old));
|
||||||
|
|
||||||
|
return (res == old);
|
||||||
|
}
|
||||||
|
|
||||||
#else
|
#else
|
||||||
|
|
||||||
typedef volatile uint32_t ngx_atomic_t;
|
typedef volatile uint32_t ngx_atomic_t;
|
||||||
|
Loading…
Reference in New Issue
Block a user