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

Function parse_event

parser/parse_event.c:186–213  ·  view source on GitHub ↗

* Parse Event header field body */

Source from the content-addressed store, hash-verified

184 * Parse Event header field body
185 */
186int parse_event(struct hdr_field* _h)
187{
188 event_t* e;
189
190 if (_h->parsed != 0) {
191 return 0;
192 }
193
194 e = (event_t*)pkg_malloc(sizeof(event_t));
195 if (e == 0) {
196 LM_ERR("no pkg memory left\n");
197 return -1;
198 }
199
200 memset(e, 0, sizeof(event_t));
201
202 if (event_parser(_h->body.s, _h->body.len, e) < 0) {
203 LM_ERR("event_parser failed\n");
204 pkg_free(e);
205 set_err_info(OSER_EC_PARSER, OSER_EL_MEDIUM,
206 "error parsing EVENT header");
207 set_err_reply(400, "bad headers");
208 return -2;
209 }
210
211 _h->parsed = (void*)e;
212 return 0;
213}
214
215
216/*

Callers 5

rls_handle_subscribeFunction · 0.85
handle_publishFunction · 0.85
handle_subscribeFunction · 0.85
ospParseSubscribeFunction · 0.85
call_handle_notifyFunction · 0.85

Calls 3

event_parserFunction · 0.85
set_err_infoFunction · 0.85
set_err_replyFunction · 0.85

Tested by

no test coverage detected