comparison src/http/modules/ngx_http_ssi_filter_module.c @ 78:9db7e0b5b27f NGINX_0_1_39

nginx 0.1.39 *) The changes in the ngx_http_charset_module: the "default_charset" directive was canceled; the "charset" directive sets the response charset; the "source_charset" directive sets the source charset only. *) Bugfix: the backend "WWW-Authenticate" header line did not transferred while the 401 response code redirecting. *) Bugfix: the ngx_http_proxy_module and ngx_http_fastcgi_module may close a connection before anything was transferred to a client; bug appeared in 0.1.38. *) Workaround: the Linux glibc crypt_r() initialization bug. *) Bugfix: the ngx_http_ssi_module did not support the relative URI in the "include virtual" command. *) Bugfix: if the backend response had the "Location" header line and nginx should not rewrite this line, then the 500 code response body was transferred; bug appeared in 0.1.29. *) Bugfix: some directives of the ngx_http_proxy_module and ngx_http_fastcgi_module were not inherited from the server to the location level; bug appeared in 0.1.29. *) Bugfix: the ngx_http_ssl_module did not support the certificate chain. *) Bugfix: the ngx_http_autoindex_module did not show correctly the long file names; bug appeared in 0.1.38. *) Bugfixes in IMAP/POP3 proxy in interaction with a backend at the login state.
author Igor Sysoev <http://sysoev.ru>
date Thu, 14 Jul 2005 00:00:00 +0400
parents da9a3b14312d
children 2aa14f638cf0
comparison
equal deleted inserted replaced
77:e6b3de2dc637 78:9db7e0b5b27f
1371 1371
1372 static ngx_int_t 1372 static ngx_int_t
1373 ngx_http_ssi_include(ngx_http_request_t *r, ngx_http_ssi_ctx_t *ctx, 1373 ngx_http_ssi_include(ngx_http_request_t *r, ngx_http_ssi_ctx_t *ctx,
1374 ngx_str_t **params) 1374 ngx_str_t **params)
1375 { 1375 {
1376 u_char ch, *p, **value; 1376 u_char ch, *p, **value, *data;
1377 size_t *size, len; 1377 size_t *size, len, prefix;
1378 ngx_uint_t i, j, n, bracket; 1378 ngx_uint_t i, j, n, bracket;
1379 ngx_str_t uri, args, name; 1379 ngx_str_t uri, args, name;
1380 ngx_array_t lengths, values; 1380 ngx_array_t lengths, values;
1381 ngx_http_variable_value_t *vv; 1381 ngx_http_variable_value_t *vv;
1382 1382
1383 /* TODO: file, virtual vs file */ 1383 /* TODO: file, virtual vs file */
1384 1384
1385 uri = *params[NGX_HTTP_SSI_INCLUDE_VIRTUAL]; 1385 uri = *params[NGX_HTTP_SSI_INCLUDE_VIRTUAL];
1386 args.len = 0; 1386 args.len = 0;
1387 args.data = NULL; 1387 args.data = NULL;
1388 prefix = 0;
1388 1389
1389 n = ngx_http_script_variables_count(&uri); 1390 n = ngx_http_script_variables_count(&uri);
1390 1391
1391 if (n > 0) { 1392 if (n > 0) {
1392 1393
1495 } 1496 }
1496 1497
1497 *value = name.data; 1498 *value = name.data;
1498 } 1499 }
1499 1500
1501 size = lengths.elts;
1502 value = values.elts;
1503
1504 for (i = 0; i < values.nelts; i++) {
1505 if (size[i] != 0) {
1506 if (*value[i] != '/') {
1507 for (prefix = r->uri.len; prefix; prefix--) {
1508 if (r->uri.data[prefix - 1] == '/') {
1509 len += prefix;
1510 break;
1511 }
1512 }
1513 }
1514
1515 break;
1516 }
1517 }
1518
1500 p = ngx_palloc(r->pool, len); 1519 p = ngx_palloc(r->pool, len);
1501 if (p == NULL) { 1520 if (p == NULL) {
1502 return NGX_HTTP_SSI_ERROR; 1521 return NGX_HTTP_SSI_ERROR;
1503 } 1522 }
1504 1523
1505 uri.len = len; 1524 uri.len = len;
1506 uri.data = p; 1525 uri.data = p;
1507 1526
1508 size = lengths.elts; 1527 if (prefix) {
1509 value = values.elts; 1528 p = ngx_cpymem(p, r->uri.data, prefix);
1529 }
1510 1530
1511 for (i = 0; i < values.nelts; i++) { 1531 for (i = 0; i < values.nelts; i++) {
1512 p = ngx_cpymem(p, value[i], size[i]); 1532 p = ngx_cpymem(p, value[i], size[i]);
1533 }
1534
1535 } else {
1536 if (uri.data[0] != '/') {
1537 for (prefix = r->uri.len; prefix; prefix--) {
1538 if (r->uri.data[prefix - 1] == '/') {
1539 break;
1540 }
1541 }
1542
1543 if (prefix) {
1544 len = prefix + uri.len;
1545
1546 data = ngx_palloc(r->pool, len);
1547 if (data == NULL) {
1548 return NGX_HTTP_SSI_ERROR;
1549 }
1550
1551 p = ngx_cpymem(data, r->uri.data, prefix);
1552 ngx_memcpy(p, uri.data, uri.len);
1553
1554 uri.len = len;
1555 uri.data = data;
1556 }
1513 } 1557 }
1514 } 1558 }
1515 1559
1516 for (i = 0; i < uri.len; i++) { 1560 for (i = 0; i < uri.len; i++) {
1517 if (uri.data[i] == '?') { 1561 if (uri.data[i] == '?') {