Skip to content

Commit da8a74c

Browse files
authored
cleanup comments a bit
cleanup comments a bit
1 parent 84f9eaa commit da8a74c

File tree

1 file changed

+18
-15
lines changed

1 file changed

+18
-15
lines changed

Diff for: ngx_cache_purge_module.c

+18-15
Original file line numberDiff line numberDiff line change
@@ -426,7 +426,7 @@ ngx_http_fastcgi_cache_purge_handler(ngx_http_request_t *r)
426426
return NGX_HTTP_INTERNAL_SERVER_ERROR;
427427
}
428428

429-
// Purge-all option
429+
/* Purge-all option */
430430
cplcf = ngx_http_get_module_loc_conf(r, ngx_http_cache_purge_module);
431431
if (cplcf->conf->purge_all) {
432432
ngx_http_cache_purge_all(r, cache);
@@ -712,7 +712,7 @@ ngx_http_proxy_cache_purge_handler(ngx_http_request_t *r)
712712
return NGX_HTTP_INTERNAL_SERVER_ERROR;
713713
}
714714

715-
// Purge-all option
715+
/* Purge-all option */
716716
cplcf = ngx_http_get_module_loc_conf(r, ngx_http_cache_purge_module);
717717
if (cplcf->conf->purge_all) {
718718
ngx_http_cache_purge_all(r, cache);
@@ -940,7 +940,7 @@ ngx_http_scgi_cache_purge_handler(ngx_http_request_t *r)
940940
return NGX_HTTP_INTERNAL_SERVER_ERROR;
941941
}
942942

943-
// Purge-all option
943+
/* Purge-all option */
944944
cplcf = ngx_http_get_module_loc_conf(r, ngx_http_cache_purge_module);
945945
if (cplcf->conf->purge_all) {
946946
ngx_http_cache_purge_all(r, cache);
@@ -1191,7 +1191,7 @@ ngx_http_uwsgi_cache_purge_handler(ngx_http_request_t *r)
11911191
return NGX_HTTP_INTERNAL_SERVER_ERROR;
11921192
}
11931193

1194-
// Purge-all option
1194+
/* Purge-all option */
11951195
cplcf = ngx_http_get_module_loc_conf(r, ngx_http_cache_purge_module);
11961196
if (cplcf->conf->purge_all) {
11971197
ngx_http_cache_purge_all(r, cache);
@@ -1248,7 +1248,7 @@ ngx_http_purge_file_cache_delete_partial_file(ngx_tree_ctx_t *ctx, ngx_str_t *pa
12481248
key_partial = ctx->data;
12491249
len = ngx_strlen(key_partial);
12501250

1251-
// if key_partial is empty always match, because is a *
1251+
/* if key_partial is empty always match, because is a '*' */
12521252
if (len == 0) {
12531253
ngx_log_debug(NGX_LOG_DEBUG_HTTP, ctx->log, 0,
12541254
"empty key_partial, forcing deletion");
@@ -1261,12 +1261,15 @@ ngx_http_purge_file_cache_delete_partial_file(ngx_tree_ctx_t *ctx, ngx_str_t *pa
12611261
file.fd = ngx_open_file(path->data, NGX_FILE_RDONLY, NGX_FILE_OPEN,
12621262
NGX_FILE_DEFAULT_ACCESS);
12631263

1264-
// I don't know if it's a good idea to use the ngx_cycle pool for this, but the request is not available here
1264+
/* I don't know if it's a good idea to use the ngx_cycle pool for this,
1265+
but the request is not available here */
12651266
key_in_file = ngx_pcalloc(ngx_cycle->pool, sizeof(u_char) * (len + 1));
12661267

1267-
// KEY: /proxy/passwd
1268-
// since we don't need the "KEY: " ignore 5 + 1 extra u_char from last intro
1269-
// Optimization: we don't need to read the full key only the n chars included in key_partial
1268+
/* KEY: /proxy/passwd */
1269+
/* since we don't need the "KEY: " ignore 5 + 1 extra u_char from last
1270+
intro */
1271+
/* Optimization: we don't need to read the full key only the n chars
1272+
included in key_partial */
12701273
ngx_read_file(&file, key_in_file, sizeof(u_char) * len,
12711274
sizeof(ngx_http_file_cache_header_t) + sizeof(u_char) * 6);
12721275
ngx_close_file(file.fd);
@@ -1656,7 +1659,7 @@ ngx_http_cache_purge_all(ngx_http_request_t *r, ngx_http_file_cache_t *cache) {
16561659
"purge_all http in %s",
16571660
cache->path->name.data);
16581661

1659-
// Walk the tree and remove all the files
1662+
/* Walk the tree and remove all the files */
16601663
ngx_tree_ctx_t tree;
16611664
tree.init_handler = NULL;
16621665
tree.file_handler = ngx_http_purge_file_cache_delete_file;
@@ -1685,11 +1688,11 @@ ngx_http_cache_purge_partial(ngx_http_request_t *r, ngx_http_file_cache_t *cache
16851688
key = c->keys.elts;
16861689
len = key[0].len;
16871690

1688-
// Only check the first key
1691+
/* Only check the first key */
16891692
key_partial = ngx_pcalloc(r->pool, sizeof(u_char) * len);
16901693
ngx_memcpy(key_partial, key[0].data, sizeof(u_char) * (len - 1));
16911694

1692-
// Walk the tree and remove all the files matching key_partial
1695+
/* Walk the tree and remove all the files matching key_partial */
16931696
ngx_tree_ctx_t tree;
16941697
tree.init_handler = NULL;
16951698
tree.file_handler = ngx_http_purge_file_cache_delete_partial_file;
@@ -1712,7 +1715,7 @@ ngx_http_cache_purge_is_partial(ngx_http_request_t *r)
17121715
c = r->cache;
17131716
key = c->keys.elts;
17141717

1715-
// Only check the first key
1718+
/* Only check the first key */
17161719
return key[0].data[key[0].len - 1] == '*';
17171720
}
17181721

@@ -1731,7 +1734,7 @@ ngx_http_cache_purge_conf(ngx_conf_t *cf, ngx_http_cache_purge_conf_t *cpcf)
17311734

17321735
from_position = 2;
17331736

1734-
// xxx_cache_purge on|off|<method> [purge_all] [from all|<ip> [.. <ip>]]
1737+
/* xxx_cache_purge on|off|<method> [purge_all] [from all|<ip> [.. <ip>]] */
17351738
value = cf->args->elts;
17361739

17371740
if (ngx_strcmp(value[1].data, "off") == 0) {
@@ -1750,7 +1753,7 @@ ngx_http_cache_purge_conf(ngx_conf_t *cf, ngx_http_cache_purge_conf_t *cpcf)
17501753
return NGX_CONF_OK;
17511754
}
17521755

1753-
// We will purge all the keys
1756+
/* We will purge all the keys */
17541757
if (ngx_strcmp(value[from_position].data, "purge_all") == 0) {
17551758
cpcf->purge_all = 1;
17561759
from_position++;

0 commit comments

Comments
 (0)