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

Function parse_expires

parser/parse_expires.c:70–97  ·  view source on GitHub ↗

* Parse expires header field body */

Source from the content-addressed store, hash-verified

68 * Parse expires header field body
69 */
70int parse_expires(struct hdr_field* _h)
71{
72 exp_body_t* e;
73
74 if (_h->parsed) {
75 return 0; /* Already parsed */
76 }
77
78 e = (exp_body_t*)pkg_malloc(sizeof(exp_body_t));
79 if (e == 0) {
80 LM_ERR("no pkg memory left\n");
81 return -1;
82 }
83
84 memset(e, 0, sizeof(exp_body_t));
85
86 if (expires_parser(_h->body.s, _h->body.len, e) < 0) {
87 LM_ERR("failed to parse\n");
88 set_err_info(OSER_EC_PARSER, OSER_EL_MEDIUM,
89 "error parsing EXPIRE header");
90 set_err_reply(400, "bad headers");
91 pkg_free(e);
92 return -2;
93 }
94
95 _h->parsed = (void*)e;
96 return 0;
97}
98
99
100/*

Callers 11

get_expiresFunction · 0.85
publ_expired_cback_funcFunction · 0.85
publ_cback_funcFunction · 0.85
subs_cback_funcFunction · 0.85
handle_publishFunction · 0.85
extract_sdialog_infoFunction · 0.85
validate_contact_headerFunction · 0.85
run_reg_tm_cbackFunction · 0.85
ospParseSubscribeFunction · 0.85
sipapi_getExpiresFunction · 0.85
parse_reg_headersFunction · 0.85

Calls 3

expires_parserFunction · 0.85
set_err_infoFunction · 0.85
set_err_replyFunction · 0.85

Tested by

no test coverage detected