nginx-0.3.44-RELEASE import

    *) Feature: the "wait" parameter in the "include" SSI command.

    *) Feature: the Ukrainian and Byelorussian characters were added to
       koi-win conversion table.

    *) Bugfix: in the SSI.
diff --git a/src/core/nginx.h b/src/core/nginx.h
index 9a08f13..7fd9d72 100644
--- a/src/core/nginx.h
+++ b/src/core/nginx.h
@@ -8,7 +8,7 @@
 #define _NGINX_H_INCLUDED_
 
 
-#define NGINX_VER          "nginx/0.3.43"
+#define NGINX_VER          "nginx/0.3.44"
 
 #define NGINX_VAR          "NGINX"
 #define NGX_OLDPID_EXT     ".oldbin"
diff --git a/src/core/ngx_buf.c b/src/core/ngx_buf.c
index 901c3f5..31d9903 100644
--- a/src/core/ngx_buf.c
+++ b/src/core/ngx_buf.c
@@ -134,12 +134,6 @@
     }
 
     while (in) {
-
-        if (ngx_buf_sync_only(in->buf)) {
-            in = in->next;
-            continue;
-        }
-
         cl = ngx_alloc_chain_link(pool);
         if (cl == NULL) {
             return NGX_ERROR;
diff --git a/src/core/ngx_conf_file.c b/src/core/ngx_conf_file.c
index 7c22948..b895910 100644
--- a/src/core/ngx_conf_file.c
+++ b/src/core/ngx_conf_file.c
@@ -221,12 +221,14 @@
 {
     char           *rv;
     void           *conf, **confp;
-    ngx_uint_t      i, valid;
+    ngx_uint_t      i, multi;
     ngx_str_t      *name;
     ngx_command_t  *cmd;
 
     name = cf->args->elts;
 
+    multi = 0;
+
     for (i = 0; ngx_modules[i]; i++) {
 
         /* look up the directive in the appropriate modules */
@@ -242,132 +244,138 @@
             continue;
         }
 
-        while (cmd->name.len) {
+        for ( /* void */ ; cmd->name.len; cmd++) {
 
-            if (name->len == cmd->name.len
-                && ngx_strcmp(name->data, cmd->name.data) == 0)
-            {
-                /* is the directive's location right ? */
+            if (name->len != cmd->name.len) {
+                continue;
+            }
 
-                if (!(cmd->type & cf->cmd_type)) {
-                    ngx_log_error(NGX_LOG_EMERG, cf->log, 0,
-                                  "directive \"%s\" in %s:%ui "
-                                  "is not allowed here",
-                                  name->data, cf->conf_file->file.name.data,
-                                  cf->conf_file->line);
-                    return NGX_ERROR;
+            if (ngx_strcmp(name->data, cmd->name.data) != 0) {
+                continue;
+            }
+
+
+            /* is the directive's location right ? */
+
+            if (!(cmd->type & cf->cmd_type)) {
+                if (cmd->type & NGX_CONF_MULTI) {
+                    multi = 1;
+                    continue;
                 }
 
-                if (!(cmd->type & NGX_CONF_BLOCK) && last != NGX_OK) {
-                    ngx_log_error(NGX_LOG_EMERG, cf->log, 0,
-                                  "directive \"%s\" in %s:%ui "
-                                  "is not terminated by \";\"",
-                                  name->data, cf->conf_file->file.name.data,
-                                  cf->conf_file->line);
-                    return NGX_ERROR;
-                }
+                goto not_allowed;
+            }
 
-                if ((cmd->type & NGX_CONF_BLOCK)
-                    && last != NGX_CONF_BLOCK_START)
-                {
-                    ngx_log_error(NGX_LOG_EMERG, cf->log, 0,
-                                  "directive \"%s\" in %s:%ui "
-                                  "has not the opening \"{\"",
-                                  name->data, cf->conf_file->file.name.data,
-                                  cf->conf_file->line);
-                    return NGX_ERROR;
-                }
+            if (!(cmd->type & NGX_CONF_BLOCK) && last != NGX_OK) {
+                ngx_log_error(NGX_LOG_EMERG, cf->log, 0,
+                              "directive \"%s\" in %s:%ui "
+                              "is not terminated by \";\"",
+                              name->data, cf->conf_file->file.name.data,
+                              cf->conf_file->line);
+                return NGX_ERROR;
+            }
 
-                /* is the directive's argument count right ? */
+            if ((cmd->type & NGX_CONF_BLOCK) && last != NGX_CONF_BLOCK_START) {
+                ngx_log_error(NGX_LOG_EMERG, cf->log, 0,
+                              "directive \"%s\" in %s:%ui "
+                              "has not the opening \"{\"",
+                              name->data, cf->conf_file->file.name.data,
+                              cf->conf_file->line);
+                return NGX_ERROR;
+            }
 
-                if (cmd->type & NGX_CONF_ANY) {
-                    valid = 1;
+            /* is the directive's argument count right ? */
 
-                } else if (cmd->type & NGX_CONF_FLAG) {
+            if (!(cmd->type & NGX_CONF_ANY)) {
 
-                    if (cf->args->nelts == 2) {
-                        valid = 1;
-                    } else {
-                        valid = 0;
+                if (cmd->type & NGX_CONF_FLAG) {
+
+                    if (cf->args->nelts != 2) {
+                        goto invalid;
                     }
 
                 } else if (cmd->type & NGX_CONF_1MORE) {
 
-                    if (cf->args->nelts > 1) {
-                        valid = 1;
-                    } else {
-                        valid = 0;
+                    if (cf->args->nelts < 2) {
+                        goto invalid;
                     }
 
                 } else if (cmd->type & NGX_CONF_2MORE) {
 
-                    if (cf->args->nelts > 2) {
-                        valid = 1;
-                    } else {
-                        valid = 0;
+                    if (cf->args->nelts < 3) {
+                        goto invalid;
                     }
 
-                } else if (cf->args->nelts <= NGX_CONF_MAX_ARGS
-                           && (cmd->type
-                               & argument_number[cf->args->nelts - 1]))
+                } else if (cf->args->nelts > NGX_CONF_MAX_ARGS) {
+
+                    goto invalid;
+
+                } else if (!(cmd->type & argument_number[cf->args->nelts - 1]))
                 {
-                    valid = 1;
-
-                } else {
-                    valid = 0;
+                    goto invalid;
                 }
+            }
 
-                if (!valid) {
-                    ngx_log_error(NGX_LOG_EMERG, cf->log, 0,
-                                  "invalid number arguments in "
-                                  "directive \"%s\" in %s:%ui",
-                                  name->data, cf->conf_file->file.name.data,
-                                  cf->conf_file->line);
-                    return NGX_ERROR;
+            /* set up the directive's configuration context */
+
+            conf = NULL;
+
+            if (cmd->type & NGX_DIRECT_CONF) {
+                conf = ((void **) cf->ctx)[ngx_modules[i]->index];
+
+            } else if (cmd->type & NGX_MAIN_CONF) {
+                conf = &(((void **) cf->ctx)[ngx_modules[i]->index]);
+
+            } else if (cf->ctx) {
+                confp = *(void **) ((char *) cf->ctx + cmd->conf);
+
+                if (confp) {
+                    conf = confp[ngx_modules[i]->ctx_index];
                 }
+            }
 
-                /* set up the directive's configuration context */
+            rv = cmd->set(cf, cmd, conf);
 
-                conf = NULL;
+            if (rv == NGX_CONF_OK) {
+                return NGX_OK;
+            }
 
-                if (cmd->type & NGX_DIRECT_CONF) {
-                    conf = ((void **) cf->ctx)[ngx_modules[i]->index];
-
-                } else if (cmd->type & NGX_MAIN_CONF) {
-                    conf = &(((void **) cf->ctx)[ngx_modules[i]->index]);
-
-                } else if (cf->ctx) {
-                    confp = *(void **) ((char *) cf->ctx + cmd->conf);
-
-                    if (confp) {
-                        conf = confp[ngx_modules[i]->ctx_index];
-                    }
-                }
-
-                rv = cmd->set(cf, cmd, conf);
-
-                if (rv == NGX_CONF_OK) {
-                    return NGX_OK;
-                }
-
-                if (rv == NGX_CONF_ERROR) {
-                    return NGX_ERROR;
-                }
-
-                ngx_log_error(NGX_LOG_EMERG, cf->log, 0,
-                              "the \"%s\" directive %s in %s:%ui",
-                              name->data, rv, cf->conf_file->file.name.data,
-                              cf->conf_file->line);
-
+            if (rv == NGX_CONF_ERROR) {
                 return NGX_ERROR;
             }
 
-            cmd++;
+            ngx_log_error(NGX_LOG_EMERG, cf->log, 0,
+                          "the \"%s\" directive %s in %s:%ui",
+                          name->data, rv, cf->conf_file->file.name.data,
+                          cf->conf_file->line);
+
+            return NGX_ERROR;
         }
     }
 
+    if (multi == 0) {
+        ngx_log_error(NGX_LOG_EMERG, cf->log, 0,
+                      "unknown directive \"%s\" in %s:%ui",
+                      name->data, cf->conf_file->file.name.data,
+                      cf->conf_file->line);
+
+        return NGX_ERROR;
+    }
+
+not_allowed:
+
     ngx_log_error(NGX_LOG_EMERG, cf->log, 0,
-                  "unknown directive \"%s\" in %s:%ui",
+                  "directive \"%s\" in %s:%ui "
+                  "is not allowed here",
+                  name->data, cf->conf_file->file.name.data,
+                  cf->conf_file->line);
+    return NGX_ERROR;
+
+invalid:
+
+    ngx_log_error(NGX_LOG_EMERG, cf->log, 0,
+                  "invalid number arguments in "
+                  "directive \"%s\" in %s:%ui",
                   name->data, cf->conf_file->file.name.data,
                   cf->conf_file->line);
 
diff --git a/src/core/ngx_conf_file.h b/src/core/ngx_conf_file.h
index a183a57..37d36d6 100644
--- a/src/core/ngx_conf_file.h
+++ b/src/core/ngx_conf_file.h
@@ -44,6 +44,7 @@
 #define NGX_CONF_ANY         0x00000400
 #define NGX_CONF_1MORE       0x00000800
 #define NGX_CONF_2MORE       0x00001000
+#define NGX_CONF_MULTI       0x00002000
 
 #define NGX_DIRECT_CONF      0x00010000
 
diff --git a/src/core/ngx_log.h b/src/core/ngx_log.h
index 290ca74..d49f9d1 100644
--- a/src/core/ngx_log.h
+++ b/src/core/ngx_log.h
@@ -28,6 +28,7 @@
 #define NGX_LOG_DEBUG_EVENT       0x080
 #define NGX_LOG_DEBUG_HTTP        0x100
 #define NGX_LOG_DEBUG_IMAP        0x200
+#define NGX_LOG_DEBUG_MYSQL       0x400
 
 /*
  * do not forget to update debug_levels[] in src/core/ngx_log.c