}
return CURLE_OK;
}
+ v = HD_VAL(hd, hdlen, "Trailer:");
+ if(v) {
+ data->req.resp_trailer = TRUE;
+ return CURLE_OK;
+ }
break;
case 'w':
case 'W':
BIT(http_bodyless); /* HTTP response status code is between 100 and 199,
204 or 304 */
BIT(chunk); /* if set, this is a chunked transfer-encoding */
+ BIT(resp_trailer); /* response carried 'Trailer:' header field */
BIT(ignore_cl); /* ignore content-length */
BIT(upload_chunky); /* set TRUE if we are doing chunked transfer-encoding
on upload */
nread = Curl_xfer_recv_resp(data, buf, bytestoread,
is_multiplex, &result);
if(nread < 0) {
- if(CURLE_AGAIN == result) {
- result = CURLE_OK;
- break; /* get out of loop */
+ if(CURLE_AGAIN != result)
+ goto out; /* real error */
+ result = CURLE_OK;
+ if(data->req.download_done && data->req.no_body &&
+ !data->req.resp_trailer) {
+ DEBUGF(infof(data, "EAGAIN, download done, no trailer announced, "
+ "not waiting for EOS"));
+ nread = 0;
+ /* continue as if we read the EOS */
}
- goto out; /* real error */
+ else
+ break; /* get out of loop */
}
/* We only get a 0-length read on EndOfStream */