The following reply was made to PR os-windows/3402; it has been noted by GNATS.
From: [EMAIL PROTECTED] (Ullrich von Bassewitz)
To: [EMAIL PROTECTED]
Cc: [EMAIL PROTECTED]
Subject: Re: os-windows/3402: CGI output is always buffered
Date: Sat, 14 Nov 1998 23:26:28 +0100 (MET)
>
> Synopsis: CGI output is always buffered
>
> State-Changed-From-To: open-closed
> State-Changed-By: marc
> State-Changed-When: Sat Nov 14 12:49:42 PST 1998
> State-Changed-Why:
> Yes, this is a known issue already being tracked and there are
> several other PRs on this.
Sorry, I've checked the database but didn't find the relevant entries.
> Win32 doesn't support various features which Apache currently
> needs to do unbuffered CGI so, until someone figures out another
> way to implement that on Win32, it won't support unbuffered
> CGI.
I don't know if I'm allowed to offer a solution here, but I've had a quick
look at the apache code (ap_bnonblock) and the problem seems rather easy to
solve. Windows has a function to make a socket handle non-blocking, we're
using this function in our own (C++) socket library. You have to use a ioctl
instead of fcntl. Here is some code straight from our socket library that
shows how to use the functions:
void SocketHandle::SetBlocking (int fd)
// Put the given socket file descriptor into blocking mode
{
unsigned long Val = 0;
CHECK (ioctlsocket (fd, FIONBIO, &Val) == 0);
}
void SocketHandle::SetNonBlocking (int fd)
// Put the given socket file descriptor into non-blocking mode
{
unsigned long Val = 1;
CHECK (ioctlsocket (fd, FIONBIO, &Val) == 0);
}
So, adding something like
#elif defined(WIN32)
unsigned long val = 1;
return ioctlsocket (fd, FIONBIO, &val);
#else
to ap_bnonblock in buff.c should solve the problem. Unfortunately I don't have
the necessary tools to compile apache for windows, so I cannot test the
changes myself. However I can offer to test the changes if someone is able to
compile the sources.
Regards
Uz
--
Ullrich von Bassewitz [EMAIL PROTECTED]