| 568 | } |
| 569 | |
| 570 | bool http_client::read_request_head(void) |
| 571 | { |
| 572 | // �Է���һ����������ܵ��ϴ�����IJ������м����ݶ��� |
| 573 | reset(); |
| 574 | |
| 575 | if (stream_ == NULL) { |
| 576 | logger_error("client stream not open yet"); |
| 577 | disconnected_ = true; |
| 578 | return false; |
| 579 | } |
| 580 | ACL_VSTREAM* vstream = stream_->get_vstream(); |
| 581 | if (vstream == NULL) { |
| 582 | logger_error("client stream null"); |
| 583 | disconnected_ = true; |
| 584 | return false; |
| 585 | } |
| 586 | |
| 587 | hdr_req_ = http_hdr_req_new(); |
| 588 | int ret = http_hdr_req_get_sync(hdr_req_, vstream, vstream->rw_timeout); |
| 589 | if (ret == -1) { |
| 590 | http_hdr_req_free(hdr_req_); |
| 591 | hdr_req_ = NULL; |
| 592 | disconnected_ = true; |
| 593 | return false; |
| 594 | } |
| 595 | |
| 596 | if (http_hdr_req_parse(hdr_req_) < 0) { |
| 597 | logger_error("parse request header error"); |
| 598 | http_hdr_req_free(hdr_req_); |
| 599 | hdr_req_ = NULL; |
| 600 | disconnected_ = true; |
| 601 | return false; |
| 602 | } |
| 603 | |
| 604 | if (hdr_req_->hdr.content_length <= 0) { |
| 605 | body_finish_ = true; |
| 606 | } |
| 607 | return true; |
| 608 | } |
| 609 | |
| 610 | acl_int64 http_client::body_length(void) const |
| 611 | { |
nothing calls this directly
no test coverage detected