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

Method response

lib_acl_cpp/src/http/http_response.cpp:292–319  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

290}
291
292bool http_response::response(const void* data, size_t len)
293{
294 if (client_ == NULL) {
295 logger_error("conn not opened");
296 return false;
297 }
298
299 // ��һ�ε��ñ�����ʱӦ�ȷ��� HTTP ��Ӧͷ
300 if (!head_sent_) {
301 if (!client_->write_head(header_)) {
302 close();
303 return false;
304 }
305 head_sent_ = true;
306 }
307
308 if (data == NULL || len == 0) {
309 head_sent_ = false;
310 }
311
312 // ���� HTTP ��Ӧ������
313 if (!client_->write_body(data, len)) {
314 close();
315 return false;
316 }
317
318 return true;
319}
320
321} // namespace acl

Callers 8

handle_requestFunction · 0.80
on_acceptMethod · 0.80
response_bodyMethod · 0.80
thread_on_readMethod · 0.80
thread_on_readMethod · 0.80
handle_connMethod · 0.80
handle_connMethod · 0.80
send_responseMethod · 0.80

Calls 3

closeFunction · 0.50
write_headMethod · 0.45
write_bodyMethod · 0.45

Tested by

no test coverage detected