@@ -426,7 +426,7 @@ ngx_http_fastcgi_cache_purge_handler(ngx_http_request_t *r)
426
426
return NGX_HTTP_INTERNAL_SERVER_ERROR ;
427
427
}
428
428
429
- // Purge-all option
429
+ /* Purge-all option */
430
430
cplcf = ngx_http_get_module_loc_conf (r , ngx_http_cache_purge_module );
431
431
if (cplcf -> conf -> purge_all ) {
432
432
ngx_http_cache_purge_all (r , cache );
@@ -712,7 +712,7 @@ ngx_http_proxy_cache_purge_handler(ngx_http_request_t *r)
712
712
return NGX_HTTP_INTERNAL_SERVER_ERROR ;
713
713
}
714
714
715
- // Purge-all option
715
+ /* Purge-all option */
716
716
cplcf = ngx_http_get_module_loc_conf (r , ngx_http_cache_purge_module );
717
717
if (cplcf -> conf -> purge_all ) {
718
718
ngx_http_cache_purge_all (r , cache );
@@ -940,7 +940,7 @@ ngx_http_scgi_cache_purge_handler(ngx_http_request_t *r)
940
940
return NGX_HTTP_INTERNAL_SERVER_ERROR ;
941
941
}
942
942
943
- // Purge-all option
943
+ /* Purge-all option */
944
944
cplcf = ngx_http_get_module_loc_conf (r , ngx_http_cache_purge_module );
945
945
if (cplcf -> conf -> purge_all ) {
946
946
ngx_http_cache_purge_all (r , cache );
@@ -1191,7 +1191,7 @@ ngx_http_uwsgi_cache_purge_handler(ngx_http_request_t *r)
1191
1191
return NGX_HTTP_INTERNAL_SERVER_ERROR ;
1192
1192
}
1193
1193
1194
- // Purge-all option
1194
+ /* Purge-all option */
1195
1195
cplcf = ngx_http_get_module_loc_conf (r , ngx_http_cache_purge_module );
1196
1196
if (cplcf -> conf -> purge_all ) {
1197
1197
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
1248
1248
key_partial = ctx -> data ;
1249
1249
len = ngx_strlen (key_partial );
1250
1250
1251
- // if key_partial is empty always match, because is a *
1251
+ /* if key_partial is empty always match, because is a '*' */
1252
1252
if (len == 0 ) {
1253
1253
ngx_log_debug (NGX_LOG_DEBUG_HTTP , ctx -> log , 0 ,
1254
1254
"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
1261
1261
file .fd = ngx_open_file (path -> data , NGX_FILE_RDONLY , NGX_FILE_OPEN ,
1262
1262
NGX_FILE_DEFAULT_ACCESS );
1263
1263
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 */
1265
1266
key_in_file = ngx_pcalloc (ngx_cycle -> pool , sizeof (u_char ) * (len + 1 ));
1266
1267
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 */
1270
1273
ngx_read_file (& file , key_in_file , sizeof (u_char ) * len ,
1271
1274
sizeof (ngx_http_file_cache_header_t ) + sizeof (u_char ) * 6 );
1272
1275
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) {
1656
1659
"purge_all http in %s" ,
1657
1660
cache -> path -> name .data );
1658
1661
1659
- // Walk the tree and remove all the files
1662
+ /* Walk the tree and remove all the files */
1660
1663
ngx_tree_ctx_t tree ;
1661
1664
tree .init_handler = NULL ;
1662
1665
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
1685
1688
key = c -> keys .elts ;
1686
1689
len = key [0 ].len ;
1687
1690
1688
- // Only check the first key
1691
+ /* Only check the first key */
1689
1692
key_partial = ngx_pcalloc (r -> pool , sizeof (u_char ) * len );
1690
1693
ngx_memcpy (key_partial , key [0 ].data , sizeof (u_char ) * (len - 1 ));
1691
1694
1692
- // Walk the tree and remove all the files matching key_partial
1695
+ /* Walk the tree and remove all the files matching key_partial */
1693
1696
ngx_tree_ctx_t tree ;
1694
1697
tree .init_handler = NULL ;
1695
1698
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)
1712
1715
c = r -> cache ;
1713
1716
key = c -> keys .elts ;
1714
1717
1715
- // Only check the first key
1718
+ /* Only check the first key */
1716
1719
return key [0 ].data [key [0 ].len - 1 ] == '*' ;
1717
1720
}
1718
1721
@@ -1731,7 +1734,7 @@ ngx_http_cache_purge_conf(ngx_conf_t *cf, ngx_http_cache_purge_conf_t *cpcf)
1731
1734
1732
1735
from_position = 2 ;
1733
1736
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>]] */
1735
1738
value = cf -> args -> elts ;
1736
1739
1737
1740
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)
1750
1753
return NGX_CONF_OK ;
1751
1754
}
1752
1755
1753
- // We will purge all the keys
1756
+ /* We will purge all the keys */
1754
1757
if (ngx_strcmp (value [from_position ].data , "purge_all" ) == 0 ) {
1755
1758
cpcf -> purge_all = 1 ;
1756
1759
from_position ++ ;
0 commit comments