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

Function h2_init_evi

modules/http2d/h2_evi.c:36–70  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

34
35
36int h2_init_evi(void)
37{
38 /* First publish the events */
39 h2ev_req_id = evi_publish_event(str_init(H2EV_REQ_NAME));
40 if (h2ev_req_id == EVI_ERROR) {
41 LM_ERR("cannot register 'request' event\n");
42 return -1;
43 }
44
45 h2ev_req_params = pkg_malloc(sizeof *h2ev_req_params);
46 if (!h2ev_req_params) {
47 LM_ERR("oom\n");
48 return -1;
49 }
50 memset(h2ev_req_params, 0, sizeof *h2ev_req_params);
51
52 h2_response = shm_malloc(sizeof *h2_response);
53 if (!h2_response) {
54 LM_ERR("oom SHM\n");
55 return -1;
56 }
57 *h2_response = NULL;
58
59 h2ev_req_param_method = evi_param_create(h2ev_req_params, &str_init("method"));
60 h2ev_req_param_path = evi_param_create(h2ev_req_params, &str_init("path"));
61 h2ev_req_param_headers = evi_param_create(h2ev_req_params, &str_init("headers"));
62 h2ev_req_param_data = evi_param_create(h2ev_req_params, &str_init("data"));
63 if (!h2ev_req_param_method || !h2ev_req_param_path
64 || !h2ev_req_param_headers || !h2ev_req_param_data) {
65 LM_ERR("failed to create EVI params\n");
66 return -1;
67 }
68
69 return 0;
70}
71
72
73/**

Callers 1

mod_initFunction · 0.85

Calls 3

evi_publish_eventFunction · 0.85
shm_mallocFunction · 0.85
evi_param_createFunction · 0.85

Tested by

no test coverage detected