]> git.kaiwu.me - nginx.git/commitdiff
u_char* is enough to keep file name
authorIgor Sysoev <igor@sysoev.ru>
Sat, 15 Sep 2007 17:11:06 +0000 (17:11 +0000)
committerIgor Sysoev <igor@sysoev.ru>
Sat, 15 Sep 2007 17:11:06 +0000 (17:11 +0000)
src/http/ngx_http.c
src/http/ngx_http_core_module.c
src/http/ngx_http_core_module.h
src/http/ngx_http_upstream.c
src/http/ngx_http_upstream.h
src/http/ngx_http_upstream_round_robin.c

index 97a2c193ccd3fd4d8a81d9c759bfdd6116618427..59b43d05444aca3da8e44cf08edd101f10480999 100644 (file)
@@ -553,8 +553,8 @@ ngx_http_block(ngx_conf_t *cf, ngx_command_t *cmd, void *conf)
 
                         if (in_addr[a].default_server) {
                             ngx_log_error(NGX_LOG_ERR, cf->log, 0,
-                                        "the duplicate default server in %V:%d",
-                                        &lscf[l].file_name, lscf[l].line);
+                                      "the duplicate default server in %s:%ui",
+                                       &lscf[l].file_name, lscf[l].line);
 
                             return NGX_CONF_ERROR;
                         }
index b25346daa8e6899cd3e97ac8d6501a25ca6c4496..f93c6a28cc47b1c09106eafff346747523e176d1 100644 (file)
@@ -2627,7 +2627,7 @@ ngx_http_core_listen(ngx_conf_t *cf, ngx_command_t *cmd, void *conf)
     ls->family = AF_INET;
     ls->addr = u.addr.in_addr;
     ls->port = u.port;
-    ls->file_name = cf->conf_file->file.name;
+    ls->file_name = cf->conf_file->file.name.data;
     ls->line = cf->conf_file->line;
     ls->conf.backlog = NGX_LISTEN_BACKLOG;
     ls->conf.rcvbuf = -1;
index 2bd687e880ad0683b558d5f0cb118611082177bb..c56e09bc27958f7edb02df367cfd6d2fd2ccaf15 100644 (file)
@@ -38,8 +38,8 @@ typedef struct {
     in_port_t                  port;
     int                        family;
 
-    ngx_str_t                  file_name;
-    ngx_int_t                  line;
+    u_char                    *file_name;
+    ngx_uint_t                 line;
 
     ngx_http_listen_conf_t     conf;
 } ngx_http_listen_t;
index ae5f3d3e851ce63d8a35ab6838a46f92b127eb36..878ca42b329858d1ce6ae77a86cd69e13736d97e 100644 (file)
@@ -3223,7 +3223,7 @@ ngx_http_upstream_add(ngx_conf_t *cf, ngx_url_t *u, ngx_uint_t flags)
             ngx_log_error(NGX_LOG_WARN, cf->log, 0,
                           "upstream \"%V\" may not have port %d in %s:%ui",
                           &u->host, uscfp[i]->port,
-                          uscfp[i]->file_name.data, uscfp[i]->line);
+                          uscfp[i]->file_name, uscfp[i]->line);
             return NULL;
         }
 
@@ -3247,7 +3247,7 @@ ngx_http_upstream_add(ngx_conf_t *cf, ngx_url_t *u, ngx_uint_t flags)
 
     uscf->flags = flags;
     uscf->host = u->host;
-    uscf->file_name = cf->conf_file->file.name;
+    uscf->file_name = cf->conf_file->file.name.data;
     uscf->line = cf->conf_file->line;
     uscf->port = u->port;
     uscf->default_port = u->default_port;
index 5c77be39cbc717245bbecad48276f8335cfd1a79..de1a2c88f3d4dcd064648afc690a33cc80a98807 100644 (file)
@@ -92,7 +92,7 @@ struct ngx_http_upstream_srv_conf_s {
 
     ngx_uint_t                      flags;
     ngx_str_t                       host;
-    ngx_str_t                       file_name;
+    u_char                         *file_name;
     ngx_uint_t                      line;
     in_port_t                       port;
     in_port_t                       default_port;
index d0911a04f6e54190b32bef27e7e8c0e809b019c4..43c2a50f1a3d2306faba70718a0c4a1dcebc8d08 100644 (file)
@@ -136,7 +136,7 @@ ngx_http_upstream_init_round_robin(ngx_conf_t *cf,
     if (us->port == 0 && us->default_port == 0) {
         ngx_log_error(NGX_LOG_EMERG, cf->log, 0,
                       "no port in upstream \"%V\" in %s:%ui",
-                      &us->host, us->file_name.data, us->line);
+                      &us->host, us->file_name, us->line);
         return NGX_ERROR;
     }
 
@@ -149,7 +149,7 @@ ngx_http_upstream_init_round_robin(ngx_conf_t *cf,
         if (u.err) {
             ngx_log_error(NGX_LOG_EMERG, cf->log, 0,
                           "%s in upstream \"%V\" in %s:%ui",
-                          u.err, &us->host, us->file_name.data, us->line);
+                          u.err, &us->host, us->file_name, us->line);
         }
 
         return NGX_ERROR;