Bug 65091 - htcacheclean displays only one cache files when few exists in one subdirectory
Summary: htcacheclean displays only one cache files when few exists in one subdirectory
Status: NEW
Alias: None
Product: Apache httpd-2
Classification: Unclassified
Component: support (show other bugs)
Version: 2.4.37
Hardware: PC Linux
: P2 normal (vote)
Target Milestone: ---
Assignee: Apache HTTPD Bugs Mailing List
URL:
Keywords: PatchAvailable
Depends on:
Blocks:
 
Reported: 2021-01-19 15:42 UTC by Artem Egorenkov
Modified: 2021-01-19 15:46 UTC (History)
1 user (show)



Attachments
Patch fixing the described problem (446 bytes, patch)
2021-01-19 15:45 UTC, Artem Egorenkov
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Artem Egorenkov 2021-01-19 15:42:10 UTC
Sometimes there are few files in one cache subdirectory. In this case using of "htcacheclean -p . -A" will only show one record.

How to reproduce:

1.
# cat /etc/httpd/conf.d/cache.conf 
<IfModule cache_disk_module>
	CacheRoot /var/cache/httpd/proxy
	CacheEnable disk  "/"
	CacheDirLevels 1
</IfModule>

2.
static html with multiple pictures created in /var/www/html/
I just saved ddg image search page with random request

3.
access static html with web browser
cache content should be generated

# ls -l /var/cache/httpd/proxy/9E/
total 112
-rw-------. 1 apache apache 27331 Jan 19 09:53 kMC7qG8oV2vER7QOa5@w.data
-rw-------. 1 apache apache   556 Jan 19 09:53 kMC7qG8oV2vER7QOa5@w.header
-rw-------. 1 apache apache 77684 Jan 19 09:53 sOsGyFnw7UEH29Jyip0Q.data
-rw-------. 1 apache apache   557 Jan 19 09:53 sOsGyFnw7UEH29Jyip0Q.header

4.
# cd /var/cache/httpd/proxy/9E/

Actual result:
# htcacheclean -p . -A
http://192.168.122.75:80/small_image_files/a_020.jpg? 556 27331 200 0 1611046420286395 1611054168715034 1611046420286096 1611046420286395 1 0

Expected result:
# htcacheclean -p . -A
http://192.168.122.75:80/small_image_files/a_020.jpg? 556 27331 200 0 1611046420286395 1611054168715034 1611046420286096 1611046420286395 1 0
http://192.168.122.75:80/small_image_files/a_052.jpg? 557 77684 200 0 1611046420291158 1611054168720273 1611046420290791 1611046420291158 1 0
Comment 1 Artem Egorenkov 2021-01-19 15:45:52 UTC
Created attachment 37705 [details]
Patch fixing the described problem

TEST:

# htcacheclean -p . -A
http://192.168.122.75:80/small_image_files/a_020.jpg? 556 27331 200 0 1611046420286395 1611054168715034 1611046420286096 1611046420286395 1 0
http://192.168.122.75:80/small_image_files/a_052.jpg? 557 77684 200 0 1611046420291158 1611054168720273 1611046420290791 1611046420291158 1 0

# echo $?
0