Hi together,
i have a problem by running a C++ executable on IIS. I have written a C++ script to read from stdin over post method, often it works fine. But sometimes i get a "Bad Gateway 502" - The specified CGI application misbehaved by not returning a complete set of HTTP headers.
I write the following source code:
int main(void)
{
char* szBuf = new char[length + 1];
_setmode( _fileno( stdin ), _O_BINARY );
fread(szBuf, sizeof(char),length,stdin);
xs.Message = (char *) memRealloc(xs.Message,length + 1);
strcpy(xs.Message,szBuf);
delete [] szBuf;
printf("Content-type:text/xml\n\n");
return 0;
}
Does IIS need more parts for the HTTP Headers?
Like "printf("HTTP/1.1 200 OK\n")"?
Does anyone have a idea?
Thanks for all!