| 46 | } |
| 47 | |
| 48 | static 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 | |
| 75 | int main(int argc acl_unused, char *argv[] acl_unused) |
| 76 | { |
no test coverage detected
searching dependent graphs…