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

Method read_request_body

lib_acl_cpp/src/http/http_client.cpp:913–952  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

911}
912
913int http_client::read_request_body(char* buf, size_t size)
914{
915 if (hdr_req_ == NULL) {
916 logger_error("request header not get yet");
917 disconnected_ = true;
918 return -1;
919 }
920
921 if (stream_ == NULL) {
922 logger_error("not connected yet");
923 disconnected_ = true;
924 return -1;
925 }
926 ACL_VSTREAM* vstream = stream_->get_vstream();
927 if (vstream == NULL) {
928 logger_error("client stream null");
929 disconnected_ = true;
930 return -1;
931 }
932
933 if (req_ == NULL) {
934 req_ = http_req_new(hdr_req_);
935 }
936
937 // ������̫����û���κ�����
938 if (size >= 1024000) {
939 size = 1024000;
940 }
941
942 http_off_t ret = http_req_body_get_sync(req_, vstream, buf, (int) size);
943
944 if (ret < 0) {
945 disconnected_ = true;
946 body_finish_ = true;
947 } else if (ret == 0) {
948 body_finish_ = true;
949 }
950
951 return ((int) ret);
952}
953
954bool http_client::body_finish(void) const
955{

Callers

nothing calls this directly

Calls 5

http_req_newFunction · 0.85
http_req_body_get_syncFunction · 0.85
get_vstreamMethod · 0.45
clearMethod · 0.45
appendMethod · 0.45

Tested by

no test coverage detected