comparison src/core/ngx_conf_file.c @ 384:09b703ae3ba5 NGINX_0_6_36

nginx 0.6.36 *) Change: now the "Invalid argument" error returned by setsockopt(TCP_NODELAY) on Solaris, is ignored. *) Change: now POSTs without "Content-Length" header line are allowed. *) Feature: the "try_files" directive. *) Feature: the --with-pcre option in the configure. *) Feature: the "if_modified_since" directive. *) Feature: the "$cookie_..." variables. *) Feature: the "$arg_..." variables. *) Bugfix: compatibility with Tru64 UNIX. Thanks to Dustin Marquess. *) Bugfix: a "ssl_engine" directive did not use a SSL-accelerator for asymmetric ciphers. Thanks to Marcin Gozdalik. *) Bugfix: in a redirect rewrite directive original arguments were concatenated with new arguments by a "?" rather than an "&"; the bug had appeared in 0.1.18. Thanks to Maxim Dounin. *) Bugfix: nginx could not be built on AIX. *) Bugfix: a double response might be returned if the epoll or rtsig methods are used and a redirect was returned to a request with body. Thanks to Eden Li. *) Bugfix: a segmentation fault might occur in worker process if "resolver" directive was used in SMTP proxy. *) Bugfix: fastcgi_store stored files not always. *) Bugfix: nginx did not process a FastCGI server response, if the server send too many messages to stderr before response.
author Igor Sysoev <http://sysoev.ru>
date Thu, 02 Apr 2009 00:00:00 +0400
parents fc497c1dfb7c
children
comparison
equal deleted inserted replaced
383:3d40b0260a84 384:09b703ae3ba5
199 done: 199 done:
200 200
201 if (filename) { 201 if (filename) {
202 ngx_free(cf->conf_file->buffer->start); 202 ngx_free(cf->conf_file->buffer->start);
203 203
204 cf->conf_file = prev;
205
206 if (ngx_close_file(fd) == NGX_FILE_ERROR) { 204 if (ngx_close_file(fd) == NGX_FILE_ERROR) {
207 ngx_log_error(NGX_LOG_ALERT, cf->log, ngx_errno, 205 ngx_log_error(NGX_LOG_ALERT, cf->log, ngx_errno,
208 ngx_close_file_n " %s failed", 206 ngx_close_file_n " %s failed",
209 cf->conf_file->file.name.data); 207 cf->conf_file->file.name.data);
210 return NGX_CONF_ERROR; 208 return NGX_CONF_ERROR;
211 } 209 }
210
211 cf->conf_file = prev;
212 } 212 }
213 213
214 if (rc == NGX_ERROR) { 214 if (rc == NGX_ERROR) {
215 return NGX_CONF_ERROR; 215 return NGX_CONF_ERROR;
216 } 216 }
851 851
852 void ngx_cdecl 852 void ngx_cdecl
853 ngx_conf_log_error(ngx_uint_t level, ngx_conf_t *cf, ngx_err_t err, 853 ngx_conf_log_error(ngx_uint_t level, ngx_conf_t *cf, ngx_err_t err,
854 char *fmt, ...) 854 char *fmt, ...)
855 { 855 {
856 u_char errstr[NGX_MAX_CONF_ERRSTR], *buf, *last; 856 u_char errstr[NGX_MAX_CONF_ERRSTR], *p, *last;
857 va_list args; 857 va_list args;
858 858
859 last = errstr + NGX_MAX_CONF_ERRSTR; 859 last = errstr + NGX_MAX_CONF_ERRSTR;
860 860
861 va_start(args, fmt); 861 va_start(args, fmt);
862 buf = ngx_vsnprintf(errstr, last - errstr, fmt, args); 862 p = ngx_vsnprintf(errstr, last - errstr, fmt, args);
863 va_end(args); 863 va_end(args);
864 864
865 *buf = '\0';
866
867 if (err) { 865 if (err) {
868 buf = ngx_snprintf(buf, last - buf - 1, " (%d: ", err); 866
869 buf = ngx_strerror_r(err, buf, last - buf - 1); 867 if (p > last - 50) {
870 *buf++ = ')'; 868
871 *buf = '\0'; 869 /* leave a space for an error code */
870
871 p = last - 50;
872 *p++ = '.';
873 *p++ = '.';
874 *p++ = '.';
875 }
876
877 #if (NGX_WIN32)
878 p = ngx_snprintf(p, last - p, ((unsigned) err < 0x80000000)
879 ? " (%d: " : " (%Xd: ", err);
880 #else
881 p = ngx_snprintf(p, last - p, " (%d: ", err);
882 #endif
883
884 p = ngx_strerror_r(err, p, last - p);
885
886 *p++ = ')';
872 } 887 }
873 888
874 if (cf->conf_file == NULL) { 889 if (cf->conf_file == NULL) {
875 ngx_log_error(level, cf->log, 0, "%s", errstr); 890 ngx_log_error(level, cf->log, 0, "%*s", p - errstr, errstr);
876 return; 891 return;
877 } 892 }
878 893
879 ngx_log_error(level, cf->log, 0, "%s in %s:%ui", 894 ngx_log_error(level, cf->log, 0, "%*s in %s:%ui",
880 errstr, cf->conf_file->file.name.data, cf->conf_file->line); 895 p - errstr, errstr,
896 cf->conf_file->file.name.data, cf->conf_file->line);
881 } 897 }
882 898
883 899
884 char * 900 char *
885 ngx_conf_set_flag_slot(ngx_conf_t *cf, ngx_command_t *cmd, void *conf) 901 ngx_conf_set_flag_slot(ngx_conf_t *cf, ngx_command_t *cmd, void *conf)