Ticket #3451 (closed defect: fixed)
WMS layer removes temp file before it has been fclosed
|Reported by:||pramsey||Owned by:||sdlime|
|Component:||MapServer C Library||Version:||5.6|
The mapwmslayer.c create a temporary image file, and then builds a temporary layerObj on top of it which is then passed to mapraster.c for rendering. When GDAL renders the file it fopens bit, but does not fclose it right away if CLOSE_CONNECTION=DEFER is set, which it is by default as of Mapserver 5.6. This can result in the mapwmslayer.c code running unlink() on the temporary file before fclose() has been run on it.
The attached patch tries to dodge the problem by setting the CLOSE_CONNECTION behavior to NORMAL for the temporary layerObj used to render the image file.