Mercurial > hg > nginx-quic
comparison src/http/modules/ngx_http_geo_module.c @ 6664:0ee6f023ef92
Geo: fixed warnings when removing nonexistent ranges.
geo $geo {
ranges;
10.0.0.0-10.0.0.255 test;
delete 10.0.1.0-10.0.1.255; # should warn
delete 10.0.0.0-10.0.0.255;
delete 10.0.0.0-10.0.0.255; # should warn
}
author | Ruslan Ermilov <ru@nginx.com> |
---|---|
date | Tue, 23 Aug 2016 15:59:42 +0300 |
parents | 53198d9bf84f |
children | 3f82c1e7e29e |
comparison
equal
deleted
inserted
replaced
6663:53198d9bf84f | 6664:0ee6f023ef92 |
---|---|
988 e = 0xffff; | 988 e = 0xffff; |
989 } | 989 } |
990 | 990 |
991 a = (ngx_array_t *) ctx->high.low[h]; | 991 a = (ngx_array_t *) ctx->high.low[h]; |
992 | 992 |
993 if (a == NULL) { | 993 if (a == NULL || a->nelts == 0) { |
994 warn = 1; | 994 warn = 1; |
995 goto next; | 995 goto next; |
996 } | 996 } |
997 | 997 |
998 range = a->elts; | 998 range = a->elts; |
1007 a->nelts--; | 1007 a->nelts--; |
1008 | 1008 |
1009 break; | 1009 break; |
1010 } | 1010 } |
1011 | 1011 |
1012 if (s != (ngx_uint_t) range[i].start | 1012 if (i == a->nelts - 1) { |
1013 && e != (ngx_uint_t) range[i].end) | 1013 warn = 1; |
1014 { | |
1015 continue; | |
1016 } | 1014 } |
1017 | |
1018 warn = 1; | |
1019 } | 1015 } |
1020 | 1016 |
1021 next: | 1017 next: |
1022 | 1018 |
1023 if (h == 0xffff) { | 1019 if (h == 0xffff) { |