[Mapserver-users] Sending image to stdout under Apache

Dana Quinn dana at nextbus.com
Thu Mar 6 12:42:05 EST 2003


So this is mainly a problem because it's difficult
to output directly to the browser when using mod_perl?
(difficult to make sure your content header goes to the
browser first, and then the actual image?)

it's hard to believe there isn't a straightforward way
to make this happen in mod_perl.

dana

Lowell Filak wrote:
> In an attempt to sum this thread up (hopefully correctly, but open for
> corrections):
> If using mod_perl you can't send the image binary to STDOUT because the
> binary can reach the browser before the content-type does or does not
> reach it at all because the content-type is sent to the browser via
> 'print "..."' and print is guaranteed to make it but the C STDOUT is
> not directly tied to the socket the client request came in on so STDOUT
> is not guaranteed to make it.
> If using the Perl script as a cgi then the '$img->saveImage...' should
> work because STDOUT for that process is directly tied to the client
> connection.
> The OUT descriptor I found was a mistake on my part.
> OUT is actually part of embperl - more on this in a minute.
> By using OUT or JUNK or any descriptor name in a print statement that is 
> not declared will automatically print to STDOUT - Perl is based around
> language, ie. "You right what u think you want it to due & ..." - that
> is why the test I ran outside of mod_perl worked.
> Back to OUT & gd.pm:
> As Eric pointed out some modules contain a way to assure that a method
> call intended for STDOUT is sent to the same place as a 'print' to
> STDOUT even under mod_perl.
> Jason proposed taking a look at setting something such as this up for
> mapscript.pm, which as I understand it requires mapscript.pm create a
> filehandle (such as OUT) and tie it to STDOUT itself without relying on
> mod_perl to do it.
> Clear as mud.?
> At this point it appears it would be a good thing to
> have if the developer(s) approve(s) (Steve, thoughts?).
> Lowell F.



-- 

Dana Quinn, dana at nextbus.com
NextBus Information Systems
(510) 420-3117




More information about the mapserver-users mailing list