Klaus Demo nginx / e44e248
Merge of r4284: Introduction of simple ngx_write_stderr() instead of ngx_log_stderr() for output of ./configure options, etc., since ngx_log_stderr() output length is limited by 2048 characters defined as NGX_MAX_ERROR_STR. Maxim Dounin 10 years ago
4 changed file(s) with 40 addition(s) and 20 deletion(s). Raw diff Collapse all Expand all
215215 }
216216
217217 if (ngx_show_version) {
218 ngx_log_stderr(0, "nginx version: " NGINX_VER);
218 ngx_write_stderr("nginx version: " NGINX_VER NGX_LINEFEED);
219219
220220 if (ngx_show_help) {
221 ngx_log_stderr(0,
221 ngx_write_stderr(
222222 "Usage: nginx [-?hvVtq] [-s signal] [-c filename] "
223 "[-p prefix] [-g directives]" CRLF CRLF
224 "Options:" CRLF
225 " -?,-h : this help" CRLF
226 " -v : show version and exit" CRLF
223 "[-p prefix] [-g directives]" NGX_LINEFEED
224 NGX_LINEFEED
225 "Options:" NGX_LINEFEED
226 " -?,-h : this help" NGX_LINEFEED
227 " -v : show version and exit" NGX_LINEFEED
227228 " -V : show version and configure options then exit"
228 CRLF
229 " -t : test configuration and exit" CRLF
229 NGX_LINEFEED
230 " -t : test configuration and exit" NGX_LINEFEED
230231 " -q : suppress non-error messages "
231 "during configuration testing" CRLF
232 "during configuration testing" NGX_LINEFEED
232233 " -s signal : send signal to a master process: "
233 "stop, quit, reopen, reload" CRLF
234 "stop, quit, reopen, reload" NGX_LINEFEED
234235 #ifdef NGX_PREFIX
235236 " -p prefix : set prefix path (default: "
236 NGX_PREFIX ")" CRLF
237 NGX_PREFIX ")" NGX_LINEFEED
237238 #else
238 " -p prefix : set prefix path (default: NONE)" CRLF
239 " -p prefix : set prefix path (default: NONE)" NGX_LINEFEED
239240 #endif
240241 " -c filename : set configuration file (default: "
241 NGX_CONF_PATH ")" CRLF
242 NGX_CONF_PATH ")" NGX_LINEFEED
242243 " -g directives : set global directives out of configuration "
243 "file" CRLF
244 "file" NGX_LINEFEED NGX_LINEFEED
244245 );
245246 }
246247
247248 if (ngx_show_configure) {
249 ngx_write_stderr(
248250 #ifdef NGX_COMPILER
249 ngx_log_stderr(0, "built by " NGX_COMPILER);
251 "built by " NGX_COMPILER NGX_LINEFEED
250252 #endif
251253 #if (NGX_SSL)
252254 #ifdef SSL_CTRL_SET_TLSEXT_HOSTNAME
253 ngx_log_stderr(0, "TLS SNI support enabled");
255 "TLS SNI support enabled" NGX_LINEFEED
254256 #else
255 ngx_log_stderr(0, "TLS SNI support disabled");
256 #endif
257 #endif
258 ngx_log_stderr(0, "configure arguments:" NGX_CONFIGURE);
257 "TLS SNI support disabled" NGX_LINEFEED
258 #endif
259 #endif
260 "configure arguments:" NGX_CONFIGURE NGX_LINEFEED);
259261 }
260262
261263 if (!ngx_test_config) {
202202 u_char *ngx_log_errno(u_char *buf, u_char *last, ngx_err_t err);
203203
204204
205 /*
206 * ngx_write_stderr() cannot be implemented as macro, since
207 * MSVC does not allow to use #ifdef inside macro parameters.
208 *
209 * ngx_write_fd() is used instead of ngx_write_console(), since
210 * CharToOemBuff() inside ngx_write_console() cannot be used with
211 * read only buffer as destination and CharToOemBuff() is not needed
212 * for ngx_write_stderr() anyway.
213 */
214 static ngx_inline void
215 ngx_write_stderr(char *text)
216 {
217 (void) ngx_write_fd(ngx_stderr, text, strlen(text));
218 }
219
220
205221 extern ngx_module_t ngx_errlog_module;
206222 extern ngx_uint_t ngx_use_stderr;
207223
127127
128128 #define ngx_linefeed(p) *p++ = LF;
129129 #define NGX_LINEFEED_SIZE 1
130 #define NGX_LINEFEED "\x0a"
130131
131132
132133 #define ngx_rename_file(o, n) rename((const char *) o, (const char *) n)
114114
115115 #define ngx_linefeed(p) *p++ = CR; *p++ = LF;
116116 #define NGX_LINEFEED_SIZE 2
117 #define NGX_LINEFEED CRLF
117118
118119
119120 #define ngx_delete_file(name) DeleteFile((const char *) name)