OGR outputs fail in fastcgi mode when STORAGE is set to stream #4858

Closed
wants to merge 1 commit into
from

Projects

None yet

2 participants

@tbonfort
Member

When setting FORMATOPTION "STORAGE=stream" in an OGR outputformat, all fastcgi requests for that format will result in a 0 length response. This seems reasonable as the /vsistdout/ datasource is not connected to the fastcgi msIO.

cc @rouault . is there a workaround to use msIO* functions in OGR? Would there be any reason to not switch to a memory storage if we can detect we are run in an fcgi container?

@rouault
Contributor
rouault commented Jan 30, 2014

There's currently no way (that I can imagine of) of using msIO* in OGR. But I can imagine that the CPL library in GDAL could be extended to accept user provided callbacks, that MapServer would set with its msIO functions.

Using memory storage is an alternative if the output fits in RAM. /vsistdout/ has the advantage to be a streaming mode.

@tbonfort
Member

I suspect the streaming mode will also fail if used through mapscript when the msIO functions have been configured to output to a buffer. I'll try to cook a workaround for this ...

@tbonfort
Member

@rouault @szekerest could you have a look at the proposed fix ?

@rouault
Contributor
rouault commented Jan 31, 2014

Looks good to me. At some point, I should try to find a way for mapserver to plug its msIO functions to be used by the vsistdout virtual file system.

@tbonfort
Member
tbonfort commented Mar 7, 2014

applied for 6.4.2 in 3d174b4

@tbonfort tbonfort closed this Mar 7, 2014
@zidge zidge added a commit to mapsherpa/mapserver that referenced this pull request Mar 10, 2014
@tbonfort @zidge tbonfort + zidge Switch off ogr-output streaming mode for non default io contexts (#4858) 1498b20
@rouault rouault added a commit to rouault/gdal that referenced this pull request May 30, 2014
@rouault rouault /vsistdout/: add VSIStdoutSetRedirection() for compatibility with Map…
…Server FCGI (mapserver/mapserver#4858)

git-svn-id: https://svn.osgeo.org/gdal/trunk@27426 f0d54148-0727-0410-94bb-9a71ac55c965
b87e03a
@kwrobot kwrobot pushed a commit to aashish24/gdal-svn that referenced this pull request May 30, 2014
rouault /vsistdout/: add VSIStdoutSetRedirection() for compatibility with Map…
…Server FCGI (mapserver/mapserver#4858)

git-svn-id: https://svn.osgeo.org/gdal/trunk/gdal@27426 f0d54148-0727-0410-94bb-9a71ac55c965
c166e43
@samalone samalone pushed a commit to samalone/gdal-ios that referenced this pull request Oct 25, 2014
rouault /vsistdout/: add VSIStdoutSetRedirection() for compatibility with Map…
…Server FCGI (mapserver/mapserver#4858)
92c3300
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment