567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
|
}
if( iHttpVersion<0 ) iHttpVersion = 1;
closeConnection = 0;
}else if( fossil_strnicmp(zLine, "content-length:", 15)==0 ){
for(i=15; fossil_isspace(zLine[i]); i++){}
iLength = atoi(&zLine[i]);
}else if( fossil_strnicmp(zLine, "connection:", 11)==0 ){
int j; /* Points to end of value (space, semicolon or zero terminator). */
i = 11;
do{
while( fossil_isspace(zLine[i]) || zLine[i]==',' ) i++;
j = i;
while( !fossil_isspace(zLine[j]) && zLine[j]!=',' && zLine[j] ) j++;
if( j-i==5 && fossil_strnicmp(&zLine[i], "close", 5)==0 ){
closeConnection = 1;
}else if( j-i==10 && fossil_strnicmp(&zLine[i], "keep-alive", 10)==0 ){
closeConnection = 0;
}
i = j;
}while( zLine[i] );
}else if( ( rc==301 || rc==302 || rc==307 || rc==308 ) &&
fossil_strnicmp(zLine, "location:", 9)==0 ){
int i, j;
|
|
>
>
|
>
>
|
|
|
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
|
}
if( iHttpVersion<0 ) iHttpVersion = 1;
closeConnection = 0;
}else if( fossil_strnicmp(zLine, "content-length:", 15)==0 ){
for(i=15; fossil_isspace(zLine[i]); i++){}
iLength = atoi(&zLine[i]);
}else if( fossil_strnicmp(zLine, "connection:", 11)==0 ){
int j; /* Position of next separator (comma or zero terminator). */
int k = 0; /* Position after last non-space char for current value. */
i = 11;
do{
while( fossil_isspace(zLine[i]) || zLine[i]==',' ) i++;
j = i;
while( zLine[j] && zLine[j]!=',' ){
if( !fossil_isspace(zLine[j]) ) k = j + 1;
j++;
}
if( k-i==5 && fossil_strnicmp(&zLine[i], "close", 5)==0 ){
closeConnection = 1;
}else if( k-i==10 && fossil_strnicmp(&zLine[i], "keep-alive", 10)==0 ){
closeConnection = 0;
}
i = j;
}while( zLine[i] );
}else if( ( rc==301 || rc==302 || rc==307 || rc==308 ) &&
fossil_strnicmp(zLine, "location:", 9)==0 ){
int i, j;
|