comparison src/http/modules/perl/nginx.xs @ 665:0b460e61bdcd default tip

Merge with nginx 1.0.0.
author Maxim Dounin <mdounin@mdounin.ru>
date Mon, 25 Apr 2011 04:22:17 +0400
parents 8214eaef3530
children
comparison
equal deleted inserted replaced
572:06419a2298a9 665:0b460e61bdcd
465 if (ngx_http_perl_sv2str(aTHX_ r, &header->value, value) != NGX_OK) { 465 if (ngx_http_perl_sv2str(aTHX_ r, &header->value, value) != NGX_OK) {
466 XSRETURN_EMPTY; 466 XSRETURN_EMPTY;
467 } 467 }
468 468
469 if (header->key.len == sizeof("Content-Length") - 1 469 if (header->key.len == sizeof("Content-Length") - 1
470 && ngx_strncasecmp(header->key.data, "Content-Length", 470 && ngx_strncasecmp(header->key.data, (u_char *) "Content-Length",
471 sizeof("Content-Length") - 1) == 0) 471 sizeof("Content-Length") - 1) == 0)
472 { 472 {
473 r->headers_out.content_length_n = (off_t) SvIV(value); 473 r->headers_out.content_length_n = (off_t) SvIV(value);
474 r->headers_out.content_length = header; 474 r->headers_out.content_length = header;
475 } 475 }
640 path.data = ngx_pnalloc(r->pool, path.len + 1); 640 path.data = ngx_pnalloc(r->pool, path.len + 1);
641 if (path.data == NULL) { 641 if (path.data == NULL) {
642 XSRETURN_EMPTY; 642 XSRETURN_EMPTY;
643 } 643 }
644 644
645 (void) ngx_cpystrn(path.data, filename, path.len + 1); 645 (void) ngx_cpystrn(path.data, (u_char *) filename, path.len + 1);
646 646
647 clcf = ngx_http_get_module_loc_conf(r, ngx_http_core_module); 647 clcf = ngx_http_get_module_loc_conf(r, ngx_http_core_module);
648 648
649 ngx_memzero(&of, sizeof(ngx_open_file_info_t)); 649 ngx_memzero(&of, sizeof(ngx_open_file_info_t));
650 650
651 of.read_ahead = clcf->read_ahead;
651 of.directio = clcf->directio; 652 of.directio = clcf->directio;
652 of.valid = clcf->open_file_cache_valid; 653 of.valid = clcf->open_file_cache_valid;
653 of.min_uses = clcf->open_file_cache_min_uses; 654 of.min_uses = clcf->open_file_cache_min_uses;
654 of.errors = clcf->open_file_cache_errors; 655 of.errors = clcf->open_file_cache_errors;
655 of.events = clcf->open_file_cache_events; 656 of.events = clcf->open_file_cache_events;
845 "perl variable: \"%V\"", &var); 846 "perl variable: \"%V\"", &var);
846 } 847 }
847 848
848 #endif 849 #endif
849 850
850 vv = ngx_http_get_variable(r, &var, hash, 1); 851 vv = ngx_http_get_variable(r, &var, hash);
851 if (vv == NULL) { 852 if (vv == NULL) {
852 XSRETURN_UNDEF; 853 XSRETURN_UNDEF;
853 } 854 }
854 855
855 if (vv->not_found) { 856 if (vv->not_found) {
899 v->value = val; 900 v->value = val;
900 901
901 XSRETURN_UNDEF; 902 XSRETURN_UNDEF;
902 } 903 }
903 904
904 ngx_log_error(NGX_LOG_ERR, r->connection->log, 0,
905 "variable \"%V\" not found", &var);
906
907 XSRETURN_UNDEF; 905 XSRETURN_UNDEF;
908 } 906 }
909 907
910 if (value) { 908 if (value) {
911 vv->len = val.len; 909 vv->len = val.len;
944 ctx->next = SvRV(ST(2)); 942 ctx->next = SvRV(ST(2));
945 943
946 ngx_add_timer(r->connection->write, sleep); 944 ngx_add_timer(r->connection->write, sleep);
947 945
948 r->write_event_handler = ngx_http_perl_sleep_handler; 946 r->write_event_handler = ngx_http_perl_sleep_handler;
947 r->main->count++;
949 948
950 949
951 void 950 void
952 log_error(r, err, msg) 951 log_error(r, err, msg)
953 CODE: 952 CODE: