Klaus Demo nginx / 43f3f4a
fix cache path slot Igor Sysoev 13 years ago
1 changed file(s) with 6 addition(s) and 16 deletion(s). Raw diff Collapse all Expand all
13561356
13571357 if (ngx_strncmp(value[i].data, "levels=", 7) == 0) {
13581358
1359 n = 0;
13601359 p = value[i].data + 7;
13611360 last = value[i].data + value[i].len;
13621361
1363 while (p < last) {
1364
1365 if (*p > '0' && *p < '6') {
1362 for (n = 0; n < 3 && p < last; n++) {
1363
1364 if (*p > '0' && *p < '3') {
13661365
13671366 cache->path->level[n] = *p++ - '0';
13681367 cache->path->len += cache->path->level[n] + 1;
13711370 break;
13721371 }
13731372
1374 if (*p++ == ':') {
1375
1376 if (n > 2) {
1377 goto invalid_levels;
1378 }
1379
1380 if (cache->path->level[n] == 0) {
1381 goto invalid_levels;
1382 }
1383
1384 n++;
1385
1373 if (*p++ == ':' && n < 2 && p != last) {
13861374 continue;
13871375 }
1376
1377 goto invalid_levels;
13881378 }
13891379
13901380 goto invalid_levels;