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

Function parse_min_se_body

parser/parse_sst.c:200–223  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

198
199
200enum parse_sst_result
201parse_min_se_body( struct hdr_field *hf )
202{
203 int len = hf->body.len;
204 char *p = hf->body.s;
205 int pos = 0;
206 unsigned int interval = 0;
207
208 /* skip whitespace */
209 for ( ; pos < len && is_space(*p); ++pos, ++p )
210 /*nothing*/;
211 if ( pos == len )
212 return parse_sst_no_value;
213 /* collect a number */
214 for ( ; pos < len && is_num(*p); ++pos, ++p )
215 interval = interval*10/*radix*/ + (*p - '0');
216 /* skip whitespace */
217 for ( ; pos < len && is_space(*p); ++pos, ++p )
218 /*nothing*/;
219 if ( pos != len ) /* shouldn't be any more junk */
220 return parse_sst_parse_error;
221 hf->parsed=(void*)(long)interval;
222 return parse_sst_success;
223}
224
225
226enum parse_sst_result

Callers 2

parse_min_expiresFunction · 0.85
parse_min_seFunction · 0.85

Calls 2

is_spaceFunction · 0.85
is_numFunction · 0.85

Tested by

no test coverage detected