I have developed a Webservice in C++, which receive streams from STDIN via POST and saves it to a file.
If there is no CR LF in the stream, IIS read the stream from stdin perfectly on IIS webserver. But if there is a CR LF inside the stream, the following code example hang on. On Apache Webserver it works always good.
int main(void)
{
size_t readbytes;
long content_length = 0;
content_length = atol(getenv("CONTENT_LENGTH"));
char * tmp = NULL;
tmp = (char*)malloc(1);
tmp[0]='\0';
tmp = (char*)realloc(tmp,content_length + 1);
readbytes = fread(tmp,1,content_length,stdin);
readbytes[content_length]='\0';
return 0;
}
Does anyone have an idea, that it will not work with a stream including CR LF on IIS?`
Thank you for your help!