comparison src/http/modules/ngx_http_geo_module.c @ 6663:53198d9bf84f

Geo: fixed insertion of ranges specified in descending order.
author Ruslan Ermilov <ru@nginx.com>
date Tue, 23 Aug 2016 15:59:14 +0300
parents 1301a58b5dac
children 0ee6f023ef92
comparison
equal deleted inserted replaced
6662:1301a58b5dac 6663:53198d9bf84f
938 range = ngx_array_push(a); 938 range = ngx_array_push(a);
939 if (range == NULL) { 939 if (range == NULL) {
940 return NGX_CONF_ERROR; 940 return NGX_CONF_ERROR;
941 } 941 }
942 942
943 range->start = (u_short) s; 943 range = a->elts;
944 range->end = (u_short) e; 944
945 range->value = ctx->value; 945 ngx_memmove(&range[1], &range[0],
946 (a->nelts - 1) * sizeof(ngx_http_geo_range_t));
947
948 range[0].start = (u_short) s;
949 range[0].end = (u_short) e;
950 range[0].value = ctx->value;
946 951
947 next: 952 next:
948 953
949 if (h == 0xffff) { 954 if (h == 0xffff) {
950 break; 955 break;