Klaus Demo nginx / 340e48b
Merging r4132, r4134, r4143, r4183, r4191, r4199: Various fixes related to error messages: *) Removed old warning that suggested to use "server_name_in_redirect off" (now the default) in place of no longer supported "server_name *". *) Fixing directive name in error message if types hash size is not enough. *) Replaced "can not" with "cannot" and "could not" in a bunch of places. Fixed nearby grammar errors. *) Overhauled error messages. Igor Sysoev 10 years ago
17 changed file(s) with 49 addition(s) and 55 deletion(s). Raw diff Collapse all Expand all
738738 ngx_temp_pool = ngx_create_pool(128, cycle->log);
739739 if (ngx_temp_pool == NULL) {
740740 ngx_log_error(NGX_LOG_EMERG, cycle->log, 0,
741 "can not create ngx_temp_pool");
741 "could not create ngx_temp_pool");
742742 exit(1);
743743 }
744744
6767
6868 /*
6969 * we could allocate the pool->log from this pool
70 * so we can not use this log while the free()ing the pool
70 * so we cannot use this log while free()ing the pool
7171 */
7272
7373 for (p = pool, n = pool->d.next; /* void */; p = n, n = n->d.next) {
380380
381381 /*
382382 * (int64_t) cast is required for msvc6:
383 * it can not convert uint64_t to double
383 * it cannot convert uint64_t to double
384384 */
385385 ui64 = (uint64_t) ((f - (int64_t) ui64) * scale + 0.5);
386386
10261026 "when the server runs without a master process "
10271027 "the \"%V\" event type must be the same as "
10281028 "in previous configuration - \"%s\" "
1029 "and it can not be changed on the fly, "
1029 "and it cannot be changed on the fly, "
10301030 "to change it you need to stop server "
10311031 "and start it again",
10321032 &value[1], old_ecf->name);
102102 if (ngx_threaded && ngx_trylock(ev->lock) == 0) {
103103
104104 /*
105 * We can not change the timer of the event that is been
106 * handling by another thread. And we can not easy walk
107 * the rbtree to find a next expired timer so we exit the loop.
108 * However it should be rare case when the event that is
109 * been handling has expired timer.
105 * We cannot change the timer of the event that is being
106 * handled by another thread. And we cannot easy walk
107 * the rbtree to find next expired timer so we exit the loop.
108 * However, it should be a rare case when the event that is
109 * being handled has an expired timer.
110110 */
111111
112112 ngx_log_debug1(NGX_LOG_DEBUG_EVENT, ev->log, 0,
157157
158158 if (r->uri.data[r->uri.len - 1] == '/') {
159159 ngx_log_error(NGX_LOG_ERR, r->connection->log, 0,
160 "can not PUT to a collection");
160 "cannot PUT to a collection");
161161 return NGX_HTTP_CONFLICT;
162162 }
163163
506506 minus = 0;
507507
508508 if (hcf->expires == NGX_HTTP_EXPIRES_MODIFIED) {
509 return "daily time can not be used with \"modified\" parameter";
509 return "daily time cannot be used with \"modified\" parameter";
510510 }
511511
512512 hcf->expires = NGX_HTTP_EXPIRES_DAILY;
959959
960960 if (log->script) {
961961 ngx_conf_log_error(NGX_LOG_EMERG, cf, 0,
962 "buffered logs can not have variables in name");
962 "buffered logs cannot have variables in name");
963963 return NGX_CONF_ERROR;
964964 }
965965
12251225 #endif
12261226
12271227 /*
1228 * we can not compare whole sockaddr struct's as kernel
1228 * we cannot compare whole sockaddr struct's as kernel
12291229 * may fill some fields in inherited sockaddr struct's
12301230 */
12311231
12801280
12811281 if (addr[i].opt.set) {
12821282 ngx_conf_log_error(NGX_LOG_EMERG, cf, 0,
1283 "a duplicate listen options for %s", addr[i].opt.addr);
1283 "duplicate listen options for %s", addr[i].opt.addr);
12841284 return NGX_ERROR;
12851285 }
12861286
12581258 tf++;
12591259
12601260 ngx_log_debug3(NGX_LOG_DEBUG_HTTP, r->connection->log, 0,
1261 "try to use %s: \"%s\" \"%s\"",
1261 "trying to use %s: \"%s\" \"%s\"",
12621262 test_dir ? "dir" : "file", name, path.data);
12631263
12641264 if (tf->lengths == NULL && tf->name.len == 0) {
18961896
18971897 if (alias && !r->valid_location) {
18981898 ngx_log_error(NGX_LOG_ALERT, r->connection->log, 0,
1899 "\"alias\" could not be used in location \"%V\" "
1899 "\"alias\" cannot be used in location \"%V\" "
19001900 "where URI was rewritten", &clcf->name);
19011901 return NULL;
19021902 }
24672467 if (r->uri_changes == 0) {
24682468 ngx_log_error(NGX_LOG_ERR, r->connection->log, 0,
24692469 "rewrite or internal redirection cycle "
2470 "while internal redirect to \"%V\"", uri);
2470 "while internally redirecting to \"%V\"", uri);
24712471
24722472 r->main->count++;
24732473 ngx_http_finalize_request(r, NGX_HTTP_INTERNAL_SERVER_ERROR);
28612861
28622862 if (pclcf->exact_match) {
28632863 ngx_conf_log_error(NGX_LOG_EMERG, cf, 0,
2864 "location \"%V\" could not be inside "
2864 "location \"%V\" cannot be inside "
28652865 "the exact location \"%V\"",
28662866 &clcf->name, &pclcf->name);
28672867 return NGX_CONF_ERROR;
28692869
28702870 if (pclcf->named) {
28712871 ngx_conf_log_error(NGX_LOG_EMERG, cf, 0,
2872 "location \"%V\" could not be inside "
2872 "location \"%V\" cannot be inside "
28732873 "the named location \"%V\"",
28742874 &clcf->name, &pclcf->name);
28752875 return NGX_CONF_ERROR;
28772877
28782878 if (clcf->named) {
28792879 ngx_conf_log_error(NGX_LOG_EMERG, cf, 0,
2880 "named location \"%V\" must be "
2881 "on server level only",
2880 "named location \"%V\" can be "
2881 "on the server level only",
28822882 &clcf->name);
28832883 return NGX_CONF_ERROR;
28842884 }
29472947 #else
29482948
29492949 ngx_conf_log_error(NGX_LOG_EMERG, cf, 0,
2950 "the using of the regex \"%V\" requires PCRE library",
2950 "using regex \"%V\" requires PCRE library",
29512951 regex);
29522952 return NGX_ERROR;
29532953
30293029 type[n].value = content_type;
30303030
30313031 ngx_conf_log_error(NGX_LOG_WARN, cf, 0,
3032 "duplicate extention \"%V\", "
3032 "duplicate extension \"%V\", "
30333033 "content type: \"%V\", "
3034 "old content type: \"%V\"",
3034 "previous content type: \"%V\"",
30353035 &value[i], content_type, old);
30363036 goto next;
30373037 }
31863186 if (conf->large_client_header_buffers.size < conf->connection_pool_size) {
31873187 ngx_conf_log_error(NGX_LOG_EMERG, cf, 0,
31883188 "the \"large_client_header_buffers\" size must be "
3189 "equal to or bigger than \"connection_pool_size\"");
3189 "equal to or greater than \"connection_pool_size\"");
31903190 return NGX_CONF_ERROR;
31913191 }
31923192
31993199 prev->underscores_in_headers, 0);
32003200
32013201 if (conf->server_names.nelts == 0) {
3202 /* the array has 4 empty preallocated elements, so push can not fail */
3202 /* the array has 4 empty preallocated elements, so push cannot fail */
32033203 sn = ngx_array_push(&conf->server_names);
32043204 #if (NGX_PCRE)
32053205 sn->regex = NULL;
34343434 types_hash.key = ngx_hash_key_lc;
34353435 types_hash.max_size = conf->types_hash_max_size;
34363436 types_hash.bucket_size = conf->types_hash_bucket_size;
3437 types_hash.name = "mime_types_hash";
3437 types_hash.name = "types_hash";
34383438 types_hash.pool = cf->pool;
34393439 types_hash.temp_pool = NULL;
34403440
37883788 continue;
37893789 #else
37903790 ngx_conf_log_error(NGX_LOG_EMERG, cf, 0,
3791 "bind ipv6only is not supported "
3791 "ipv6only is not supported "
37923792 "on this platform");
37933793 return NGX_CONF_ERROR;
37943794 #endif
38073807 }
38083808
38093809 ngx_conf_log_error(NGX_LOG_EMERG, cf, 0,
3810 "the invalid \"%V\" parameter", &value[n]);
3810 "invalid parameter \"%V\"", &value[n]);
38113811 return NGX_CONF_ERROR;
38123812 }
38133813
38453845
38463846 if (ngx_strchr(value[i].data, '/')) {
38473847 ngx_conf_log_error(NGX_LOG_WARN, cf, 0,
3848 "server name \"%V\" has strange symbols",
3848 "server name \"%V\" has suspicious symbols",
38493849 &value[i]);
3850 }
3851
3852 if (value[i].len == 1 && ch == '*') {
3853 ngx_conf_log_error(NGX_LOG_EMERG, cf, 0,
3854 "\"server_name *\" is unsupported, use "
3855 "\"server_name_in_redirect off\" instead");
3856 return NGX_CONF_ERROR;
38573850 }
38583851
38593852 sn = ngx_array_push(&cscf->server_names);
39163909 }
39173910 #else
39183911 ngx_conf_log_error(NGX_LOG_EMERG, cf, 0,
3919 "the using of the regex \"%V\" "
3912 "using regex \"%V\" "
39203913 "requires PCRE library", &value[i]);
39213914
39223915 return NGX_CONF_ERROR;
39483941 } else {
39493942 ngx_conf_log_error(NGX_LOG_EMERG, cf, 0,
39503943 "\"%V\" directive is duplicate, "
3951 "\"%s\" directive is specified before",
3944 "\"%s\" directive was specified earlier",
39523945 &cmd->name, clcf->alias ? "alias" : "root");
39533946 }
39543947
39573950
39583951 if (clcf->named && alias) {
39593952 ngx_conf_log_error(NGX_LOG_EMERG, cf, 0,
3960 "the \"alias\" directive may not be used "
3961 "inside named location");
3953 "the \"alias\" directive cannot be used "
3954 "inside the named location");
39623955
39633956 return NGX_CONF_ERROR;
39643957 }
39693962 || ngx_strstr(value[1].data, "${document_root}"))
39703963 {
39713964 ngx_conf_log_error(NGX_LOG_EMERG, cf, 0,
3972 "the $document_root variable may not be used "
3965 "the $document_root variable cannot be used "
39733966 "in the \"%V\" directive",
39743967 &cmd->name);
39753968
39803973 || ngx_strstr(value[1].data, "${realpath_root}"))
39813974 {
39823975 ngx_conf_log_error(NGX_LOG_EMERG, cf, 0,
3983 "the $realpath_root variable may not be used "
3976 "the $realpath_root variable cannot be used "
39843977 "in the \"%V\" directive",
39853978 &cmd->name);
39863979
44394432
44404433 if (max == 0) {
44414434 ngx_conf_log_error(NGX_LOG_EMERG, cf, 0,
4442 "\"open_file_cache\" must have \"max\" parameter");
4435 "\"open_file_cache\" must have the \"max\" parameter");
44434436 return NGX_CONF_ERROR;
44444437 }
44454438
986986
987987 if (!u->cacheable && u->peer.connection) {
988988 ngx_log_error(NGX_LOG_INFO, ev->log, ev->kq_errno,
989 "kevent() reported that client closed prematurely "
989 "kevent() reported that client prematurely closed "
990990 "connection, so upstream connection is closed too");
991991 ngx_http_upstream_finalize_request(r, u,
992992 NGX_HTTP_CLIENT_CLOSED_REQUEST);
994994 }
995995
996996 ngx_log_error(NGX_LOG_INFO, ev->log, ev->kq_errno,
997 "kevent() reported that client closed "
998 "prematurely connection");
997 "kevent() reported that client prematurely closed "
998 "connection");
999999
10001000 if (u->peer.connection == NULL) {
10011001 ngx_http_upstream_finalize_request(r, u,
10491049
10501050 if (!u->cacheable && u->peer.connection) {
10511051 ngx_log_error(NGX_LOG_INFO, ev->log, err,
1052 "client closed prematurely connection, "
1052 "client prematurely closed connection, "
10531053 "so upstream connection is closed too");
10541054 ngx_http_upstream_finalize_request(r, u,
10551055 NGX_HTTP_CLIENT_CLOSED_REQUEST);
10571057 }
10581058
10591059 ngx_log_error(NGX_LOG_INFO, ev->log, err,
1060 "client closed prematurely connection");
1060 "client prematurely closed connection");
10611061
10621062 if (u->peer.connection == NULL) {
10631063 ngx_http_upstream_finalize_request(r, u,
1111 * The strerror() messages are copied because:
1212 *
1313 * 1) strerror() and strerror_r() functions are not Async-Signal-Safe,
14 * therefore, they can not be used in signal handlers;
14 * therefore, they cannot be used in signal handlers;
1515 *
1616 * 2) a direct sys_errlist[] array may be used instead of these functions,
1717 * but Linux linker warns about its usage:
2222 * kqueue EVFILT_AIO filter is level triggered only: an event repeats
2323 * until aio_return() will be called;
2424 *
25 * aio_cancel() can not cancel file AIO: it returns AIO_NOTCANCELED always.
25 * aio_cancel() cannot cancel file AIO: it returns AIO_NOTCANCELED always.
2626 */
2727
2828
1010
1111 /*
1212 * Although FreeBSD sendfile() allows to pass a header and a trailer,
13 * it can not send a header with a part of the file in one packet until
13 * it cannot send a header with a part of the file in one packet until
1414 * FreeBSD 5.3. Besides, over the fast ethernet connection sendfile()
1515 * may send the partially filled packets, i.e. the 8 file pages may be sent
1616 * as the 11 full 1460-bytes packets, then one incomplete 324-bytes packet,
540540 if (WEXITSTATUS(status) == 2 && ngx_processes[i].respawn) {
541541 ngx_log_error(NGX_LOG_ALERT, ngx_cycle->log, 0,
542542 "%s %P exited with fatal code %d "
543 "and can not be respawn",
543 "and cannot be respawned",
544544 process, pid, WEXITSTATUS(status));
545545 ngx_processes[i].respawn = 0;
546546 }
619619 == NGX_INVALID_PID)
620620 {
621621 ngx_log_error(NGX_LOG_ALERT, cycle->log, 0,
622 "can not respawn %s", ngx_processes[i].name);
622 "could not respawn %s",
623 ngx_processes[i].name);
623624 continue;
624625 }
625626
529529 == NGX_INVALID_PID)
530530 {
531531 ngx_log_error(NGX_LOG_ALERT, cycle->log, 0,
532 "can not respawn %s", ngx_processes[n].name);
532 "could not respawn %s", ngx_processes[n].name);
533533
534534 if (n == ngx_last_process - 1) {
535535 ngx_last_process--;