I use this function in winhttp.c to improve windows http server performance.
see my attachment.
Have a fun!
<hr><i>anonymous added on 2010-08-26 09:08:18:</i><br>
Notice:
The child processes must set "stdin" and "stdout" to binary mode when use pipe to pass binary data.
<pre>
_setmode(0, _O_BINARY);
_setmode(1, _O_BINARY);
</pre>
<hr><i>anonymous added on 2010-08-26 09:53:14:</i><br>
And I have a suggestion that the subroutine "pclose2" is prone to confuse.
Such as in winhttp.c, if the parent does not close pOut in time, the child will block on reading the pipe until his parent close the pOut.
|