Opened 13 years ago
Last modified 13 years ago
#3643 new defect
Temporary file for SLD external graphic is not deleted
Reported by: | matthijsln | Owned by: | mapserverbugs |
---|---|---|---|
Priority: | low | Milestone: | FUTURE |
Component: | WMS Server | Version: | svn-trunk (development) |
Severity: | minor | Keywords: | sld temporary file external graphic |
Cc: |
Description
When using an ExternalGraphic in a SLD symbolizer, a temporary .gif or .png file is created with msTmpFile() in msSLDParseExternalGraphic() in mapogcsld.c. After the external image is saved to the temporary file using msHTTPGetFile(), it is never deleted.
In my case this led to a build-up of thousands of temporary files after many WMS requests.
#1123 is similar but concerning the SLD itself.
The solution would be to add the line
unlink(pszTmpSymbolName);
after the call to msSLDGetGraphicSymbol() in the function msSLDParseExternalGraphic() in mapogcsld.c.
Another very minor issue is that the filename allocated by msTmpFile() is not msFree()'d. This also occurs in other places where msTmpFile() is used.
Steps to reproduce:
- save extgraphicsld.map to /tmp/
- save extgraphicsld.xml to /var/www/
- open the following url:
- observe a temporary gif file in /tmp remaining after each request
Attachments (2)
Change History (3)
by , 13 years ago
Attachment: | extgraphicsld.map added |
---|
by , 13 years ago
Attachment: | extgraphicsld.xml added |
---|
comment:1 by , 13 years ago
Milestone: | → FUTURE |
---|
Inthe sld code, the filename is set in the symbol property. The file is loaded and used layer on when the symbol is drawn. Unlinking/deleting the file in the sld code would break the drawing. As for tmp management we have a better tmp directory management (http://mapserver.org/development/rfc/ms-rfc-66.html) that can ease up the management of temporary files. Maybe a flag that indicate that the file is temporary would be the utlimate solution.
Pushing it to future