comparison src/http/modules/ngx_http_charset_filter.c @ 10:46833bd150cb NGINX_0_1_5

nginx 0.1.5 *) Bugfix: on Solaris and Linux there may be too many "recvmsg() returned not enough data" alerts. *) Bugfix: there were the "writev() failed (22: Invalid argument)" errors on Solaris in proxy mode without sendfile. On other platforms that do not support sendfile at all the process got caught in an endless loop. *) Bugfix: segmentation fault on Solaris in proxy mode and using sendfile. *) Bugfix: segmentation fault on Solaris. *) Bugfix: on-line upgrade did not work on Linux. *) Bugfix: the ngx_http_autoindex_module module did not escape the spaces, the quotes, and the percent signs in the directory listing. *) Change: the decrease of the copy operations. *) Feature: the userid_p3p directive.
author Igor Sysoev <http://sysoev.ru>
date Thu, 11 Nov 2004 00:00:00 +0300
parents 4b2dafa26fe2
children 45fe5b98a9de
comparison
equal deleted inserted replaced
9:77eee314ddbd 10:46833bd150cb
123 NGX_MODULE, 123 NGX_MODULE,
124 &ngx_http_charset_filter_module_ctx, /* module context */ 124 &ngx_http_charset_filter_module_ctx, /* module context */
125 ngx_http_charset_filter_commands, /* module directives */ 125 ngx_http_charset_filter_commands, /* module directives */
126 NGX_HTTP_MODULE, /* module type */ 126 NGX_HTTP_MODULE, /* module type */
127 ngx_http_charset_filter_init, /* init module */ 127 ngx_http_charset_filter_init, /* init module */
128 NULL /* init child */ 128 NULL /* init process */
129 }; 129 };
130 130
131 131
132 static ngx_http_output_header_filter_pt ngx_http_next_header_filter; 132 static ngx_http_output_header_filter_pt ngx_http_next_header_filter;
133 static ngx_http_output_body_filter_pt ngx_http_next_body_filter; 133 static ngx_http_output_body_filter_pt ngx_http_next_body_filter;
285 } 285 }
286 286
287 if (src == dst) { 287 if (src == dst) {
288 ngx_conf_log_error(NGX_LOG_EMERG, cf, 0, 288 ngx_conf_log_error(NGX_LOG_EMERG, cf, 0,
289 "\"charset_map\" between the same charsets " 289 "\"charset_map\" between the same charsets "
290 "\"%s\" and \"%s\"", 290 "\"%V\" and \"%V\"", &value[1], &value[2]);
291 value[1].data, value[2].data);
292 return NGX_CONF_ERROR; 291 return NGX_CONF_ERROR;
293 } 292 }
294 293
295 table = mcf->tables.elts; 294 table = mcf->tables.elts;
296 for (i = 0; i < mcf->tables.nelts; i++) { 295 for (i = 0; i < mcf->tables.nelts; i++) {
297 if ((src == table->src && dst == table->dst) 296 if ((src == table->src && dst == table->dst)
298 || (src == table->dst && dst == table->src)) 297 || (src == table->dst && dst == table->src))
299 { 298 {
300 ngx_conf_log_error(NGX_LOG_EMERG, cf, 0, 299 ngx_conf_log_error(NGX_LOG_EMERG, cf, 0,
301 "duplicate \"charset_map\" between " 300 "duplicate \"charset_map\" between "
302 "\"%s\" and \"%s\"", 301 "\"%V\" and \"%V\"", &value[1], &value[2]);
303 value[1].data, value[2].data);
304 return NGX_CONF_ERROR; 302 return NGX_CONF_ERROR;
305 } 303 }
306 } 304 }
307 305
308 if (!(table = ngx_push_array(&mcf->tables))) { 306 if (!(table = ngx_push_array(&mcf->tables))) {
355 value = cf->args->elts; 353 value = cf->args->elts;
356 354
357 src = ngx_hextoi(value[0].data, value[0].len); 355 src = ngx_hextoi(value[0].data, value[0].len);
358 if (src == NGX_ERROR || src > 255) { 356 if (src == NGX_ERROR || src > 255) {
359 ngx_conf_log_error(NGX_LOG_EMERG, cf, 0, 357 ngx_conf_log_error(NGX_LOG_EMERG, cf, 0,
360 "invalid value \"%s\"", value[0].data); 358 "invalid value \"%V\"", &value[0]);
361 return NGX_CONF_ERROR; 359 return NGX_CONF_ERROR;
362 } 360 }
363 361
364 dst = ngx_hextoi(value[1].data, value[1].len); 362 dst = ngx_hextoi(value[1].data, value[1].len);
365 if (dst == NGX_ERROR || dst > 255) { 363 if (dst == NGX_ERROR || dst > 255) {
366 ngx_conf_log_error(NGX_LOG_EMERG, cf, 0, 364 ngx_conf_log_error(NGX_LOG_EMERG, cf, 0,
367 "invalid value \"%s\"", value[1].data); 365 "invalid value \"%V\"", &value[1]);
368 return NGX_CONF_ERROR; 366 return NGX_CONF_ERROR;
369 } 367 }
370 368
371 table = cf->ctx; 369 table = cf->ctx;
372 370
523 continue; 521 continue;
524 } 522 }
525 523
526 ngx_log_error(NGX_LOG_EMERG, cf->log, 0, 524 ngx_log_error(NGX_LOG_EMERG, cf->log, 0,
527 " no \"charset_map\" between the charsets " 525 " no \"charset_map\" between the charsets "
528 "\"%s\" and \"%s\"", 526 "\"%V\" and \"%V\"",
529 charset[i].name.data, charset[n].name.data); 527 &charset[i].name, &charset[n].name);
530 return NGX_CONF_ERROR; 528 return NGX_CONF_ERROR;
531 } 529 }
532 } 530 }
533 531
534 return NGX_CONF_OK; 532 return NGX_CONF_OK;