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

Function test

lib_protocol/samples/http_gate/main.c:48–73  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

46}
47
48static void test(void)
49{
50 HTTP_HDR_REQ *hdr_req = http_hdr_req_new();
51 HTTP_HDR_ENTRY *entry;
52 ACL_VSTRING *buf = acl_vstring_alloc(256);
53
54 entry = http_hdr_entry_new("GET / HTTP/1.1");
55 http_hdr_append_entry(&hdr_req->hdr, entry);
56
57 entry = http_hdr_entry_new("HOST: www.test.com");
58 http_hdr_append_entry(&hdr_req->hdr, entry);
59
60 entry = http_hdr_entry_new("Cookie: utmcsr=cs.tv.test.com");
61 http_hdr_append_entry(&hdr_req->hdr, entry);
62
63 http_hdr_build(&hdr_req->hdr, buf);
64 http_hdr_print(&hdr_req->hdr, "---request hdr---");
65
66 http_hdr_entry_replace2(&hdr_req->hdr, "Cookie", "test.com", "test.com.cn", 1);
67 http_hdr_build(&hdr_req->hdr, buf);
68 http_hdr_print(&hdr_req->hdr, "---request hdr---");
69
70 acl_vstring_free(buf);
71 http_hdr_req_free(hdr_req);
72 exit (0);
73}
74
75int main(int argc acl_unused, char *argv[] acl_unused)
76{

Callers 1

mainFunction · 0.70

Calls 9

http_hdr_req_newFunction · 0.85
acl_vstring_allocFunction · 0.85
http_hdr_entry_newFunction · 0.85
http_hdr_append_entryFunction · 0.85
http_hdr_buildFunction · 0.85
http_hdr_printFunction · 0.85
http_hdr_entry_replace2Function · 0.85
acl_vstring_freeFunction · 0.85
http_hdr_req_freeFunction · 0.85

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…