comparison http_resolver.t @ 836:a9c4cebcfe69

Tests: adjusted http resolver test with resend. Don't bother with socket error to force resolver resend. Nginx doesn't handle well ECONNREFUSED send() error, which results in "500 Internal Server Error". It may deserve a separate test, though.
author Sergey Kandaurov <pluknet@nginx.com>
date Fri, 29 Jan 2016 00:40:05 +0300
parents 37747a4ff78e
children b1fa8e0cc27b
comparison
equal deleted inserted replaced
835:650465c099e1 836:a9c4cebcfe69
81 resolver 127.0.0.1:8089; 81 resolver 127.0.0.1:8089;
82 resolver_timeout 1s; 82 resolver_timeout 1s;
83 proxy_pass http://$host:8080/backend; 83 proxy_pass http://$host:8080/backend;
84 } 84 }
85 location /tcp { 85 location /tcp {
86 resolver 127.0.0.1:8083 127.0.0.1:8084; 86 resolver 127.0.0.1:8083 127.0.0.1:8082;
87 resolver_timeout 1s; 87 resolver_timeout 1s;
88 proxy_pass http://$host:8080/backend; 88 proxy_pass http://$host:8080/backend;
89 proxy_connect_timeout 1s; 89 proxy_connect_timeout 1s;
90 add_header X-IP $upstream_addr; 90 add_header X-IP $upstream_addr;
91 error_page 504 502 /50x; 91 error_page 504 502 /50x;
493 if ($type == A) { 493 if ($type == A) {
494 push @rdata, rd_addr($ttl, '127.0.0.1'); 494 push @rdata, rd_addr($ttl, '127.0.0.1');
495 } 495 }
496 496
497 } elsif ($name =~ /tcp2?.example.net/) { 497 } elsif ($name =~ /tcp2?.example.net/) {
498 $rcode = FORMERR if $port == 8082;
498 $hdr |= 0x0300 unless $extra{tcp}; 499 $hdr |= 0x0300 unless $extra{tcp};
499 push @rdata, rd_addr($ttl, $extra{tcp} 500 push @rdata, rd_addr($ttl, $extra{tcp}
500 ? '127.0.0.1' : '127.0.0.201') if $type == A; 501 ? '127.0.0.1' : '127.0.0.201') if $type == A;
501 } 502 }
502 503