Opened 19 years ago

Closed 19 years ago

#1153 closed defect (wontfix)

WMS image output problems when FASTCGI is enabled

Reported by: bartvde@… Owned by: mapserverbugs
Priority: high Milestone:
Component: WMS Server Version: 4.4
Severity: normal Keywords:
Cc:

Description

Mapserv does produce an image, as does shp2img, the images cannot be displayed
though and seem to be mucked up.

I will make an attachment showing the mucked up output against a correct one.

Attachments (1)

bug1153.tar (55.0 KB ) - added by bartvde@… 19 years ago.
normal output versus mucked up output

Download all attachments as: .zip

Change History (2)

by bartvde@…, 19 years ago

Attachment: bug1153.tar added

normal output versus mucked up output

comment:1 by bartvde@…, 19 years ago

Resolution: wontfix
Status: newclosed
This seems to be fixed after applying the fixes Frank has suggested to libfcgi.

binary io patch

It is critical that stdio be in binary mode when PNG and other binary images are
written to it. To accomplish this for stdio handled through the FastCGI library,
I had to do the following hack to libfcgi/fcgi_stdio.c within the fcgi-2.4.0
distribution.

In FCGI_Accept() made he following change:

    if(isCGI) {
        FCGI_stdin->stdio_stream = stdin;
        FCGI_stdin->fcgx_stream = NULL;
        FCGI_stdout->stdio_stream = stdout;
        FCGI_stdout->fcgx_stream = NULL;
        FCGI_stderr->stdio_stream = stderr;
        FCGI_stderr->fcgx_stream = NULL;

        /* FrankWarmerdam: added so that returning PNG and other binary data
           will still work */
  #ifdef _WIN32
        _setmode( _fileno(stdout), _O_BINARY);
  #endif

    } else {

Also, add the following just before the FCGI_Accept() function:

  #ifdef _WIN32
  #include <fcntl.h>
  #include <io.h>
  #endif

http://mapserver.gis.umn.edu/cgi-bin/wiki.pl?FastCGIOnWin32
Note: See TracTickets for help on using tickets.