Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/nginx/nginx.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
path: root/src/core
diff options
context:
space:
mode:
authorIgor Sysoev <igor@sysoev.ru>2005-01-25 15:27:35 +0300
committerIgor Sysoev <igor@sysoev.ru>2005-01-25 15:27:35 +0300
commite5a222c6fef26b51d956c35530178837c60bf8c4 (patch)
tree65dafe2f85fe2b09b82d3efd2abe2b43720a1f4e /src/core
parent4f06a9709164123e7d8ccbd6fa723da387a9a86c (diff)
nginx-0.1.16-RELEASE importrelease-0.1.16
*) Bugfix: if the response were transferred by chunks, then on the HEAD request the final chunk was issued. *) Bugfix: the "Connection: keep-alive" header were issued, even if the keepalive_timeout directive forbade the keep-alive use. *) Bugfix: the errors in the ngx_http_fastcgi_module caused the segmentation faults. *) Bugfix: the compressed response encrypted by SSL may not transferred complete. *) Bugfix: the TCP-specific TCP_NODELAY, TCP_NOPSUH, and TCP_CORK options, are not used for the unix domain sockets. *) Feature: the rewrite directive supports the arguments rewriting. *) Bugfix: the response code 400 was returned for the POST request with the "Content-Length: 0" header; the bug had appeared in 0.1.14.
Diffstat (limited to 'src/core')
-rw-r--r--src/core/nginx.h2
-rw-r--r--src/core/ngx_conf_file.c26
-rw-r--r--src/core/ngx_connection.c4
-rw-r--r--src/core/ngx_connection.h17
-rw-r--r--src/core/ngx_log.c8
-rw-r--r--src/core/ngx_log.h118
-rw-r--r--src/core/ngx_output_chain.c12
7 files changed, 93 insertions, 94 deletions
diff --git a/src/core/nginx.h b/src/core/nginx.h
index 2d18bc996..0b9d9905c 100644
--- a/src/core/nginx.h
+++ b/src/core/nginx.h
@@ -8,7 +8,7 @@
#define _NGINX_H_INCLUDED_
-#define NGINX_VER "nginx/0.1.15"
+#define NGINX_VER "nginx/0.1.16"
#define NGINX_VAR "NGINX"
#define NGX_NEWPID_EXT ".newbin"
diff --git a/src/core/ngx_conf_file.c b/src/core/ngx_conf_file.c
index 3c7898ae2..19a567f68 100644
--- a/src/core/ngx_conf_file.c
+++ b/src/core/ngx_conf_file.c
@@ -111,10 +111,6 @@ char *ngx_conf_parse(ngx_conf_t *cf, ngx_str_t *filename)
* NGX_CONF_FILE_DONE the configuration file is done
*/
-#if 0
-ngx_log_debug(cf->log, "token %d" _ rc);
-#endif
-
if (rc == NGX_ERROR) {
break;
}
@@ -173,9 +169,7 @@ ngx_log_debug(cf->log, "token %d" _ rc);
{
found = 1;
-#if 0
-ngx_log_debug(cf->log, "command '%s'" _ cmd->name.data);
-#endif
+
/* is the directive's location right ? */
if ((cmd->type & cf->cmd_type) == 0) {
@@ -284,10 +278,6 @@ ngx_log_debug(cf->log, "command '%s'" _ cmd->name.data);
rv = cmd->set(cf, cmd, conf);
-#if 0
-ngx_log_debug(cf->log, "rv: %d" _ rv);
-#endif
-
if (rv == NGX_CONF_OK) {
break;
@@ -366,10 +356,6 @@ static int ngx_conf_read_token(ngx_conf_t *cf)
b = cf->conf_file->buffer;
start = b->pos;
-#if 0
-ngx_log_debug(cf->log, "TOKEN START");
-#endif
-
for ( ;; ) {
if (b->pos >= b->last) {
@@ -398,12 +384,6 @@ ngx_log_debug(cf->log, "TOKEN START");
ch = *b->pos++;
-#if 0
-ngx_log_debug(cf->log, "%d:%d:%d:%d:%d '%c'" _
- last_space _ need_space _
- quoted _ s_quoted _ d_quoted _ ch);
-#endif
-
if (ch == LF) {
cf->conf_file->line++;
@@ -574,10 +554,6 @@ ngx_log_debug(cf->log, "%d:%d:%d:%d:%d '%c'" _
*dst = '\0';
word->len = len;
-#if 0
-ngx_log_debug(cf->log, "FOUND %d:'%s'" _ word->len _ word->data);
-#endif
-
if (ch == ';') {
return NGX_OK;
}
diff --git a/src/core/ngx_connection.c b/src/core/ngx_connection.c
index 64be1ec86..b3fa5de35 100644
--- a/src/core/ngx_connection.c
+++ b/src/core/ngx_connection.c
@@ -13,8 +13,8 @@ ngx_os_io_t ngx_io;
ngx_listening_t *ngx_listening_inet_stream_socket(ngx_conf_t *cf,
- in_addr_t addr,
- in_port_t port)
+ in_addr_t addr,
+ in_port_t port)
{
size_t len;
ngx_listening_t *ls;
diff --git a/src/core/ngx_connection.h b/src/core/ngx_connection.h
index 20589a502..5479faaaf 100644
--- a/src/core/ngx_connection.h
+++ b/src/core/ngx_connection.h
@@ -64,9 +64,16 @@ typedef enum {
typedef enum {
- NGX_TCP_NOPUSH_DISABLED = -1,
+ NGX_TCP_NODELAY_UNSET = 0,
+ NGX_TCP_NODELAY_SET,
+ NGX_TCP_NODELAY_DISABLED
+} ngx_connection_tcp_nodelay_e;
+
+
+typedef enum {
NGX_TCP_NOPUSH_UNSET = 0,
- NGX_TCP_NOPUSH_SET
+ NGX_TCP_NOPUSH_SET,
+ NGX_TCP_NOPUSH_DISABLED
} ngx_connection_tcp_nopush_e;
@@ -109,7 +116,7 @@ struct ngx_connection_s {
ngx_uint_t number;
- unsigned log_error:2; /* ngx_connection_log_error_e */
+ unsigned log_error:2; /* ngx_connection_log_error_e */
unsigned buffered:1;
unsigned single_connection:1;
@@ -118,8 +125,8 @@ struct ngx_connection_s {
unsigned sendfile:1;
unsigned sndlowat:1;
- unsigned tcp_nodelay:1;
- signed tcp_nopush:2;
+ unsigned tcp_nodelay:2; /* ngx_connection_tcp_nodelay_e */
+ unsigned tcp_nopush:2; /* ngx_connection_tcp_nopush_e */
#if (NGX_HAVE_IOCP)
unsigned accept_context_updated:1;
diff --git a/src/core/ngx_log.c b/src/core/ngx_log.c
index b7198cd7f..d9c5c59bc 100644
--- a/src/core/ngx_log.c
+++ b/src/core/ngx_log.c
@@ -86,9 +86,15 @@ void ngx_log_error_core(ngx_uint_t level, ngx_log_t *log, ngx_err_t err,
/* pid#tid */
p = ngx_sprintf(p, "%P#" NGX_TID_T_FMT ": ", ngx_log_pid, ngx_log_tid);
+ if (log->connection) {
+ p = ngx_sprintf(p, "*%ui ", log->connection);
+ }
+
+#if 0
if (log->data && *(int *) log->data != -1) {
p = ngx_sprintf(p, "*%ud ", *(u_int *) log->data);
}
+#endif
#if (NGX_HAVE_VARIADIC_MACROS)
@@ -137,7 +143,7 @@ void ngx_log_error_core(ngx_uint_t level, ngx_log_t *log, ngx_err_t err,
}
if (level != NGX_LOG_DEBUG && log->handler) {
- p = log->handler(log->data, p, last - p);
+ p = log->handler(log, p, last - p);
}
ngx_log_write(log, errstr, p - errstr);
diff --git a/src/core/ngx_log.h b/src/core/ngx_log.h
index c54c18723..588837fff 100644
--- a/src/core/ngx_log.h
+++ b/src/core/ngx_log.h
@@ -40,14 +40,25 @@
#define NGX_LOG_DEBUG_ALL 0x7ffffff0
-typedef u_char *(*ngx_log_handler_pt) (void *ctx, u_char *buf, size_t len);
+typedef u_char *(*ngx_log_handler_pt) (ngx_log_t *log, u_char *buf, size_t len);
struct ngx_log_s {
ngx_uint_t log_level;
ngx_open_file_t *file;
- void *data;
+
+ ngx_uint_t connection;
+
ngx_log_handler_pt handler;
+ void *data;
+
+ /*
+ * we declare "action" as "char *" because the actions are usually
+ * the static strings and in the "u_char *" case we have to override
+ * their types all the time
+ */
+
+ char *action;
};
@@ -60,24 +71,32 @@ struct ngx_log_s {
#define NGX_HAVE_VARIADIC_MACROS 1
-#define ngx_log_error(level, log, args...) \
+#define ngx_log_error(level, log, args...) \
if (log->log_level >= level) ngx_log_error_core(level, log, args)
void ngx_log_error_core(ngx_uint_t level, ngx_log_t *log, ngx_err_t err,
const char *fmt, ...);
+#define ngx_log_debug(level, log, args...) \
+ if (log->log_level & level) \
+ ngx_log_error_core(NGX_LOG_DEBUG, log, args)
+
/*********************************/
#elif (NGX_HAVE_C99_VARIADIC_MACROS)
#define NGX_HAVE_VARIADIC_MACROS 1
-#define ngx_log_error(level, log, ...) \
+#define ngx_log_error(level, log, ...) \
if (log->log_level >= level) ngx_log_error_core(level, log, __VA_ARGS__)
void ngx_log_error_core(ngx_uint_t level, ngx_log_t *log, ngx_err_t err,
const char *fmt, ...);
+#define ngx_log_debug(level, log, ...) \
+ if (log->log_level & level) \
+ ngx_log_error_core(NGX_LOG_DEBUG, log, __VA_ARGS__)
+
/*********************************/
#else /* NO VARIADIC MACROS */
@@ -100,80 +119,59 @@ void ngx_log_debug_core(ngx_log_t *log, ngx_err_t err, const char *fmt, ...);
#if (NGX_HAVE_VARIADIC_MACROS)
-#define ngx_log_debug0(level, log, err, fmt) \
- if (log->log_level & level) \
- ngx_log_error_core(NGX_LOG_DEBUG, log, err, fmt)
-
-#define ngx_log_debug1(level, log, err, fmt, arg1) \
- if (log->log_level & level) \
- ngx_log_error_core(NGX_LOG_DEBUG, log, err, fmt, arg1)
-
-#define ngx_log_debug2(level, log, err, fmt, arg1, arg2) \
- if (log->log_level & level) \
- ngx_log_error_core(NGX_LOG_DEBUG, log, err, fmt, arg1, arg2)
-
-#define ngx_log_debug3(level, log, err, fmt, arg1, arg2, arg3) \
- if (log->log_level & level) \
- ngx_log_error_core(NGX_LOG_DEBUG, log, err, fmt, arg1, arg2, arg3)
-
-#define ngx_log_debug4(level, log, err, fmt, arg1, arg2, arg3, arg4) \
- if (log->log_level & level) \
- ngx_log_error_core(NGX_LOG_DEBUG, log, err, fmt, arg1, arg2, arg3, arg4)
-
-#define ngx_log_debug5(level, log, err, fmt, arg1, arg2, arg3, arg4, arg5) \
- if (log->log_level & level) \
- ngx_log_error_core(NGX_LOG_DEBUG, log, err, fmt, \
- arg1, arg2, arg3, arg4, arg5)
-
-#define ngx_log_debug6(level, log, err, fmt, \
- arg1, arg2, arg3, arg4, arg5, arg6) \
- if (log->log_level & level) \
- ngx_log_error_core(NGX_LOG_DEBUG, log, err, fmt, \
- arg1, arg2, arg3, arg4, arg5, arg6)
-
-#define ngx_log_debug7(level, log, err, fmt, \
- arg1, arg2, arg3, arg4, arg5, arg6, arg7) \
- if (log->log_level & level) \
- ngx_log_error_core(NGX_LOG_DEBUG, log, err, fmt, \
- arg1, arg2, arg3, arg4, arg5, arg6, arg7)
+#define ngx_log_debug0 ngx_log_debug
+#define ngx_log_debug1 ngx_log_debug
+#define ngx_log_debug2 ngx_log_debug
+#define ngx_log_debug3 ngx_log_debug
+#define ngx_log_debug4 ngx_log_debug
+#define ngx_log_debug5 ngx_log_debug
+#define ngx_log_debug6 ngx_log_debug
+#define ngx_log_debug7 ngx_log_debug
+#define ngx_log_debug8 ngx_log_debug
#else /* NO VARIADIC MACROS */
-#define ngx_log_debug0(level, log, err, fmt) \
- if (log->log_level & level) \
+#define ngx_log_debug0(level, log, err, fmt) \
+ if (log->log_level & level) \
ngx_log_debug_core(log, err, fmt)
-#define ngx_log_debug1(level, log, err, fmt, arg1) \
- if (log->log_level & level) \
+#define ngx_log_debug1(level, log, err, fmt, arg1) \
+ if (log->log_level & level) \
ngx_log_debug_core(log, err, fmt, arg1)
-#define ngx_log_debug2(level, log, err, fmt, arg1, arg2) \
- if (log->log_level & level) \
+#define ngx_log_debug2(level, log, err, fmt, arg1, arg2) \
+ if (log->log_level & level) \
ngx_log_debug_core(log, err, fmt, arg1, arg2)
-#define ngx_log_debug3(level, log, err, fmt, arg1, arg2, arg3) \
- if (log->log_level & level) \
+#define ngx_log_debug3(level, log, err, fmt, arg1, arg2, arg3) \
+ if (log->log_level & level) \
ngx_log_debug_core(log, err, fmt, arg1, arg2, arg3)
-#define ngx_log_debug4(level, log, err, fmt, arg1, arg2, arg3, arg4) \
- if (log->log_level & level) \
+#define ngx_log_debug4(level, log, err, fmt, arg1, arg2, arg3, arg4) \
+ if (log->log_level & level) \
ngx_log_debug_core(log, err, fmt, arg1, arg2, arg3, arg4)
-#define ngx_log_debug5(level, log, err, fmt, arg1, arg2, arg3, arg4, arg5) \
- if (log->log_level & level) \
+#define ngx_log_debug5(level, log, err, fmt, arg1, arg2, arg3, arg4, arg5) \
+ if (log->log_level & level) \
ngx_log_debug_core(log, err, fmt, arg1, arg2, arg3, arg4, arg5)
-#define ngx_log_debug6(level, log, err, fmt, \
- arg1, arg2, arg3, arg4, arg5, arg6) \
- if (log->log_level & level) \
+#define ngx_log_debug6(level, log, err, fmt, \
+ arg1, arg2, arg3, arg4, arg5, arg6) \
+ if (log->log_level & level) \
ngx_log_debug_core(log, err, fmt, arg1, arg2, arg3, arg4, arg5, arg6)
-#define ngx_log_debug7(level, log, err, fmt, \
- arg1, arg2, arg3, arg4, arg5, arg6, arg7) \
- if (log->log_level & level) \
- ngx_log_debug_core(log, err, fmt, \
+#define ngx_log_debug7(level, log, err, fmt, \
+ arg1, arg2, arg3, arg4, arg5, arg6, arg7) \
+ if (log->log_level & level) \
+ ngx_log_debug_core(log, err, fmt, \
arg1, arg2, arg3, arg4, arg5, arg6, arg7)
+#define ngx_log_debug8(level, log, err, fmt, \
+ arg1, arg2, arg3, arg4, arg5, arg6, arg7, arg8) \
+ if (log->log_level & level) \
+ ngx_log_debug_core(log, err, fmt, \
+ arg1, arg2, arg3, arg4, arg5, arg6, arg7, arg8)
+
#endif
#else /* NO NGX_DEBUG */
@@ -187,6 +185,8 @@ void ngx_log_debug_core(ngx_log_t *log, ngx_err_t err, const char *fmt, ...);
#define ngx_log_debug6(level, log, err, fmt, arg1, arg2, arg3, arg4, arg5, arg6)
#define ngx_log_debug7(level, log, err, fmt, arg1, arg2, arg3, arg4, arg5, \
arg6, arg7)
+#define ngx_log_debug8(level, log, err, fmt, arg1, arg2, arg3, arg4, arg5, \
+ arg6, arg7, arg8)
#endif
diff --git a/src/core/ngx_output_chain.c b/src/core/ngx_output_chain.c
index 2b8da22be..557dd22c9 100644
--- a/src/core/ngx_output_chain.c
+++ b/src/core/ngx_output_chain.c
@@ -80,7 +80,17 @@ ngx_int_t ngx_output_chain(ngx_output_chain_ctx_t *ctx, ngx_chain_t *in)
if (bsize == 0 && !ngx_buf_special(ctx->in->buf)) {
ngx_log_error(NGX_LOG_ALERT, ctx->pool->log, 0,
- "zero size buf in output");
+ "zero size buf in output "
+ "t:%d r:%d f:%d %p %p-%p %p %O-%O",
+ ctx->in->buf->temporary,
+ ctx->in->buf->recycled,
+ ctx->in->buf->in_file,
+ ctx->in->buf->start,
+ ctx->in->buf->pos,
+ ctx->in->buf->last,
+ ctx->in->buf->file,
+ ctx->in->buf->file_pos,
+ ctx->in->buf->file_last);
ngx_debug_point();