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

Method write_body

lib_acl_cpp/src/http/http_client.cpp:417–456  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

415}
416
417bool http_client::write_body(const void* data, size_t len)
418{
419 ostream& out = get_ostream();
420
421 // ����� gzip ���䣬���ѹ����д����
422 if (zstream_ != NULL) {
423 // ���ѹ��������
424 if (!write_gzip(out, data, len)) {
425 return false;
426 }
427
428 // ������������ϣ�������� gzip β���ֶ�
429 if (data == NULL || len == 0) {
430 return write_gzip_trailer(out);
431 }
432 return true;
433 }
434
435 // ��ѹ����ʽ��������
436
437 // �������Ϊ NULL����˵������д���
438 if (data == NULL || len == 0) {
439 if (chunked_transfer_) {
440 return write_chunk_trailer(out);
441 }
442 return true;
443 }
444
445 // �鷽ʽд��������
446 if (chunked_transfer_) {
447 return write_chunk(out, data, len);
448 }
449
450 // ��ͨ��ʽд��������
451 if (out.write(data, len, true, true) == -1 || !out.fflush()) {
452 disconnected_ = true;
453 return false;
454 }
455 return true;
456}
457
458//////////////////////////////////////////////////////////////////////////////
459

Callers 2

writeMethod · 0.45
responseMethod · 0.45

Calls 2

fflushMethod · 0.80
writeMethod · 0.45

Tested by

no test coverage detected