Skip to content
Snippets Groups Projects
Commit 6335c574 authored by Mirar (Pontus Hagland)'s avatar Mirar (Pontus Hagland)
Browse files

bugfix; IIS (couldn'tve guessed that one, right) sends \n\n instead of...

bugfix; IIS (couldn'tve guessed that one, right) sends \n\n instead of \r\n\r\n to separate the headers from the data...

Rev: lib/modules/Protocols.pmod/HTTP.pmod/Query.pike:1.7
parent cc10c073
No related branches found
No related tags found
No related merge requests found
......@@ -139,13 +139,16 @@ static void ponder_answer()
// read until we have all headers
int i=0;
int j=0;
for (;;)
{
string s;
if (i<0) i=0;
if ((i=search(buf,"\r\n\r\n",i))!=-1) break;
j=search(buf,"\r\n\r\n",i); if (j==-1) j=10000000;
i=search(buf,"\n\n",i); if (i==-1) i=10000000;
if ((j=min(i,j))!=10000000) break;
s=con->read(8192,1);
if (s=="") { i=strlen(buf); break; }
......@@ -155,7 +158,9 @@ static void ponder_answer()
}
headerbuf=buf[..i-1];
datapos=i+4;
if (buf[i..i+1]=="\n\n") datapos=i+2;
else datapos=i+4;
// split headers
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment