MCPcopy Create free account
hub / github.com/SIPp/sipp / internal_match_header

Function internal_match_header

src/sip_parser.cpp:267–291  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

265}
266
267char* internal_match_header(char* message, const char* hdr, const char* compact_hdr) {
268 // Attempt to find the header
269 char* header_match = strcasestr(message, hdr);
270 if (!compact_hdr) {
271 // Exit when there is no compact header to compare to
272 return header_match;
273 }
274
275 char* compact_header_match = strcasestr(message, compact_hdr);
276
277 // Return the other if one is null
278 if (header_match == nullptr) {
279 return compact_header_match;
280 }
281 if (compact_header_match == nullptr) {
282 return header_match;
283 }
284
285 // Value exists return the smaller of the two.
286 if (header_match < compact_header_match) {
287 return header_match;
288 }
289
290 return compact_header_match;
291}
292
293const char* internal_compact_header_name(const char* name)
294{

Callers 1

get_headerFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected