Lines 1443-1448
Link Here
|
1443 |
} |
1443 |
} |
1444 |
} |
1444 |
} |
1445 |
else { |
1445 |
else { |
|
|
1446 |
char *cl; |
1447 |
|
1446 |
/* have full header */ |
1448 |
/* have full header */ |
1447 |
if (!good) { |
1449 |
if (!good) { |
1448 |
/* |
1450 |
/* |
Lines 1485-1508
Link Here
|
1485 |
} |
1487 |
} |
1486 |
c->gotheader = 1; |
1488 |
c->gotheader = 1; |
1487 |
*s = 0; /* terminate at end of header */ |
1489 |
*s = 0; /* terminate at end of header */ |
|
|
1490 |
cl = strstr(c->cbuff, "Content-Length:"); |
1491 |
/* handle NCSA, which sends Content-length: */ |
1492 |
if (!cl) |
1493 |
cl = strstr(c->cbuff, "Content-length:"); |
1494 |
if (cl) { |
1495 |
/* response to HEAD doesn't have entity body */ |
1496 |
c->length = method != HEAD ? atoi(cl + 16) : 0; |
1497 |
} |
1498 |
/* The response may not have a Content-Length header */ |
1499 |
if (!cl) { |
1500 |
c->keepalive = 1; |
1501 |
c->length = 0; |
1502 |
} |
1503 |
|
1488 |
if (keepalive && |
1504 |
if (keepalive && |
1489 |
(strstr(c->cbuff, "Keep-Alive") |
1505 |
(strstr(c->cbuff, "Keep-Alive") |
1490 |
|| strstr(c->cbuff, "keep-alive"))) { /* for benefit of MSIIS */ |
1506 |
|| strstr(c->cbuff, "keep-alive"))) { /* for benefit of MSIIS */ |
1491 |
char *cl; |
1507 |
c->keepalive = 1; |
1492 |
cl = strstr(c->cbuff, "Content-Length:"); |
|
|
1493 |
/* handle NCSA, which sends Content-length: */ |
1494 |
if (!cl) |
1495 |
cl = strstr(c->cbuff, "Content-length:"); |
1496 |
if (cl) { |
1497 |
c->keepalive = 1; |
1498 |
/* response to HEAD doesn't have entity body */ |
1499 |
c->length = method != HEAD ? atoi(cl + 16) : 0; |
1500 |
} |
1501 |
/* The response may not have a Content-Length header */ |
1502 |
if (!cl) { |
1503 |
c->keepalive = 1; |
1504 |
c->length = 0; |
1505 |
} |
1506 |
} |
1508 |
} |
1507 |
c->bread += c->cbx - (s + l - c->cbuff) + r - tocopy; |
1509 |
c->bread += c->cbx - (s + l - c->cbuff) + r - tocopy; |
1508 |
totalbread += c->bread; |
1510 |
totalbread += c->bread; |
Lines 1548-1553
Link Here
|
1548 |
c->start = c->connect = lasttime = apr_time_now(); |
1550 |
c->start = c->connect = lasttime = apr_time_now(); |
1549 |
write_request(c); |
1551 |
write_request(c); |
1550 |
} |
1552 |
} |
|
|
1553 |
|
1554 |
if (c->length && (c->bread >= c->length)) { |
1555 |
/* finished a non keep-alive connection */ |
1556 |
good++; |
1557 |
close_connection(c); |
1558 |
return; |
1559 |
} |
1551 |
} |
1560 |
} |
1552 |
|
1561 |
|
1553 |
/* --------------------------------------------------------- */ |
1562 |
/* --------------------------------------------------------- */ |