Perl CGI and binary requests

I've got some legacy Perl CGI scripts that I would like to
use with Jigsaw on windows but am having some problems. When I try
to return an image, say MIME type "image/jpeg", STDOUT
is getting closed when the first ^Z is sent across the stream.
I've tried setting binmode(STDOUT) but that doesn't seem
to be affecting it.

I'm still not convinced this is a Jigsaw problem but I'd to rule
that out. Is there something I can do to Jigsaw so that I know
that it will read in the entire stream using the Content-Length
header instead of doing partial read? I'm assuming this
is windows control Z weirdness and that there is some setting
somewhere that will fix this.

Here's a sample Perl script which tries to send a text stream
with a control Z embedded in it. The output from Jigsaw is:

CGI Test

====



binmode( STDOUT );

print <<EOM;
Content-Length: 117
Content-type: text/html

<html>
<head><title>CGI Test</title></head>
<body>
<h1>CGI Test</h1>
<pre>
EOM

printf STDOUT "====%c====\n",0032;

print <<EOM;
</pre>
</body>
</html>
EOM

close STDOUT;

Received on Wednesday, 15 October 1997 14:22:45 UTC