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

Class http_ipc_request

lib_acl_cpp/src/http/http_service.cpp:74–486  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

72//////////////////////////////////////////////////////////////////////////
73
74class http_ipc_request : public ipc_request
75{
76public:
77 http_ipc_request(http_service_request* callback, int nwait)
78 {
79 nwait_ = nwait;
80 memset(&data_, 0, sizeof(data_));
81 data_.callback = callback;
82 hdr_res_ = NULL;
83 res_ = NULL;
84 vstream_ = NULL;
85 respond_over_ = false;
86 }
87
88 ~http_ipc_request(void)
89 {
90 if (res_) {
91 res_->hdr_res = NULL;
92 http_res_free(res_);
93 }
94 }
95
96 // ���� ipc_request ���Զ����ô˻ص������������
97 // @override
98 void run(ipc_client* ipc)
99 {
100 unsigned int nredirect_limit = data_.callback->get_redirect();
101 unsigned int nredirect = 0;
102 http_status_t ret;
103
104 while (true) {
105 if ((ret = connect_server()) != HTTP_OK) {
106 report_error(ipc, ret);
107 break;
108 }
109 if ((ret = send_request()) != HTTP_OK) {
110 report_error(ipc, ret);
111 break;
112 }
113 if ((ret = read_respond_hdr()) != HTTP_OK) {
114 report_error(ipc, ret);
115 break;
116 }
117
118 acl_assert(hdr_res_);
119
120 // ������������ص����ض�����Ϣ��������ض������
121
122 if ((hdr_res_->reply_status != 301
123 && hdr_res_->reply_status != 302)
124 || nredirect_limit == 0) {
125
126 // ������Ӧͷ�յ���Ϣ�����߳�
127 report(ipc, HTTP_MSG_HDR);
128
129 // ����������Ӧ�岢����Ӧ���յ���Ϣ�����߳�
130 read_respond_body(ipc);
131 break;

Callers 1

do_requestMethod · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…