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

Method on_hdr

lib_acl_cpp/samples/http_client/main.cpp:35–48  ·  view source on GitHub ↗

�������� HTTP ��Ӧͷʱ�Ļص��ӿ�

Source from the content-addressed store, hash-verified

33
34 // �������� HTTP ��Ӧͷʱ�Ļص��ӿ�
35 virtual void on_hdr(const char* addr, const HTTP_HDR_RES* hdr)
36 {
37 printf(">>server addr: %s, http reply status: %d\n",
38 addr, hdr->reply_status);
39 http_hdr_print(&hdr->hdr, "http reply hdr");
40 content_length_ = hdr->hdr.content_length;
41 if (content_length_ > 0)
42 {
43 if (out_.open_write("test.exe") == false)
44 printf("create file error(%s)\n",
45 acl_last_serror());
46 }
47 time(&begin_);
48 }
49
50 // ������ HTTP ��Ӧ��ʱ�Ļص�����
51 virtual void on_body(const char* data, size_t dlen)

Callers

nothing calls this directly

Calls 3

http_hdr_printFunction · 0.85
acl_last_serrorFunction · 0.85
open_writeMethod · 0.45

Tested by

no test coverage detected