Mercurial > hg > nginx
comparison src/stream/ngx_stream_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 | 577628e6b6a6 |
comparison
equal
deleted
inserted
replaced
6663:53198d9bf84f | 6664:0ee6f023ef92 |
---|---|
938 e = 0xffff; | 938 e = 0xffff; |
939 } | 939 } |
940 | 940 |
941 a = (ngx_array_t *) ctx->high.low[h]; | 941 a = (ngx_array_t *) ctx->high.low[h]; |
942 | 942 |
943 if (a == NULL) { | 943 if (a == NULL || a->nelts == 0) { |
944 warn = 1; | 944 warn = 1; |
945 goto next; | 945 goto next; |
946 } | 946 } |
947 | 947 |
948 range = a->elts; | 948 range = a->elts; |
957 a->nelts--; | 957 a->nelts--; |
958 | 958 |
959 break; | 959 break; |
960 } | 960 } |
961 | 961 |
962 if (s != (ngx_uint_t) range[i].start | 962 if (i == a->nelts - 1) { |
963 && e != (ngx_uint_t) range[i].end) | 963 warn = 1; |
964 { | |
965 continue; | |
966 } | 964 } |
967 | |
968 warn = 1; | |
969 } | 965 } |
970 | 966 |
971 next: | 967 next: |
972 | 968 |
973 if (h == 0xffff) { | 969 if (h == 0xffff) { |