MCPcopy Create free account
hub / github.com/acl-dev/acl / read_request_head

Method read_request_head

lib_acl_cpp/src/http/http_client.cpp:570–608  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

568}
569
570bool 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
610acl_int64 http_client::body_length(void) const
611{

Callers

nothing calls this directly

Calls 5

http_hdr_req_newFunction · 0.85
http_hdr_req_get_syncFunction · 0.85
http_hdr_req_freeFunction · 0.85
http_hdr_req_parseFunction · 0.85
get_vstreamMethod · 0.45

Tested by

no test coverage detected