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

Function set_cookies

app/wizard/http_creator.cpp:7–23  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

5//////////////////////////////////////////////////////////////////////////
6
7static bool set_cookies(tpl_t* tpl)
8{
9 printf("Please enter cookie name: "); fflush(stdout);
10 char line[256];
11 int n = acl_vstream_gets_nonl(ACL_VSTREAM_IN, line, sizeof(line));
12 if (n == ACL_VSTREAM_EOF) {
13 printf("enter cookie name error!\r\n");
14 return false;
15 }
16
17 string buf;
18 buf.format("const char* %s = req.getCookieValue(\"%s\");\r\n", line, line);
19 buf.format_append("\tif (%s == NULL) {\r\n\t\tres.addCookie(\"%s\", \"{xxx}\");\r\n\t}\r\n", line, line);
20
21 tpl_set_field_fmt_global(tpl, "GET_COOKIES", "%s", buf.c_str());
22 return true;
23}
24
25//////////////////////////////////////////////////////////////////////////
26

Callers 1

create_http_servletFunction · 0.85

Calls 4

acl_vstream_gets_nonlFunction · 0.85
tpl_set_field_fmt_globalFunction · 0.70
formatMethod · 0.45
c_strMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…