Mercurial > hg > nginx
comparison src/core/ngx_conf_file.c @ 507:cd3117ad9aab release-0.1.28
nginx-0.1.28-RELEASE import
*) Bugfix: nginx hogs CPU while proxying the huge files.
*) Bugfix: nginx could not be built by gcc 4.0 on Linux.
author | Igor Sysoev <igor@sysoev.ru> |
---|---|
date | Fri, 08 Apr 2005 15:18:55 +0000 |
parents | b1648294f693 |
children | 9b8c906f6e63 |
comparison
equal
deleted
inserted
replaced
506:005e65646622 | 507:cd3117ad9aab |
---|---|
135 rc = NGX_ERROR; | 135 rc = NGX_ERROR; |
136 break; | 136 break; |
137 } | 137 } |
138 | 138 |
139 ngx_log_error(NGX_LOG_EMERG, cf->log, 0, | 139 ngx_log_error(NGX_LOG_EMERG, cf->log, 0, |
140 "%s in %s:%d", | 140 "%s in %s:%ui", |
141 rv, cf->conf_file->file.name.data, | 141 rv, cf->conf_file->file.name.data, |
142 cf->conf_file->line); | 142 cf->conf_file->line); |
143 rc = NGX_ERROR; | 143 rc = NGX_ERROR; |
144 break; | 144 break; |
145 } | 145 } |
205 { | 205 { |
206 /* is the directive's location right ? */ | 206 /* is the directive's location right ? */ |
207 | 207 |
208 if (!(cmd->type & cf->cmd_type)) { | 208 if (!(cmd->type & cf->cmd_type)) { |
209 ngx_log_error(NGX_LOG_EMERG, cf->log, 0, | 209 ngx_log_error(NGX_LOG_EMERG, cf->log, 0, |
210 "directive \"%s\" in %s:%d " | 210 "directive \"%s\" in %s:%ui " |
211 "is not allowed here", | 211 "is not allowed here", |
212 name->data, cf->conf_file->file.name.data, | 212 name->data, cf->conf_file->file.name.data, |
213 cf->conf_file->line); | 213 cf->conf_file->line); |
214 return NGX_ERROR; | 214 return NGX_ERROR; |
215 } | 215 } |
216 | 216 |
217 if (!(cmd->type & NGX_CONF_BLOCK) && last != NGX_OK) { | 217 if (!(cmd->type & NGX_CONF_BLOCK) && last != NGX_OK) { |
218 ngx_log_error(NGX_LOG_EMERG, cf->log, 0, | 218 ngx_log_error(NGX_LOG_EMERG, cf->log, 0, |
219 "directive \"%s\" in %s:%d " | 219 "directive \"%s\" in %s:%ui " |
220 "is not terminated by \";\"", | 220 "is not terminated by \";\"", |
221 name->data, cf->conf_file->file.name.data, | 221 name->data, cf->conf_file->file.name.data, |
222 cf->conf_file->line); | 222 cf->conf_file->line); |
223 return NGX_ERROR; | 223 return NGX_ERROR; |
224 } | 224 } |
225 | 225 |
226 if ((cmd->type & NGX_CONF_BLOCK) | 226 if ((cmd->type & NGX_CONF_BLOCK) |
227 && last != NGX_CONF_BLOCK_START) | 227 && last != NGX_CONF_BLOCK_START) |
228 { | 228 { |
229 ngx_log_error(NGX_LOG_EMERG, cf->log, 0, | 229 ngx_log_error(NGX_LOG_EMERG, cf->log, 0, |
230 "directive \"%s\" in %s:%d " | 230 "directive \"%s\" in %s:%ui " |
231 "has not the opening \"{\"", | 231 "has not the opening \"{\"", |
232 name->data, cf->conf_file->file.name.data, | 232 name->data, cf->conf_file->file.name.data, |
233 cf->conf_file->line); | 233 cf->conf_file->line); |
234 return NGX_ERROR; | 234 return NGX_ERROR; |
235 } | 235 } |
274 } | 274 } |
275 | 275 |
276 if (!valid) { | 276 if (!valid) { |
277 ngx_log_error(NGX_LOG_EMERG, cf->log, 0, | 277 ngx_log_error(NGX_LOG_EMERG, cf->log, 0, |
278 "invalid number arguments in " | 278 "invalid number arguments in " |
279 "directive \"%s\" in %s:%d", | 279 "directive \"%s\" in %s:%ui", |
280 name->data, cf->conf_file->file.name.data, | 280 name->data, cf->conf_file->file.name.data, |
281 cf->conf_file->line); | 281 cf->conf_file->line); |
282 return NGX_ERROR; | 282 return NGX_ERROR; |
283 } | 283 } |
284 | 284 |
309 if (rv == NGX_CONF_ERROR) { | 309 if (rv == NGX_CONF_ERROR) { |
310 return NGX_ERROR; | 310 return NGX_ERROR; |
311 } | 311 } |
312 | 312 |
313 ngx_log_error(NGX_LOG_EMERG, cf->log, 0, | 313 ngx_log_error(NGX_LOG_EMERG, cf->log, 0, |
314 "the \"%s\" directive %s in %s:%d", | 314 "the \"%s\" directive %s in %s:%ui", |
315 name->data, rv, cf->conf_file->file.name.data, | 315 name->data, rv, cf->conf_file->file.name.data, |
316 cf->conf_file->line); | 316 cf->conf_file->line); |
317 | 317 |
318 return NGX_ERROR; | 318 return NGX_ERROR; |
319 } | 319 } |
321 cmd++; | 321 cmd++; |
322 } | 322 } |
323 } | 323 } |
324 | 324 |
325 ngx_log_error(NGX_LOG_EMERG, cf->log, 0, | 325 ngx_log_error(NGX_LOG_EMERG, cf->log, 0, |
326 "unknown directive \"%s\" in %s:%d", | 326 "unknown directive \"%s\" in %s:%ui", |
327 name->data, cf->conf_file->file.name.data, | 327 name->data, cf->conf_file->file.name.data, |
328 cf->conf_file->line); | 328 cf->conf_file->line); |
329 | 329 |
330 return NGX_ERROR; | 330 return NGX_ERROR; |
331 } | 331 } |
358 if (cf->conf_file->file.offset | 358 if (cf->conf_file->file.offset |
359 >= ngx_file_size(&cf->conf_file->file.info)) | 359 >= ngx_file_size(&cf->conf_file->file.info)) |
360 { | 360 { |
361 if (cf->args->nelts > 0) { | 361 if (cf->args->nelts > 0) { |
362 ngx_log_error(NGX_LOG_EMERG, cf->log, 0, | 362 ngx_log_error(NGX_LOG_EMERG, cf->log, 0, |
363 "unexpected end of file in %s:%d, " | 363 "unexpected end of file in %s:%ui, " |
364 "expecting \";\" or \"}\"", | 364 "expecting \";\" or \"}\"", |
365 cf->conf_file->file.name.data, | 365 cf->conf_file->file.name.data, |
366 cf->conf_file->line); | 366 cf->conf_file->line); |
367 return NGX_ERROR; | 367 return NGX_ERROR; |
368 } | 368 } |
421 if (ch == '{') { | 421 if (ch == '{') { |
422 return NGX_CONF_BLOCK_START; | 422 return NGX_CONF_BLOCK_START; |
423 } | 423 } |
424 | 424 |
425 ngx_log_error(NGX_LOG_EMERG, cf->log, 0, | 425 ngx_log_error(NGX_LOG_EMERG, cf->log, 0, |
426 "unexpected \"%c\" in %s:%d", | 426 "unexpected \"%c\" in %s:%ui", |
427 ch, cf->conf_file->file.name.data, | 427 ch, cf->conf_file->file.name.data, |
428 cf->conf_file->line); | 428 cf->conf_file->line); |
429 | 429 |
430 return NGX_ERROR; | 430 return NGX_ERROR; |
431 } | 431 } |
441 | 441 |
442 case ';': | 442 case ';': |
443 case '{': | 443 case '{': |
444 if (cf->args->nelts == 0) { | 444 if (cf->args->nelts == 0) { |
445 ngx_log_error(NGX_LOG_EMERG, cf->log, 0, | 445 ngx_log_error(NGX_LOG_EMERG, cf->log, 0, |
446 "unexpected \"%c\" in %s:%d", | 446 "unexpected \"%c\" in %s:%ui", |
447 ch, cf->conf_file->file.name.data, | 447 ch, cf->conf_file->file.name.data, |
448 cf->conf_file->line); | 448 cf->conf_file->line); |
449 return NGX_ERROR; | 449 return NGX_ERROR; |
450 } | 450 } |
451 | 451 |
456 return NGX_OK; | 456 return NGX_OK; |
457 | 457 |
458 case '}': | 458 case '}': |
459 if (cf->args->nelts > 0) { | 459 if (cf->args->nelts > 0) { |
460 ngx_log_error(NGX_LOG_EMERG, cf->log, 0, | 460 ngx_log_error(NGX_LOG_EMERG, cf->log, 0, |
461 "unexpected \"}\" in %s:%d", | 461 "unexpected \"}\" in %s:%ui", |
462 cf->conf_file->file.name.data, | 462 cf->conf_file->file.name.data, |
463 cf->conf_file->line); | 463 cf->conf_file->line); |
464 return NGX_ERROR; | 464 return NGX_ERROR; |
465 } | 465 } |
466 | 466 |
727 buf = ngx_strerror_r(err, buf, last - buf - 1); | 727 buf = ngx_strerror_r(err, buf, last - buf - 1); |
728 *buf++ = ')'; | 728 *buf++ = ')'; |
729 *buf = '\0'; | 729 *buf = '\0'; |
730 } | 730 } |
731 | 731 |
732 ngx_log_error(level, cf->log, 0, "%s in %s:%d", | 732 ngx_log_error(level, cf->log, 0, "%s in %s:%ui", |
733 errstr, cf->conf_file->file.name.data, cf->conf_file->line); | 733 errstr, cf->conf_file->file.name.data, cf->conf_file->line); |
734 } | 734 } |
735 | 735 |
736 | 736 |
737 char * | 737 char * |
1063 if (*np >= bounds->low) { | 1063 if (*np >= bounds->low) { |
1064 return NGX_CONF_OK; | 1064 return NGX_CONF_OK; |
1065 } | 1065 } |
1066 | 1066 |
1067 ngx_conf_log_error(NGX_LOG_EMERG, cf, 0, | 1067 ngx_conf_log_error(NGX_LOG_EMERG, cf, 0, |
1068 "value must be equal or more than %d", bounds->low); | 1068 "value must be equal or more than %i", bounds->low); |
1069 | 1069 |
1070 return NGX_CONF_ERROR; | 1070 return NGX_CONF_ERROR; |
1071 } | 1071 } |
1072 | 1072 |
1073 if (*np >= bounds->low && *np <= bounds->high) { | 1073 if (*np >= bounds->low && *np <= bounds->high) { |
1074 return NGX_CONF_OK; | 1074 return NGX_CONF_OK; |
1075 } | 1075 } |
1076 | 1076 |
1077 ngx_conf_log_error(NGX_LOG_EMERG, cf, 0, | 1077 ngx_conf_log_error(NGX_LOG_EMERG, cf, 0, |
1078 "value must be between %d and %d", | 1078 "value must be between %i and %i", |
1079 bounds->low, bounds->high); | 1079 bounds->low, bounds->high); |
1080 | 1080 |
1081 return NGX_CONF_ERROR; | 1081 return NGX_CONF_ERROR; |
1082 } | 1082 } |