cat << END >> $NGX_MAKEFILE
install: $NGX_OBJS${ngx_dirsep}nginx${ngx_binext}
- test -d "$NGX_PREFIX" || mkdir -p "$NGX_PREFIX"
+ test -d '$NGX_PREFIX' || mkdir -p '$NGX_PREFIX'
- test -d "`dirname \"$NGX_SBIN_PATH\"`" \
- || mkdir -p "`dirname \"$NGX_SBIN_PATH\"`"
- test ! -f "$NGX_SBIN_PATH" || mv "$NGX_SBIN_PATH" "$NGX_SBIN_PATH.old"
- cp $NGX_OBJS/nginx "$NGX_SBIN_PATH"
+ test -d '`dirname "$NGX_SBIN_PATH"`' \
+ || mkdir -p '`dirname "$NGX_SBIN_PATH"`'
+ test ! -f '$NGX_SBIN_PATH' || mv '$NGX_SBIN_PATH' '$NGX_SBIN_PATH.old'
+ cp $NGX_OBJS/nginx '$NGX_SBIN_PATH'
- test -d "`dirname \"$NGX_CONF_PATH\"`" \
- || mkdir -p "`dirname \"$NGX_CONF_PATH\"`"
+ test -d '`dirname "$NGX_CONF_PATH"`' \
+ || mkdir -p '`dirname "$NGX_CONF_PATH"`'
- cp conf/koi-win "`dirname \"$NGX_CONF_PATH\"`"
+ cp conf/koi-win '`dirname "$NGX_CONF_PATH"`'
- test -f "`dirname \"$NGX_CONF_PATH\"`/mime.types" || \
- cp conf/mime.types "`dirname \"$NGX_CONF_PATH\"`/mime.types"
- cp conf/mime.types "`dirname \"$NGX_CONF_PATH\"`/mime.types.default"
+ test -f '`dirname "$NGX_CONF_PATH"`/mime.types' || \
+ cp conf/mime.types '`dirname "$NGX_CONF_PATH"`/mime.types'
+ cp conf/mime.types '`dirname "$NGX_CONF_PATH"`/mime.types.default'
- test -f "$NGX_CONF_PATH" || cp conf/nginx.conf "$NGX_CONF_PATH"
- cp conf/nginx.conf "`dirname \"$NGX_CONF_PATH\"`/nginx.conf.default"
+ test -f '$NGX_CONF_PATH' || cp conf/nginx.conf '$NGX_CONF_PATH'
+ cp conf/nginx.conf '`dirname "$NGX_CONF_PATH"`/nginx.conf.default'
- test -d "`dirname \"$NGX_PID_PATH\"`" \
- || mkdir -p "`dirname \"$NGX_PID_PATH\"`"
+ test -d '`dirname "$NGX_PID_PATH"`' \
+ || mkdir -p '`dirname "$NGX_PID_PATH"`'
- test -d "`dirname \"$NGX_HTTP_LOG_PATH\"`" || \
- mkdir -p "`dirname \"$NGX_HTTP_LOG_PATH\"`"
+ test -d '`dirname "$NGX_HTTP_LOG_PATH"`' || \
+ mkdir -p '`dirname "$NGX_HTTP_LOG_PATH"`'
- test -d "$NGX_PREFIX/html" || cp -r html "$NGX_PREFIX"
+ test -d '$NGX_PREFIX/html' || cp -r html '$NGX_PREFIX'
END
if test -n "$NGX_ERROR_LOG_PATH"; then
cat << END >> $NGX_MAKEFILE
- test -d "`dirname \"$NGX_ERROR_LOG_PATH\"`" || \
- mkdir -p "`dirname \"$NGX_ERROR_LOG_PATH\"`"
+ test -d '`dirname "$NGX_ERROR_LOG_PATH"`' || \
+ mkdir -p '`dirname "$NGX_ERROR_LOG_PATH"`'
END
fi
<title lang="en">nginx changelog</title>
+<changes ver="0.1.22" date="22.02.2005">
+
+<change type="bugfix">
+<para lang="ru">
+ÍÏÄÕÌØ ngx_http_stub_status_module ÐÏËÁÚÙ×ÁÌ ÎÅ×ÅÒÎÕÀ ÓÔÁÔÉÓÔÉËÕ
+ÄÌÑ ÏÂÒÁÂÏÔÁÎÎÙÈ ÓÏÅÄÉÎÅÎÉÊ, ÅÓÌÉ ÉÓÐÏÌØÚÏ×ÁÌÏÓØ ÐÒÏËÓÉÒÏ×ÁÎÉÅ
+ÉÌÉ FastCGI-ÓÅÒ×ÅÒ.
+</para>
+<para lang="en">
+the ngx_http_stub_status_module showed incorrect handled connections
+statictics if the proxing or FastCGI server were used.
+</para>
+</change>
+
+<change type="bugfix">
+<para lang="ru">
+ÎÁ Linux É Solaris ÕÓÔÁÎÏ×ÏÞÎÙÅ ÐÕÔÉ ÂÙÌÉ ÎÅ×ÅÒÎÏ ÚÁËÌÀÞÅÎÙ × ËÁ×ÙÞËÉ;
+ÏÛÉÂËÁ ÐÏÑ×ÉÌÁÓØ × 0.1.21.
+</para>
+<para lang="en">
+the installation pathes were incorrectly quoted on Linux and Solaris;
+bug appeared in 0.1.21.
+</para>
+</change>
+
+</changes>
+
+
<changes ver="0.1.21" date="22.02.2005">
<change type="bugfix">
#define _NGINX_H_INCLUDED_
-#define NGINX_VER "nginx/0.1.21"
+#define NGINX_VER "nginx/0.1.22"
#define NGINX_VAR "NGINX"
#define NGX_NEWPID_EXT ".newbin"
ngx_buf_t *buffer;
- ngx_atomic_int_t number;
+ ngx_atomic_uint_t number;
unsigned log_error:2; /* ngx_connection_log_error_e */
#include <ngx_core.h>
-static ngx_atomic_int_t ngx_temp_number;
-static ngx_atomic_int_t ngx_random;
+static ngx_atomic_uint_t ngx_temp_number;
+static ngx_atomic_uint_t ngx_random;
ssize_t
ngx_create_temp_file(ngx_file_t *file, ngx_path_t *path, ngx_pool_t *pool,
int persistent)
{
- ngx_err_t err;
- ngx_atomic_int_t n;
+ ngx_err_t err;
+ ngx_atomic_uint_t n;
file->name.len = path->name.len + 1 + path->len + NGX_ATOMIC_T_LEN;
}
-ngx_atomic_int_t
+ngx_atomic_uint_t
ngx_next_temp_number(ngx_uint_t collision)
{
if (collision) {
ngx_int_t ngx_create_pathes(ngx_cycle_t *cycle, ngx_uid_t user);
void ngx_init_temp_number();
-ngx_atomic_int_t ngx_next_temp_number(ngx_uint_t collision);
+ngx_atomic_uint_t ngx_next_temp_number(ngx_uint_t collision);
char *ngx_conf_set_path_slot(ngx_conf_t *cf, ngx_command_t *cmd, void *conf);
ngx_uint_t log_level;
ngx_open_file_t *file;
- ngx_atomic_int_t connection;
+ ngx_atomic_uint_t connection;
ngx_log_handler_pt handler;
void *data;
* %[0][width|m][u][x|X]i ngx_int_t/ngx_uint_t
* %[0][width][u][x|X]D int32_t/uint32_t
* %[0][width][u][x|X]L int64_t/uint64_t
- * %[0][width|m][u][x|X]A ngx_atomic_int_t
+ * %[0][width|m][u][x|X]A ngx_atomic_int_t/ngx_atomic_uint_t
* %P ngx_pid_t
* %r rlim_t
* %p pointer
if (sign) {
i64 = (int64_t) va_arg(args, ngx_atomic_int_t);
} else {
- ui64 = (uint64_t) va_arg(args, ngx_atomic_int_t);
+ ui64 = (uint64_t) va_arg(args, ngx_atomic_uint_t);
}
if (max_width) {
static char *ngx_accept_mutex_check(ngx_conf_t *cf, void *post, void *data);
-static ngx_uint_t ngx_event_max_module;
+static ngx_uint_t ngx_event_max_module;
-ngx_uint_t ngx_event_flags;
-ngx_event_actions_t ngx_event_actions;
+ngx_uint_t ngx_event_flags;
+ngx_event_actions_t ngx_event_actions;
-ngx_atomic_t connection_counter;
+ngx_atomic_t connection_counter;
ngx_atomic_t *ngx_connection_counter = &connection_counter;
ngx_atomic_t *ngx_accept_mutex_ptr;
ngx_atomic_t *ngx_accept_mutex;
-ngx_uint_t ngx_accept_mutex_held;
-ngx_msec_t ngx_accept_mutex_delay;
-ngx_int_t ngx_accept_disabled;
+ngx_uint_t ngx_accept_mutex_held;
+ngx_msec_t ngx_accept_mutex_delay;
+ngx_int_t ngx_accept_disabled;
#if (NGX_STAT_STUB)
ngx_atomic_t ngx_stat_accepted0;
ngx_atomic_t *ngx_stat_accepted = &ngx_stat_accepted0;
+ngx_atomic_t ngx_stat_handled0;
+ngx_atomic_t *ngx_stat_handled = &ngx_stat_handled0;
ngx_atomic_t ngx_stat_requests0;
ngx_atomic_t *ngx_stat_requests = &ngx_stat_requests0;
ngx_atomic_t ngx_stat_active0;
ngx_atomic_t ngx_stat_reading0;
ngx_atomic_t *ngx_stat_reading = &ngx_stat_reading0;
ngx_atomic_t ngx_stat_writing0;
-ngx_atomic_t *ngx_stat_writing = &ngx_stat_reading0;
+ngx_atomic_t *ngx_stat_writing = &ngx_stat_writing0;
#endif
#if (NGX_STAT_STUB)
size += 128 /* ngx_stat_accepted */
+ + 128 /* ngx_stat_handled */
+ 128 /* ngx_stat_requests */
+ 128 /* ngx_stat_active */
+ 128 /* ngx_stat_reading */
#if (NGX_STAT_STUB)
ngx_stat_accepted = (ngx_atomic_t *) (shared + 2 * 128);
- ngx_stat_requests = (ngx_atomic_t *) (shared + 3 * 128);
- ngx_stat_active = (ngx_atomic_t *) (shared + 4 * 128);
- ngx_stat_reading = (ngx_atomic_t *) (shared + 5 * 128);
- ngx_stat_writing = (ngx_atomic_t *) (shared + 6 * 128);
+ ngx_stat_handled = (ngx_atomic_t *) (shared + 3 * 128);
+ ngx_stat_requests = (ngx_atomic_t *) (shared + 4 * 128);
+ ngx_stat_active = (ngx_atomic_t *) (shared + 5 * 128);
+ ngx_stat_reading = (ngx_atomic_t *) (shared + 6 * 128);
+ ngx_stat_writing = (ngx_atomic_t *) (shared + 7 * 128);
#endif
#if (NGX_STAT_STUB)
extern ngx_atomic_t *ngx_stat_accepted;
+extern ngx_atomic_t *ngx_stat_handled;
extern ngx_atomic_t *ngx_stat_requests;
extern ngx_atomic_t *ngx_stat_active;
extern ngx_atomic_t *ngx_stat_reading;
#if (NGX_STAT_STUB)
ngx_atomic_inc(ngx_stat_accepted);
+ ngx_atomic_inc(ngx_stat_active);
#endif
ngx_accept_disabled = (ngx_uint_t) s + NGX_ACCEPT_THRESHOLD
return;
}
-#if (NGX_STAT_STUB)
- ngx_atomic_inc(ngx_stat_active);
-#endif
-
/* set a blocking mode for aio and non-blocking mode for others */
if (ngx_inherited_nonblocking) {
c->number = ngx_atomic_inc(ngx_connection_counter);
+#if (NGX_STAT_STUB)
+ ngx_atomic_inc(ngx_stat_handled);
+#endif
+
#if (NGX_THREADS)
rev->lock = &c->lock;
wev->lock = &c->lock;
ngx_log_error(NGX_LOG_ALERT, log, ngx_socket_errno,
ngx_close_socket_n " failed");
}
+
+#if (NGX_STAT_STUB)
+ ngx_atomic_dec(ngx_stat_active);
+#endif
}
off_t start, end;
ngx_int_t rc;
ngx_uint_t suffix, i;
- ngx_atomic_int_t boundary;
+ ngx_atomic_uint_t boundary;
ngx_table_elt_t *content_range;
ngx_http_range_t *range;
ngx_http_range_filter_ctx_t *ctx;
static ngx_int_t ngx_http_status_handler(ngx_http_request_t *r)
{
- size_t size;
- ngx_int_t rc;
- uint32_t ap, hn, ac, rq, rd, wr;
- ngx_buf_t *b;
- ngx_chain_t out;
+ size_t size;
+ ngx_int_t rc;
+ ngx_buf_t *b;
+ ngx_chain_t out;
+ ngx_atomic_int_t ap, hn, ac, rq, rd, wr;
if (r->method != NGX_HTTP_GET && r->method != NGX_HTTP_HEAD) {
return NGX_HTTP_NOT_ALLOWED;
}
}
- size = sizeof("Active connections: \n") + NGX_INT32_LEN
+ size = sizeof("Active connections: \n") + NGX_ATOMIC_T_LEN
+ sizeof("server accepts handled requests\n") - 1
- + 6 + 3 * NGX_INT32_LEN
- + sizeof("Reading: Writing: Waiting: \n") + 3 * NGX_INT32_LEN;
+ + 6 + 3 * NGX_ATOMIC_T_LEN
+ + sizeof("Reading: Writing: Waiting: \n") + 3 * NGX_ATOMIC_T_LEN;
if (!(b = ngx_create_temp_buf(r->pool, size))) {
return NGX_HTTP_INTERNAL_SERVER_ERROR;
out.next = NULL;
ap = *ngx_stat_accepted;
- hn = *ngx_connection_counter;
+ hn = *ngx_stat_handled;
ac = *ngx_stat_active;
rq = *ngx_stat_requests;
rd = *ngx_stat_reading;
wr = *ngx_stat_writing;
- b->last = ngx_sprintf(b->last, "Active connections: %D \n", ac);
+ b->last = ngx_sprintf(b->last, "Active connections: %A \n", ac);
b->last = ngx_cpymem(b->last, "server accepts handled requests\n",
sizeof("server accepts handled requests\n") - 1);
- b->last = ngx_sprintf(b->last, " %D %D %D \n", ap, hn, rq);
+ b->last = ngx_sprintf(b->last, " %A %A %A \n", ap, hn, rq);
- b->last = ngx_sprintf(b->last, "Reading: %D Writing: %D Waiting: %d \n",
+ b->last = ngx_sprintf(b->last, "Reading: %A Writing: %A Waiting: %A \n",
rd, wr, ac - (rd + wr));
r->headers_out.status = NGX_HTTP_OK;
ngx_mutex_unlock(ngx_posted_events_mutex);
#if (NGX_STAT_STUB)
- ngx_atomic_inc(ngx_stat_reading);
+ ngx_atomic_inc(ngx_stat_reading);
#endif
return;
}
#define NGX_HAVE_ATOMIC_OPS 1
-typedef uint32_t ngx_atomic_int_t;
-typedef volatile ngx_atomic_int_t ngx_atomic_t;
+typedef int32_t ngx_atomic_int_t;
+typedef uint32_t ngx_atomic_uint_t;
+typedef volatile ngx_atomic_uint_t ngx_atomic_t;
#define NGX_ATOMIC_T_LEN sizeof("-2147483648") - 1
* the "=q" is any of the %eax, %ebx, %ecx, or %edx registers.
* the '"0" (1)' parameter preloads 1 into %0.
* the "cc" means that flags were changed.
+ *
+ * "xadd r, [m]":
+ *
+ * temp = [m];
+ * [m] += r;
+ * r = temp;
*/
-static ngx_inline ngx_atomic_int_t
+static ngx_inline ngx_atomic_uint_t
ngx_atomic_inc(ngx_atomic_t *value)
{
- ngx_atomic_int_t old;
+ ngx_atomic_uint_t old;
__asm__ volatile (
}
-static ngx_inline ngx_atomic_int_t
+static ngx_inline ngx_atomic_uint_t
ngx_atomic_dec(ngx_atomic_t *value)
{
- ngx_atomic_int_t old;
+ ngx_atomic_uint_t old;
__asm__ volatile (
*
* "cmpxchg r, [m]":
*
- * if (eax == [m]) {
- * zf = 1;
- * [m] = r;
- * } else {
- * zf = 0;
- * eax = [m];
- * }
+ * if (eax == [m]) {
+ * zf = 1;
+ * [m] = r;
+ * } else {
+ * zf = 0;
+ * eax = [m];
+ * }
*/
-static ngx_inline ngx_atomic_int_t
-ngx_atomic_cmp_set(ngx_atomic_t *lock, ngx_atomic_int_t old,
- ngx_atomic_int_t set)
+static ngx_inline ngx_atomic_uint_t
+ngx_atomic_cmp_set(ngx_atomic_t *lock, ngx_atomic_uint_t old,
+ ngx_atomic_uint_t set)
{
- ngx_atomic_int_t res;
+ ngx_atomic_uint_t res;
__asm__ volatile (
#define NGX_HAVE_ATOMIC_OPS 1
typedef int64_t ngx_atomic_int_t;
-typedef volatile ngx_atomic_int_t ngx_atomic_t;
+typedef uint64_t ngx_atomic_uint_t;
+typedef volatile ngx_atomic_uint_t ngx_atomic_t;
#define NGX_ATOMIC_T_LEN sizeof("-9223372036854775808") - 1
#endif
-static ngx_inline ngx_atomic_int_t
+static ngx_inline ngx_atomic_uint_t
ngx_atomic_inc(ngx_atomic_t *value)
{
- ngx_atomic_int_t old;
+ ngx_atomic_uint_t old;
__asm__ volatile (
/* the '"0" (-1LL)' parameter preloads -1 into the 64-bit %0 register */
-static ngx_inline ngx_atomic_int_t
+static ngx_inline ngx_atomic_uint_t
ngx_atomic_dec(ngx_atomic_t *value)
{
- ngx_atomic_int_t old;
+ ngx_atomic_uint_t old;
__asm__ volatile (
/* the "=a" and "a" are the %rax register. */
-static ngx_inline ngx_atomic_int_t
-ngx_atomic_cmp_set(ngx_atomic_t *lock, ngx_atomic_int_t old,
- ngx_atomic_int_t set)
+static ngx_inline ngx_atomic_uint_t
+ngx_atomic_cmp_set(ngx_atomic_t *lock, ngx_atomic_uint_t old,
+ ngx_atomic_uint_t set)
{
- ngx_atomic_int_t res;
+ ngx_atomic_uint_t res;
__asm__ volatile (
#define NGX_HAVE_ATOMIC_OPS 1
#if (NGX_PTR_SIZE == 8)
-typedef uint64_t ngx_atomic_int_t;
+typedef int64_t ngx_atomic_int_t;
+typedef uint64_t ngx_atomic_uint_t;
#define NGX_ATOMIC_T_LEN sizeof("-9223372036854775808") - 1
#define NGX_CASXA "casxa"
#else
-typedef uint32_t ngx_atomic_int_t;
+typedef int32_t ngx_atomic_int_t;
+typedef uint32_t ngx_atomic_uint_t;
#define NGX_ATOMIC_T_LEN sizeof("-2147483648") - 1
#define NGX_CASXA "casa"
#endif
-typedef volatile ngx_atomic_int_t ngx_atomic_t;
+typedef volatile ngx_atomic_uint_t ngx_atomic_t;
/*
* so "r0 == r2" means that the operation was successfull.
*/
-static ngx_inline ngx_atomic_int_t
+static ngx_inline ngx_atomic_uint_t
ngx_atomic_inc(ngx_atomic_t *value)
{
- ngx_atomic_int_t old, new, res;
+ ngx_atomic_uint_t old, new, res;
old = *value;
}
-static ngx_inline ngx_atomic_int_t
+static ngx_inline ngx_atomic_uint_t
ngx_atomic_dec(ngx_atomic_t *value)
{
- ngx_atomic_int_t old, new, res;
+ ngx_atomic_uint_t old, new, res;
old = *value;
}
-static ngx_inline ngx_atomic_int_t
-ngx_atomic_cmp_set(ngx_atomic_t *lock, ngx_atomic_int_t old, ngx_atomic_int_t set)
+static ngx_inline ngx_atomic_uint_t
+ngx_atomic_cmp_set(ngx_atomic_t *lock, ngx_atomic_uint_t old,
+ ngx_atomic_uint_t set)
{
__asm__ volatile (
#define NGX_HAVE_ATOMIC_OPS 1
#if (NGX_PTR_SIZE == 8)
-typedef uint64_t ngx_atomic_int_t;
+typedef int64_t ngx_atomic_int_t;
+typedef uint64_t ngx_atomic_uint_t;
#define NGX_ATOMIC_T_LEN sizeof("-9223372036854775808") - 1
#else
+typedef int32_t ngx_atomic_int_t;
+typedef uint32_t ngx_atomic_uint_t;
#define NGX_ATOMIC_T_LEN sizeof("-2147483648") - 1
-typedef uint32_t ngx_atomic_int_t;
#endif
-typedef volatile ngx_atomic_int_t ngx_atomic_t;
+typedef volatile ngx_atomic_uint_t ngx_atomic_t;
/*
* the nearest forward label "1".
*/
-static ngx_inline ngx_atomic_int_t
+static ngx_inline ngx_atomic_uint_t
ngx_atomic_inc(ngx_atomic_t *value)
{
- ngx_atomic_int_t res;
+ ngx_atomic_uint_t res;
__asm__ volatile (
}
-static ngx_inline ngx_atomic_int_t
+static ngx_inline ngx_atomic_uint_t
ngx_atomic_dec(ngx_atomic_t *value)
{
- ngx_atomic_int_t res;
+ ngx_atomic_uint_t res;
__asm__ volatile (
}
-static ngx_inline ngx_atomic_int_t
-ngx_atomic_cmp_set(ngx_atomic_t *lock, ngx_atomic_int_t old,
- ngx_atomic_int_t set)
+static ngx_inline ngx_atomic_uint_t
+ngx_atomic_cmp_set(ngx_atomic_t *lock, ngx_atomic_uint_t old,
+ ngx_atomic_uint_t set)
{
- ngx_atomic_int_t res, temp;
+ ngx_atomic_uint_t res, temp;
__asm__ volatile (
#define NGX_HAVE_ATOMIC_OPS 0
-typedef uint32_t ngx_atomic_int_t;
-typedef volatile ngx_atomic_int_t ngx_atomic_t;
+typedef int32_t ngx_atomic_int_t;
+typedef uint32_t ngx_atomic_uint_t;
+typedef volatile ngx_atomic_uint_t ngx_atomic_t;
#define ngx_atomic_inc(x) ++(*(x))
#define ngx_atomic_dec(x) --(*(x))
-static ngx_inline ngx_atomic_int_t
-ngx_atomic_cmp_set(ngx_atomic_t *lock, ngx_atomic_int_t old,
- ngx_atomic_int_t set)
+static ngx_inline ngx_atomic_uint_t
+ngx_atomic_cmp_set(ngx_atomic_t *lock, ngx_atomic_uint_t old,
+ ngx_atomic_uint_t set)
{
*lock = set;
return 1;