MCPcopy Create free account
hub / github.com/OpenSIPS/opensips / ph_build_reply

Function ph_build_reply

modules/pi_http/http_fnc.c:2330–2370  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

2328
2329
2330int ph_build_reply(str *page, int max_page_len, int mod, int cmd)
2331{
2332 char *p, *buf;
2333 ph_mod_t *ph_modules;
2334
2335 ph_modules = ph_framework_data->ph_modules;
2336 buf = page->s;
2337 p = page->s + page->len;
2338
2339 /* Print comand name */
2340 PI_HTTP_COPY_4(p,PI_HTTP_Response_Menu_Cmd_Table_1b,
2341 PI_HTTP_Response_Menu_Cmd_tr_1,
2342 PI_HTTP_Response_Menu_Cmd_td_1a,
2343 PI_HTTP_SLASH);
2344 if (http_root.len) {
2345 PI_HTTP_COPY_2(p,http_root, PI_HTTP_SLASH);
2346 }
2347 PI_HTTP_COPY_6(p,ph_modules[mod].module,
2348 PI_HTTP_SLASH,
2349 ph_modules[mod].cmds[cmd].name,
2350 PI_HTTP_SQUOT_GT,
2351 ph_modules[mod].cmds[cmd].name,
2352 PI_HTTP_Response_Menu_Cmd_td_4a);
2353 /* Print cmd name */
2354 PI_HTTP_COPY_9(p,PI_HTTP_Response_Menu_Cmd_td_1e,
2355 ph_modules[mod].cmds[cmd].name,
2356 PI_HTTP_Response_Menu_Cmd_td_4d,
2357 PI_HTTP_Response_Menu_Cmd_tr_2,
2358 PI_HTTP_Response_Menu_Cmd_tr_1,
2359 PI_HTTP_Response_Menu_Cmd_td_1f,
2360 PI_HTTP_NBSP,
2361 PI_HTTP_Response_Menu_Cmd_td_4d,
2362 PI_HTTP_Response_Menu_Cmd_td_1d);
2363
2364 page->len = p - page->s;
2365 return 0;
2366error:
2367 LM_ERR("buffer 2 small\n");
2368 page->len = p - page->s;
2369 return -1;
2370}
2371
2372int ph_build_reply_footer(str *page, int max_page_len)
2373{

Callers 1

ph_run_pi_cmdFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected