comparison src/http/ngx_http_core_module.c @ 390:0b6053502c55 NGINX_0_7_7

nginx 0.7.7 *) Change: now the EAGAIN error returned by connect() is not considered as temporary error. *) Change: now the $ssl_client_cert variable value is a certificate with TAB character intended before each line except first one; an unchanged certificate is available in the $ssl_client_raw_cert variable. *) Feature: the "ask" parameter in the "ssl_verify_client" directive. *) Feature: byte-range processing improvements. Thanks to Maxim Dounin. *) Feature: the "directio" directive. *) Feature: MacOSX 1.5 sendfile() support. *) Bugfix: now in MacOSX and Cygwin locations are tested in case insensitive mode; however, the compare is provided by single-byte locales only. *) Bugfix: mail proxy SSL connections hanged, if select, poll, or /dev/poll methods were used. *) Bugfix: UTF-8 encoding usage in the ngx_http_autoindex_module.
author Igor Sysoev <http://sysoev.ru>
date Wed, 30 Jul 2008 00:00:00 +0400
parents 6de24473fa70
children 34fb3a573548
comparison
equal deleted inserted replaced
389:930e48a26dde 390:0b6053502c55
51 void *conf); 51 void *conf);
52 static char *ngx_http_core_server_name(ngx_conf_t *cf, ngx_command_t *cmd, 52 static char *ngx_http_core_server_name(ngx_conf_t *cf, ngx_command_t *cmd,
53 void *conf); 53 void *conf);
54 static char *ngx_http_core_root(ngx_conf_t *cf, ngx_command_t *cmd, void *conf); 54 static char *ngx_http_core_root(ngx_conf_t *cf, ngx_command_t *cmd, void *conf);
55 static char *ngx_http_core_limit_except(ngx_conf_t *cf, ngx_command_t *cmd, 55 static char *ngx_http_core_limit_except(ngx_conf_t *cf, ngx_command_t *cmd,
56 void *conf);
57 static char *ngx_http_core_directio(ngx_conf_t *cf, ngx_command_t *cmd,
56 void *conf); 58 void *conf);
57 static char *ngx_http_core_error_page(ngx_conf_t *cf, ngx_command_t *cmd, 59 static char *ngx_http_core_error_page(ngx_conf_t *cf, ngx_command_t *cmd,
58 void *conf); 60 void *conf);
59 static char *ngx_http_core_open_file_cache(ngx_conf_t *cf, ngx_command_t *cmd, 61 static char *ngx_http_core_open_file_cache(ngx_conf_t *cf, ngx_command_t *cmd,
60 void *conf); 62 void *conf);
351 ngx_conf_set_size_slot, 353 ngx_conf_set_size_slot,
352 NGX_HTTP_LOC_CONF_OFFSET, 354 NGX_HTTP_LOC_CONF_OFFSET,
353 offsetof(ngx_http_core_loc_conf_t, sendfile_max_chunk), 355 offsetof(ngx_http_core_loc_conf_t, sendfile_max_chunk),
354 NULL }, 356 NULL },
355 357
358 { ngx_string("directio"),
359 NGX_HTTP_MAIN_CONF|NGX_HTTP_SRV_CONF|NGX_HTTP_LOC_CONF|NGX_CONF_TAKE1,
360 ngx_http_core_directio,
361 NGX_HTTP_LOC_CONF_OFFSET,
362 0,
363 NULL },
364
356 { ngx_string("tcp_nopush"), 365 { ngx_string("tcp_nopush"),
357 NGX_HTTP_MAIN_CONF|NGX_HTTP_SRV_CONF|NGX_HTTP_LOC_CONF|NGX_CONF_FLAG, 366 NGX_HTTP_MAIN_CONF|NGX_HTTP_SRV_CONF|NGX_HTTP_LOC_CONF|NGX_CONF_FLAG,
358 ngx_conf_set_flag_slot, 367 ngx_conf_set_flag_slot,
359 NGX_HTTP_LOC_CONF_OFFSET, 368 NGX_HTTP_LOC_CONF_OFFSET,
360 offsetof(ngx_http_core_loc_conf_t, tcp_nopush), 369 offsetof(ngx_http_core_loc_conf_t, tcp_nopush),
1202 ngx_log_debug2(NGX_LOG_DEBUG_HTTP, r->connection->log, 0, 1211 ngx_log_debug2(NGX_LOG_DEBUG_HTTP, r->connection->log, 0,
1203 "test location: \"%*s\"", node->len, node->name); 1212 "test location: \"%*s\"", node->len, node->name);
1204 1213
1205 n = (len <= (size_t) node->len) ? len : node->len; 1214 n = (len <= (size_t) node->len) ? len : node->len;
1206 1215
1207 rc = ngx_memcmp(uri, node->name, n); 1216 rc = ngx_filename_cmp(uri, node->name, n);
1208 1217
1209 if (rc != 0) { 1218 if (rc != 0) {
1210 node = (rc < 0) ? node->left : node->right; 1219 node = (rc < 0) ? node->left : node->right;
1211 1220
1212 continue; 1221 continue;
2584 lcf->satisfy = NGX_CONF_UNSET_UINT; 2593 lcf->satisfy = NGX_CONF_UNSET_UINT;
2585 lcf->internal = NGX_CONF_UNSET; 2594 lcf->internal = NGX_CONF_UNSET;
2586 lcf->client_body_in_file_only = NGX_CONF_UNSET; 2595 lcf->client_body_in_file_only = NGX_CONF_UNSET;
2587 lcf->sendfile = NGX_CONF_UNSET; 2596 lcf->sendfile = NGX_CONF_UNSET;
2588 lcf->sendfile_max_chunk = NGX_CONF_UNSET_SIZE; 2597 lcf->sendfile_max_chunk = NGX_CONF_UNSET_SIZE;
2598 lcf->directio = NGX_CONF_UNSET;
2589 lcf->tcp_nopush = NGX_CONF_UNSET; 2599 lcf->tcp_nopush = NGX_CONF_UNSET;
2590 lcf->tcp_nodelay = NGX_CONF_UNSET; 2600 lcf->tcp_nodelay = NGX_CONF_UNSET;
2591 lcf->send_timeout = NGX_CONF_UNSET_MSEC; 2601 lcf->send_timeout = NGX_CONF_UNSET_MSEC;
2592 lcf->send_lowat = NGX_CONF_UNSET_SIZE; 2602 lcf->send_lowat = NGX_CONF_UNSET_SIZE;
2593 lcf->postpone_output = NGX_CONF_UNSET_SIZE; 2603 lcf->postpone_output = NGX_CONF_UNSET_SIZE;
2772 ngx_conf_merge_value(conf->client_body_in_file_only, 2782 ngx_conf_merge_value(conf->client_body_in_file_only,
2773 prev->client_body_in_file_only, 0); 2783 prev->client_body_in_file_only, 0);
2774 ngx_conf_merge_value(conf->sendfile, prev->sendfile, 0); 2784 ngx_conf_merge_value(conf->sendfile, prev->sendfile, 0);
2775 ngx_conf_merge_size_value(conf->sendfile_max_chunk, 2785 ngx_conf_merge_size_value(conf->sendfile_max_chunk,
2776 prev->sendfile_max_chunk, 0); 2786 prev->sendfile_max_chunk, 0);
2787 ngx_conf_merge_off_value(conf->directio, prev->directio,
2788 NGX_MAX_OFF_T_VALUE);
2777 ngx_conf_merge_value(conf->tcp_nopush, prev->tcp_nopush, 0); 2789 ngx_conf_merge_value(conf->tcp_nopush, prev->tcp_nopush, 0);
2778 ngx_conf_merge_value(conf->tcp_nodelay, prev->tcp_nodelay, 1); 2790 ngx_conf_merge_value(conf->tcp_nodelay, prev->tcp_nodelay, 1);
2779 2791
2780 ngx_conf_merge_msec_value(conf->send_timeout, prev->send_timeout, 60000); 2792 ngx_conf_merge_msec_value(conf->send_timeout, prev->send_timeout, 60000);
2781 ngx_conf_merge_size_value(conf->send_lowat, prev->send_lowat, 0); 2793 ngx_conf_merge_size_value(conf->send_lowat, prev->send_lowat, 0);
3338 return rv; 3350 return rv;
3339 } 3351 }
3340 3352
3341 3353
3342 static char * 3354 static char *
3355 ngx_http_core_directio(ngx_conf_t *cf, ngx_command_t *cmd, void *conf)
3356 {
3357 ngx_http_core_loc_conf_t *clcf = conf;
3358
3359 ngx_str_t *value;
3360
3361 if (clcf->directio != NGX_CONF_UNSET) {
3362 return "is duplicate";
3363 }
3364
3365 value = cf->args->elts;
3366
3367 if (ngx_strcmp(value[1].data, "off") == 0) {
3368 clcf->directio = NGX_MAX_OFF_T_VALUE;
3369 return NGX_CONF_OK;
3370 }
3371
3372 clcf->directio = ngx_parse_offset(&value[1]);
3373 if (clcf->directio == (off_t) NGX_ERROR) {
3374 return "invalid value";
3375 }
3376
3377 return NGX_CONF_OK;
3378 }
3379
3380
3381 static char *
3343 ngx_http_core_error_page(ngx_conf_t *cf, ngx_command_t *cmd, void *conf) 3382 ngx_http_core_error_page(ngx_conf_t *cf, ngx_command_t *cmd, void *conf)
3344 { 3383 {
3345 ngx_http_core_loc_conf_t *lcf = conf; 3384 ngx_http_core_loc_conf_t *lcf = conf;
3346 3385
3347 u_char *args; 3386 u_char *args;